KickJava   Java API By Example, From Geeks To Geeks.

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


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.ContentField;
21 import com.blandware.atleap.model.core.ContentFieldValue;
22 import com.blandware.atleap.model.core.ContentLocale;
23
24 /**
25  * <p>DAO for content field value</p>
26  * <p><a HREF="ContentFieldValueDAO.java.htm"><i>View Source</i></a></p>
27  *
28  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
29  * @version $Revision: 1.12 $ $Date: 2006/03/16 11:09:37 $
30  */

31 public interface ContentFieldValueDAO extends DAO {
32
33     // ~ CRUD Methods ================================================================
34

35     /**
36      * Creates new content field value
37      *
38      * @param contentFieldValue Content field value object that represents what
39      * field value must be created
40      * @param field Content field to which this content field value belongs
41      * @param contentLocale Content locale that corresponds to this content
42      * field value
43      * @return ID of created content field value
44      */

45     public Long JavaDoc createContentFieldValue(ContentFieldValue contentFieldValue, ContentField field, ContentLocale contentLocale);
46
47     /**
48      * Retrieves content field value with specified ID
49      *
50      * @param contentFieldValueId ID to search by
51      * @return Content field value or null if no content field value with specified ID exists in database
52      */

53     public ContentFieldValue retrieveContentFieldValue(Long JavaDoc contentFieldValueId);
54
55     /**
56      * Updates content field value
57      *
58      * @param contentFieldValue content field value to update
59      * @param field field to which this CFV belongs
60      * @param contentLocale content locale that corresponds to this CFV
61      */

62     public void updateContentFieldValue(ContentFieldValue contentFieldValue, ContentField field, ContentLocale contentLocale);
63
64     /**
65      * Deletes content field value
66      *
67      * @param contentFieldValue CFV of field to delete
68      */

69     public void deleteContentFieldValue(ContentFieldValue contentFieldValue);
70
71     // ~ Additional methods ================================================================
72

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

79     public PartialCollection listContentFieldValues(QueryInfo queryInfo);
80
81     /**
82      * Searches for duplicates. Returns true if there is one or more field values with another ID, but which
83      * have the same field and locale
84      *
85      * @param contentFieldValue Field value to find duplicates for
86      * @param fieldId ID of field
87      * @param localeIdentifier Identifier of locale
88      * @return whether this content field value has duplicates
89      */

90     public boolean hasDuplicates(ContentFieldValue contentFieldValue, Long JavaDoc fieldId, String JavaDoc localeIdentifier);
91
92     // ~ Finders ================================================================
93

94
95     /**
96      * Finds content field value by its field and locale
97      *
98      * @param field Content field to search by
99      * @param contentLocale Locale to search by
100      * @return ContentFieldValue or null if nothing was found
101      */

102     public ContentFieldValue findContentFieldValueByContentFieldAndLocale(ContentField field, ContentLocale contentLocale);
103
104     /**
105      * Finds content field value by page URI, content field identifier and locale.
106      * If nothing was found for specified locale, attempt to find the same for
107      * default locale.
108      *
109      * @param uri URI of page that contains content field
110      * @param identifier Identifier of content field
111      * @param localeIdentifier Content locale identifier
112      * @return Content field value or null if nothing was found
113      */

114     public ContentFieldValue findContentFieldValueByUriAndIdentifierAndLocale(String JavaDoc uri, String JavaDoc identifier, String JavaDoc localeIdentifier);
115
116     /**
117      * Finds content field value by layout definition, field identifier and locale.
118      * If nothing was found for specified locale, attempt to find the same for
119      * default locale.
120      *
121      * @param definition Struts tile definition layout that contains content field
122      * @param identifier Identifier of content field
123      * @param localeIdentifier Content locale identifier
124      * @return Content field value or null if nothing was found
125      */

126     public ContentFieldValue findContentFieldValueByDefinitionAndIdentifierAndLocale(String JavaDoc definition, String JavaDoc identifier, String JavaDoc localeIdentifier);
127
128     /**
129      * Finds content field value by localizable id, field identifier and locale.
130      * If nothing was found for specified locale, attempt to find the same for
131      * default locale.
132      *
133      * @param localizableId Id of localizable object
134      * @param identifier Identifier of content field
135      * @param localeIdentifier Content locale identifier
136      * @return Content field value or null if nothing was found
137      */

138     public ContentFieldValue findContentFieldValueByLocalizableIdAndIdentifierAndLocale(Long JavaDoc localizableId, String JavaDoc identifier, String JavaDoc localeIdentifier);
139
140 }
141
142
Popular Tags