Hi,
I have the following question.
I have an main wiki (xwiki) and a subwiki (test)
I want to access objects from class ’space.someclassClass’ located on a page
‘space.somepage' in the main wiki
When in the subwiki, I have a query such as:
String query = "select name.value from XWikiDocument doc, BaseObject obj,
StringProperty name where doc.fullName=obj.name and obj.className=‘space.someclassClass’
and” +
"obj.className<>’space.someclassTemplate’ and name.id.id=obj.id order by
doc.title"
List<java.lang.Object[]> results = (List<java.lang.Object[]>) (List)
this.queryManager.createQuery(query, Query.XWQL).setWiki(“xwiki").execute();
This gives me the name.value of the property of the object in the main wiki.
What I need however is something like:
String query = "select obj from XWikiDocument doc, BaseObject obj where
doc.fullName=obj.name and obj.className=‘space.someclassClass’ and” +
"obj.className<>’space.someclassTemplate’ order by doc.title”
I expect this to return a BaseObject. When displaying this (toXMLString()), it is however
an empty object:
<?xml version="1.0" encoding="UTF-8"?>
<object>
<name>space.somepage</name>
<number>0</number>
<className>space.someclassClass</className>
<guid>3c145abe-b334-4801-a100-24c8ef2eea9f</guid>
</object>
There is no way (that I have tried) that would give me the object of class
“xwiki:space.someclassClass” that contains the properties that I need (and get using the
first query).
I expect that it might have to do with the context but I’m not that familiar with it that
I know how to do this.
Can someone please shed some light on this?
With kind regards,
Peter Huisman