Re: [xwiki-users] Automatic subpage creation for application items
Hi Moritz, On Mon, Apr 23, 2012 at 1:27 PM, Moritz Hesse (EA GmbH) <[email protected]> wrote:
Hi,
as I am new to XWiki I am trying to gain some inspiration and ideas how to successfully use it for our business purposes.
I have created an app (application within a minute) to organize and manage our projects. We have designed a structure of fix sub-wikipages, which we want to attach to every application item.
Example: let's say we have a project #123 and some metainformation like project leader etc. which is all organized in the application fields. And now we want some subpages like 1. project-todos, project-documentation, project-log etc.
What possible ways do exist to automatize the creation of the subpages, so that each time I create a project item in that app, all the predefined subpages will be created by the system.
I don't expect you to write me the complete solution. But I would really appreciate if you could just drop some buzzwords or some links, that point me the proper direction.
I know two ways to achieve what you want: (1) Use the observation module. You can write an event listener that is called each time a new document is created. See http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial for a tutorial on how to do this, and http://extensions.xwiki.org/xwiki/bin/view/Extension/Title+Post+Processing+U... as a simple example. (2) Customize the sheet used to create application entries/items. You can modify the HTML form to post to the same page and thus catch the save action and perform there additional stuff. This is a bit more complicated and has the downside that you won't be able to update the sheet when you edit the application (e.g. add new field) because you would loose your custom changes. If you don't know what a sheet is, see http://extensions.xwiki.org/xwiki/bin/view/Extension/Sheet+Module . If your application is named Foo, then on the FooClass page (which holds the application structure/fields) you'll find a link to the sheet. Hope this helps, Marius
Thanks in advance, best regards, Moritz
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Marius Dumitru Florea wrote
Hi Moritz,
(1) Use the observation module. You can write an event listener that is called each time a new document is created. See http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial for a tutorial on how to do this, and http://extensions.xwiki.org/xwiki/bin/view/Extension/Title+Post+Processing+U... as a simple example.
In a realty existing very big problem with this method. I should manually start event listener every time after restarting application server ... In a theory is possible to write a job in a scheduler, which will restart event listener every 10 minutes - I tried - but without success. In any case - it is a terrible solution - same as "patching patch" ... As a result - XWiki haven't easy and transparent possibility to "attach" additional actions to some internal actions (create, save, delete, etc). Methods exists, but all have some big minuses. -- Best regards Eugen Colesnicov -- View this message in context: http://xwiki.475771.n2.nabble.com/Automatic-subpage-creation-for-application... Sent from the XWiki- Users mailing list archive at Nabble.com.
On Thu, Apr 26, 2012 at 10:00 PM, Eugen Colesnicov <[email protected]> wrote:
Marius Dumitru Florea wrote
Hi Moritz,
(1) Use the observation module. You can write an event listener that is called each time a new document is created. See http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial for a tutorial on how to do this, and http://extensions.xwiki.org/xwiki/bin/view/Extension/Title+Post+Processing+U... as a simple example.
In a realty existing very big problem with this method. I should manually start event listener every time after restarting application server ... In a
You can of course write the listener in Java (it's a component) and drop the jar in WEB-INF/lib. You won't have to manually register the listener in this case.
theory is possible to write a job in a scheduler, which will restart event listener every 10 minutes - I tried - but without success. In any case - it is a terrible solution - same as "patching patch" ...
With http://dev.xwiki.org/xwiki/bin/view/Design/WikiComponents hopefully you'll be able to implement event listeners (which are components) and they will be detected automatically, even after restart, by the WikiComponentManager. Hope this helps, Marius
As a result - XWiki haven't easy and transparent possibility to "attach" additional actions to some internal actions (create, save, delete, etc). Methods exists, but all have some big minuses.
-- Best regards Eugen Colesnicov
-- View this message in context: http://xwiki.475771.n2.nabble.com/Automatic-subpage-creation-for-application... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Eugen Colesnicov -
Marius Dumitru Florea