[xwiki-users] Help wanted on the database list class property, database tree class property and the Custom Display attribute.
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 -- W: http://kodefabrikken.dk If you failing to plan, then you´re planning to fail.
Hi, Is it really so that no one can give a pointer or an example of the use of the database list class and the database tree class property, see my posting from yesterday below. Cheers /Thorbjørn
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
-- W: http://kodefabrikken.dk If you failing to plan, then you´re planning to fail.
Hi, Sure there are, just give us a moment. I am saving your mail for a later answer, as right now I'm a bit busy with other issues. Thorbjørn Konstantinovitz wrote:
Hi,
Is it really so that no one can give a pointer or an example of the use of the database list class and the database tree class property, see my posting from yesterday below.
Cheers
/Thorbjørn
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
-- Sergiu Dumitriu http://purl.org/net/sergiu/
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/
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
Sorry for that, wrong manip Jerome.
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
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Hello, I'm posting here because I tried to implement solution proposed by Sergiu but it's not (yet) working ... (I'm using XWiki 1.5.2) I want to have a "Database Tree List" property in a class of type FAQ (FAQs.FAQClass). I would like to use this property to link together a FAQ property "Category" with a "SubCategory", the subcategory being a db tree list (and the category being ...I don't know ...) So I first created a class "FAQs.FAQCategoryClass" with the class wizard, with String properties "ID", "VALUE" and "PARENT" Then, I created objects of this class as follows : Obj1 (ID='CAT1', VALUE='CAT1', PARENT='') Obj2 (ID='SUBCAT11', VALUE='SUBCAT11', PARENT='CAT1') Obj3 (ID='SUBCAT12', VALUE='SUBCAT12', PARENT='CAT1') Obj4 (ID='CAT2', VALUE='CAT2', PARENT='') Obj5 (ID='SUBCAT21', VALUE='SUBCAT21', PARENT='CAT2') Then I created only 1 property "Category", as a Database List type, and parameterized : XWiki Class Name = 'FAQs.FAQCategoriesClass', ID Field Name = 'ID', Value Field Name = 'VALUE'. When creating an object from my FAQ class, I get in "Category" field expected valued as a list : "CAT1", "SUBCAT11", "SUBCAT12", "CAT2", SUBCAT21". **** First question : what if I wanted to have only "CAT1" and "CAT2" in this list, in order to first select a category, and then the dependent subcategory ? Then I created a "SubCategory" property, as a Database Tree List type, and parameterized : XWiki Class Name = 'FAQs.FAQCategoriesClass', ID Field Name = 'ID', Value Field Name = 'VALUE', Parent Field Name = 'PARENT'. When creating an object from my FAQ class, I get a java.lang.StackOverflowError at com.xpn.xwiki.objects.classes.ListClass.getDisplayValue (infinite calls to addToSelect() ). **** Second question : what am I doing wrong ? **** Third question : maybe I don't even need the "Categories" field, and the tree is displayed directly in the select field ? (Don't know because could not make it succeed yet). Thanks for help, and sorry for long message ... :/ Regards, Jeremie -- View this message in context: http://n2.nabble.com/Help-wanted-on-the-database-list-class-property%2C-data... Sent from the XWiki- Users mailing list archive at Nabble.com.
I just tested that problem is the same with XWiki 1.6.1 ... -- View this message in context: http://n2.nabble.com/Help-wanted-on-the-database-list-class-property%2C-data... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (4)
-
jerem -
Jerome Velociter -
Sergiu Dumitriu -
Thorbjørn Konstantinovitz