KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > CmsToolUserData


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/tools/CmsToolUserData.java,v $
3  * Date : $Date: 2006/03/27 14:52:51 $
4  * Version: $Revision: 1.10 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.tools;
33
34 import java.util.HashMap JavaDoc;
35 import java.util.Map JavaDoc;
36
37 /**
38  * Store for some administration view parameters,
39  * for each user, used by the <code>{@link CmsToolManager}</code>.<p>
40  *
41  * @author Michael Moossen
42  *
43  * @version $Revision: 1.10 $
44  *
45  * @since 6.0.0
46  */

47 public class CmsToolUserData {
48
49     /** base tool for the user, root-based. */
50     private Map JavaDoc m_baseTools;
51
52     /** Current used tool paths, root-based. */
53     private Map JavaDoc m_currentToolPaths;
54
55     /** root key for the user. */
56     private String JavaDoc m_rootKey;
57
58     /**
59      * Default Constructor.<p>
60      */

61     public CmsToolUserData() {
62
63         m_baseTools = new HashMap JavaDoc();
64         m_currentToolPaths = new HashMap JavaDoc();
65     }
66
67     /**
68      * Returns the base tool.<p>
69      *
70      * @param rootKey the tool root
71      *
72      * @return the base tool
73      */

74     public String JavaDoc getBaseTool(String JavaDoc rootKey) {
75
76         return (String JavaDoc)m_baseTools.get(rootKey);
77     }
78
79     /**
80      * Returns the current tool path.<p>
81      *
82      * @param rootKey the tool root
83      *
84      * @return the current tool path
85      */

86     public String JavaDoc getCurrentToolPath(String JavaDoc rootKey) {
87
88         return (String JavaDoc)m_currentToolPaths.get(rootKey);
89     }
90
91     /**
92      * Returns the root key.<p>
93      *
94      * @return the root key
95      */

96     public String JavaDoc getRootKey() {
97
98         return m_rootKey;
99     }
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 JavaDoc rootKey, String JavaDoc 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 JavaDoc rootKey, String JavaDoc currentToolPath) {
119
120         m_currentToolPaths.put(rootKey, currentToolPath);
121     }
122
123     /**
124      * Sets the root key.<p>
125      *
126      * @param key the root key to set
127      */

128     public void setRootKey(String JavaDoc key) {
129
130         m_rootKey = key;
131     }
132
133 }
Popular Tags