KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > navigation > menu > item > MenuItemDO


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: MenuItemDO.java,v $
31  * Revision 1.3 2005/04/10 20:09:39 colinmacleod
32  * Added new themes.
33  * Changed id type to String.
34  * Changed i tag to em and b tag to strong.
35  * Improved PicoContainerFactory with NanoContainer scripts.
36  *
37  * Revision 1.2 2005/04/09 17:19:09 colinmacleod
38  * Changed copyright text to GPL v2 explicitly.
39  *
40  * Revision 1.1.1.1 2005/03/10 17:50:36 colinmacleod
41  * Restructured ivata op around Hibernate/PicoContainer.
42  * Renamed ivata groupware.
43  *
44  * Revision 1.1 2004/07/13 19:41:16 colinmacleod
45  * Moved project to POJOs from EJBs.
46  * Applied PicoContainer to services layer (replacing session EJBs).
47  * Applied Hibernate to persistence layer (replacing entity EJBs).
48  *
49  * Revision 1.3 2004/03/21 21:16:19 colinmacleod
50  * Shortened name to ivata op.
51  *
52  * Revision 1.2 2004/02/01 22:00:34 colinmacleod
53  * Added full names to author tags
54  *
55  * Revision 1.1.1.1 2004/01/27 20:57:59 colinmacleod
56  * Moved ivata openportal to SourceForge..
57  *
58  * Revision 1.5 2003/11/03 11:28:25 jano
59  * commiting addressbook,
60  * tryinjg to fix deploying problem
61  *
62  * Revision 1.4 2003/10/17 12:36:13 jano
63  * fixing problems with building
64  * converting intranet -> portal
65  * Eclipse building
66  *
67  * Revision 1.3 2003/10/15 13:56:20 jano
68  * converting to XDoclet
69  *
70  * Revision 1.2 2003/10/15 13:49:57 colin
71  * fixing fo Xdoclet
72  *
73  * Revision 1.10 2003/05/01 12:15:43 jano
74  * tidy up names of sequeneces
75  *
76  * Revision 1.9 2003/02/25 14:38:14 colin
77  * implemented setModified methods on entity beans thro IvataEntityBean superclass
78  *
79  * Revision 1.8 2003/02/24 19:27:17 colin
80  * restructured file paths
81  *
82  * Revision 1.7 2003/02/04 17:43:50 colin
83  * copyright notice
84  *
85  * Revision 1.6 2002/09/11 15:00:29 colin
86  * update for adding new menu items
87  *
88  * Revision 1.5 2002/08/19 13:35:02 colin
89  * added image
90  *
91  * Revision 1.4 2002/07/04 12:29:28 jano
92  * i put readonly script to CVS and i will commit all SRC directory
93  *
94  * Revision 1.3 2002/06/28 13:31:20 colin
95  * changed create method.
96  *
97  * Revision 1.2 2002/06/17 07:29:08 colin
98  * improved and extended javadoc documentation
99  * -----------------------------------------------------------------------------
100  */

101 package com.ivata.groupware.navigation.menu.item;
102
103
104 import com.ivata.groupware.admin.security.user.UserDO;
105 import com.ivata.groupware.container.persistence.BaseDO;
106 import com.ivata.groupware.navigation.menu.MenuDO;
107
108
109 /**
110  * <p><code>EntityBean</code> to store items in the users menu system.</p>
111  *
112  * @since 2002-05-07
113  * @author Colin MacLeod
114  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
115  * @version $Revision: 1.3 $
116  * @see com.ivata.groupware.menu.MenuBean
117  *
118  * @hibernate.class
119  * table="navigation_menu_item"
120  * @hibernate.cache
121  * usage="read-write"
122  */

123 public class MenuItemDO extends BaseDO {
124
125     /**
126      * <p>Image associated with the item.</p>
127      */

128     private String JavaDoc image;
129
130     /**
131      * <p>
132      * Menu which contains this item.
133      * </p>
134      */

135     private MenuDO menu;
136     /**
137      * <p>Order in which this menu item should appear, in relation to the other
138      * menu items.<p>
139      */

140     private Integer JavaDoc priority;
141
142     /**
143      * <p>Get the text or caption which should appear in this menu.</p>
144      */

145     private String JavaDoc text;
146
147
148     /**
149      * <p>Get the URL to link this menu item to.</p>
150      */

151     private String JavaDoc uRL;
152
153     /**
154      * <p>User associated with this menu item.</p>
155      */

156     private UserDO user;
157     /**
158      * <p>Get the image associated with the item.</p>
159      *
160      * @return the filename (without path) of an image associated with this
161      * item, or <code>null</code> if no image is currently associated with this
162      * menu item.
163      * @hibernate.property
164      */

165     public final String JavaDoc getImage() {
166         return image;
167     }
168
169     /**
170      * <p>
171      * Menu which contains this item.
172      * </p>
173      *
174      * @return current value of menu.
175      * @hibernate.many-to-one
176      */

177     public final MenuDO getMenu() {
178         return menu;
179     }
180
181     /**
182      * <p>Get the order in which this menu item should appear, in relation to the other
183      * menu items.<p>
184      *
185      * @return the order in which this menu item should appear, in relation
186      * to the other menu items. Lower values of this number will appear lower in the
187      * list of menu items (and are therefore more significant).
188      * @hibernate.property
189      */

190     public final Integer JavaDoc getPriority() {
191         return priority;
192     }
193     /**
194      * <p>Get the text or caption which should appear in this menu.</p>
195      *
196      * @return the text or caption which should appear in this menu
197      * @hibernate.property
198      */

199     public final String JavaDoc getText() {
200         return text;
201     }
202
203     /**
204      * <p>Get the <code>uRL</code> to link this menu item to.</p>
205      *
206      * @return the <code>uRL</code> to link this menu item to
207      * @hibernate.property
208      */

209     public final String JavaDoc getURL() {
210         return uRL;
211     }
212     /**
213      * <p>Get the user associated with this menu item.</p>
214      *
215      * @return the user associated with this item, or <code>null</code> if
216      * the item should appear in all users' menues.
217      *
218      * @hibernate.many-to-one
219      * column="person_user"
220      */

221     public UserDO getUser() {
222         return user;
223     }
224
225     /**
226      * <p>Set the image associated with the item.</p>
227      *
228      * @param image the filename (without path) of an image associated with this
229      * item, or <code>null</code> if no image is currently associated with this
230      * menu item.
231      */

232     public final void setImage(final String JavaDoc image) {
233         this.image = image;
234     }
235     /**
236      * <p>
237      * Menu which contains this item.
238      * </p>
239      *
240      * @param menu new value of menu.
241      */

242     public final void setMenu(final MenuDO menu) {
243         this.menu = menu;
244     }
245
246     /**
247      * <p>Set the order in which this menu item should appear, in relation to the other
248      * menu items.<p>
249      *
250      * @param priority the order in which this menu item should appear, in relation
251      * to the other menu items. Lower values of this number will appear lower in the
252      * list of menu items (and are therefore more significant).
253      */

254     public final void setPriority(final Integer JavaDoc priority) {
255         this.priority = priority;
256     }
257
258     /**
259      * <p>Set the text or caption which should appear in this menu.</p>
260      *
261      * @param text the text or caption which should appear in this menu.
262      */

263     public final void setText(final String JavaDoc text) {
264         this.text = text;
265     }
266
267     /**
268      * <p>Set the <code>uRL</code> to link this menu item to.</p>
269      *
270      * @param uRL the <code>uRL</code> to link this menu item to.
271      */

272     public final void setURL(final String JavaDoc URL) {
273         this.uRL = URL;
274     }
275
276     /**
277      * <p>Set the user associated with this menu item.</p>
278      *
279      * @param user the user associated with this item, or <code>null</code> if
280      * the item should appear in all users' menues.
281      */

282     public final void setUser(final UserDO user) {
283         this.user = user;
284     }
285 }
286
Popular Tags