Hi,
I'm writing a comoponent that needs to access and modify XWiki objects. I'm
using the DocumentAccessBridge interface, but a little puzzled by the
interface. It seems like, to inspect the objects of a given class in a
given document, I have to do something like:
String[] properties = new String {"firstName, lastName"};
int objectNum = 0;
boolean moreObjects = true;
while (moreObjects) {
for (String property : properties) {
String value = (String) documentAccessBridge.getProperty(documentName,
"Main.MyClass", objectNum, property);
if (value == null) {
moreObjects = false;
break;
}
// ...
}
objectNum++;
}
It also seems like it's impossible to set properties of any object other
than the first one of its class in a document, using the one setProperty
method.
Is this a correct way to access objects (I've been having trouble testing as
per my previous post)? Is there another way to modify objects?
I did notice that this interface is only intended to be temporary until a
redesign exposes the whole model as a component. When is this expected to
happen?
Thanks,
David Breeden
--
View this message in context:
http://n2.nabble.com/Accessing-objects-via-DocumentAccessBridge-tp3825435p3…
Sent from the XWiki- Users mailing list archive at
Nabble.com.