MyTodos not showing my todos

15 Messages Forum Options Options
Embed this topic
Permalink
Antonio Goncalves
MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
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.id and
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
_______________________________________________
users mailing list
users@...
http://lists.xwiki.org/mailman/listinfo/users
Antonio Goncalves
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
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 <antonio.mailing@...>

> 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.id and
> 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 (antonio.goncalves@...)
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@...
http://lists.xwiki.org/mailman/listinfo/users
Fabian Pichler
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
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 <antonio.mailing@...>

> 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 <antonio.mailing@...>
>
> > 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.id and
> > 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 (antonio.goncalves@...)
> 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@...
> http://lists.xwiki.org/mailman/listinfo/users
>



--
–––––––––––––––––––––––––––––––––––––––––

Fabian Pichler                fabian.pichler@...

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@...
http://lists.xwiki.org/mailman/listinfo/users
Fabian Pichler
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
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 <fabian.pichler@...>

> 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 <antonio.mailing@...>
>
> 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 <antonio.mailing@...>
>>
>> > 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.id and
>> > 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 (antonio.goncalves@...)
>> 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@...
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
>
>
> --
> –––––––––––––––––––––––––––––––––––––––––
>
> Fabian Pichler                fabian.pichler@...
>
> 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                fabian.pichler@...

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@...
http://lists.xwiki.org/mailman/listinfo/users
Antonio Goncalves
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
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 <fabian.pichler@...>

> 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 <fabian.pichler@...>
>
> > 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 <antonio.mailing@...>
> >
> > 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 <antonio.mailing@...>
> >>
> >> > 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 (antonio.goncalves@...)
> >> 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@...
> >> http://lists.xwiki.org/mailman/listinfo/users
> >>
> >
> >
> >
> > --
> > –––––––––––––––––––––––––––––––––––––––––
> >
> > Fabian Pichler                fabian.pichler@...
> >
> > 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                fabian.pichler@...
>
> 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@...
> http://lists.xwiki.org/mailman/listinfo/users
>



--
--
Antonio Goncalves (antonio.goncalves@...)
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@...
http://lists.xwiki.org/mailman/listinfo/users
Fabian Pichler
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
Try:
#set ($hql = ", BaseObject as obj, StringProperty as prop1,
LargeStringProperty as prop2, DateProperty as dueDate 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' and obj.id = dueDate.id.id and
dueDate.id.name='TargetDate'
order by dueDate.value desc")

Fabian.

2008/10/15 Antonio Goncalves <antonio.mailing@...>

> 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 <fabian.pichler@...>
>
> > 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 <fabian.pichler@...>
> >
> > > 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 <antonio.mailing@...>
> > >
> > > 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 <antonio.mailing@...>
> > >>
> > >> > 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 (antonio.goncalves@...)
> > >> 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@...
> > >> http://lists.xwiki.org/mailman/listinfo/users
> > >>
> > >
> > >
> > >
> > > --
> > > –––––––––––––––––––––––––––––––––––––––––
> > >
> > > Fabian Pichler                fabian.pichler@...
> > >
> > > 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                fabian.pichler@...
> >
> > 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@...
> > http://lists.xwiki.org/mailman/listinfo/users
> >
>
>
>
> --
> --
> Antonio Goncalves (antonio.goncalves@...)
> 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@...
> http://lists.xwiki.org/mailman/listinfo/users
>



--
–––––––––––––––––––––––––––––––––––––––––

Fabian Pichler                fabian.pichler@...

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@...
http://lists.xwiki.org/mailman/listinfo/users
Antonio Goncalves
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
That works great thanks Fabian. IMHO the TODO application should be changed
and use this HQL request instead. It makes more sense to only display the
todos of the connected user and sort them by due date.
Antonio

2008/10/16 Fabian Pichler <fabian.pichler@...>

> Try:
> #set ($hql = ", BaseObject as obj, StringProperty as prop1,
> LargeStringProperty as prop2, DateProperty as dueDate 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' and obj.id = dueDate.id.id and
> dueDate.id.name='TargetDate'
> order by dueDate.value desc")
>
> Fabian.
>
> 2008/10/15 Antonio Goncalves <antonio.mailing@...>
>
> > 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 <fabian.pichler@...>
> >
> > > 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 <fabian.pichler@...>
> > >
> > > > 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 <antonio.mailing@...>
> > > >
> > > > 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 <antonio.mailing@...>
> > > >>
> > > >> > 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.idand
> > > >> > 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 (antonio.goncalves@...)
> > > >> 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@...
> > > >> http://lists.xwiki.org/mailman/listinfo/users
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > –––––––––––––––––––––––––––––––––––––––––
> > > >
> > > > Fabian Pichler                fabian.pichler@...
> > > >
> > > > 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                fabian.pichler@...
> > >
> > > 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@...
> > > http://lists.xwiki.org/mailman/listinfo/users
> > >
> >
> >
> >
> > --
> > --
> > Antonio Goncalves (antonio.goncalves@...)
> > 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@...
> > http://lists.xwiki.org/mailman/listinfo/users
> >
>
>
>
> --
> –––––––––––––––––––––––––––––––––––––––––
>
> Fabian Pichler                fabian.pichler@...
>
> 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@...
> http://lists.xwiki.org/mailman/listinfo/users
>



