KickJava   Java API By Example, From Geeks To Geeks.

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


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.Localizable;
22
23 import java.util.List JavaDoc;
24
25 /**
26  * <p>DAO for content field.</p>
27  * <p><a HREF="ContentFieldDAO.java.htm"><i>View Source</i></a></p>
28  *
29  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
30  * @version $Revision: 1.9 $ $Date: 2005/07/29 14:12:16 $
31  */

32 public interface ContentFieldDAO extends DAO {
33
34     // ~ CRUD Methods ================================================================
35

36     /**
37      * Creates new localizable field
38      *
39      * @param field Value object that represents what field must be created
40      * @param localizable Localizable to associate field with
41      * @return ID of created localizable field
42      */

43     public Long JavaDoc createContentField(ContentField field, Localizable localizable);
44
45     /**
46      * Retrieves localizable field with specified ID
47      *
48      * @param contentFieldId ID to search by
49      * @return Localizable field or null if no field with specified ID exists in database
50      */

51     public ContentField retrieveContentField(Long JavaDoc contentFieldId);
52
53     /**
54      * Updates localizable field
55      *
56      * @param contentField Localizable field to update
57      * @param localizable Localizable to associate field with
58      */

59     public void updateContentField(ContentField contentField, Localizable localizable);
60
61     /**
62      * Deletes localizable field
63      *
64      * @param contentField field to delete
65      */

66     public void deleteContentField(ContentField contentField);
67
68     // ~ Additional methods ================================================================
69

70     /**
71      * Retrieves filtered/sorted collection of localizable fields.
72      *
73      * @param queryInfo Object that contains information about how to filter and sort data
74      * @return Collection of fields
75      */

76     public PartialCollection listContentFields(QueryInfo queryInfo);
77
78     /**
79      * Searches for duplicates. Returns true if there is one or more fields with another ID, but which
80      * have same values from some set (e.g. identifier and localizable)
81      *
82      * @param contentField Field to find duplicates for
83      * @param ownerId ID of owner Localizable
84      * @return whether this content field has duplicates
85      */

86     public boolean hasDuplicates(ContentField contentField, Long JavaDoc ownerId);
87
88     // ~ Finders ================================================================
89

90     /**
91      * Finds localizable field by identifier and layout definition
92      *
93      * @param identifier Identifier of field to search by
94      * @param definition Struts tile definition on which localizable is based
95      * @return ContentField or null if nothing was found
96      */

97     public ContentField findContentFieldByLayoutDefinition(String JavaDoc identifier, String JavaDoc definition);
98
99     /**
100      * Finds indexed fields by identifier prefix and layout definition.
101      * Only those fields are returned that have a content field value for
102      * specified locale or default locale.
103      *
104      * @param identifier Identifier prefix of field to search by
105      * @param definition Struts tile definition on which localizable is based
106      * @param locale locale
107      * @return List of ContentFields or null if nothing was found
108      */

109     public List JavaDoc findIndexedContentFieldsByLayoutDefinitionAndLocale(String JavaDoc identifier, String JavaDoc definition, String JavaDoc locale);
110
111     /**
112      * Finds field by page URI and identifier
113      *
114      * @param identifier Identifier of field to search by
115      * @param uri URI of page to which field belongs
116      * @return Page field or null if nothing was found
117      */

118     public ContentField findContentFieldByPageUri(String JavaDoc identifier, String JavaDoc uri);
119
120     /**
121      * Finds indexed fields by page URI and identifier prefix.
122      * Only those fields are returned that have a content field value for
123      * specified locale or default locale.
124      *
125      * @param identifier Identifier of field to search by
126      * @param uri URI of page to which field belongs
127      * @param locale locale
128      * @return List of content fields or null if nothing was found
129      */

130     public List JavaDoc findIndexedContentFieldsByPageUriAndLocale(String JavaDoc identifier, String JavaDoc uri, String JavaDoc locale);
131
132     /**
133      * Finds localizable field by identifier and localizable
134      *
135      * @param identifier Identifier of field to search by
136      * @param localizable Owner of this field
137      * @return ContentField or null if nothing was found
138      */

139     public ContentField findContentFieldByLocalizable(String JavaDoc identifier, Localizable localizable);
140
141
142 }
143
Popular Tags