KickJava   Java API By Example, From Geeks To Geeks.

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


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.ContentImage;
21 import com.blandware.atleap.model.core.ContentResource;
22 import com.blandware.atleap.model.core.ResourceData;
23 import com.blandware.atleap.model.core.ContentDocument;
24 import com.blandware.atleap.persistence.exception.DeleteException;
25 import com.blandware.atleap.service.exception.BeanAlreadyExistsException;
26 import com.blandware.atleap.service.exception.BeanNotFoundException;
27
28 /**
29  * <p>Business Delegate (Proxy) Interface to handle communication between web and
30  * persistence layer.
31  * </p>
32  * <p><a HREF="ContentResourceManager.java.htm"><i>View Source</i></a>
33  * </p>
34  *
35  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
36  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
37  * @version $Revision: 1.12 $ $Date: 2005/08/02 14:53:39 $
38  */

39 public interface ContentResourceManager extends BaseManager {
40
41     // C O N T E N T R E S O U R C E S
42

43     //~ CRUD Methods ================================================================
44

45     /**
46      * Creates new content resource
47      *
48      * @param contentResource Content resource to create
49      * @param resourceData resource data
50      * @return ID of created resource
51      * @throws BeanAlreadyExistsException if resource with same URI already exists
52      */

53     public Long JavaDoc createContentResource(ContentResource contentResource, ResourceData resourceData) throws BeanAlreadyExistsException;
54
55     /**
56      * Retrieves content resource with specified ID
57      *
58      * @param contentResourceId The ID of content resource to retrieve
59      * @return Content resource or null if no content resource with specified ID exists in database
60      */

61     public ContentResource retrieveContentResource(Long JavaDoc contentResourceId);
62
63     /**
64      * Updates content resource
65      *
66      * @param contentResource ContentResource to update
67      * @param resourceData resource data
68      * @throws BeanAlreadyExistsException if resource with same name already exists
69      */

70     public void updateContentResource(ContentResource contentResource, ResourceData resourceData) throws BeanAlreadyExistsException;
71
72     /**
73      * Removes content resource
74      *
75      * @param contentResourceId ID of contentResource to remove
76      * @throws DeleteException if content resource cannot be deleted
77      */

78     public void deleteContentResource(Long JavaDoc contentResourceId) throws DeleteException, BeanNotFoundException;
79
80     // ~ Additional methods ================================================================
81

82     /**
83      * Retrieves filtered/sorted collection of content resources
84      *
85      * @param queryInfo Object that contains information about how to filter and sort data
86      * @return Collection of content resources
87      */

88     public PartialCollection listContentResources(QueryInfo queryInfo);
89
90     /**
91      * Increases usage counter to some value (can be negative)
92      *
93      * @param resourceId ID of content resource to update
94      * @param value the value that will be added to usage counter
95      * @throws BeanNotFoundException if resource with this ID is not found
96      */

97     public void increaseUsageCounter(Long JavaDoc resourceId, Integer JavaDoc value) throws BeanNotFoundException;
98
99     // ~ Finders ================================================================
100

101     /**
102      * Searches for content resource with specified URI
103      *
104      * @param uri URI to search by
105      * @return content resource or null if none has been found
106      */

107     public ContentResource findContentResourceByUri(String JavaDoc uri);
108
109
110     // C O N T E N T I M A G E S
111

112     //~ CRUD Methods ================================================================
113

114     /**
115      * Creates new content image
116      *
117      * @param contentImage Content image to create
118      * @param resourceData resource data
119      * @return ID of created image
120      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
121      * if image with same URI already exists
122      */

123     public Long JavaDoc createContentImage(ContentImage contentImage, ResourceData resourceData) throws BeanAlreadyExistsException;
124
125     /**
126      * Retrieves content image with specified ID
127      *
128      * @param contentImageId The ID of content image to retrieve
129      * @return Content image or null if no content image with specified ID exists in database
130      */

131     public ContentImage retrieveContentImage(Long JavaDoc contentImageId);
132
133     /**
134      * Updates content image
135      *
136      * @param contentImage ContentImage to update
137      * @param resourceData resource data
138      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
139      * if image with same name already exists
140      */

141     public void updateContentImage(ContentImage contentImage, ResourceData resourceData) throws BeanAlreadyExistsException;
142
143     /**
144      * Removes content image
145      *
146      * @param contentImageId ID of content image to remove
147      * @throws com.blandware.atleap.persistence.exception.DeleteException
148      * if content image cannot be deleted
149      */

150     public void deleteContentImage(Long JavaDoc contentImageId) throws DeleteException, BeanNotFoundException;
151
152     // ~ Additional methods ================================================================
153

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

160     public PartialCollection listContentImages(QueryInfo queryInfo);
161
162     // ~ Finders ================================================================
163

164     /**
165      * Searches for content image with specified URI
166      *
167      * @param uri URI to search by
168      * @return content image or null if none has been found
169      */

170     public ContentImage findContentImageByUri(String JavaDoc uri);
171
172     // C O N T E N T D O C U M E N T S
173

174     //~ CRUD Methods ================================================================
175

176     /**
177      * Creates new content document
178      *
179      * @param contentDocument Content document to create
180      * @param resourceData resource data
181      * @param localeIdentifier The identifier of content locale to associate with
182      * this document
183      * @return ID of created document
184      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
185      * if document with same URI already exists
186      */

187     public Long JavaDoc createContentDocument(ContentDocument contentDocument, ResourceData resourceData, String JavaDoc localeIdentifier) throws BeanNotFoundException, BeanAlreadyExistsException;
188
189     /**
190      * Retrieves content document with specified ID
191      *
192      * @param contentDocumentId The ID of content document to retrieve
193      * @return Content document or null if no content document with specified ID exists in database
194      */

195     public ContentDocument retrieveContentDocument(Long JavaDoc contentDocumentId);
196
197     /**
198      * Updates content document
199      *
200      * @param contentDocument ContentDocument to update
201      * @param resourceData resource data
202      * @param localeIdentifier The identifier of content locale to associate with
203      * this document
204      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
205      * if document with same name already exists
206      */

207     public void updateContentDocument(ContentDocument contentDocument, ResourceData resourceData, String JavaDoc localeIdentifier) throws BeanNotFoundException, BeanAlreadyExistsException;
208
209     /**
210      * Removes content document
211      *
212      * @param contentDocumentId ID of contentDocument to remove
213      * @throws com.blandware.atleap.persistence.exception.DeleteException
214      * if content document cannot be deleted
215      */

216     public void deleteContentDocument(Long JavaDoc contentDocumentId) throws DeleteException, BeanNotFoundException;
217
218     // ~ Additional methods ================================================================
219

220     /**
221      * Retrieves filtered/sorted collection of content documents
222      *
223      * @param queryInfo Object that contains information about how to filter and sort data
224      * @return Collection of content documents
225      */

226     public PartialCollection listContentDocuments(QueryInfo queryInfo);
227
228     // ~ Finders ================================================================
229

230     /**
231      * Searches for content document with specified URI
232      *
233      * @param uri URI to search by
234      * @return content document or null if none has been found
235      */

236     public ContentDocument findContentDocumentByUri(String JavaDoc uri);
237
238 }
Popular Tags