KickJava   Java API By Example, From Geeks To Geeks.

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


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.ContentField;
21 import com.blandware.atleap.model.core.ContentFieldValue;
22 import com.blandware.atleap.persistence.exception.DeleteException;
23 import com.blandware.atleap.service.exception.BeanAlreadyExistsException;
24 import com.blandware.atleap.service.exception.BeanNotFoundException;
25
26 import java.util.List JavaDoc;
27
28 /**
29  * <p>Business Delegate (Proxy) Interface to handle communication between web and
30  * persistence layer.
31  * </p>
32  * <p><a HREF="ContentFieldManager.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  * @version $Revision: 1.14 $ $Date: 2005/08/03 15:38:59 $
37  */

38 public interface ContentFieldManager extends BaseManager {
39
40     // F I E L D S
41

42     //~ CRUD Methods ================================================================
43

44     /**
45      * Creates new field
46      *
47      * @param field ContentField to create
48      * @param ownerId ID of owner localizable to associate field with
49      * @return ID of created field
50      * @throws BeanNotFoundException if localizable with specified ID couldn't be found
51      * @throws BeanAlreadyExistsException if content field with such identifier already exists on localizable with specified ID
52      */

53     public Long JavaDoc createContentField(ContentField field, Long JavaDoc ownerId) throws BeanNotFoundException, BeanAlreadyExistsException;
54
55     /**
56      * Retrieves field with specified ID
57      *
58      * @param fieldId the ID of field to retrieve
59      * @return Content field or null if no field with specified ID exists in database
60      */

61     public ContentField retrieveContentField(Long JavaDoc fieldId);
62
63     /**
64      * Updates field
65      *
66      * @param field ContentField to update
67      * @param localizableId ID of localizable to associate field with
68      * @throws BeanNotFoundException if localizable with specified ID couldn't be found
69      * @throws BeanAlreadyExistsException if content field with such identifier already exists on localizable with specified ID
70      */

71     public void updateContentField(ContentField field, Long JavaDoc localizableId) throws BeanNotFoundException, BeanAlreadyExistsException;
72
73
74     /**
75      * Removes localizable field
76      *
77      * @param fieldId ID of localizable field to remove
78      * @throws BeanNotFoundException if contentField with specified ID couldn't be found
79      * @throws DeleteException if content field cannot be deleted (e.g. it has one or more associated values)
80      */

81     public void deleteContentField(Long JavaDoc fieldId) throws BeanNotFoundException, DeleteException;
82
83     // ~ Additional methods ================================================================
84

85     /**
86      * Retrieves filtered/sorted collection of localizable fields
87      *
88      * @param queryInfo Object that contains information about how to filter and sort data
89      * @return Collection of content fields
90      */

91     public PartialCollection listContentFields(QueryInfo queryInfo);
92
93     // ~ Finders ================================================================
94

95     /**
96      * Finds content field by layout definition and identifier
97      *
98      * @param identifier Identifier of content field to search by
99      * @param definition Struts tile definition on which layout is based
100      * @return Content field or null if nothing was found
101      */

102     public ContentField findContentFieldByLayoutDefinition(String JavaDoc identifier, String JavaDoc definition);
103
104     /**
105      * Finds content field by page URI and identifier
106      *
107      * @param identifier Identifier of content field to search by
108      * @param uri URI of page to which content field belongs
109      * @return Content field or null if nothing was found
110      */

111     public ContentField findContentFieldByPageUri(String JavaDoc identifier, String JavaDoc uri);
112
113     /**
114      * Finds indexed content fields by identifier prefix and layout definition;
115      * only fields that have CFVs for specified locale (or default locale) are
116      * returned
117      *
118      * @param identifier Identifier prefix of field to search by
119      * @param definition Struts tile definition on which localizable is based
120      * @param locale Content locale for which fields must have values
121      * @return List of content fields or null if nothing was found
122      */

123     public List JavaDoc findIndexedContentFieldsByLayoutDefinition(String JavaDoc identifier, String JavaDoc definition, String JavaDoc locale);
124
125     /**
126      * Finds indexed content fields by page URI and identifier prefix;
127      * only fields that have CFVs for specified locale (or default locale) are
128      * returned
129      *
130      * @param identifier Identifier of field to search by
131      * @param uri URI of page to which content fields belong
132      * @param locale Content locale for which fields must have values
133      * @return List of content fields or null if nothing was found
134      */

135     public List JavaDoc findIndexedContentFieldsByPageUri(String JavaDoc identifier, String JavaDoc uri, String JavaDoc locale);
136
137
138     
139     // C O N T E N T F I E L D V A L U E
140

141     //~ CRUD Methods ================================================================
142

143     /**
144      * Creates new content field value
145      *
146      * @param contentFieldValue content field value to create
147      * @param fieldId ID of content field to create value for
148      * @param localeIdentifier the identifier of content locale to assosiate this
149      * CFV with
150      * @return ID of created content field value
151      * @throws BeanNotFoundException if content field with specified ID couldn't be found
152      * @throws BeanAlreadyExistsException if content field value already exists for content field with specified identifier and locale
153      */

154     public Long JavaDoc createContentFieldValue(ContentFieldValue contentFieldValue, Long JavaDoc fieldId, String JavaDoc localeIdentifier) throws BeanNotFoundException, BeanAlreadyExistsException;
155
156     /**
157      * Retrieves content field value with specified ID
158      *
159      * @param contentFieldValueId the id of CFV to retrieve
160      * @return Content field value or null if no content field value with specified ID exists in database
161      */

162     public ContentFieldValue retrieveContentFieldValue(Long JavaDoc contentFieldValueId);
163
164     /**
165      * Updates content field value
166      *
167      * @param contentFieldValue the content field value to update
168      * @param fieldId Content field to update value for
169      * @param localeIdentifier the identifier of content locale to assosiate this
170      * CFV with
171      * @throws BeanNotFoundException if field value with specified ID couldn't be found
172      * @throws BeanAlreadyExistsException if field content already exists for field with specified identifier and locale
173      */

174     public void updateContentFieldValue(ContentFieldValue contentFieldValue, Long JavaDoc fieldId, String JavaDoc localeIdentifier) throws BeanNotFoundException, BeanAlreadyExistsException;
175
176
177     /**
178      * Removes content field value with specified ID
179      *
180      * @param contentFieldValueId ID of content field value to remove
181      * @throws BeanNotFoundException if content field with specified ID couldn't be found
182      */

183     public void deleteContentFieldValue(Long JavaDoc contentFieldValueId) throws BeanNotFoundException;
184
185     // ~ Additional methods ================================================================
186

187     /**
188      * Retrieves filtered/sorted collection of content field values
189      *
190      * @param queryInfo Object that contains information about how to filter and sort data
191      * @return Collection of content field values
192      */

193     public PartialCollection listContentFieldValues(QueryInfo queryInfo);
194
195     // ~ Finders ================================================================
196

197     /**
198      * Finds content field value by page URI, field identifier and locale
199      *
200      * @param uri URI of page that contains field
201      * @param identifier Identifier of content field
202      * @param localeIdentifier Content locale identifier
203      * @return Content field value or null if nothing was found
204      */

205     public ContentFieldValue findContentFieldValueByUriAndIdentifierAndLocale(String JavaDoc uri, String JavaDoc identifier, String JavaDoc localeIdentifier);
206
207     /**
208      * Finds content field value by layout definition, field identifier and locale
209      *
210      * @param definition Struts tile definition of page that contains field
211      * @param identifier Identifier of content field
212      * @param localeIdentifier Content locale identifier
213      * @return Content field value or null if nothing was found
214      */

215     public ContentFieldValue findContentFieldValueByDefinitionAndIdentifierAndLocale(String JavaDoc definition, String JavaDoc identifier, String JavaDoc localeIdentifier);
216
217     /**
218      * Finds content field value by localizable id, field identifier and locale
219      *
220      * @param localizableId ID of localizable object
221      * @param identifier Identifier of content field
222      * @param localeIdentifier Content locale identifier
223      * @return Content field value or null if nothing was found
224      */

225     public ContentFieldValue findContentFieldValueByLocalizableIdAndIdentifierAndLocale(Long JavaDoc localizableId, String JavaDoc identifier, String JavaDoc localeIdentifier);
226
227     /**
228      * Finds content field value by content field ID and locale
229      *
230      * @param fieldId ID of content field
231      * @param localeIdentifier Content locale identifier
232      * @return Content field value or null if nothing was found
233      */

234     public ContentFieldValue findContentFieldValueByContentFieldIdAndLocale(Long JavaDoc fieldId, String JavaDoc localeIdentifier);
235
236 }
237
Popular Tags