ActionModule

Version 7.1 by Vincent Massol on 2010/01/14 08:50
Warning
For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [dev:XWiki.DesignClassSheet]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

The need is to develop the Action module of the XWiki platform, i.e. the module that is the entry point for all UIs and in charge of calling the correct backend code to display what the user has asked for (it's the Controller in MVC terminology).

Requirements & Use cases

  • UC1: Actions should be able to be added without touching at the existing platform code (i.e. someone could write a new action in java and plug it in)
  • UC2: It should be possible to execute something before or after an Action's execution. Note that there could be different ways to implement this: As events, or as Actions you'd chain before or after existing actions, or both.
  • UC3: It should be possible to completely replace an Action with another implementation.
  • UC4: Int the future when we have the extension manager it should be possible to dynamically download an extension with Actions and register them dynamically.
  • UC5: Actions should not know about each other

Some examples matching those use cases:

  • When a browser supports gzip compression, the response should be passed through a discrete gzip Action component. However if the requested material is already compressed (images), it should not be gzip'd.
  • If the user is not logged in and the action they are requesting does not alter the database (Registration) the request should be passed to a cache Action. If the cache contains the desired page then it is returned, otherwise it is passed on to the requested action and when returned it is added to the cache.
  • If desired, a filter Action may catch requests depending on user agent, ip address etc. And reroute the request. Banned!

Current Situation

There's a start of an Action module. It has an Action, and an ActionManager. They are already written and are functional although the XWikiServlet which routes requests to the ActionManager is still not activated in the web.xml file.

Todo

  • Decide what Action framework to use: ours, Struts 2, Webwork, xwork, spring, etc.
  • Decide if we want pre/post Actions or instead use Observation events.
  • Actions would need to be ported out of the old core into their own components. It is important that the new Action model be in place so that newly added actions do not have to be ported as well.

Get Connected