[xwiki-users] Annotations
Hi there, I observed the Annotation-code in XWiki is having problems with the general approach of having a document-class rendered by a class-specific sheet. E.g. the highlighting of text passages isn't rendering properly. Is this a general limitation or am I doing something wrong with the classes' sheet? It's more or less a listing of textfields fed by class properties. Best, Michael ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Using parameter macro in the js extension
Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb Eduardo Abritta eduardo.abri...@outlook.com: Hi Sirs, I am developing a macro in velocity (wiki macro) and need to use a parameter (wiki macro parameter) defined by the user in my java script code (java script extension). I tried can several methods but it is not working. How can I do this? Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | ___ 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] XWIKI to MediaWIKI
There is no existing tool I know of for this, see my answer on your other mail on dev mailing list. On Mon, May 12, 2014 at 11:59 PM, walid yaich walid.ya...@gmail.com wrote: Hi everybody, The reason is that we need a simple workflow in the wiki, the extension XWiki Publication Workflow Application not working. Well, actually i need to move from XWIKI to MediaWIKI, but the most difficult problem is the migration Would you please give me any clue about the easiest way to migrate the whole content from XWIKI to MediaWIKI Thanks in advance :) ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Using parameter macro in the js extension
Hi, 2014-05-13 8:40 GMT+02:00 Michael Bußler michael.buss...@googlemail.com: Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Only if value needs to be refreshed without a page refresh. If value comes from a velocity macro, it's in the context of a page, so it's enough to initialize the javascript var from velocity (which is ok as velocity is executed before) - it's not supposed to be updated server-side after the page is rendered. Of course if it needs to be dynamic you could go ajax. Well my understanding of Eduardo is that he needs to initialize a value in javascript, based on a macro parameter passed to a velocity macro. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb Eduardo Abritta eduardo.abri...@outlook.com : Hi Sirs, I am developing a macro in velocity (wiki macro) and need to use a parameter (wiki macro parameter) defined by the user in my java script code (java script extension). I tried can several methods but it is not working. How can I do this? Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | ___ 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 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWIKI to MediaWIKI
On 12 May 2014 at 23:59:35, walid yaich (walid.ya...@gmail.com(mailto:walid.ya...@gmail.com)) wrote: Hi everybody, The reason is that we need a simple workflow in the wiki, the extension XWiki Publication Workflow Application not working. hmm that doesn’t seem a good reason to switch IMO… :) You’re going to spend 10 times more time writing a migrator than you would to make the Workflow Application work. AFAICS you’ve just posted an email about the Workflow issue only a few minutes/hours ago and you’re not even waiting for the response before deciding to migrate, that doesn’t look serious to me… Thanks -Vincent Well, actually i need to move from XWIKI to MediaWIKI, but the most difficult problem is the migration Would you please give me any clue about the easiest way to migrate the whole content from XWIKI to MediaWIKI Thanks in advance :) ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWIKI to MediaWIKI
I'm sorry, i'm so serious, we're more than 300 persons in the company using XIWKI, si i'm pretty serious, if it's possible to write a tool to migrate in 1 or 2 weeks, i'll probably do it. Maybe you're right, i didn't wait much, but i spend much time trying to make it work and i didn't even understand the concept of this extension, so maybe it's not well documented, in 1 days i get MediaWIKI with the extension work properly, but i spend 3 days on XWIKI without any result, so maybe one another reason is documentation :) 2014-05-13 9:18 GMT+01:00 vinc...@massol.net vinc...@massol.net: On 12 May 2014 at 23:59:35, walid yaich (walid.ya...@gmail.com(mailto: walid.ya...@gmail.com)) wrote: Hi everybody, The reason is that we need a simple workflow in the wiki, the extension XWiki Publication Workflow Application not working. hmm that doesn’t seem a good reason to switch IMO… :) You’re going to spend 10 times more time writing a migrator than you would to make the Workflow Application work. AFAICS you’ve just posted an email about the Workflow issue only a few minutes/hours ago and you’re not even waiting for the response before deciding to migrate, that doesn’t look serious to me… Thanks -Vincent Well, actually i need to move from XWIKI to MediaWIKI, but the most difficult problem is the migration Would you please give me any clue about the easiest way to migrate the whole content from XWIKI to MediaWIKI Thanks in advance :) ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWIKI to MediaWIKI
Hi Walid, On 13 May 2014 at 10:23:42, walid yaich (walid.ya...@gmail.com(mailto:walid.ya...@gmail.com)) wrote: I'm sorry, i'm so serious, we're more than 300 persons in the company using XIWKI, si i'm pretty serious, if it's possible to write a tool to migrate in 1 or 2 weeks, i'll probably do it. BTW did you check the comments at http://extensions.xwiki.org/xwiki/bin/view/Extension/XWiki+Publication+Workflow+Application ? Note that this extension is NOT developed by the XWiki dev team, it’s done by some individual and is in no way supported by the XWiki dev team. Also note that you don’t need this extension at all to implement a simple workflow in XWiki. It can be done easily with the notion of XClass/XObjects natively but you’d need to spend 1-2 days to understand these concepts. Actually these concepts are the main reason people use XWiki and they allow you to go so much further than any other wiki can go. If you’re serious and want to build something for the long run, I highly recommend that you spend 2-3 days to get familiar with XWiki before making an impacting change for your company. Some tutorials on XClass/XObjects: - http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel - http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorial Generally speaking you’ll find technical resources here: http://platform.xwiki.org/xwiki/bin/view/DevGuide/WebHome Maybe you're right, i didn't wait much, but i spend much time trying to make it work and i didn't even understand the concept of this extension, so maybe it's not well documented, in 1 days i get MediaWIKI with the extension work properly, but i spend 3 days on XWIKI without any result, so maybe one another reason is documentation :) Yes that’s a good point. We always need to improve documentation. In this case however, it’s beyond our control since this is an extension contributed by some individual and is in no way managed by the XWiki dev team. What could help would be to have a Workflow extension developed/supported by the XWiki dev team. If enough people request this, this could be considered indeed. BTW most people switch from Mediawiki to XWiki because they’re quickly limited by Mediawiki on the “enterprise” aspects: fine-grained permissions, flat page hierarchy, LDAP integration, Office integration, etc. Thanks -Vincent 2014-05-13 9:18 GMT+01:00 vinc...@massol.net(mailto:vinc...@massol.net) : On 12 May 2014 at 23:59:35, walid yaich (walid.ya...@gmail.com(mailto:walid.ya...@gmail.com)(mailto:walid.ya...@gmail.com)) wrote: Hi everybody, The reason is that we need a simple workflow in the wiki, the extension XWiki Publication Workflow Application not working. hmm that doesn’t seem a good reason to switch IMO… :) You’re going to spend 10 times more time writing a migrator than you would to make the Workflow Application work. AFAICS you’ve just posted an email about the Workflow issue only a few minutes/hours ago and you’re not even waiting for the response before deciding to migrate, that doesn’t look serious to me… Thanks -Vincent Well, actually i need to move from XWIKI to MediaWIKI, but the most difficult problem is the migration Would you please give me any clue about the easiest way to migrate the whole content from XWIKI to MediaWIKI Thanks in advance :) ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWIKI to MediaWIKI
Thank you so much, i'll talk to my boss and see what can we do, so nice to get responses 2014-05-13 9:32 GMT+01:00 vinc...@massol.net vinc...@massol.net: Hi Walid, On 13 May 2014 at 10:23:42, walid yaich (walid.ya...@gmail.com(mailto: walid.ya...@gmail.com)) wrote: I'm sorry, i'm so serious, we're more than 300 persons in the company using XIWKI, si i'm pretty serious, if it's possible to write a tool to migrate in 1 or 2 weeks, i'll probably do it. BTW did you check the comments at http://extensions.xwiki.org/xwiki/bin/view/Extension/XWiki+Publication+Workflow+Application? Note that this extension is NOT developed by the XWiki dev team, it’s done by some individual and is in no way supported by the XWiki dev team. Also note that you don’t need this extension at all to implement a simple workflow in XWiki. It can be done easily with the notion of XClass/XObjects natively but you’d need to spend 1-2 days to understand these concepts. Actually these concepts are the main reason people use XWiki and they allow you to go so much further than any other wiki can go. If you’re serious and want to build something for the long run, I highly recommend that you spend 2-3 days to get familiar with XWiki before making an impacting change for your company. Some tutorials on XClass/XObjects: - http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel - http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorial Generally speaking you’ll find technical resources here: http://platform.xwiki.org/xwiki/bin/view/DevGuide/WebHome Maybe you're right, i didn't wait much, but i spend much time trying to make it work and i didn't even understand the concept of this extension, so maybe it's not well documented, in 1 days i get MediaWIKI with the extension work properly, but i spend 3 days on XWIKI without any result, so maybe one another reason is documentation :) Yes that’s a good point. We always need to improve documentation. In this case however, it’s beyond our control since this is an extension contributed by some individual and is in no way managed by the XWiki dev team. What could help would be to have a Workflow extension developed/supported by the XWiki dev team. If enough people request this, this could be considered indeed. BTW most people switch from Mediawiki to XWiki because they’re quickly limited by Mediawiki on the “enterprise” aspects: fine-grained permissions, flat page hierarchy, LDAP integration, Office integration, etc. Thanks -Vincent 2014-05-13 9:18 GMT+01:00 vinc...@massol.net(mailto:vinc...@massol.net) : On 12 May 2014 at 23:59:35, walid yaich (walid.ya...@gmail.com(mailto: walid.ya...@gmail.com)(mailto:walid.ya...@gmail.com)) wrote: Hi everybody, The reason is that we need a simple workflow in the wiki, the extension XWiki Publication Workflow Application not working. hmm that doesn’t seem a good reason to switch IMO… :) You’re going to spend 10 times more time writing a migrator than you would to make the Workflow Application work. AFAICS you’ve just posted an email about the Workflow issue only a few minutes/hours ago and you’re not even waiting for the response before deciding to migrate, that doesn’t look serious to me… Thanks -Vincent Well, actually i need to move from XWIKI to MediaWIKI, but the most difficult problem is the migration Would you please give me any clue about the easiest way to migrate the whole content from XWIKI to MediaWIKI Thanks in advance :) ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWiki Publication Workflow Application
Hello, So first you need to make sure you installed both the API and the application (the APi is a dependency of the application, so if you install with Extension Manager that will just work, if you install manually you need to handle it yourself). Then, once installed, create at least one workflow in the place of your choice (iirc, there is a template provider that is available in the PublicationWorkflow space, so just use the Add - Page menu in this space). This workflow is an association of groups of contributors, validators, etc. Then, in the space where you wanna keep your draft documents, add the PublicationWorkflow.PublicationWorkflowPanel panel from the administration. Then, for a draft document that you created, use the form in this panel to setup the destination document, where the draft should be copied when it was approved for publication (the published document). The rights on the draft documents are handled by the workflow extension, but the rights on the published document need to be handled by you (e.g. remove all edit rights of people on that space, since nobody should be editing directly a published document, they should go through the draft and publication process). Now, you're all done, this panel should be showing you actions that you can do on the document. Also, if you put this panel (or use the macro somehow) on the published document, it will allow you to go back from the published document to its corresponding draft. If you still have troubles, check the logs of your wiki and give the exception/message/warning if there is any in the logs (when you get workflow.script.failed). Happy XWikiing, Anca On Mon, May 12, 2014 at 11:46 PM, walid yaich walid.ya...@gmail.com wrote: Hi, Basically my need is to have a simple workflow, someone to edit a page and another to validate and publish. I can't get this extension working, i setup it on XWIKI 4.4 (5.2 too) and try to run a workflow but i always get workflow.script.failed. Please, do you know how to get it work ? Thanks in advance ___ 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] XWiki Publication Workflow Application
Thank you so much, Probably its because i don't understand XWIKi basics, now i'll take my time to understand basics You're a good community ! 2014-05-13 9:50 GMT+01:00 Anca Luca lu...@xwiki.com: Hello, So first you need to make sure you installed both the API and the application (the APi is a dependency of the application, so if you install with Extension Manager that will just work, if you install manually you need to handle it yourself). Then, once installed, create at least one workflow in the place of your choice (iirc, there is a template provider that is available in the PublicationWorkflow space, so just use the Add - Page menu in this space). This workflow is an association of groups of contributors, validators, etc. Then, in the space where you wanna keep your draft documents, add the PublicationWorkflow.PublicationWorkflowPanel panel from the administration. Then, for a draft document that you created, use the form in this panel to setup the destination document, where the draft should be copied when it was approved for publication (the published document). The rights on the draft documents are handled by the workflow extension, but the rights on the published document need to be handled by you (e.g. remove all edit rights of people on that space, since nobody should be editing directly a published document, they should go through the draft and publication process). Now, you're all done, this panel should be showing you actions that you can do on the document. Also, if you put this panel (or use the macro somehow) on the published document, it will allow you to go back from the published document to its corresponding draft. If you still have troubles, check the logs of your wiki and give the exception/message/warning if there is any in the logs (when you get workflow.script.failed). Happy XWikiing, Anca On Mon, May 12, 2014 at 11:46 PM, walid yaich walid.ya...@gmail.com wrote: Hi, Basically my need is to have a simple workflow, someone to edit a page and another to validate and publish. I can't get this extension working, i setup it on XWIKI 4.4 (5.2 too) and try to run a workflow but i always get workflow.script.failed. Please, do you know how to get it work ? Thanks in advance ___ 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 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWIKI to MediaWIKI
Thanks to your advice, i'm going to spend 2-3 days on basics and see if i can make the simple workflow this week ;) Good community ! i like it :) 2014-05-13 9:49 GMT+01:00 walid yaich walid.ya...@gmail.com: Thank you so much, i'll talk to my boss and see what can we do, so nice to get responses 2014-05-13 9:32 GMT+01:00 vinc...@massol.net vinc...@massol.net: Hi Walid, On 13 May 2014 at 10:23:42, walid yaich (walid.ya...@gmail.com(mailto: walid.ya...@gmail.com)) wrote: I'm sorry, i'm so serious, we're more than 300 persons in the company using XIWKI, si i'm pretty serious, if it's possible to write a tool to migrate in 1 or 2 weeks, i'll probably do it. BTW did you check the comments at http://extensions.xwiki.org/xwiki/bin/view/Extension/XWiki+Publication+Workflow+Application? Note that this extension is NOT developed by the XWiki dev team, it’s done by some individual and is in no way supported by the XWiki dev team. Also note that you don’t need this extension at all to implement a simple workflow in XWiki. It can be done easily with the notion of XClass/XObjects natively but you’d need to spend 1-2 days to understand these concepts. Actually these concepts are the main reason people use XWiki and they allow you to go so much further than any other wiki can go. If you’re serious and want to build something for the long run, I highly recommend that you spend 2-3 days to get familiar with XWiki before making an impacting change for your company. Some tutorials on XClass/XObjects: - http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel - http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorial Generally speaking you’ll find technical resources here: http://platform.xwiki.org/xwiki/bin/view/DevGuide/WebHome Maybe you're right, i didn't wait much, but i spend much time trying to make it work and i didn't even understand the concept of this extension, so maybe it's not well documented, in 1 days i get MediaWIKI with the extension work properly, but i spend 3 days on XWIKI without any result, so maybe one another reason is documentation :) Yes that’s a good point. We always need to improve documentation. In this case however, it’s beyond our control since this is an extension contributed by some individual and is in no way managed by the XWiki dev team. What could help would be to have a Workflow extension developed/supported by the XWiki dev team. If enough people request this, this could be considered indeed. BTW most people switch from Mediawiki to XWiki because they’re quickly limited by Mediawiki on the “enterprise” aspects: fine-grained permissions, flat page hierarchy, LDAP integration, Office integration, etc. Thanks -Vincent 2014-05-13 9:18 GMT+01:00 vinc...@massol.net(mailto:vinc...@massol.net) : On 12 May 2014 at 23:59:35, walid yaich (walid.ya...@gmail.com (mailto:walid.ya...@gmail.com)(mailto:walid.ya...@gmail.com)) wrote: Hi everybody, The reason is that we need a simple workflow in the wiki, the extension XWiki Publication Workflow Application not working. hmm that doesn’t seem a good reason to switch IMO… :) You’re going to spend 10 times more time writing a migrator than you would to make the Workflow Application work. AFAICS you’ve just posted an email about the Workflow issue only a few minutes/hours ago and you’re not even waiting for the response before deciding to migrate, that doesn’t look serious to me… Thanks -Vincent Well, actually i need to move from XWIKI to MediaWIKI, but the most difficult problem is the migration Would you please give me any clue about the easiest way to migrate the whole content from XWIKI to MediaWIKI Thanks in advance :) ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Annotations
Hello Michael, there is a chance that this is a standard issue, but it also depends on what you're trying to do. The main limitation of the annotations is that they are not working on content rendered with the {{html}} macro, because they are rendered at the XDOM Level and the html macro is not parsed in the XDOM. So if your sheet does everything in a html macro, than chances are it won't work. If your sheet is rendering using the xwiki syntax, then stuff should work fine. Can you describe a bit more in detail your problem? or if you have an online server, show us there what's happening? is your sheet custom? can you show the code of your sheet? a screenshot of isn't rendering properly? Anca On Tue, May 13, 2014 at 8:38 AM, Michael Bußler michael.buss...@googlemail.com wrote: Hi there, I observed the Annotation-code in XWiki is having problems with the general approach of having a document-class rendered by a class-specific sheet. E.g. the highlighting of text passages isn't rendering properly. Is this a general limitation or am I doing something wrong with the classes' sheet? It's more or less a listing of textfields fed by class properties. Best, Michael ___ 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] Using parameter macro in the js extension
Exactly. I'm needing initialize a value in the velocity environment and use it on the javascript code. it not needs to be dinamic. I am trying to use the following code but the JS variable is returning undefined Java Script Code var param; this.param=$xcontext.macro.params.parameter; console.log(param); Velocity (Macro) $xcontext.put(param, $xcontext.macro.params.parameter) Some light? ty Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | Date: Tue, 13 May 2014 10:05:17 +0200 From: jeremie.bousq...@gmail.com To: users@xwiki.org Subject: Re: [xwiki-users] Using parameter macro in the js extension Hi, 2014-05-13 8:40 GMT+02:00 Michael Bußler michael.buss...@googlemail.com: Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Only if value needs to be refreshed without a page refresh. If value comes from a velocity macro, it's in the context of a page, so it's enough to initialize the javascript var from velocity (which is ok as velocity is executed before) - it's not supposed to be updated server-side after the page is rendered. Of course if it needs to be dynamic you could go ajax. Well my understanding of Eduardo is that he needs to initialize a value in javascript, based on a macro parameter passed to a velocity macro. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb Eduardo Abritta eduardo.abri...@outlook.com : Hi Sirs, I am developing a macro in velocity (wiki macro) and need to use a parameter (wiki macro parameter) defined by the user in my java script code (java script extension). I tried can several methods but it is not working. How can I do this? Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | ___ 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 ___ 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
[xwiki-users] newsletter application seem to break xwikiUserSheet with flamingo skin
Hello, If I install newsletter extension on xwiki 6.0, my profil is display like this :-( http://snag.gy/NY6p2.jpg Thxs Pascal B ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Using parameter macro in the js extension
This depends a lot on how the javascript is loaded... If you're including it using $xwiki.jsx.use() then it won't have the same context because it's a different HTTP request. If you use the macro and then do a {{velocity}} macro with an {{html}} macro and a script inside of that, the content will (should) be there. Another solution is to pass the info in a parameter, eg: $xwiki.jsx.use('My.Document', {param: $value}) and then in the jsx extension... var PARAMETER_ONE = $escapetool.javascript($request.getParameter('param')); Thanks, Caleb On 05/13/2014 03:28 PM, Eduardo Abritta wrote: Exactly. I'm needing initialize a value in the velocity environment and use it on the javascript code. it not needs to be dinamic. I am trying to use the following code but the JS variable is returning undefined Java Script Code var param; this.param=$xcontext.macro.params.parameter; console.log(param); Velocity (Macro) $xcontext.put(param, $xcontext.macro.params.parameter) Some light? ty Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | Date: Tue, 13 May 2014 10:05:17 +0200 From: jeremie.bousq...@gmail.com To: users@xwiki.org Subject: Re: [xwiki-users] Using parameter macro in the js extension Hi, 2014-05-13 8:40 GMT+02:00 Michael Bußler michael.buss...@googlemail.com: Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Only if value needs to be refreshed without a page refresh. If value comes from a velocity macro, it's in the context of a page, so it's enough to initialize the javascript var from velocity (which is ok as velocity is executed before) - it's not supposed to be updated server-side after the page is rendered. Of course if it needs to be dynamic you could go ajax. Well my understanding of Eduardo is that he needs to initialize a value in javascript, based on a macro parameter passed to a velocity macro. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb Eduardo Abritta eduardo.abri...@outlook.com : Hi Sirs, I am developing a macro in velocity (wiki macro) and need to use a parameter (wiki macro parameter) defined by the user in my java script code (java script extension). I tried can several methods but it is not working. How can I do this? Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | ___ 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 ___ 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 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Using parameter macro in the js extension
2014-05-13 16:04 GMT+02:00 Caleb James DeLisle c...@cjdns.fr: This depends a lot on how the javascript is loaded... If you're including it using $xwiki.jsx.use() then it won't have the same context because it's a different HTTP request. If you use the macro and then do a {{velocity}} macro with an {{html}} macro and a script inside of that, the content will (should) be there. Another solution is to pass the info in a parameter, eg: $xwiki.jsx.use('My.Document', {param: $value}) and then in the jsx extension... var PARAMETER_ONE = $escapetool.javascript($request.getParameter('param')); Thanks, Caleb On 05/13/2014 03:28 PM, Eduardo Abritta wrote: Exactly. I'm needing initialize a value in the velocity environment and use it on the javascript code. it not needs to be dinamic. I am trying to use the following code but the JS variable is returning undefined Java Script Code var param; this.param=$xcontext.macro.params.parameter; console.log(param); Velocity (Macro) $xcontext.put(param, $xcontext.macro.params.parameter) Did you also check that this $param is correctly set a value in your velocity code ? The fact that param is undefined on javascript side is strange, if it didn't find anything in the velocity context, it should contain exactly the string '$xcontext.macro.params.parameter', not undefined. So it seems to me it was found in the context, but it has null value. Some light? ty Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | Date: Tue, 13 May 2014 10:05:17 +0200 From: jeremie.bousq...@gmail.com To: users@xwiki.org Subject: Re: [xwiki-users] Using parameter macro in the js extension Hi, 2014-05-13 8:40 GMT+02:00 Michael Bußler michael.buss...@googlemail.com: Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Only if value needs to be refreshed without a page refresh. If value comes from a velocity macro, it's in the context of a page, so it's enough to initialize the javascript var from velocity (which is ok as velocity is executed before) - it's not supposed to be updated server-side after the page is rendered. Of course if it needs to be dynamic you could go ajax. Well my understanding of Eduardo is that he needs to initialize a value in javascript, based on a macro parameter passed to a velocity macro. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb Eduardo Abritta eduardo.abri...@outlook.com : Hi Sirs, I am developing a macro in velocity (wiki macro) and need to use a parameter (wiki macro parameter) defined by the user in my java script code (java script extension). I tried can several methods but it is not working. How can I do this? Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | ___ 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 ___ 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 ___ 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
[xwiki-users] Components, context and subwikis
Hello, I have some java components (@Singleton) that depend on old core. It is bad, and I'm trying to move away from it, but I'll keep at least one component like this - my own bridge. I have this in initialize() of these components: ExecutionContext context = execution.getContext(); this.context = (XWikiContext) context.getProperty(xwikicontext); this.xwiki = this.context.getWiki(); I realize that this worked well in the context of a mono-wiki, but in a subwiki I wonder if it causes issues. Here, ExecutionContext relates to the request (user action) at initialize() time, so I suppose it's a sort of default execution context, related to main wiki, right ? So for example when xwiki.getDocument() is called, it looks after a document in the main wiki - not in the (sub)wiki from which the component method was called, right ? Should I just call initialize() at the beginning of every method that needs a correct context, in order to get a fresh execution context related to correct wiki ? Or should I pass the context from the script service, adding it as parameter to all needed methods in my component ? Thanks, Jeremie ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Components, context and subwikis
The ExecutionContext returned by execution.getContext(); comes from a ThreadLocal which means it's not a singleton associated to the main wiki but a new ExecutionContext generated for each http request. By the way you should really use ProviderXWikiContext component instead. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Components, context and subwikis
2014-05-13 17:53 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com: The ExecutionContext returned by execution.getContext(); comes from a ThreadLocal which means it's not a singleton associated to the main wiki but a new ExecutionContext generated for each http request. That is what I understood, but that means that for my component to operate on correct wiki (in correct context), it should reassign his own context member for each request - and not do it once at component initialization time. By the way you should really use ProviderXWikiContext component instead. I will, thanks. Does it have a different/better behaviour or is just the preferred way ? ___ 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] Using parameter macro in the js extension
Caleb, I did what do you say and it worked. Thank you. Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | Date: Tue, 13 May 2014 16:19:17 +0200 From: jeremie.bousq...@gmail.com To: users@xwiki.org Subject: Re: [xwiki-users] Using parameter macro in the js extension 2014-05-13 16:04 GMT+02:00 Caleb James DeLisle c...@cjdns.fr: This depends a lot on how the javascript is loaded... If you're including it using $xwiki.jsx.use() then it won't have the same context because it's a different HTTP request. If you use the macro and then do a {{velocity}} macro with an {{html}} macro and a script inside of that, the content will (should) be there. Another solution is to pass the info in a parameter, eg: $xwiki.jsx.use('My.Document', {param: $value}) and then in the jsx extension... var PARAMETER_ONE = $escapetool.javascript($request.getParameter('param')); Thanks, Caleb On 05/13/2014 03:28 PM, Eduardo Abritta wrote: Exactly. I'm needing initialize a value in the velocity environment and use it on the javascript code. it not needs to be dinamic. I am trying to use the following code but the JS variable is returning undefined Java Script Code var param; this.param=$xcontext.macro.params.parameter; console.log(param); Velocity (Macro) $xcontext.put(param, $xcontext.macro.params.parameter) Did you also check that this $param is correctly set a value in your velocity code ? The fact that param is undefined on javascript side is strange, if it didn't find anything in the velocity context, it should contain exactly the string '$xcontext.macro.params.parameter', not undefined. So it seems to me it was found in the context, but it has null value. Some light? ty Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | Date: Tue, 13 May 2014 10:05:17 +0200 From: jeremie.bousq...@gmail.com To: users@xwiki.org Subject: Re: [xwiki-users] Using parameter macro in the js extension Hi, 2014-05-13 8:40 GMT+02:00 Michael Bußler michael.buss...@googlemail.com: Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Only if value needs to be refreshed without a page refresh. If value comes from a velocity macro, it's in the context of a page, so it's enough to initialize the javascript var from velocity (which is ok as velocity is executed before) - it's not supposed to be updated server-side after the page is rendered. Of course if it needs to be dynamic you could go ajax. Well my understanding of Eduardo is that he needs to initialize a value in javascript, based on a macro parameter passed to a velocity macro. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb Eduardo Abritta eduardo.abri...@outlook.com : Hi Sirs, I am developing a macro in velocity (wiki macro) and need to use a parameter (wiki macro parameter) defined by the user in my java script code (java script extension). I tried can several methods but it is not working. How can I do this? Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | ___ 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 ___ 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 ___ 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 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Components, context and subwikis
On Tue, May 13, 2014 at 6:29 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: 2014-05-13 17:53 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com: The ExecutionContext returned by execution.getContext(); comes from a ThreadLocal which means it's not a singleton associated to the main wiki but a new ExecutionContext generated for each http request. That is what I understood, but that means that for my component to operate on correct wiki (in correct context), it should reassign his own context member for each request - and not do it once at component initialization time. I'm not sure I understand, are you talking about storing the XWikiContext in your component instance at init ? The XWikiContext should never ever be stored, instead you should always request the current one when you need it. Among other things the XWikiContext is not thread safe at all and is supposed to always be used in the Thread it's been created for. By the way you should really use ProviderXWikiContext component instead. I will, thanks. Does it have a different/better behaviour or is just the preferred way ? ___ 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 -- Thomas Mortagne ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Components, context and subwikis
2014-05-13 19:10 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com: On Tue, May 13, 2014 at 6:29 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: 2014-05-13 17:53 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com: The ExecutionContext returned by execution.getContext(); comes from a ThreadLocal which means it's not a singleton associated to the main wiki but a new ExecutionContext generated for each http request. That is what I understood, but that means that for my component to operate on correct wiki (in correct context), it should reassign his own context member for each request - and not do it once at component initialization time. I'm not sure I understand, are you talking about storing the XWikiContext in your component instance at init ? Yes in fact it's what I did (the this.context = in my sample code). I realize that I didn't think about it so much when I did it :) The XWikiContext should never ever be stored, instead you should always request the current one when you need it. Among other things the XWikiContext is not thread safe at all and is supposed to always be used in the Thread it's been created for. Here I have to apologize because we already had this discussion here, and you already suggested to use ProviderXWikiContext, but I completely forgot about it. I suggest that the component tutorial could be updated around this context stuff ? http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HTheXWikicontext I would propose to replace: If you still need to access the old XWiki context, then you can get a reference to it from the execution context, but you should not cast it to an XWikiContext, which would pull the whole xwiki-core as a dependency, but to a Map. You won't be able to access all the properties, like the current user name or the URL factory, but you can access anything placed in the internal map of the XWikiContext. By: If you still need to access the old XWiki context, then you can get a reference to it from an injected XWikiContext Provider, but you should not cast it to an XWikiContext, which would pull the whole xwiki-core as a dependency, but to a Map. You won't be able to access all the properties, like the current user name or the URL factory, but you can access anything placed in the internal map of the XWikiContext. And to replace the sample code by: /** Provides access to the XWiki context. Injected by the Component Manager. */ @Inject private ProviderXWikiContext xcontextProvider; [...] private void workWithTheContext() { MapObject, Object xwikiContext = (MapObject, Object) xcontextProvider.get(); // Do something with the XWiki context } By the way you should really use ProviderXWikiContext component instead. I will, thanks. Does it have a different/better behaviour or is just the preferred way ? ___ 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 -- Thomas Mortagne ___ 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] Components, context and subwikis
On Tue, May 13, 2014 at 9:04 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: 2014-05-13 19:10 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com: On Tue, May 13, 2014 at 6:29 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: 2014-05-13 17:53 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com: The ExecutionContext returned by execution.getContext(); comes from a ThreadLocal which means it's not a singleton associated to the main wiki but a new ExecutionContext generated for each http request. That is what I understood, but that means that for my component to operate on correct wiki (in correct context), it should reassign his own context member for each request - and not do it once at component initialization time. I'm not sure I understand, are you talking about storing the XWikiContext in your component instance at init ? Yes in fact it's what I did (the this.context = in my sample code). I realize that I didn't think about it so much when I did it :) The XWikiContext should never ever be stored, instead you should always request the current one when you need it. Among other things the XWikiContext is not thread safe at all and is supposed to always be used in the Thread it's been created for. Here I have to apologize because we already had this discussion here, and you already suggested to use ProviderXWikiContext, but I completely forgot about it. I suggest that the component tutorial could be updated around this context stuff ? http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HTheXWikicontext I would propose to replace: If you still need to access the old XWiki context, then you can get a reference to it from the execution context, but you should not cast it to an XWikiContext, which would pull the whole xwiki-core as a dependency, but to a Map. You won't be able to access all the properties, like the current user name or the URL factory, but you can access anything placed in the internal map of the XWikiContext. By: If you still need to access the old XWiki context, then you can get a reference to it from an injected XWikiContext Provider, but you should not cast it to an XWikiContext, which would pull the whole xwiki-core as a dependency, but to a Map. This is not going to be very easy since you have to know the XWikiContext class to use that Provider ;) You won't be able to access all the properties, like the current user name or the URL factory, but you can access anything placed in the internal map of the XWikiContext. And to replace the sample code by: /** Provides access to the XWiki context. Injected by the Component Manager. */ @Inject private ProviderXWikiContext xcontextProvider; [...] private void workWithTheContext() { MapObject, Object xwikiContext = (MapObject, Object) xcontextProvider.get(); // Do something with the XWiki context } By the way you should really use ProviderXWikiContext component instead. I will, thanks. Does it have a different/better behaviour or is just the preferred way ? ___ 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 -- Thomas Mortagne ___ 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 -- Thomas Mortagne ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Annotations
Hi Anca, My XWiki (www.wikiderm.de) is build up like a encyclopedia and consists of entry pages, which I'm using a custom class called EntryClass. The class object stores the entries title, letter and the actual entry text (entry), which is just plain XWiki 2.0 syntax enriched with custom style classes like (% class=Level-1 %) ... (% class=Level-2 %) ... including a custom image macro: {{zoombox Bilder=... /}}. Here is an example of how the entry text might look like: (% class=Ebene-1 %) (% class=Bullet %)-(%%) Mangel an Nikotinsäureamid (% class=Eintrag-2 %) (% class=Feature %)KL:(%%) lange schwarze Papillae filiformes {{zoombox Bilder=Klinik, Lingua villosa nigra.jpg Autoren=Sören Rabenhorst Institute=Hautärzte am Markt Orte=Dortmund /}} So, no HTML here, except for the macro, which of course renders to HTML. The EntrySheet for the EntryClass includes some script code via JSX and CSS via SSX and then just renders the entry class property via: {{velocity}}$xwiki.ssx.use(...)$xwiki.jsx.use(...)$doc.display(entry){{/velocity}} (This needs to be a one-liner, otherwise I get unwanted extra line-breaks in the rendered output) I've added an annotation at http://www.wikiderm.de/Kompendium/BCG-Vakzine, so you can check the improper rendering. :-) Annotations are not shown by default. The XWki 5.4.4 was installed from scratch, so no clutter from updating or scattered versions. Thank you for your help!! Michael 2014-05-13 13:37 GMT+02:00 Anca Luca lu...@xwiki.com: Hello Michael, there is a chance that this is a standard issue, but it also depends on what you're trying to do. The main limitation of the annotations is that they are not working on content rendered with the {{html}} macro, because they are rendered at the XDOM Level and the html macro is not parsed in the XDOM. So if your sheet does everything in a html macro, than chances are it won't work. If your sheet is rendering using the xwiki syntax, then stuff should work fine. Can you describe a bit more in detail your problem? or if you have an online server, show us there what's happening? is your sheet custom? can you show the code of your sheet? a screenshot of isn't rendering properly? Anca On Tue, May 13, 2014 at 8:38 AM, Michael Bußler michael.buss...@googlemail.com wrote: Hi there, I observed the Annotation-code in XWiki is having problems with the general approach of having a document-class rendered by a class-specific sheet. E.g. the highlighting of text passages isn't rendering properly. Is this a general limitation or am I doing something wrong with the classes' sheet? It's more or less a listing of textfields fed by class properties. Best, Michael ___ 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 -- Dipl.-Inf. Michael Bußler Forststr. 24 74379 Ingersheim Email: michael.buss...@googlemail.com Tel: +49 7142 70 92 309 Mobil: +49 176 219 55 940 Web: www.michael-bussler.de ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users