Thorbjørn Konstantinovitz wrote:
Hi,
I am currently developing a program documentation system based on xwiki. I am able to create pages which describes programs. For each program which has to be described I programatically creates a page and populate a object with static program information. But I need to document which database files the program uses, with links to the relevant database file descriptions (a list). For that I want to use a database list class. I also want to show a call graph. for that I want to use a database tree class. But I am not able to find any documentation on these class properties. Can anyone give an example of use for each of these two properties or give pointers to relevant examples.
The article http://www.theserverside.com/tt/articles/article.tss?l=XWiki on the server side were a very good introduction! But it didn't treat the property Custom Display. Are there any documentation on this property?
Cheers
/Thorbjørn Konstantinovitz
First, a bit of introduction on DBList and DBTreeList.
StaticList properties, when edited, allow the user to select one of the predefined values (or more, if the property has "multiple select" = true). DBList does something similar, allows the user to select one or more values from a list of values, but the list is not predefined, it is populated with values from the database.
DBTreeList does the same as DBList, but also induces a pseudo-hierarchy in the option list, displaying the options as a tree.
DBList and DBTreeList properties work in two ways.
One is with an hql query, which allows complete flexibility on what you want to select. For DBList you select one or two columns. The first column is the list of possible values that get into the option list. The second (optional) column allows to separate the actual value that gets stored in the database, and the values that are displayed to the user. This allows, for example, to store XWiki.JohnDoe in the database, but to display "Doe, John" in the interface. If only one column is selected, the value displayed is the same as the value used internally.
DBTreeList queries must select 3 columns. The first two are the same as for DBList, while the 3rd column defines the child<->parent relations. Selected rows that have null or an empty string on the third column will be considered the roots of the tree. Rows that have a value "X" on the third column will be inserted as child nodes of the node with value "X" (the first column).
The second way to define the option lists is by using the fields: XWiki Class Name, Id Field Name, Value Field Name and Parent Field Name. Using those fields, the XWiki platform constructs the following hql queries:
select idprop.value, valueprop.value, parentprop.value from XWikiDocument doc, BaseObject obj, StringProperty idprop, StringProperty valueprop, StringProperty parentprop.value where obj.name = doc.name and obj.className = "value entered in Class name" and idprop.id.id = obj.id and idprop.id.name = "value entered in Id Field Name" and valueprop.id.id = obj.id and valueprop.id.name = "value entered in Value Field Name" and parentprop.id.id = obj.id and parentprop.id.name = "value entered in Parent Field Name"
So, it selects from objects of a given type (XWiki Class) 3 properties (of storage type String, read bellow what this means). As a special case, you can use "doc.<some doc property>" or "obj.<some object property>" instead of property names, and the query is adapted accordingly. In the case of DBList, only 2 columns are selected, as the Parent property is not used/defined.
String storage type means: - either a property of type String - or a property of type StaticList, DBList or DBTreeList with multipleSelect = false
If you want to use the DBTreeList, you must model your data so that they will allow these kind of queries.
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users