Hi Paul!

Paul Libbrecht wrote:
> In HQL in Lucene?
> or... in java as Jérôme answered.
>
>   
It was Velocity code where I needed to solve this issue. I guess this 
page point in the right direction for HQL:

http://platform.xwiki.org/xwiki/bin/view/DevGuide/QueryGuide

As for Lucene I've found this:

http://code.xwiki.org/xwiki/bin/view/Applications/SearchApplicationLuceneSearchQueryHelp#Hobject

What I've been trying to get is a modified version of the Last Visited 
panel that shows more "user friendly" messages as links. I've still to 
add some if() to check availability of translations for some kind of 
entries. It reads now like this:

******
#set($rv_maxItems = $!xwiki.getUserPreference("recent_actions_items"))
#if($rv_maxItems == "")
#set($rv_maxItems = 5)
#end
#set($recentlyViewed = $xwiki.getRecentActions("view", $rv_maxItems))
#set($header = $msg.get("panels.recentlyVisited.title"))
*$header*<br/>
#foreach($docname in $recentlyViewed)
#set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
#if($xwiki.getDocument($docname).getObject('Users.PdrUserClass'))
#set($user = 
"${rdoc.getObject('Users.PdrUserClass').getProperty('Name').getValue()}")
#set($cropat = $user.indexOf("#"))
#set($user = $user.substring(0,$cropat))
<a href="$rdoc.getURL("view")">$user</a><br/>
#else
#if($xwiki.getDocument($docname).getObject('Species.SpeciesClass'))
#set($species = 
"${rdoc.getObject('Species.SpeciesClass').getProperty('GalicianName').getValue()}")
<a href="$rdoc.getURL("view")">$species</a><br/>
#else
<a href="$rdoc.getURL("view")">$rdoc.displayTitle</a><br/>
#end
#end
#end
******

I don't know if using Lucene or HQL options could add some advantage to 
the used method: I've only used the current LastVisited panel code (as 
per XE 1.3.x) as base for modifications. This solution is only intended 
to last until we get this wiki migrated to an updated >2.4 XE/XEM 
environment.

Any idea will be welcome!

Ricardo

-- 
Ricardo Rodríguez
CTO
eBioTIC.
Life Sciences, Data Modeling and Information Management Systems

_______________________________________________
devs mailing list
devs@xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to