On Fri, Nov 27, 2009 at 16:31, Anca Luca <[email protected]> wrote: > Hi devs, > > in order to complete the clean implementation of the annotation features using > components, I would need some API for manipulating objects from the DAB. I > thought of 2 versions for it: > > 1/ > create ObjectModelBridge interface implemented by BaseObject with: > Object get(String propertyName) > void set(String propertyName, Object propertyValue) > int getNumber() > Add to DAB: > ObjectModelBridge createObject(DocumentName docName, String className) > Collection<ObjectModelBridge> getObjects(DocumentName docName, String > className) > void removeObject(DocumentName docName, ObjectModelBridge object) > void saveDocument(DocumentName docName) > 2/ > Add to DAB: > int createObject(DocumentName docName, String className) > Collection<Map<String, Object>> getObjects(DocumentName docName, > String className) > void setProperties(DocumentName docName, String className, int > objNumber, > Map<String, Object> properties) > void removeObject(DocumentName docName, int objectNumber) > void saveDocument(DocumentName docName) > > any of the two solutions is fine with me (maybe second a little more because > it's minimal) > > WDYT?
I really don't like adding more apis in the bridge, couldn't you have a AnnotationStorage component interface you implements in xwiki-core instead like we do for wiki macros for example. Plus AnnotationStorage also mean easily change the way/place annotations are stored latter so it could be useful anyway. Also i'm -1 for the saveDocument methods anyway, we already talked about that in previous discussions and it was decided that bridges methods should be atomic and not keep unfinished things until someone apply it. > > Also, since XWikiDocument.getRenderedContent() gets more and more used by > various access API to XWiki (GWT, XMLRPC, etc), I propose to add to DAB: > > getRenderedContent(DocumentName docName, String text, Syntax > sourceSyntax, > Syntax finalSyntax) > > which would call XWikiDocument.getRenderedContent() but also > xwiki.prepareResources() before so that the msg tools are initialized too > (hoping this would help to programatically render a document as similar as > possible with what is obtained through the view action & templates). Is there > anything I'm missing from the list to achieve this? (any other setting, > configuration needed, context setup, etc) > > > Thanks, > Anca > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

