Thomas Mortagne wrote:
On Tue, Nov 4, 2008 at 7:48 PM, BrianJones <[email protected]> wrote:
Thomas Mortagne wrote:
The prop contains all the tags of one document not just one tag.
I you want to get all tags ordered alphabetically, I think the following should do the trick :
#set($sql = "select distinct elements(prop.list) as tagvalue from BaseObject as obj, DBStringListProperty as prop where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' order by tagvalue asc")
Thanks for your reply Thomas, your suggestion seems to make sense to me, but when I tested it out, I get an error in the Tomcat window, and the page doesn't render. The error is as follows:
... Cause by: org.apahace.velocity.exception.MethodInvocationException: Invocation of method 'search' in class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct elements(prop.list) as tagvalue from BaseObject as obj, DBStringListProperty as prop where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prod.id.name='tags' order by tagvalue asc Wrapped Exception: could not execute query @ Main.Tags[5,22] ...
I guess there is a syntax issue somewhere, don't you have more information in the log file ?
Try: select distinct elements(prop.list) from BaseObject as obj, DBStringListProperty as prop where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' order by 1 asc -- Sergiu Dumitriu http://purl.org/net/sergiu/