View Javadoc

1   /*
2    * Copyright 2000-2004 The Apache Software Foundation.
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 org.apache.portals.graffito;
17  
18  import java.util.Collection;
19  
20  import org.apache.portals.graffito.exception.*;
21  import org.apache.portals.graffito.model.CmsObject;
22  import org.apache.portals.graffito.model.Document;
23  import org.apache.portals.graffito.model.Folder;
24  import org.apache.portals.graffito.model.Link;
25  
26  /***
27   * <P>CMS Model Service Interface</P>
28   *
29   * This service maintains folder, Documents and any other objects
30   * tied to the CMS that are stored in the repository and used to access the CMS.
31   * The model represents persistent state stored by Graffito to configure and
32   * maintain CMS servers working with Jetspeed.
33   *
34   * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
35   * @author <a href="mailto:ruchi@bluesunrise.com">Ruchir Gatha</a>
36   * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
37   * 
38   * @version $Id: ContentModelService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
39   *
40   */
41  public interface ContentModelService
42  {
43  
44      /***
45       * Factory to create a new Folder object.
46       *
47       * @return an empty factory created folder.
48       * @throws ContentManagementException
49       */
50      public Folder createFolder() throws ContentManagementException;
51  
52      /***
53       * Adds a new folder to engine's persistent store.
54       *
55       * @param folder the folder to add.
56       * @throws ContentManagementException
57       */
58      public void addFolder(Folder folder) throws ContentManagementException;
59  
60      /***
61       * Remove a folder from the engine's persistent store.
62       *
63       * @param folder the folder to be removed.
64       * @throws ContentManagementException
65       */
66      public void removeFolder(Folder folder) throws ContentManagementException;
67  
68      /***
69       * Remove many cms objects
70       *
71       * @param uris an Array of uri's matching to the Cms Object to remove
72       * @throws ContentManagementException
73       */
74      public void removeAll(String[] uris) throws ContentManagementException;    
75      
76      /***
77       * Get a folder from the engine's persistent store.
78       *
79       * @param uri  the uri assigned to the folder to retrieve.
80       * @return folder found or null.
81       * @throws ContentManagementException
82       */
83      public Folder getFolder(String uri) throws ContentManagementException;
84  
85      /***
86       * Update a folder in the engine's persistent store.
87       *
88       * @param folder the folder to be updated.
89       * @throws ContentManagementException
90       */
91      public void updateFolder(Folder folder) throws ContentManagementException;
92  
93      /***
94       * Factory to create a new Link object.
95       *
96       * @return an empty factory created link.
97       * @throws ContentManagementException
98       */
99      public Link createLink() throws ContentManagementException;
100 
101     /***
102      * Adds a Link to engine's persistent store.
103      *
104      * @param link the new Link to add.
105      *
106      * @throws ContentManagementException
107      */
108     public void addLink(Link link) throws ContentManagementException;
109 
110     /***
111      * Get a Link from the engine's persistent store.
112      *
113      * @param uri  the uri assigned to the link to retrieve.
114      * @return link found or null.
115      * @throws ContentManagementException
116      */
117     public Link getLink(String uri) throws ContentManagementException;
118 
119     /***
120      * Remove a Link from the engine's persistent store.
121      *
122      * @param link the Link to remove.
123      *
124      * @throws ContentManagementException
125      */
126     public void removeLink(Link link) throws ContentManagementException;
127 
128     /***
129      * Update a link in the engine's persistent store.
130      *
131      * @param link the link to be updated.
132      * @throws ContentManagementException
133      */
134     public void updateLink(Link link) throws ContentManagementException;
135 
136     /***
137      * Adds a document to engine's persistent store.
138      *
139      * @param document the new document
140      *
141      * @throws ContentManagementException
142      */
143     public void addDocument(Document document) throws ContentManagementException;
144 
145     /***
146      * Factory to create a new empty document object.
147      *
148      * @return an empty factory created document
149      * 
150      * @throws ContentManagementException
151      */
152     public Document createDocument() throws ContentManagementException;
153 
154     /***
155      * Get a document from the engine's persistent store by uri.
156      *
157      * @param uri uri assigned to the document.
158      * @return Document found or null
159      *
160      * @throws ContentManagementException
161      */
162     public Document getDocument(String uri) throws ContentManagementException;
163 
164     /***
165      * Get a document from the engine's persistent store by uri.
166      *
167      * @param uri uri assigned to the document.
168      * @param versionNum the desired version number assigned to the document to retrieve
169      * @return Document found or null
170      *
171      * @throws ContentManagementException
172      */
173     public Document getDocument(String uri, String versionNum) throws ContentManagementException;
174 
175     /***
176      * Remove a document from the engine's persistent store.
177      *
178      * @param document the document to remove.
179      *
180      * @throws ContentManagementException
181      */
182     public void removeDocument(Document document) throws ContentManagementException;
183 
184     /***
185      * Update a document in the engine's persistent store.
186      *
187      * @param document the document to update.
188      *
189      * @throws ContentManagementException
190      */
191     public void updateDocument(Document document) throws ContentManagementException;
192 
193     /***
194      * Get all folder children. It is a collection of CmsObject instances.
195      * 
196      * @param folder the parent folder.
197      * @return the folder children (collection of CmsObject).
198      * @throws ContentManagementException
199      */
200     public Collection getChildren(Folder folder) throws ContentManagementException;
201 
202     /***
203      * Get all folder children (documents & folders).
204      * 
205      * @param parentUri the uri from which the children have to be retrieved. It can be an server scope or a folder uri.
206      * @return the folder children (collection of CmsObject).
207      * @throws ContentManagementException
208      */
209     public Collection getChildren(String parentUri) throws ContentManagementException;
210 
211     /***
212      * Get all documents found in a parent uri. 
213      * 
214      * @param parentUri The uri from which the documents have be retrieved. It can be an server scope or a folder uri.
215      * @return a collection of {@link Document}
216      * @throws ContentManagementException
217      */
218     public Collection getDocuments(String parentUri) throws ContentManagementException;
219 
220     /***
221      * Get all links found in a parent uri. 
222      * 
223      * @param parentUri The uri from which the links have be retrieved. It can be an server scope or a folder uri.
224      * @return a collection of {@link Link}
225      * @throws ContentManagementException
226      */
227     public Collection getLinks(String parentUri) throws ContentManagementException;
228     
229     /***
230      * Get all folders found in a parent uri. 
231      * 
232      * @param parentUri The uri from which the folders have be retrieved. It can be an server scope or a folder uri.
233      * @return a collection of {@link Folder}
234      * @throws ContentManagementException
235      */
236     public Collection getFolders(String parentUri) throws ContentManagementException;
237     
238     /***
239      * Get a CmsObject from the engine's persistent store.
240      *
241      * @param uri  the uri assigned to the cms object to retrieve.
242      * @return The cms object found or null.
243      * @throws ContentManagementException
244      */
245     public CmsObject getCmsObject(String uri) throws ContentManagementException;
246 
247 }