KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > service > core > PageManager


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.service.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.ActionPage;
21 import com.blandware.atleap.model.core.ContentPage;
22 import com.blandware.atleap.model.core.Page;
23 import com.blandware.atleap.persistence.exception.DeleteException;
24 import com.blandware.atleap.service.exception.BeanAlreadyExistsException;
25 import com.blandware.atleap.service.exception.BeanNotFoundException;
26
27 import java.util.Collection JavaDoc;
28
29 /**
30  * <p>Business Delegate (Proxy) Interface to handle communication between web and
31  * persistence layer.
32  * </p>
33  * <p><a HREF="PageManager.java.htm"><i>View Source</i></a>
34  * </p>
35  *
36  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
37  * @version $Revision: 1.12 $ $Date: 2005/08/20 10:18:53 $
38  */

39 public interface PageManager extends BaseManager {
40
41     // L I N K A B L E I T E M S
42

43     /**
44      * Returns collection of pages, which are not content nor action
45      *
46      * @param queryInfo Object with some information for query
47      * @return Collection of linkable items
48      */

49     public PartialCollection listLinkableItems(QueryInfo queryInfo);
50
51     // C O N T E N T P A G E S
52

53     //~ CRUD Methods ================================================================
54

55     /**
56      * Creates new content page
57      *
58      * @param contentPage Content page to create
59      * @param layoutId ID of layout to create page on
60      * @return ID of created page
61      * @throws BeanNotFoundException if layout with specified ID couldn't be found
62      * @throws BeanAlreadyExistsException if linkable item with same URI already exists
63      */

64     public Long JavaDoc createContentPage(ContentPage contentPage, Long JavaDoc layoutId) throws BeanAlreadyExistsException, BeanNotFoundException;
65
66     /**
67      * Retrieves content page with specified ID
68      *
69      * @param contentPageId The ID of content page to retrieve
70      * @return Content page or null if no content page with specified ID exists in database
71      */

72     public ContentPage retrieveContentPage(Long JavaDoc contentPageId);
73
74     /**
75      * Updates content page
76      *
77      * @param contentPage Content page to update
78      * @param layoutId ID of layout to associate page with
79      * @throws BeanNotFoundException if layout with specified ID couldn't be found
80      * @throws BeanAlreadyExistsException if page (no matter content or action) with same URI already exists
81      */

82     public void updateContentPage(ContentPage contentPage, Long JavaDoc layoutId) throws BeanAlreadyExistsException, BeanNotFoundException;
83
84
85     /**
86      * Removes content page
87      *
88      * @param contentPageId ID of content page to remove
89      * @throws BeanNotFoundException if content page with specified ID couldn't be found
90      * @throws DeleteException if content page cannot be deleted
91      */

92     public void deleteContentPage(Long JavaDoc contentPageId) throws BeanNotFoundException, DeleteException;
93
94     // ~ Additional methods ================================================================
95

96     /**
97      * Retrieves filtered/sorted collection of content pages
98      *
99      * @param queryInfo Object that contains information about how to filter and sort data
100      * @return Collection of content pages
101      */

102     public PartialCollection listContentPages(QueryInfo queryInfo);
103
104     // ~ Finders ================================================================
105

106     /**
107      * Finds content page by URI
108      *
109      * @param contentPageUri URI of content page to search by
110      * @return Content page or null if nothing was found
111      */

112     public ContentPage findContentPageByUri(String JavaDoc contentPageUri);
113
114
115     // A C T I O N P A G E S
116

117     //~ CRUD Methods ================================================================
118

119     /**
120      * Creates new action page
121      *
122      * @param actionPage Action page to create
123      * @return ID of created page
124      * @throws BeanAlreadyExistsException if linkable item with same URI already exists
125      */

126     public Long JavaDoc createActionPage(ActionPage actionPage) throws BeanAlreadyExistsException;
127
128     /**
129      * Retrieves action page with specified ID
130      *
131      * @param actionPageId The ID of the action page to retrieve
132      * @return Action page or null if no action page with specified ID exists in database
133      */

134     public ActionPage retrieveActionPage(Long JavaDoc actionPageId);
135
136     /**
137      * Updates action page
138      *
139      * @param actionPage Action page to update
140      * @throws BeanAlreadyExistsException if page (no matter content or action) with same URI already exists
141      */

142     public void updateActionPage(ActionPage actionPage) throws BeanAlreadyExistsException;
143
144
145     /**
146      * Removes action page
147      *
148      * @param actionPageId ID of action page to remove
149      * @throws DeleteException if action page cannot be deleted
150      */

151     public void deleteActionPage(Long JavaDoc actionPageId) throws DeleteException, BeanNotFoundException;
152
153     // ~ Additional methods ================================================================
154

155     /**
156      * Retrieves filtered/sorted collection of action pages
157      *
158      * @param queryInfo Object that contains information about how to filter and sort data
159      * @return Collection of action pages
160      */

161     public PartialCollection listActionPages(QueryInfo queryInfo);
162
163     // ~ Finders ================================================================
164

165     /**
166      * Finds action page by URI
167      *
168      * @param actionPageUri URI of action page to search by
169      * @return Action page or null if nothing was found
170      */

171     public ActionPage findActionPageByUri(String JavaDoc actionPageUri);
172
173
174     // P A G E S
175

176     /**
177      * Finds linkable item by URI
178      *
179      * @param pageUri URI of page to search by
180      * @return Page or null if nothing was found
181      */

182     public Page findPageByUri(String JavaDoc pageUri);
183
184     /**
185      * Retrieves linkable item with specified ID
186      *
187      * @param pageId The ID of page to retrieve
188      * @return Action page or null if no page with specified ID exists in database
189      */

190     public Page retrievePage(Long JavaDoc pageId);
191
192     /**
193      * Returns list of all pages with their content fields and content values
194      * correctly assigned
195      *
196      * @return Collection of pages
197      */

198     public Collection listPagesFetching();
199
200     /**
201      * Increases usage counter to some value (can be negative)
202      *
203      * @param pageId id of page to update
204      * @param value the value to add to usage counter
205      * @throws BeanNotFoundException if page with specified ID couldn't be found
206      */

207     public void increaseUsageCounter(Long JavaDoc pageId, Integer JavaDoc value) throws BeanNotFoundException;
208 }
209
Popular Tags