KickJava   Java API By Example, From Geeks To Geeks.

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


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.Layout;
21 import com.blandware.atleap.persistence.exception.DeleteException;
22 import com.blandware.atleap.persistence.exception.UpdateException;
23
24 /**
25  * <p>DAO for layout</p>
26  * <p><a HREF="LayoutDAO.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.8 $ $Date: 2005/11/28 15:56:27 $
30  */

31 public interface LayoutDAO extends LocalizableDAO {
32     // ~ CRUD Methods ================================================================
33

34     /**
35      * Creates new layout
36      *
37      * @param layout Value object that represents what layout must be created
38      * @return ID of created layout
39      */

40     public Long JavaDoc createLayout(Layout layout);
41
42     /**
43      * Retrieves layout with specified ID
44      *
45      * @param layoutId ID to search by
46      * @return Layout or null if no layout with specified ID exists in database
47      */

48     public Layout retrieveLayout(Long JavaDoc layoutId);
49
50     /**
51      * Updates layout
52      *
53      * @param layout Layout to update
54      */

55     public void updateLayout(Layout layout) throws UpdateException;
56
57     /**
58      * Deletes layout
59      *
60      * @param layout Layout to delete
61      * @throws DeleteException if layout cannot be deleted (e.g. there is one or more content page
62      * based on it)
63      */

64     public void deleteLayout(Layout layout) throws DeleteException;
65
66     // ~ Additional methods ================================================================
67

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

74     public PartialCollection listLayouts(QueryInfo queryInfo);
75
76     /**
77      * Searches for duplicates. Returns true if there is one or more layouts with another ID, but which
78      * have same values from some set (e.g. name and/or definition)
79      *
80      * @param layout Layout to find duplicates for
81      * @return whether this layout has duplicates
82      */

83     public boolean hasDuplicates(Layout layout);
84
85     // ~ Finders ================================================================
86

87     /**
88      * Finds layout by content page URI
89      *
90      * @param contentPageUri URI of content page to find layout
91      * @return Layout or null if nothing was found
92      */

93     public Layout findLayoutByContentPageUri(String JavaDoc contentPageUri);
94
95     /**
96      * Finds layout by name of Struts tile definition name
97      *
98      * @param definitionName Name of defintion to search by
99      * @return Layout or null if nothing was found
100      */

101     public Layout findLayoutByDefinition(String JavaDoc definitionName);
102
103     /**
104      * Finds layout by name
105      *
106      * @param name Name of layout to search by
107      * @return Layout or null if nothing was found
108      */

109     public Layout findLayoutByName(String JavaDoc name);
110
111 }
112
Popular Tags