Hello,
the option is the boolean "xwiki.store.hibernate.useclasstables" to put in
the config...
sorry if I don't answer quickly but I'm quite busy and I can't answer in a
serious manner just now...
Anyway, if it can help you, I think you should read this tuto:
Even if I know a bit the class design, I'm not an expert yet :)
But $xwiki.search seems not to return Object[] but Collection[] only with
properties Name, ClassName and Number... Don't know why exactly but I will
look at it...
So something like this seems to work for me... you retrieve the doc and then
the object and then you get our Object :)
#set($query="from BaseObject obj where obj.className
='Contacts.ContactClass'")
#set($results=$xwiki.search($query, 10, 0))
#foreach ($item in $results)
#set($myObject = $xwiki.getDocument($item.Name).getObject($item.ClassName,
$item.Number))
$myObject.get("firstname") | $myObject.get("surname") |
$myObject.get("phone1")
#end surname
Maybe somebody could tell if there is something quicker?
br
Pascal
On Tue, Apr 15, 2008 at 9:39 AM, [Ricardo Rodriguez] Your EPEC Network ICT
Team <webmaster(a)environmentalchange.net> wrote:
Hi Pascal,
Thannks for the detailed explanation!
Pascal Voitot wrote:
Hello,
by default, Classes aren't stored in any specific table but are stored
as
XML with the document...
You can trigger an option called UseClassesTable or something like that
which will make classes be stored in tables using the hibernate mapping
defined by XWIki (tables xwikiclasses and xwikiclassesprop)...
You can even provide your custom mapping...
Anyway, this is not important because the class is the data structure
and
what you certainly need is to keep objects and
property values. The
objects
are stored in the XWIkiObjects table and
properties in the
XWikiProperties
table using objectID as external key and also in
the specific
XWikiTypeTable
(XWikiStrings, XWikilongs etc...) depending on
the type of the property.
Please, what is the so called UseClassesTable option intended for?
Concerning the deletion of properties, it
doesn't exist yet because it
is
not so simple... But I'm currently working on
a solution for that... I
should propose a demo of it very soon...
These are great news! It is frequent to make a mistake as Kammy stated.
And event more frequent is that a group changes its mind about the
design of a given class.
For the time being, this is not really easy
because you have to go in
the
XWikiDoc table and modify the XWD_CLASS_XML to
remove the unwanted
field...
Then you have also to find all the objects you
created for this class
and
remove the unwanted fields...
regards
Pascal
There is still a Kamy's question left: "How can we access the values of
any instance of the created class?" It may seem simple, but I and others
are having a hard time trying to access and show these values. For
instance, see this...
http://tinyurl.com/3f44gm
Please, could you elaborate your answer in that sense? Could it be
advisable to add an example about how to access properties values in a
given object to the FAQ tutorial? Perhaps how to retrieve all questions
with a given string in question property.
There is a FAQs entry about this (
http://tinyurl.com/6rgm8h). I am sure
this is enough for programmers, but it is a bit "conceptually dense" for
non-programmers like me! As usually an example would help.
Thanks for your help,
Ricardo
On 4/15/08, Kamna Jain
<kammy.scorpi(a)gmail.com> wrote:
> Hello all,
>
> I went through the TodoClass tutorial and found it useful.
> I have a question regarding this functionality.
> Are these classes or the values of the properties for its instances
saved
in
any table in the Xwiki database?
Say, we use Classes and Objects to create a form that the user needs to
create a document. Will the form values be saved in a database?
How can we access the values of any instance of the created class?
Also, how do we Delete a property from a Class definition? (If added by
mistake while creating the class)
Thanks for all help
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Ricardo RodrÃguez
Your EPEC Network ICT Team
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs