KickJava   Java API By Example, From Geeks To Geeks.

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


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.ResourceData;
21 import com.blandware.atleap.model.core.ContentDocument;
22 import com.blandware.atleap.model.core.ContentLocale;
23 import com.blandware.atleap.persistence.exception.DeleteException;
24
25 /**
26  * <p>DAO for content document</p>
27  * <p><a HREF="ContentDocumentDAO.java.htm"><i>View Source</i></a></p>
28  *
29  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
30  * @version $Revision: 1.3 $ $Date: 2006/03/16 11:09:37 $
31  */

32 public interface ContentDocumentDAO extends ContentResourceDAO {
33
34     // ~ CRUD Methods ================================================================
35

36     /**
37      * Creates new content document
38      *
39      * @param contentDocument Value object that represents what document must be created
40      * @param resourceData resource data that holds the document content
41      * @param contentLocale content locale to which this document belongs
42      * @return ID of created content document
43      */

44     public Long JavaDoc createContentDocument(ContentDocument contentDocument, ResourceData resourceData, ContentLocale contentLocale);
45
46     /**
47      * Retrieves content document with specified ID
48      *
49      * @param contentDocumentId ID to search by
50      * @return Content document or null if no content document with specified ID exists in database
51      */

52     public ContentDocument retrieveContentDocument(Long JavaDoc contentDocumentId);
53
54     /**
55      * Updates content document
56      *
57      * @param contentDocument document to update
58      * @param resourceData resource data that holds the document content
59      * @param contentLocale content locale to which this document belongs
60      */

61     public void updateContentDocument(ContentDocument contentDocument, ResourceData resourceData, ContentLocale contentLocale);
62
63     /**
64      * Deletes content document
65      *
66      * @param contentDocument document to delete
67      * @throws com.blandware.atleap.persistence.exception.DeleteException
68      * if content document cannot be deleted
69      */

70     public void deleteContentDocument(ContentDocument contentDocument) throws DeleteException;
71
72     // ~ Additional methods ================================================================
73

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

80     public PartialCollection listContentDocuments(QueryInfo queryInfo);
81
82     
83     // ~ Finders ================================================================
84

85     /**
86      * Finds content document by URI
87      *
88      * @param uri URI of document to search by
89      * @return Content document or null if nothing was found
90      */

91     public ContentDocument findContentDocumentByUri(String JavaDoc uri);
92
93
94 }
95
Popular Tags