org.apache.beehive.netui.compiler.model
Class StrutsApp

Object
  extended by StrutsElementSupport
      extended by StrutsApp
All Implemented Interfaces:
ExceptionContainer, ForwardContainer
Direct Known Subclasses:
GenStrutsApp

public class StrutsApp
extends StrutsElementSupport
implements ForwardContainer, ExceptionContainer


Nested Class Summary
protected static class StrutsApp.ActionMappingComparator
           
 
Field Summary
protected static String DEFAULT_VALIDATOR_RULES_URI
           
protected static String DUPLICATE_ACTION_COMMENT
           
protected static String PAGEFLOW_CONTROLLER_CONFIG_CLASSNAME
           
protected static String PAGEFLOW_REQUESTPROCESSOR_CLASSNAME
           
protected static String STRUTS_CONFIG_EXTENSION
           
protected static String STRUTS_CONFIG_PREFIX
           
protected static char STRUTS_CONFIG_SEPARATOR
           
protected static String STRUTSCONFIG_OUTPUT_DIR
           
protected static String VALIDATOR_PATHNAMES_PROPERTY
           
protected static String VALIDATOR_PLUG_IN_CLASSNAME
           
protected static String WEBINF_DIR_NAME
           
 
Constructor Summary
StrutsApp(String controllerClassName)
           
 
Method Summary
 void addActionMapping(ActionModel newActionMapping)
          Adds a new ActionMapping to this StrutsApp.
 void addException(ExceptionModel c)
          Implemented for ExceptionContainer.
 void addFormBean(FormBeanModel newFormBean)
          Adds a new form bean to this StrutsApp.
 void addForward(ForwardModel newActionForward)
          Implemented for ForwardContainer.
 void addMessageResources(MessageResourcesModel mr)
           
protected  ForwardDocument.Forward addNewForward(XmlObject xmlObject)
           
protected static void addSetProperty(ControllerDocument.Controller controller, String propName, String propValue)
           
protected  ActionModel createActionModel(ActionModel src, String newPath)
           
 void deleteActionMapping(ActionModel actionMapping)
          Deletes the given ActionModel.
 void deleteFormBean(FormBeanModel formBean)
          Delete the given form-bean.
 void deleteForward(ForwardModel forward)
           
 ForwardModel findForward(String forwardName)
           
 ActionModel[] getActionMappings()
          Returns all of the action mappings that are defined for this StrutsApp.
 List getActionMappingsAsList()
          Returns all of the action mappings that are defined for this StrutsApp as a list that is a clone of this StrutsApp's internal list.
protected  List getActionMappingsList()
           
 MessageResourcesModel getDefaultMessageResources()
          Get the MessageResourcesModel for which no "key" is set (the default one used at runtime).
protected  List getExceptionCatchesList()
           
 FormBeanModel getFormBean(String formBeanName)
           
 FormBeanModel getFormBeanByActualType(String actualTypeName)
           
 FormBeanModel[] getFormBeans()
          Returns all of the form beans that are defined for this StrutsApp.
 List getFormBeansAsList()
          Returns a list of all the form beans that are defined for this StrutsApp.
protected  Map getFormBeansMap()
           
 String getFormNameForType(String formType)
           
protected  String getFormQualifiedActionPath(ActionModel action)
           
 ForwardModel[] getForwards()
           
 List getForwardsAsList()
           
protected  String getHeaderComment(File mergeFile)
           
protected  List<MessageResourcesModel> getMessageResourcesList()
           
 String getMultipartHandlerClassName()
           
static String getOutputFileURI(String filePrefix, String containingPackage, boolean isSharedFlow)
           
protected static String getStrutsConfigURI(String containingPackage, boolean isSharedFlow)
           
static File getWebappRootFromJpf(File jpf)
           
 boolean isReturnToActionDisabled()
           
 boolean isReturnToPageDisabled()
           
protected static String makeFullyQualifiedBeanName(String formType)
           
