[xwiki-users] How to inject some velocity or groovy code into my 'app within minutes' template?
Hi, I'm a real novice, so please forgive my question if it is trivial. I've created a simple app with App Within Minutes, and I'd like to customise it a little. For example I have a boolean checkbox and a user selector with the app, which I'd like to be disabled (uneditable) for all users except my manager. So that only the manager can edit the assigned users to a 'task' and mark the task as complete. I'd also like a second user selector to default to the currently logged in user. I've spent a few days googling the problem, and I've come across information in the xwiki mailing archive etc which makes me think that it is possible to run checks against the current user using velocity or groovy scripts embedded in one of the app sheets and modify the respective elements. But I don't really understand how. Can this actually be done? Can anyone direct me to a resource that would clear this up for me? Or give me an example code snippet and simple directions for its implementation i.e. what sheet they should be inserted into? A real idiot's guide I'd really appreciate any help you could give me, Thanks Danny
Hi Danny, I suggest you start by reading http://extensions.xwiki.org/xwiki/bin/view/Extension/App+Within+Minutes+Appl... , in case you haven't done it already. Hope this helps, Marius On Wed, Jan 13, 2016 at 1:11 PM, Danny Sharpe <[email protected]> wrote:
Hi,
I'm a real novice, so please forgive my question if it is trivial.
I've created a simple app with App Within Minutes, and I'd like to customise it a little. For example I have a boolean checkbox and a user selector with the app, which I'd like to be disabled (uneditable) for all users except my manager. So that only the manager can edit the assigned users to a 'task' and mark the task as complete. I'd also like a second user selector to default to the currently logged in user.
I've spent a few days googling the problem, and I've come across information in the xwiki mailing archive etc which makes me think that it is possible to run checks against the current user using velocity or groovy scripts embedded in one of the app sheets and modify the respective elements. But I don't really understand how.
Can this actually be done?
Can anyone direct me to a resource that would clear this up for me? Or give me an example code snippet and simple directions for its implementation i.e. what sheet they should be inserted into? A real idiot's guide
I'd really appreciate any help you could give me,
Thanks
Danny _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Marius, Thanks for the speedy reply :) I had read that page, but having re-read it today I made a modicum of progress. I'm still not sure how to disable and set defaults to the template when creating a new page/object within my app, but I did figure out how to edit values of the pages after creation using scripts. I suppose it's a step in the right direction. I guess I'll just have to keep reading and experimenting :( Thanks Danny -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-inject-some-velocity-or-groovy-code... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Marius, Sorry to ask again, but I'm quite lost. Is there any additional resources you could recommend? Or is there any apps that you know of which currently perform this type of behaviour, that I might examine their structure and code for help? Thanks Danny -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-inject-some-velocity-or-groovy-code... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Danny, To make a dropdown in Bootstrap, see this page: http://getbootstrap.com/components/#dropdowns To make a list of pages in XWiki, see this page: http://extensions.xwiki.org/xwiki/bin/view/Extension/List+All+Documents+In+A... Combine these two and you have a nice page viewing widget! Yours codingly, Jan-Paul Op 14-1-2016 om 13:57 schreef DannyS:
Hi Marius,
Sorry to ask again, but I'm quite lost.
Is there any additional resources you could recommend? Or is there any apps that you know of which currently perform this type of behaviour, that I might examine their structure and code for help?
Thanks
Danny
-- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-inject-some-velocity-or-groovy-code... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (4)
-
Danny Sharpe -
DannyS -
Jan-Paul Kleijn -
Marius Dumitru Florea