[xwiki-users] Question on DBList and the use of different wikis
Hi, I am looking for a solution for the following situation. I have 2 wiki's. The fist one (ref: MD) contains "Master Data". The second one (ref: UD) contains "User Data". I have Classes in UD that use data from the MD. The way to connect them is using DBList. I am however not able to compose a HQL query that enables me to select a different Wiki to run the query on. I know it is possible to select the Wiki in Velocity but until now, that didn't help me. In the Github code (the getDBList method in the DBListClass.java) a comment is included just before a statement: // The DBlist may come from an other wiki StringwikiName =getReference().extractReference(EntityType.WIKI).getName(); This might indicate that selecting a wiki might be an option when getting a DBList. Anybody knows how to solve this problem (without replicating the data from MD in UD ;-))? Any additional suggestions are welcome. Thanks, Peter
Hi, The method you are mentioning is used to list the available options, thus to run the query. The code you mention with the comment was added in order to make sure that if you are on wiki A and you are getting objects from a document in wiki B (through velocity for example) and you want to display those objects from wiki B, then the DBList properties of those objects will run their queries on wiki B (where their class comes from) and not in wiki A (where they are called from/displayed). I also tried to do something similar to what you want, but found that this is not yet supported by DBList properties. What you could do at this point is to have a custom displayer for your property that runs the query on the right wiki and displays the current value(s) and the possible values. Hope this helps, Eduard On Tue, Mar 17, 2015 at 3:32 PM, Peter Huisman <[email protected]> wrote:
Hi,
I am looking for a solution for the following situation.
I have 2 wiki's. The fist one (ref: MD) contains "Master Data". The second one (ref: UD) contains "User Data". I have Classes in UD that use data from the MD. The way to connect them is using DBList. I am however not able to compose a HQL query that enables me to select a different Wiki to run the query on. I know it is possible to select the Wiki in Velocity but until now, that didn't help me. In the Github code (the getDBList method in the DBListClass.java) a comment is included just before a statement:
// The DBlist may come from an other wiki StringwikiName =getReference().extractReference(EntityType. WIKI).getName();
This might indicate that selecting a wiki might be an option when getting a DBList.
Anybody knows how to solve this problem (without replicating the data from MD in UD ;-))? Any additional suggestions are welcome.
Thanks,
Peter _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
I don't know if this is the case for you but you should know that classes cannot be used outside the wiki where they are defined. In your case, you cannot add an object of type (class) T to a page from UD if T is defined in MD. But I guess you just want to link an object from UD to an object from MD through a DBList property, which is a different story, covered by Eduard's reply. Hope this helps, Marius On Tue, Mar 17, 2015 at 3:32 PM, Peter Huisman <[email protected]> wrote:
Hi,
I am looking for a solution for the following situation.
I have 2 wiki's. The fist one (ref: MD) contains "Master Data". The second one (ref: UD) contains "User Data". I have Classes in UD that use data from the MD. The way to connect them is using DBList. I am however not able to compose a HQL query that enables me to select a different Wiki to run the query on. I know it is possible to select the Wiki in Velocity but until now, that didn't help me. In the Github code (the getDBList method in the DBListClass.java) a comment is included just before a statement:
// The DBlist may come from an other wiki StringwikiName =getReference().extractReference(EntityType.WIKI).getName();
This might indicate that selecting a wiki might be an option when getting a DBList.
Anybody knows how to solve this problem (without replicating the data from MD in UD ;-))? Any additional suggestions are welcome.
Thanks,
Peter _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Eduard Moraru -
Marius Dumitru Florea -
Peter Huisman