001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/tools/CmsToolUserData.java,v $
003: * Date : $Date: 2008-02-27 12:05:31 $
004: * Version: $Revision: 1.12 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software GmbH, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.workplace.tools;
033:
034: import java.util.HashMap;
035: import java.util.Map;
036:
037: /**
038: * Store for some administration view parameters,
039: * for each user, used by the <code>{@link CmsToolManager}</code>.<p>
040: *
041: * @author Michael Moossen
042: *
043: * @version $Revision: 1.12 $
044: *
045: * @since 6.0.0
046: */
047: public class CmsToolUserData {
048:
049: /** base tool for the user, root-based. */
050: private Map m_baseTools;
051:
052: /** Current used tool paths, root-based. */
053: private Map m_currentToolPaths;
054:
055: /** root key for the user. */
056: private String m_rootKey;
057:
058: /**
059: * Default Constructor.<p>
060: */
061: public CmsToolUserData() {
062:
063: m_baseTools = new HashMap();
064: m_currentToolPaths = new HashMap();
065: }
066:
067: /**
068: * Returns the base tool.<p>
069: *
070: * @param rootKey the tool root
071: *
072: * @return the base tool
073: */
074: public String getBaseTool(String rootKey) {
075:
076: return (String) m_baseTools.get(rootKey);
077: }
078:
079: /**
080: * Returns the current tool path.<p>
081: *
082: * @param rootKey the tool root
083: *
084: * @return the current tool path
085: */
086: public String getCurrentToolPath(String rootKey) {
087:
088: return (String) m_currentToolPaths.get(rootKey);
089: }
090:
091: /**
092: * Returns the root key.<p>
093: *
094: * @return the root key
095: */
096: public String getRootKey() {
097:
098: return m_rootKey;
099: }
100:
101: /**
102: * Sets the base tool.<p>
103: *
104: * @param rootKey the tool root
105: * @param baseTool the base tool to set
106: */
107: public void setBaseTool(String rootKey, String baseTool) {
108:
109: m_baseTools.put(rootKey, baseTool);
110: }
111:
112: /**
113: * Sets the current tool path.<p>
114: *
115: * @param rootKey the tool root
116: * @param currentToolPath the current tool path to set
117: */
118: public void setCurrentToolPath(String rootKey,
119: String currentToolPath) {
120:
121: m_currentToolPaths.put(rootKey, currentToolPath);
122: }
123:
124: /**
125: * Sets the root key.<p>
126: *
127: * @param key the root key to set
128: */
129: public void setRootKey(String key) {
130:
131: m_rootKey = key;
132: }
133:
134: }
|