On Tue, Dec 30, 2008 at 9:54 AM, Asiri Rathnayake <[email protected]> wrote:
After few discussions it seems like we need two more methods.
1. createNewDocument(String documentName, String content) //This method will
throw an exception if the document already exists.
This methods is not needed, 2. already do the job. In wiki concept when you ask for a non existing document you get an empty document, you never need to create one before manipulating it.
2. setDocumentContent(String documentName, String newContent) //For updating an existing document.
3. setDocumentSyntaxId(String documentName, String syntaxId) //For presentation documents the syntax would be 1.0 and for others it would be 2.0
4. addAttachmentToDocument(String documentName, String AttachmentName, byte [] attachmentData) //For making attachments
5. isDocumentEditable(String documentName) //This is following isDocumentViewable() mthod. But we could also have a hasRight() mthod instead.
I prefer isDocumentEditable since it's in a bridge for the same reason I voted for isDocumentViewable().
6. getCurrentUser() // Returns the current user as a string (equivalent to XWikiContext.getUser())
This has nothing to do with documents. It should be stored in ExecutionContext or add another bridge. (+1 for ExecutionContext)
7. getDefaultEncoding() // Returns the default wiki encoding (equivalent to xwikiContext.getWiki().getEncoding())
Same, this is more general that documents. Need another bridge or put it in ExecutionContext. (+1 for ExecutionContext)
Thanks.
- Asiri _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne