Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-21 Thread Tjaart van Wijck
Thanks, these are extremely helpful comments. On 21/04/2008, Sergiu Dumitriu <[EMAIL PROTECTED]> wrote: > Tjaart van Wijck wrote: > > a) A class definition is essentially a special type of wiki page that > > defines the class structure (i.e. properties). > > > Yes, but here "special" means just

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-21 Thread Sergiu Dumitriu
Tjaart van Wijck wrote: > a) A class definition is essentially a special type of wiki page that > defines the class structure (i.e. properties). Yes, but here "special" means just that it contains a class definition, as otherwise nothing makes it "special". Any document can host a class, just ad

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-21 Thread Sergiu Dumitriu
Tjaart van Wijck wrote: > Guillaume, > > That worked! Thanks a lot for the help. > > Yet, I still don't understand why the HQL string below does not yield > the correct results: > $query = "select obj from BaseObject obj where > obj.className='Contacts.ContactClass'" > > Can someone explain how

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-21 Thread Sergiu Dumitriu
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote: > But, please, why obj.name=doc.fullName is required? If I remove this > conditions, the query retrieve only a couple of documents with the > defined properties populated and a bunch of empty ones. > As with any query language, "select from

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-16 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote: > A brief update: > > http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specification?language=en > > Greetings, > > Ricardo > > Still another entry. Sorry, I forgot it in my previous message: http://www.xwiki.org/xwiki/bin/vie

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-16 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
A brief update: http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specification?language=en Greetings, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listin

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
Hi all! Tjaart van Wijck wrote: > Guillaume, > > That worked! Thanks a lot for the help. > > Yet, I still don't understand why the HQL string below does not yield > the correct results: > $query = "select obj from BaseObject obj where > obj.className='Contacts.ContactClass'" > > Can someone explai

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Tjaart van Wijck
Guillaume, That worked! Thanks a lot for the help. Yet, I still don't understand why the HQL string below does not yield the correct results: $query = "select obj from BaseObject obj where obj.className='Contacts.ContactClass'" Can someone explain how XWiki traverses documents and objects to gen

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Guillaume Lerouge
Hi Tjaart, Unfortunately removing the select part does not help and I get the same > error. > > It is hard to believe that few people have managed to construct a > query for all object of the same class. I though this would be > straight forward. > > I want to retrieve a list of object from a spec

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Tjaart van Wijck
Marco, Unfortunately removing the select part does not help and I get the same error. It is hard to believe that few people have managed to construct a query for all object of the same class. I though this would be straight forward. I want to retrieve a list of object from a specified class and

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Marco Fabbri
On Tue, 2008-04-15 at 14:43 +0100, Tjaart van Wijck wrote: > > #set($query="select obj from BaseObject obj where > obj.className='Contacts.ContactClass'") > #set($results=$xwiki.searchDocuments($query, 10, 1)) > #foreach($item in $results) > #set ($itemdoc = $xwiki.getDocument($item)) > #set ($it

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Tjaart van Wijck
Hi Guillaume, Thanks for the advise but it still doesn't work. I've implemented: #set($query="select obj from BaseObject obj where obj.className='Contacts.ContactClass'") #set($results=$xwiki.searchDocuments($query, 10, 1)) #foreach($item in $results) #set ($itemdoc = $xwiki.getDocument($item)) #

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Guillaume Lerouge
Hi Tjaart, Here we go at last : #set($query="select obj from BaseObject obj where obj.className='Contacts .ContactClass'") #set($results=$xwiki.searchDocuments($query, 10, 1)) #foreach($item in $results) #set ($itemdoc = $xwiki.getDocument($item)) #set ($itemobject = $itemdoc.getObject('Contacts

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Tjaart van Wijck
Hi, My problem is still unresolved. I have followed the suggestions from the FAQ post: http://www.xwiki.org/xwiki/bin/view/FAQ/HowToListDocumentsWithACertainPropertyValue And rewrote the code as follows: #set($query="select obj from BaseObject obj where obj.className='Contacts.ContactClass'") #s

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
Guillaume Lerouge wrote: > > > Obviously I've been writing too fast thus proposing a mistaken solution :-) > > I'll check on stuff I've used before and try to get back with a _working_ > suggestion ;-) > > Guillaume Thanks! -- Ricardo Rodríguez Your EPEC Network ICT Team ___

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Guillaume Lerouge
Hi Ricardo, > > I have created the class Contacts.ContactClass. This class has three > string > > properties "firstname", "surname" and "phone1". I have also created two > > instances of this class and filled out the attributes. > > > > Now, it should be straight forward to write a Velocity scrip

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
Hi Tjaart, all, Tjaart van Wijck wrote: > I have created the class Contacts.ContactClass. This class has three string > properties "firstname", "surname" and "phone1". I have also created two > instances of this class and filled out the attributes. > > Now, it should be straight forward to write a

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-15 Thread Tjaart van Wijck
Thanks for the help but unfortunately this still does not solve my problem. 1) Your first suggestion: #foreach($item in $results) $item.getObject('Contacts.ContactClass') $item.display('firstname') | $item.display('lastname') | $item.display('phone1') #end Produces: $item.getObject('Contacts.Co

Re: [xwiki-users] Trouble with velocity script to list Object properties

2008-04-14 Thread Guillaume Lerouge
Hi Tjaart, > I have created the class Contacts.ContactClass. This class has three > string > properties "firstname", "surname" and "phone1". I have also created two > instances of this class and filled out the attributes. > > Now, it should be straight forward to write a Velocity script to seach f

[xwiki-users] Trouble with velocity script to list Object properties

2008-04-14 Thread Tjaart van Wijck
I have created the class Contacts.ContactClass. This class has three string properties "firstname", "surname" and "phone1". I have also created two instances of this class and filled out the attributes. Now, it should be straight forward to write a Velocity script to seach for all objects with the