KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > persistence > core > MenuDAO


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.persistence.core;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.model.core.Localizable;
21 import com.blandware.atleap.model.core.MenuItem;
22
23 import java.util.List JavaDoc;
24
25 /**
26  * <p>DAO for menu item</p>
27  * <p><a HREF="MenuDAO.java.htm"><i>View Source</i></a></p>
28  *
29  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
30  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
31  * @version $Revision: 1.11 $ $Date: 2005/07/29 14:12:18 $
32  */

33 public interface MenuDAO extends LocalizableDAO {
34
35     // ~ CRUD Methods ================================================================
36

37     /**
38      * Creates new menu item
39      *
40      * @param menuItem Value object that represents what resource must be created
41      * @param parent Value object that represents the parent menu item, maybe <code>null</code> if menu does not have parent
42      * @param owner Owner of this menu item
43      * @return ID of created content resource
44      */

45     public Long JavaDoc createMenuItem(MenuItem menuItem, MenuItem parent, Localizable owner);
46
47     /**
48      * Retrieves menu item with specified ID
49      *
50      * @param menuItemId ID to search by
51      * @return Menu item or null if no menu item with specified ID exists in database
52      */

53     public MenuItem retrieveMenuItem(Long JavaDoc menuItemId);
54
55     /**
56      * Updates menu item
57      *
58      * @param menuItem Menu item to update
59      * @param parent Value object that represents the parent menu item, maybe <code>null</code> if menu does not have parent
60      * @param owner Owner of this menu item
61      */

62     public void updateMenuItem(MenuItem menuItem, MenuItem parent, Localizable owner);
63
64     /**
65      * Deletes menu item
66      *
67      * @param menuItem Menu item to delete
68      */

69     public void deleteMenuItem(MenuItem menuItem);
70
71     // ~ Additional methods ================================================================
72

73     /**
74      * Retrieves filtered/sorted collection of menu items.
75      *
76      * @param queryInfo Object that contains information about how to filter and sort data
77      * @return Collection of resources
78      */

79     public PartialCollection listMenuItems(QueryInfo queryInfo);
80
81     // ~ Finders ================================================================
82

83     /**
84      * Finds menu item by identifier, and parent and owner
85      *
86      * @param identifier Identifier of menu item
87      * @param parentItemId ID of parent menu item
88      * @param ownerId ID of owner of menu item
89      * @return Menu item or null if none exists
90      */

91     public MenuItem findMenuItemByIdentifierAndParentAndOwner(String JavaDoc identifier, Long JavaDoc parentItemId, Long JavaDoc ownerId);
92
93     /**
94      * Finds menu item by position, parent and owner
95      *
96      * @param position Position of menu item
97      * @param parentItemId ID of parent menu item
98      * @param ownerId ID of owner of menu item
99      * @return Menu item or null if none exists
100      */

101     public MenuItem findMenuItemByPositionAndParentAndOwner(Integer JavaDoc position, Long JavaDoc parentItemId, Long JavaDoc ownerId);
102
103     /**
104      * Finds all menu items with specified parent and owner
105      *
106      * @param parentItemId ID of parent menu item
107      * @param ownerId ID of owner of menu item
108      * @return List of menu items or null if none exists
109      */

110     public List JavaDoc findMenuItemsByParentAndOwner(Long JavaDoc parentItemId, Long JavaDoc ownerId);
111
112     /**
113      * Looks up for redefinition of item with specified ID on specified layer
114      *
115      * @param origItemId ID of item to lookup redefinitions for
116      * @param ownerId ID of layer to search on
117      * @return Menu item or null if none exists
118      */

119     public MenuItem findRedefinitionItem(Long JavaDoc origItemId, Long JavaDoc ownerId);
120
121 }
122
Popular Tags