protected  void setMultipartHandlerClassName(String multipartHandlerClassName)
           
 void setNestedPageFlow(boolean nestedPageFlow)
           
protected  void setSharedFlow(boolean sharedFlow)
           
protected  void setSharedFlowTypeNames(List<String> sharedFlowTypeNames)
           
 void setSingletonPageFlow(boolean singletonPageFlow)
           
 void setValidationModel(ValidationModel validationModel)
           
protected  void sortActionMappings()
           Remove duplicate action mappings.
protected  void writeControllerElement(StrutsConfigDocument.StrutsConfig scElement)
           
 void writeForwards(ForwardDocument.Forward[] existingForwards, XmlObject xmlForwardContainer)
           
protected  void writeValidatorInit(StrutsConfigDocument.StrutsConfig scElement)
           
 void writeXml(PrintStream outputStream, File mergeFile, File webappRoot)
           
 
Methods inherited from class StrutsElementSupport
addComment, getAttr, getAttrBool, getClassName, getComment, getDescription, getDisplayName, getIcon, getParentApp, getProperty, setClassName, setComment, setDescription, setDisplayName, setIcon, setParentApp, setProperty
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ForwardContainer
addForward, findForward
 

Field Detail

DUPLICATE_ACTION_COMMENT

protected static final String DUPLICATE_ACTION_COMMENT
See Also:
Constant Field Values

PAGEFLOW_REQUESTPROCESSOR_CLASSNAME

protected static final String PAGEFLOW_REQUESTPROCESSOR_CLASSNAME
See Also:
Constant Field Values

PAGEFLOW_CONTROLLER_CONFIG_CLASSNAME

protected static final String PAGEFLOW_CONTROLLER_CONFIG_CLASSNAME
See Also:
Constant Field Values

STRUTS_CONFIG_PREFIX

protected static final String STRUTS_CONFIG_PREFIX
See Also:
Constant Field Values

STRUTS_CONFIG_EXTENSION

protected static final String STRUTS_CONFIG_EXTENSION
See Also:
Constant Field Values

STRUTS_CONFIG_SEPARATOR

protected static final char STRUTS_CONFIG_SEPARATOR
See Also:
Constant Field Values

WEBINF_DIR_NAME

protected static final String WEBINF_DIR_NAME
See Also:
Constant Field Values

STRUTSCONFIG_OUTPUT_DIR

protected static final String STRUTSCONFIG_OUTPUT_DIR
See Also:
Constant Field Values

VALIDATOR_PLUG_IN_CLASSNAME

protected static final String VALIDATOR_PLUG_IN_CLASSNAME
See Also:
Constant Field Values

VALIDATOR_PATHNAMES_PROPERTY

protected static final String VALIDATOR_PATHNAMES_PROPERTY
See Also:
Constant Field Values

DEFAULT_VALIDATOR_RULES_URI

protected static final String DEFAULT_VALIDATOR_RULES_URI
See Also:
Constant Field Values
Constructor Detail

StrutsApp

public StrutsApp(String controllerClassName)
Method Detail

getActionMappings

public ActionModel[] getActionMappings()
Returns all of the action mappings that are defined for this StrutsApp.


getActionMappingsAsList

public List getActionMappingsAsList()
Returns all of the action mappings that are defined for this StrutsApp as a list that is a clone of this StrutsApp's internal list.


addMessageResources

public void addMessageResources(MessageResourcesModel mr)

addActionMapping

public void addActionMapping(ActionModel newActionMapping)
Adds a new ActionMapping to this StrutsApp.


createActionModel

protected ActionModel createActionModel(ActionModel src,
                                        String newPath)

getFormQualifiedActionPath

protected String getFormQualifiedActionPath(ActionModel action)

deleteActionMapping

public void deleteActionMapping(ActionModel actionMapping)
Deletes the given ActionModel.


addException

public void addException(ExceptionModel c)
Implemented for ExceptionContainer.

Specified by:
addException in interface ExceptionContainer

