de.matthias_burbach.flux
Class PageActionMappingGenerator

java.lang.Object
  extended byde.matthias_burbach.flux.AbstractActionMappingGenerator
      extended byde.matthias_burbach.flux.PageActionMappingGenerator
All Implemented Interfaces:
ActionMappingGenerator

public class PageActionMappingGenerator
extends AbstractActionMappingGenerator

Generates one action mapping for each UML state with stereotype 'Page' that forwards from the logical page name to the physical (JSP) name.

Author:
Matthias Burbach

Field Summary
 
Fields inherited from class de.matthias_burbach.flux.AbstractActionMappingGenerator
settings
 
Constructor Summary
PageActionMappingGenerator()
           
 
Method Summary
 void begin(StateMachine stateMachine, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement)
          Introduces the <action> elements generated by this generator with the comment <--Page States-->.
 void generate(StateMachine stateMachine, State state, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement)
          Generates one <action> element per call.
protected  void generatePageActionMapping(StateMachine stateMachine, State state, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement)
          Generates one <action> element per call.
protected  boolean generatePagePreprocessings()
           
protected  void generatePageVariationActionMapping(StateMachine stateMachine, State state, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement)
          Generates an <action> element that routes from the actual logical page and the current value of the mode variable to the modified logical page that is created as the concatenation of the mode value and the actual logical page name.
protected  java.lang.String getBasePathExtension(State state)
          The base path extension may suffix the base path to make a full path of an <action> or <forward> element.
protected  java.lang.String getForwardToPhysicalPage(State state)
          Derives the default forward path to the physical page resource (JSP) that implements the state of stereotype 'Page'.
 
Methods inherited from class de.matthias_burbach.flux.AbstractActionMappingGenerator
end, generateForward, generateForward, generateForwards, generateProperty, getActionMappingElementForPath, getBasePath, getDefaultName, getDefaultPackage, getDefaultType, getForwardElementForName, getForwardPath, getForwardPathPrefix, getForwardPathSuffix, getNamePartOfBasePath, setSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageActionMappingGenerator

public PageActionMappingGenerator()
Method Detail

begin

public void begin(StateMachine stateMachine,
                  org.jdom.Document oldDocument,
                  org.jdom.Element oldActionMappingsElement,
                  org.jdom.Document newDocument,
                  org.jdom.Element newActionMappingsElement)
           throws java.lang.Exception
Introduces the <action> elements generated by this generator with the comment <--Page States-->.

Specified by:
begin in interface ActionMappingGenerator
Overrides:
begin in class AbstractActionMappingGenerator
Throws:
java.lang.Exception

generate

public void generate(StateMachine stateMachine,
                     State state,
                     org.jdom.Document oldDocument,
                     org.jdom.Element oldActionMappingsElement,
                     org.jdom.Document newDocument,
                     org.jdom.Element newActionMappingsElement)
              throws java.lang.Exception
Generates one <action> element per call. The generated path attribute follows the pattern '/Page.%NAME%.display'.

Preserves all attributes from the previous version of the element except the disallowed type and include attributes.

Generates no nested <forward> elements and preserves all child elements except the disallowed <forward> elements (like <set-property>, e. g.) from the previous version.

Specified by:
generate in interface ActionMappingGenerator
Overrides:
generate in class AbstractActionMappingGenerator
Throws:
java.lang.Exception

generatePageVariationActionMapping

protected void generatePageVariationActionMapping(StateMachine stateMachine,
                                                  State state,
                                                  org.jdom.Document oldDocument,
                                                  org.jdom.Element oldActionMappingsElement,
                                                  org.jdom.Document newDocument,
                                                  org.jdom.Element newActionMappingsElement)
                                           throws java.lang.Exception
Generates an <action> element that routes from the actual logical page and the current value of the mode variable to the modified logical page that is created as the concatenation of the mode value and the actual logical page name.

Preserves all attributes from the previous version of the element except the disallowed path, type, parameter, forward, include and input attributes.

Generates no nested <forward> elements and preserves all child elements except the disallowed <forward> elements (like <set-property>, e. g.) from the previous version.

Throws:
java.lang.Exception

generatePageActionMapping

protected void generatePageActionMapping(StateMachine stateMachine,
                                         State state,
                                         org.jdom.Document oldDocument,
                                         org.jdom.Element oldActionMappingsElement,
                                         org.jdom.Document newDocument,
                                         org.jdom.Element newActionMappingsElement)
                                  throws java.lang.Exception
Generates one <action> element per call. The generated path attribute follows the pattern '/Page.%NAME%.display'.

If in 'double step display' mode, the literal 'doDisplay' is used instead of 'display'.

Preserves all attributes from the previous version of the element except the disallowed type and include attributes.

Generates no nested <forward> elements and preserves all child elements except the disallowed <forward> elements (like <set-property>, e. g.) from the previous version.

Throws:
java.lang.Exception

getForwardToPhysicalPage

protected java.lang.String getForwardToPhysicalPage(State state)
Derives the default forward path to the physical page resource (JSP) that implements the state of stereotype 'Page'.

Parameters:
state - the state to derive the physical forward path from
Returns:
the path to the physical page resource (JSP)

getBasePathExtension

protected java.lang.String getBasePathExtension(State state)
Description copied from class: AbstractActionMappingGenerator
The base path extension may suffix the base path to make a full path of an <action> or <forward> element.

Overrides:
getBasePathExtension in class AbstractActionMappingGenerator
Parameters:
state - the state the extension is to be derived from
Returns:
the default base path extension ('.enter' for modules, '.display' for pages and '' else)

generatePagePreprocessings

protected boolean generatePagePreprocessings()