Working with actions

Actions are represented by NodeAction class in object model.

Actions are used to perform some actions on web application. They are usually associated with views.

Implementing new actions

Adding a new action is performed by the following steps:

  • Implementing ActionManager
  • Modifying/Adding XSLT filters to handle the new specific action type
  • Adding new LinkManager(s) to handle incoming and outgoing links on your action.

ActionManager

See extension point for ActionManager to add your own classes.

ActionManager must implement a few methods:

  • a method to create a new specific action of the given type (do not forget to set mgrId on the created action),
  • a method to delete a node of the given action type,
  • a method to copy an action to another package, or to the same package (need to rename automatically target action),
  • a method to edit action properties (using plugin view, in ProjectContext.getNodePropertiesView),
  • methods so serialize/deserialize action on XML project file,
  • a method to adapt node in target classes (such as UrlManager),
  • a method to obtain the node icon.

Manager is responsible of firing change events on project.

Xslt filters

You will have to either modify or add new XSLT filters. These filters will for example generate a struts.xml file with your newly created action type.

LinkManagers

Declare link-managers on extension point .

LinkManagers are responsible of creating links from and to your newly created action.

Create at least one LinkManager to handle links from your action. Then create LinkManager to handle links from existing other node types to your action, or implement UrlManager for your actions to use existing LinkManagers (example: Jsp views are able to manage links to any UrlManager node).