001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/rwiki/tags/sakai_2-4-1/rwiki-api/api/src/java/uk/ac/cam/caret/sakai/rwiki/service/api/model/RWikiObject.java $
003: * $Id: RWikiObject.java 9108 2006-05-08 14:30:57Z ian@caret.cam.ac.uk $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package uk.ac.cam.caret.sakai.rwiki.service.api.model;
021:
022: import java.util.Date;
023:
024: /**
025: * The base object for a Wiki page, id, name, realm, permissions, revision,
026: * version, owner
027: */
028: // FIXME: Service
029: public interface RWikiObject extends Comparable {
030: /**
031: * Access the unique id.
032: *
033: * @return The unique id.
034: */
035: String getId();
036:
037: /**
038: * Set the ID, ONLY do this if you really know you must.
039: *
040: * @return
041: */
042: void setId(String id);
043:
044: /**
045: * Access the object's version time stamp.
046: *
047: * @return The object's version time stamp.
048: */
049: Date getVersion();
050:
051: /**
052: * Set the "version"
053: *
054: * @param version
055: * The new "version".
056: */
057: void setVersion(Date version);
058:
059: /**
060: * Access "name".
061: *
062: * @return "name".
063: */
064: String getName();
065:
066: /**
067: * Set the "name".
068: *
069: * @param name
070: * The new "name".
071: */
072: void setName(String name);
073:
074: /**
075: * Access "rank".
076: *
077: * @return "rank".
078: */
079: String getRealm();
080:
081: /**
082: * Set the "rank".
083: *
084: * @param rank
085: * The new "rank".
086: */
087: void setRealm(String rank);
088:
089: /**
090: * Access "serial number".
091: *
092: * @return "serial number".
093: */
094: String getContent();
095:
096: /**
097: * a list of referenced pages seperated by ::
098: *
099: * @return
100: */
101: String getReferenced();
102:
103: /**
104: * a list of referenced pages seperated by ::
105: */
106: void setReferenced(String referenced);
107:
108: /**
109: * Set the "serial number".
110: *
111: * @param sn
112: * The new "serial number".
113: */
114: void setContent(String sn);
115:
116: /**
117: * The user that last edited this record
118: *
119: * @param user
120: */
121: void setUser(String user);
122:
123: /**
124: * @return The user that last edited this record
125: * @return
126: */
127: String getUser();
128:
129: /**
130: * The user that owns this record
131: */
132: void setOwner(String owner);
133:
134: /**
135: * @return The user that owns this record
136: */
137: String getOwner();
138:
139: /**
140: * Can the user read the page
141: *
142: * @return
143: */
144: boolean getOwnerRead();
145:
146: /**
147: * set what the owner can do to the page, requires admin for the user
148: *
149: * @param userRead
150: */
151: void setOwnerRead(boolean ownerRead);
152:
153: /**
154: * can the user edit the page
155: *
156: * @return
157: */
158: boolean getOwnerWrite();
159:
160: /**
161: * set the user edit permission
162: *
163: * @param userWrite
164: */
165: void setOwnerWrite(boolean ownerWrite);
166:
167: /**
168: * can the user admin the page (set other permissions)
169: *
170: * @return
171: */
172: boolean getOwnerAdmin();
173:
174: /**
175: * Can the user set admin permissions, (set other permissions, including
176: * this one, potential lock out so we need a higher level admin )
177: *
178: * @param userAdmin
179: */
180: void setOwnerAdmin(boolean ownerAdmin);
181:
182: /**
183: * can the group read the page
184: *
185: * @return
186: */
187: boolean getGroupRead();
188:
189: /**
190: * set the group permission
191: *
192: * @param groupRead
193: */
194: void setGroupRead(boolean groupRead);
195:
196: /**
197: * can the group edit the page
198: *
199: * @return
200: */
201: boolean getGroupWrite();
202:
203: /**
204: * set the group edit
205: *
206: * @param groupWrite
207: */
208: void setGroupWrite(boolean groupWrite);
209:
210: /**
211: * can the group admin the page (set other permissions)
212: *
213: * @return
214: */
215: boolean getGroupAdmin();
216:
217: /**
218: * set the group admin permissoins
219: *
220: * @param groupAdmin
221: */
222: void setGroupAdmin(boolean groupAdmin);
223:
224: /**
225: * Can the public read the page
226: *
227: * @return
228: */
229: boolean getPublicRead();
230:
231: /**
232: * set the public read permissions
233: *
234: * @param publicRead
235: */
236: void setPublicRead(boolean publicRead);
237:
238: /**
239: * can the public edit the page
240: *
241: * @return
242: */
243: boolean getPublicWrite();
244:
245: /**
246: * set the public edit permissions
247: *
248: * @param publicWrite
249: */
250: void setPublicWrite(boolean publicWrite);
251:
252: /**
253: * @return Returns the revision number
254: */
255: Integer getRevision();
256:
257: /**
258: *
259: */
260: void setRevision(Integer revision);
261:
262: /**
263: * Copy a RWikiObject into an existing RWiki Object This will copy the
264: * contents and settings of the RWiki Object into the supplied RWikiObject.
265: * The ID and the User will not be changed, everything else will be coppied.
266: * NB. THE GLOBAL NAME, AND REALM WILL NOT BE COPIED, and should be changed
267: * by the calling method.
268: */
269: void copyTo(RWikiObject rwo);
270:
271: /**
272: * Copies everything
273: *
274: * @param rwo
275: */
276: void copyAllTo(RWikiObject rwo);
277:
278: // /**
279: // * Update content of the RWikiObject, taking care of history
280: // * @return false if newContent is the same as the current content
281: // */
282: // iebdelete boolean updateContent(String newContent);
283:
284: // iebdelete RWikiHistoryObject getRevision(int revisionNumber);
285:
286: // iebdelete int getNumberOfRevisions();
287:
288: /**
289: * Update permissions, the permission array must be of length 8
290: */
291: void setPermissions(RWikiPermissions permissions);
292:
293: /**
294: * get an object containing the current state of the permissions, this MUST
295: * be pushed back into the DAO for the changes to take effect. Changing the
296: * contents of RWikiPermissions is not sufficient.
297: *
298: * @return
299: */
300: RWikiPermissions getPermissions();
301:
302: /**
303: * The id of the rwiki object which this is a version of
304: *
305: * @param rwikiobjectid
306: */
307: void setRwikiobjectid(String rwikiobjectid);
308:
309: /**
310: * The parent rwiki object
311: *
312: * @return
313: */
314: String getRwikiobjectid();
315:
316: /**
317: * get the hash
318: *
319: * @return
320: */
321: String getSha1();
322:
323: /**
324: * set the hash.
325: *
326: * @param sha1
327: */
328: void setSha1(String sha1);
329:
330: /**
331: * @return
332: */
333: String getSource();
334:
335: }
336:
337: /*******************************************************************************
338: * $Header$
339: ******************************************************************************/
|