On Sat, Sep 18, 2010 at 12:04 PM, [Ricardo Rodriguez] eBioTIC.
<ricardo.rodriguez(a)ebiotic.net> wrote:
  Hi!
 Caleb James DeLisle wrote:
  There are various ways with different levels of
code cleanliness
 since all user names start off with 'XWiki.' you could use
$context.getUser().substring(6)
 If you're looking for the user's "common name" instead of the user
name, you might want to look at
 $xwiki.getUserName
http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xw…
  Please, as $context is a class and getUser() is a method of that class,
 what is .substring()? 
$context.getUser() returns a String representing the full name of the
current user document (ex: "XWiki.RicardoRodriguez").
This is why, all the String methods can be applied on the returned value.
 Let's call *name* to the answer to the previous question. Please, where
 are the possible *name* that could be used with a given method of a
 given class?
 I'm browsing XWiki API looking for a way of doing the same you have
 proposed with .getUser() but with the name of a document. That is, how
 to get Document instead Space.Document.
 For instance, here...
 #set($results=$xwiki.searchDocuments($query))
 #foreach($item in $results)
 #set ($itemdoc = $xwiki.getDocument($item))
 * [$itemdoc>$itemdoc],  ~~$itemdoc.display('Genrus')
 $itemdoc.display('Species')~~<br/>
 $itemdoc shows Space.Document. How do I get just Document? 
You have to get the name of the document:
$itemdoc.name
Raluca.
 Please, excuse me if this questions are too basic! Thanks for your help!
 --
 Ricardo Rodríguez
 CTO
 eBioTIC.
 Life Sciences, Data Modeling and Information Management Systems
 _______________________________________________
 users mailing list
 users(a)xwiki.org
 
http://lists.xwiki.org/mailman/listinfo/users