--
--
Antonio Goncalves (antonio.goncalves@...)
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@...
http://lists.xwiki.org/mailman/listinfo/users
Antonio Goncalves
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
It's me again. I'm still confused by the property classes.
The dueDate is of type DateProperty. How can have the milliseconds value of
that date ? I've tried to format the date, but it doesn't work. If I display
 $todoObj.TargetDate, it's fine, but I can manipulate it as a date (
using formatDate for exemple)

#foreach ($todo in $todos)
    #set ($todoDoc = $xwiki.getDocument($todo))
    #set ($todoObj = $todoDoc.getObject("XWiki.TodoClass"))

    $todoObj.TargetDate
  // This works
    $xwiki.formatDate($todoObj.TargetDate, "yymmdd")          // This does'n
work
#end

Do you know what to do to use formatDate on a DateProperty ?

Thanks,
Antonio


2008/10/16 Antonio Goncalves <antonio.mailing@...>

> That works great thanks Fabian. IMHO the TODO application should be changed
> and use this HQL request instead. It makes more sense to only display the
> todos of the connected user and sort them by due date.
> Antonio
>
> 2008/10/16 Fabian Pichler <fabian.pichler@...>
>
> Try:
>> #set ($hql = ", BaseObject as obj, StringProperty as prop1,
>> LargeStringProperty as prop2, DateProperty as dueDate 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' and obj.id = dueDate.id.id and
>> dueDate.id.name='TargetDate'
>> order by dueDate.value desc")
>>
>> Fabian.
>>
>> 2008/10/15 Antonio Goncalves <antonio.mailing@...>
>>
>> > 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 <fabian.pichler@...>
>> >
>> > > 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 <fabian.pichler@...>
>> > >
>> > > > 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 <antonio.mailing@...>
>> > > >
>> > > > 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 <antonio.mailing@...>
>> > > >>
>> > > >> > 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.idand
>> > > >> > 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 (antonio.goncalves@...)
>> > > >> 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@...
>> > > >> http://lists.xwiki.org/mailman/listinfo/users
>> > > >>
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > –––––––––––––––––––––––––––––––––––––––––
>> > > >
>> > > > Fabian Pichler                fabian.pichler@...
>> > > >
>> > > > 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                fabian.pichler@...
>> > >
>> > > 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@...
>> > > http://lists.xwiki.org/mailman/listinfo/users
>> > >
>> >
>> >
>> >
>> > --
>> > --
>> > Antonio Goncalves (antonio.goncalves@...)
>> > 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@...
>> > http://lists.xwiki.org/mailman/listinfo/users
>> >
>>
>>
>>
>> --
>> –––––––––––––––––––––––––––––––––––––––––
>>
>> Fabian Pichler                fabian.pichler@...
>>
>> 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@...
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
>
>
> --
> --
> Antonio Goncalves (antonio.goncalves@...)
> Software architect
>
> Paris JUG leader : www.parisjug.org
> Web site : www.antoniogoncalves.org
> Blog: jroller.com/agoncal
> LinkedIn: www.linkedin.com/in/agoncal
>



--
--
Antonio Goncalves (antonio.goncalves@...)
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@...
http://lists.xwiki.org/mailman/listinfo/users
Sergiu Dumitriu-2
Re: MyTodos not showing my todos
Reply Threaded MoreMore options
Print post
Permalink
Antonio Goncalves wrote:

> It's me again. I'm still confused by the property classes.
> The dueDate is of type DateProperty. How can have the milliseconds value of
> that date ? I've tried to format the date, but it doesn't work. If I display
>  $todoObj.TargetDate, it's fine, but I can manipulate it as a date (
> using formatDate for exemple)
>
> #foreach ($todo in $todos)
>     #set ($todoDoc = $xwiki.getDocument($todo))
>     #set ($todoObj = $todoDoc.getObject("XWiki.TodoClass"))
>
>     $todoObj.TargetDate
>   // This works
>     $xwiki.formatDate($todoObj.TargetDate, "yymmdd")          // This does'n
> work
> #end
>
> Do you know what to do to use formatDate on a DateProperty ?
>

$xwiki.formatDate($todoObj.getProperty("TargetDate").value, "yymmdd")

$todoObj.TargetDate formats the date into a string.
$todoObj.getProperty("TargetDate").value is the actual value of the
property, which is a Date for date properties.

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
users@...
http://lists.xwiki.org/mailman/listinfo/users
Antonio Goncalves