Thanks Fabian, it works, that's great. I would have a second question though. The TODOs are ordered by doc.date (which is the creation of the document). What I really want is to order by the Target Date (it's the property of the TodoClass). This property is a date, so do you know how I can order by this property ?
Thanks in advance Antonio 2008/10/15 Fabian Pichler <[EMAIL PROTECTED]> > Sorry, missing a 't' in $context so once again: > #set ($hql = ", BaseObject as obj, StringProperty as prop1, > LargeStringProperty as prop2 where obj.name=doc.fullName and > obj.className='XWiki.TodoClass' and obj.name<>'XWiki.TodoClassTemplate' > and > obj.id=prop1.id.id and prop1.id.name='Status' and prop1.value <> > 'Finished' > and obj.id=prop2.id.id and prop2.id.name='Assignee' and > prop2.value='$context.user' order by doc.date desc") > > Fabian. > > 2008/10/15 Fabian Pichler <[EMAIL PROTECTED]> > > > Hi Antonio > > > > I had a quick look at your problem and think your right the HQL-Query is > > wrong. The Problem comes from the definition of the Assignee-Field in > > the XWiki.TodoClass. The Assignee-Field is defined as "List of Users" > > Property which is based on the LargeStringProperty and not the > > StringProperty. > > > > Therefore try the following hql query: > > #set ($hql = ", BaseObject as obj, StringProperty as prop1, > > LargeStringProperty as prop2 where obj.name=doc.fullName and > > obj.className='XWiki.TodoClass' and obj.name<>'XWiki.TodoClassTemplate' > > and obj.id=prop1.id.id and prop1.id.name='Status' and prop1.value <> > > 'Finished' and obj.id=prop2.id.id and prop2.id.name='Assignee' and > > prop2.value='$contex.user' order by doc.date desc") > > > > Kind Regards, > > Fabian > > > > > > 2008/10/13 Antonio Goncalves <[EMAIL PROTECTED]> > > > > I've tried everything but I can't make it work. I'm now using the HQL > Query > >> Tester ( > >> http://code.xwiki.org/xwiki/bin/view/Snippets/HQLQueryTesterSnippet) > >> to test my HQL queries, but it looks like this snippet of code of the > HQL > >> Query Tester doesn't work either :o( > >> Any idea to try HQL queries ? I really need to display the TODOs of the > >> current user and it looks like it's just a query to change but I can't > >> figure it out. > >> > >> Any idea ? > >> > >> Thanks, > >> Antonio > >> > >> 2008/10/8 Antonio Goncalves <[EMAIL PROTECTED]> > >> > >> > Hi everybody, > >> > I've installed the Todo application ( > >> > > >> > http://code.xwiki.org/xwiki/bin/view/Applications/TodoApplicationDownloads > >> ). > >> > I can add new todos, affect them to users and so on. But when I check > >> the > >> > MyTodos Panel (http://localhost:8080/xwiki/bin/view/Panels/MyTodos) > >> it's > >> > always empty. The problem is the HQL statement. It's like that : > >> > > >> > #set ($hql = ", BaseObject as obj, StringProperty as prop1, > >> StringProperty > >> > as prop2 where obj.name=doc.fullName and > >> obj.className='XWiki.TodoClass' > >> > and obj.name<>'XWiki.TodoClassTemplate' and obj.id=prop1.id.id and > >> > prop1.id.name='Status' and prop1.value <> 'Finished' and obj.id= > >> > prop2.id.id and prop2.id.name='Assignee' and > >> prop2.value='$context.user' > >> > order by doc.date desc") > >> > > >> > And if I get rid of the last assignee close (and obj.id=prop2.id.idand > >> > prop2.id.name='Assignee' and prop2.value='$context.user' ), it works > >> but > >> > shows all the todos of everybody. > >> > > >> > Do you know how to fix this HQL query so it shows the todos of the > >> current > >> > user ? > >> > > >> > Thanks, > >> > Antonio > >> > > >> > > >> > >> > >> -- > >> -- > >> Antonio Goncalves ([EMAIL PROTECTED]) > >> Software architect > >> > >> Paris JUG leader : www.parisjug.org > >> Web site : www.antoniogoncalves.org > >> Blog: jroller.com/agoncal > >> LinkedIn: www.linkedin.com/in/agoncal > >> _______________________________________________ > >> users mailing list > >> users@xwiki.org > >> http://lists.xwiki.org/mailman/listinfo/users > >> > > > > > > > > -- > > ––––––––––––––––––––––––––––––––––––––––– > > > > Fabian Pichler [EMAIL PROTECTED] > > > > phone +41 61 261 67 89 fax +41 61 261 67 88 > > synventis gmbh Gerbergasse 30 CH - 4001 Basel > > > > The information contained in this message may be > > confidential and is intended for the addressee only. > > Any unauthorised use, dissemination of the infor- > > mation, or copying of this message is prohibited. > > > > > > > > > > > -- > ––––––––––––––––––––––––––––––––––––––––– > > Fabian Pichler [EMAIL PROTECTED] > > phone +41 61 261 67 89 fax +41 61 261 67 88 > synventis gmbh Gerbergasse 30 CH - 4001 Basel > > The information contained in this message may be > confidential and is intended for the addressee only. > Any unauthorised use, dissemination of the infor- > mation, or copying of this message is prohibited. > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > -- -- Antonio Goncalves ([EMAIL PROTECTED]) Software architect Paris JUG leader : www.parisjug.org Web site : www.antoniogoncalves.org Blog: jroller.com/agoncal LinkedIn: www.linkedin.com/in/agoncal _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users