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.model;
17  
18  import java.io.NotSerializableException;
19  import java.sql.Timestamp;
20  import java.util.Map;
21  
22  
23  /***
24   * The CmsObject interface is the ancestor for all Cms objects present into the content tree (Document, folder, link, ...).
25   *  
26   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
27   * 
28   * @version $Id: CmsObject.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
29   */
30  public interface CmsObject
31  {
32      
33      public final static String URI_SEPARATOR = "/"; 
34      /***
35      * Get the Name
36      *
37      * @return String
38      */
39      String getName();
40  
41      /***
42      * Set the value of Name
43      *
44      * @param v new value
45      */
46      void setName(String v);
47  
48      /***
49       * Get the object's URI, a unique resource identifier
50       *
51       * @return String the URI value
52       */
53      String getUri();
54  
55      
56      /***
57       * Set the object's URI, a unique resource identifier
58       *
59       * @param uri the URI value
60       */
61      void setUri(String uri);
62      
63      /***
64       * Get the parent folder
65       *
66       * @return Folder the folder which contains this object
67       */
68      Folder getParentFolder();
69      
70      /***
71       * Set the parent folder
72       *
73       * @param parentFolder the folder which contains this object
74       */
75      void setParentFolder(Folder parentFolder);    
76      /***
77       * Get the last modified date for this document
78       *
79       * @return Date
80       */
81      Timestamp getLastModified();
82  
83      /***
84       * Set the last modified date for this document
85       * 
86       * @param lastModified the new last modified date value
87       */
88      void setLastModified(Timestamp lastModified);
89  
90      /***
91       * Get the document's creation date
92       *
93       * @return Date
94       */
95      Timestamp getCreationDate();
96  
97      /***
98       * Set the creation date for this document
99       * 
100      * @param creationDate The new creation date value
101      */
102     void setCreationDate(Timestamp creationDate);
103 
104     /***
105      * Get the document's description
106      *
107      * @return String
108      */
109     String getDescription();
110 
111     /***
112      * Set the document's description
113      *
114      * @param description the new description value
115      */
116     void setDescription(String description);
117 
118     /***
119      * Get the document's title (short description)
120      *
121      * @return String
122      */
123     String getTitle();
124 
125     /***
126      * Set the document's title (short description)
127      *
128      * @param title the new title value
129      */
130     void setTitle(String title);
131     
132     
133     /***
134      * Return the splitted uri
135      * @return
136      */
137     String[] getPath();
138     
139 
140     /***
141      * Get a map of all non standard properties for this object
142      *
143      * @return a map of properties
144      */
145     Map getProperties();
146 
147     /***
148      * Get a named property for this object
149      *
150      * @param name of the property
151      * @return the property as an string
152      */
153     String getProperty(String name);
154 
155     /***
156      * Sets a named property for this string
157      *
158      * @param name
159      * @param property
160      */
161     void setProperty(String name, String property);     
162 
163     /***
164      * Get a map of all objects for this documen t
165      * Objects should be serializable
166      * 
167      * @return a map of objects
168      */
169     Map getObjects();
170 
171     /***
172      * Get a named object for this document
173      * Objects should be serializable
174      * 
175      * @param name of the object
176      * @return the object 
177      */
178     Object getObject(String name);
179 
180     /***
181      * Sets a named object for this string
182      * Objects should be serializable
183      * 
184      * @param name
185      * @param object
186      */
187     void setObject(String name, Object object)
188     throws NotSerializableException;
189     
190     /***
191      * Gets the version number
192      * 
193      * @return version number is a string composed of point separated digit
194      */
195     String getVersionNumber();
196     
197     /***
198      * Check if the current document is the last version
199      * 
200      * @return the last version attribute value
201      */
202     boolean isLastVersion();
203     
204     /***
205      * Makes the current document the last version for the associated uri
206      * 
207      * @param isLastVersion
208      */
209     void setLastVersion(boolean isLastVersion);
210     
211     /***
212      * Sets the version number
213      * 
214      * @param versionNumber version number is a string composed of point separated digit
215      */
216     void setVersionNumber(String versionNumber);
217     
218     
219     
220 }