getFormBeans

public FormBeanModel[] getFormBeans()
Returns all of the form beans that are defined for this StrutsApp.


getFormBeansAsList

public List getFormBeansAsList()
Returns a list of all the form beans that are defined for this StrutsApp.


getFormBean

public FormBeanModel getFormBean(String formBeanName)

getFormBeanByActualType

public FormBeanModel getFormBeanByActualType(String actualTypeName)

addFormBean

public void addFormBean(FormBeanModel newFormBean)
Adds a new form bean to this StrutsApp.


deleteFormBean

public void deleteFormBean(FormBeanModel formBean)
Delete the given form-bean.


getWebappRootFromJpf

public static File getWebappRootFromJpf(File jpf)
                                 throws NoWebInfDirectoryException
Throws:
NoWebInfDirectoryException

getFormNameForType

public String getFormNameForType(String formType)

makeFullyQualifiedBeanName

protected static String makeFullyQualifiedBeanName(String formType)

sortActionMappings

protected void sortActionMappings()
  1. Remove duplicate action mappings.
  2. For action mappings that have the same pahts (but have different forms), add a comment.
  3. Sort the action mappings by path name.


addNewForward

protected ForwardDocument.Forward addNewForward(XmlObject xmlObject)

getFormBeansMap

protected Map getFormBeansMap()

getExceptionCatchesList

protected List getExceptionCatchesList()

getActionMappingsList

protected List getActionMappingsList()

getMessageResourcesList

protected List<MessageResourcesModel> getMessageResourcesList()

getDefaultMessageResources

public MessageResourcesModel getDefaultMessageResources()
Get the MessageResourcesModel for which no "key" is set (the default one used at runtime).


isReturnToPageDisabled

public boolean isReturnToPageDisabled()

isReturnToActionDisabled

public boolean isReturnToActionDisabled()

setValidationModel

public void setValidationModel(ValidationModel validationModel)

writeXml

public void writeXml(PrintStream outputStream,
                     File mergeFile,
                     File webappRoot)
              throws IOException,
                     XmlException,
                     NoWebInfDirectoryException
Throws:
IOException
XmlException
NoWebInfDirectoryException

writeControllerElement

protected void writeControllerElement(StrutsConfigDocument.StrutsConfig scElement)

addSetProperty

protected static void addSetProperty(ControllerDocument.Controller controller,
                                     String propName,
                                     String propValue)

writeValidatorInit

protected void writeValidatorInit(StrutsConfigDocument.StrutsConfig scElement)

getHeaderComment

protected String getHeaderComment(File mergeFile)

setNestedPageFlow

public void setNestedPageFlow(boolean nestedPageFlow)

setSingletonPageFlow

public void setSingletonPageFlow(boolean singletonPageFlow)

getStrutsConfigURI

protected static String getStrutsConfigURI(String containingPackage,
                                           boolean isSharedFlow)

getOutputFileURI

public static String getOutputFileURI(String filePrefix,
                                      String containingPackage,
                                      boolean isSharedFlow)

setSharedFlow

protected void setSharedFlow(boolean sharedFlow)

setSharedFlowTypeNames

protected void setSharedFlowTypeNames(List<String> sharedFlowTypeNames)

getMultipartHandlerClassName

public String getMultipartHandlerClassName()

setMultipartHandlerClassName

protected void setMultipartHandlerClassName(String multipartHandlerClassName)

addForward

public void addForward(ForwardModel newActionForward)
Implemented for ForwardContainer.

Specified by:
addForward in interface ForwardContainer

findForward

public ForwardModel findForward(String forwardName)
Specified by:
findForward in interface ForwardContainer

writeForwards

public void writeForwards(ForwardDocument.Forward[] existingForwards,
                          XmlObject xmlForwardContainer)

getForwards

public ForwardModel[] getForwards()

getForwardsAsList

public List getForwardsAsList()

deleteForward

public void deleteForward(ForwardModel forward)