[xwiki-users] getting documents "I've been involved in"
hello, what would be the query to obtain all the documents that a user has been editing, at any revision? thanks paul
Paul Libbrecht wrote:
hello,
what would be the query to obtain all the documents that a user has been editing, at any revision?
thanks
paul
Hi Paul Could the code in My Recent Modifications panel help you? #set($recentDocs = $xwiki.searchDocuments("where 1=1 and doc.author='$context.user' order by doc.date desc", 5, 0)) #if($recentDocs.size() > 0 || $showEmptyPanels) #panelheader($msg.get("My Recent Modifications")) #set($first = true) #foreach($docname in $recentDocs) #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument()) #if($first == true) #set($first = false) #else <span class="pitemseparator"> | </span> #end <span class="panelitem"><a href="$rdoc.getURL("view")">$rdoc.displayTitle</a></span> #end #panelfooter() #end HTH, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi, The code from the "My recent modifications" panel doesn't help much, as it lists only documents which have the user as the most recent author, and not those that were sometime edited by the user. A proper query would be: select distinct doc.fullName from XWikiDocument doc, XWikiRCSNodeInfo ni where ni.id.docId = doc.id and ni.author = 'the user name' This query lists only the name of the documents, not the versions. If you also need the version numbers, use this: select doc.fullName, ni.id.version1, ni.id.version2 from XWikiDocument doc, XWikiRCSNodeInfo ni where ni.id.docId = doc.id and ni.author = 'the user name' These queries need programming rights, so you will have to write a java plugin that executes them and use the plugin from velocity, or put them in a page that will always have programming rights. Sergiu [Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Paul Libbrecht wrote:
hello,
what would be the query to obtain all the documents that a user has been editing, at any revision?
thanks
paul
Hi Paul
Could the code in My Recent Modifications panel help you?
#set($recentDocs = $xwiki.searchDocuments("where 1=1 and doc.author='$context.user' order by doc.date desc", 5, 0)) #if($recentDocs.size() > 0 || $showEmptyPanels) #panelheader($msg.get("My Recent Modifications")) #set($first = true) #foreach($docname in $recentDocs) #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument()) #if($first == true) #set($first = false) #else <span class="pitemseparator"> | </span> #end <span class="panelitem"><a href="$rdoc.getURL("view")">$rdoc.displayTitle</a></span> #end #panelfooter() #end
HTH,
Ricardo
Note also that it requires XWiki 1.2 Ludovic Sergiu Dumitriu wrote:
Hi,
The code from the "My recent modifications" panel doesn't help much, as it lists only documents which have the user as the most recent author, and not those that were sometime edited by the user.
A proper query would be:
select distinct doc.fullName from XWikiDocument doc, XWikiRCSNodeInfo ni where ni.id.docId = doc.id and ni.author = 'the user name'
This query lists only the name of the documents, not the versions. If you also need the version numbers, use this:
select doc.fullName, ni.id.version1, ni.id.version2 from XWikiDocument doc, XWikiRCSNodeInfo ni where ni.id.docId = doc.id and ni.author = 'the user name'
These queries need programming rights, so you will have to write a java plugin that executes them and use the plugin from velocity, or put them in a page that will always have programming rights.
Sergiu
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Paul Libbrecht wrote:
hello,
what would be the query to obtain all the documents that a user has been editing, at any revision?
thanks
paul
Hi Paul
Could the code in My Recent Modifications panel help you?
#set($recentDocs = $xwiki.searchDocuments("where 1=1 and doc.author='$context.user' order by doc.date desc", 5, 0)) #if($recentDocs.size() > 0 || $showEmptyPanels) #panelheader($msg.get("My Recent Modifications")) #set($first = true) #foreach($docname in $recentDocs) #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument()) #if($first == true) #set($first = false) #else <span class="pitemseparator"> | </span> #end <span class="panelitem"><a href="$rdoc.getURL("view")">$rdoc.displayTitle</a></span> #end #panelfooter() #end
HTH,
Ricardo
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
participants (4)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Ludovic Dubost -
Paul Libbrecht -
Sergiu Dumitriu