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?
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