Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Ricardo, If you agree to work with outdated projects, why not consider the project: http://svn.activemath.org/intergeo/Platform/Vignettes/ It's referencing old xwiki things because that's where curriki holds me but is otherwise giving me the edit luxury for groovy and velocity. It builds applets, per default (it's an applet-based screenshot uploader) but it also contains the source of an xwiki application. It also has src/main/pages/VignettesCode/ which contains source files in groovy and velocity languages and editing with intelliJ there gives me all the code-completions. I believe the project does not have personal dependencies but I could be wrong. The main visible output page being: http://i2geo.net/xwiki/bin/view/VignettesCode/CarouselHtml To upload I use my own post script (http://svn.activemath.org/intergeo/Platform/bin/upload-to-wiki) or simply and quite often copy and paste. paul PS: the project does not build a xar which would require those uneditable xml files or a modification to the plugin or xml infrastructure (xinclude probably) so that the .vm and .groovy are still kept, which is essential for editing luxury. Le 21 sept. 2010 à 07:57, Paul Libbrecht a écrit : Let's go back to the initial question: what I was looking for was how to read all available properties of a given object with a piece of code within a XWiki page. I think I'm not able yet to use the right concepts and the right words when taking about, in general, object-oriented programming. I think that what you have gone several steps further and give me/us some nice keys about how to do that programmatically from within your favourite IDE. This will allow anybody using this environment to get auto-completion. I summarize it all as the autocompletion function. You type $xxx then dot (.) then get a popup... that popup is based on what is known as type. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Paul Libbrecht wrote: The grant would be for the xwiki development, not for xwiki applications. I think I saw there was one long ago. Your product should be open-source. Yes, yes! I meant I'm not the one to propose XWiki devs to apply for such a grant! :-) I must recognize that I am a bit of a mess when talking about variables, properties, methods, objects and stuff! Let's go back to the initial question: what I was looking for was how to read all available properties of a given object with a piece of code within a XWiki page. I think I'm not able yet to use the right concepts and the right words when taking about, in general, object-oriented programming. I think that what you have gone several steps further and give me/us some nice keys about how to do that programmatically from within your favourite IDE. This will allow anybody using this environment to get auto-completion. I summarize it all as the autocompletion function. You type $xxx then dot (.) then get a popup... that popup is based on what is known as type. I'm afraid I'm lost again... by saying based on what is know as type you mean that we'll get all methods for a given class? all properties? For instance, if i type $xwiki. will I get all methods of this class? All its properties? I know, I can't learn Java by asking here all I don't know! But it is really useful to make this kind of questions, and get them answered!, to better understand the concepts I found defined in many places in Internet or asking colleagues. At least for me is quite difficult to know what is wrong, ill-defined or correct in that ocean of information! Thank you so much! -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Thanks! Paul Libbrecht wrote: Ricardo, If you agree to work with outdated projects, why not consider the project: http://svn.activemath.org/intergeo/Platform/Vignettes/ It's referencing old xwiki things because that's where curriki holds me but is otherwise giving me the edit luxury for groovy and velocity. It builds applets, per default (it's an applet-based screenshot uploader) but it also contains the source of an xwiki application. It also has src/main/pages/VignettesCode/ which contains source files in groovy and velocity languages and editing with intelliJ there gives me all the code-completions. I believe the project does not have personal dependencies but I could be wrong. I'm afraid my skills are still far from required to be involve in such a project! But I keep trying! I know, I've already said this before... but, you know, kids, banks,... :-) I'll catch up! The main visible output page being: http://i2geo.net/xwiki/bin/view/VignettesCode/CarouselHtml To upload I use my own post script (http://svn.activemath.org/intergeo/Platform/bin/upload-to-wiki) or simply and quite often copy and paste. I'll take a look to the project ASAP and come back with doubts. I remember your project which I reach some years ago following thread discussions here and in the devs list. I'm not involved with any Geometry problem, but Multivariate Statistics is currently one of my main concerns. The objective is to be able to collaboratively develop, document and submit R (http://www.r-project.org/) scripts within an XWiki environment. We have a lot of happy XWiki users, all of them requires some kind of statistical analysis for their work. So, to be able to capture and document the process of generation of knowledge associated with statistical analysis will be a killer application (I do like this concept :-) here. And, of course, this would be a Curriki project as well: we want to teach that! I'm sure I/we can learn a lot from the i2geo project! Keep in touch! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Ricardo, I am suggesting this project not for you to get involved but for the virtues of an example: - check it out - import it in IntelliJ - see if you can edit with luxury The vignettes project is a simple (sub-)project of i2geo. paul Le 21 sept. 2010 à 10:10, [Ricardo Rodriguez] eBioTIC. a écrit : Thanks! Paul Libbrecht wrote: Ricardo, If you agree to work with outdated projects, why not consider the project: http://svn.activemath.org/intergeo/Platform/Vignettes/ It's referencing old xwiki things because that's where curriki holds me but is otherwise giving me the edit luxury for groovy and velocity. It builds applets, per default (it's an applet-based screenshot uploader) but it also contains the source of an xwiki application. It also has src/main/pages/VignettesCode/ which contains source files in groovy and velocity languages and editing with intelliJ there gives me all the code-completions. I believe the project does not have personal dependencies but I could be wrong. I'm afraid my skills are still far from required to be involve in such a project! But I keep trying! I know, I've already said this before... but, you know, kids, banks,... :-) I'll catch up! The main visible output page being: http://i2geo.net/xwiki/bin/view/VignettesCode/CarouselHtml To upload I use my own post script (http://svn.activemath.org/intergeo/Platform/bin/upload-to-wiki) or simply and quite often copy and paste. I'll take a look to the project ASAP and come back with doubts. I remember your project which I reach some years ago following thread discussions here and in the devs list. I'm not involved with any Geometry problem, but Multivariate Statistics is currently one of my main concerns. The objective is to be able to collaboratively develop, document and submit R (http://www.r-project.org/) scripts within an XWiki environment. We have a lot of happy XWiki users, all of them requires some kind of statistical analysis for their work. So, to be able to capture and document the process of generation of knowledge associated with statistical analysis will be a killer application (I do like this concept :-) here. And, of course, this would be a Curriki project as well: we want to teach that! I'm sure I/we can learn a lot from the i2geo project! Keep in touch! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Paul Libbrecht wrote: Ricardo, I am suggesting this project not for you to get involved but for the virtues of an example: - check it out - import it in IntelliJ - see if you can edit with luxury The vignettes project is a simple (sub-)project of i2geo. Got! Thanks! -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
On Sat, Sep 18, 2010 at 12:04 PM, [Ricardo Rodriguez] eBioTIC. ricardo.rodrig...@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/xwiki/api/XWiki.html#getUserName%28java.lang.String%29 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@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Le 20 sept. 2010 à 08:44, Raluca Stavro a écrit : 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/xwiki/api/XWiki.html#getUserName%28java.lang.String%29 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 At debugging time, I make heavy use of $.getClass() or the failsafe variant: $!.getClass() (which cannot be used as $.class) so as to recognize the class of an object hence know the available properties. Of course, the javadoc also helps. paul ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Thanks! Raluca Stavro wrote: 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. Thus, all these methods are the ones documented here.. http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html Is that right? 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 That is far clear: once I get in $itemdoc a document object I can retrieve its properties by using $itemdoc.property syntax. I can't use .substring() (or any other String method) with $itemdoc simply because $itemdoc is not a string. Am I right? Please, accept my apologies if this questions are too basic! Thanks! -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Thanks, Paul! Paul Libbrecht wrote: $.getClass() or the failsafe variant: $!.getClass() (which cannot be used as $.class) so as to recognize the class of an object hence know the available properties. Of course, the javadoc also helps. It seems really useful for me as well. But, please, how could I query the class or available properties? Is that possible or the only way to get them is by going to the JavaDoc document? And, if so, where could I found the available properties for XWiki classes? I am sure I am missing something obvious... It's easy to read the properties by using the web interface and ?editor=class to the URL of the document holding the class definition, but how could I do this programmatically? Of course, it has to be the code of that editor. But I'm not able yet of reading and understanding that code. Any entry level help will be welcome! Thanks! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
I think XEclipse does it pretty well. But what I prefer to use is my favourite IDE IntelliJ IDEA. For this, it depends if velocity or groovy. - if groovy, I use imports and give types to my variables... this way... there's a way to add variables from context but I was never fully satisfied with it. I name the files *.groovy. - if velocity, I name the files *.vm, and I insert such fragments as the below in the header #* @vtlvariable name=lucene type=com.xpn.xwiki.plugin.lucene.LucenePluginApi *# ## #* @vtlvariable name=xwiki type=com.xpn.xwiki.api.XWiki *# ## #* @vtlvariable name=request type=javax.servlet.http.HttpServletRequest *# ## #* @vtlvariable name=luQ type=org.apache.lucene.search.BooleanQuery *# and this gives me auto completion Of course, this relies on the fact that my IntelliJ has all the necessary dependencies (I import the right pom.xml for this). I believe it should be possible to get this in Eclipse using the velocity mode but a friend of mine, an expert there told me it wasn't possible. I can't believe it. We should definitely have a page about that in dev.xwiki.org. But not how to build! paul Le 20 sept. 2010 à 19:50, [Ricardo Rodriguez] eBioTIC. a écrit : It seems really useful for me as well. But, please, how could I query the class or available properties? Is that possible or the only way to get them is by going to the JavaDoc document? And, if so, where could I found the available properties for XWiki classes? I am sure I am missing something obvious... It's easy to read the properties by using the web interface and ?editor=class to the URL of the document holding the class definition, but how could I do this programmatically? Of course, it has to be the code of that editor. But I'm not able yet of reading and understanding that code. Any entry level help will be welcome! Thanks! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Thanks again, Paul, Paul Libbrecht wrote: I think XEclipse does it pretty well. But what I prefer to use is my favourite IDE IntelliJ IDEA. For this, it depends if velocity or groovy. - if groovy, I use imports and give types to my variables... this way... there's a way to add variables from context but I was never fully satisfied with it. I name the files *.groovy. - if velocity, I name the files *.vm, and I insert such fragments as the below in the header #* @vtlvariable name=lucene type=com.xpn.xwiki.plugin.lucene.LucenePluginApi *# ## #* @vtlvariable name=xwiki type=com.xpn.xwiki.api.XWiki *# ## #* @vtlvariable name=request type=javax.servlet.http.HttpServletRequest *# ## #* @vtlvariable name=luQ type=org.apache.lucene.search.BooleanQuery *# and this gives me auto completion Of course, this relies on the fact that my IntelliJ has all the necessary dependencies (I import the right pom.xml for this). I believe it should be possible to get this in Eclipse using the velocity mode but a friend of mine, an expert there told me it wasn't possible. I can't believe it. I am afraid that I can do about this today is to say thanks and mark this thread as important and come back to it when I has a well installed and configured dev environment! :-) I thin I was not far from this point some time ago, but I have to catch up again now! Let's see if I'm able to get something and will be back with results! Do you use IntellijIDEA Community Edition or Ultimate Edition? We should definitely have a page about that in dev.xwiki.org. But not how to build! Please, why do say But not how to build! Simply because it already exists such a page? Thanks! -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Hi! ... It's easy to read the properties by using the web interface and ?editor=class to the URL of the document holding the class definition, but how could I do this programmatically? Of course, it has to be the code of that editor. But I'm not able yet of reading and This page content a lot of useful code for I was trying to learn how to do... http://yourwiki/bin/edit/XWiki/ClassSheet?editor=wiki I'm user it is well know for most of you, but I've just found it a while ago! I'm using a XE 2.4.30451. Thanks! -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Le 20 sept. 2010 à 20:33, [Ricardo Rodriguez] eBioTIC. a écrit : Of course, this relies on the fact that my IntelliJ has all the necessary dependencies (I import the right pom.xml for this). I believe it should be possible to get this in Eclipse using the velocity mode but a friend of mine, an expert there told me it wasn't possible. I can't believe it. I am afraid that I can do about this today is to say thanks and mark this thread as important and come back to it when I has a well installed and configured dev environment! :-) I thin I was not far from this point some time ago, but I have to catch up again now! Let's see if I'm able to get something and will be back with results! It really isn't difficult. Take a blank pom.xml. Add a dependency to xwiki entreprise... Import your pom in intelliJ (create a project from external model). Do you use IntellijIDEA Community Edition or Ultimate Edition? For velocity support you need the Ultimate edition unfortunately. But the licenses for open-source projects are still being granted. For groovy, the Community edition is enough I believe. We should definitely have a page about that in dev.xwiki.org. But not how to build! Please, why do say But not how to build! Simply because it already exists such a page? Yes, it's about how to create applications, not how to build xwiki-core. Le 20 sept. 2010 à 20:59, [Ricardo Rodriguez] eBioTIC. a écrit : This page content a lot of useful code for I was trying to learn how to do... http://yourwiki/bin/edit/XWiki/ClassSheet?editor=wiki I'm user it is well know for most of you, but I've just found it a while ago! I'm using a XE 2.4.30451. Does it help to get the methods of the XWiki object? Maybe we're having a parallel dialog. paul ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Hi! Paul Libbrecht wrote: Do you use IntellijIDEA Community Edition or Ultimate Edition? For velocity support you need the Ultimate edition unfortunately. But the licenses for open-source projects are still being granted. For groovy, the Community edition is enough I believe. I don't see XWiki among the projects granted an Ultimate Edition Intelljidea. I don't think I'm the one to propose such an application! Its web site states that, as you say, the Community edition is enough for Groovy so, let's give it a try! This page content a lot of useful code for I was trying to learn how to do... http://yourwiki/bin/edit/XWiki/ClassSheet?editor=wiki I'm user it is well know for most of you, but I've just found it a while ago! I'm using a XE 2.4.30451. Does it help to get the methods of the XWiki object? Maybe we're having a parallel dialog. I must recognize that I am a bit of a mess when talking about variables, properties, methods, objects and stuff! Let's go back to the initial question: what I was looking for was how to read all available properties of a given object with a piece of code within a XWiki page. I think I'm not able yet to use the right concepts and the right words when taking about, in general, object-oriented programming. I think that what you have gone several steps further and give me/us some nice keys about how to do that programmatically from within your favourite IDE. This will allow anybody using this environment to get auto-completion. I don't know if I've resumed correctly the point of situation here! I agree with you that it will be great to have some page in the developing niche of XWiki Ecosystem, but I do understand that is up to me/us to create it! Let's keep learning! Thank you so much for your time! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
Le 21 sept. 2010 à 00:32, [Ricardo Rodriguez] eBioTIC. a écrit : For velocity support you need the Ultimate edition unfortunately. But the licenses for open-source projects are still being granted. For groovy, the Community edition is enough I believe. I don't see XWiki among the projects granted an Ultimate Edition Intelljidea. I don't think I'm the one to propose such an application! Its web site states that, as you say, the Community edition is enough for Groovy so, let's give it a try! The grant would be for the xwiki development, not for xwiki applications. I think I saw there was one long ago. Your product should be open-source. I must recognize that I am a bit of a mess when talking about variables, properties, methods, objects and stuff! Let's go back to the initial question: what I was looking for was how to read all available properties of a given object with a piece of code within a XWiki page. I think I'm not able yet to use the right concepts and the right words when taking about, in general, object-oriented programming. I think that what you have gone several steps further and give me/us some nice keys about how to do that programmatically from within your favourite IDE. This will allow anybody using this environment to get auto-completion. I summarize it all as the autocompletion function. You type $xxx then dot (.) then get a popup... that popup is based on what is known as type. paul ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
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/xwiki/api/XWiki.html#getUserName%28java.lang.String%29 Please, as $context is a class and getUser() is a method of that class, what is .substring()? 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? 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@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
[Ricardo Rodriguez] eBioTIC. 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/xwiki/api/XWiki.html#getUserName%28java.lang.String%29 Please, as $context is a class and getUser() is a method of that class, what is .substring()? Another way of writing is: #set($nameString = $xcontext.getUser()) #set($nameStringWithNoPrefix = $nameString.substring(6)) substring is a function of java.lang.String which is what's returned by context.getUser() You can google java.lang.String to get a listing of all of String's functions. 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? Please, excuse me if this questions are too basic! Thanks for your help! If you just put the name of the document ie: * [$itemdoc] It should extract the user friendly name and display it automatically. BTW: That is syntax/1.0 and all new development on the rendering engine is for the syntax/2.0 renderer. 1.0 will not be removed for quite some time but if you want to take advantage of new features, I recommend writing new code in syntax/2.0. Caleb ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How do I for divide one string I need only the part of the user name (Admin) instead of XWiki.Admin
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/xwiki/api/XWiki.html#getUserName%28java.lang.String%29 Caleb abrante wrote: I recovered the value from $context.user Thanks ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users