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 DUPLICATE_ACTION_COMMENT
           
protected static String NETUI_VALIDATOR_RULES_URI
           
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 STRUTS_VALIDATOR_RULES_URI
           
protected static String STRUTSCONFIG_OUTPUT_DIR
           
protected static String TILES_DEFINITIONS_CONFIG_PROPERTY
           
protected static String TILES_MODULE_AWARE_PROPERTY
           
protected static String TILES_PLUG_IN_CLASSNAME
           
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 mapping)
          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)
           
 void deleteFormBean(FormBeanModel formBean)
          Delete the given form-bean.
 void deleteForward(ForwardModel forward)
           
 ForwardModel findForward(String forwardName)
           
 String getBeanType(ActionModel actionMapping)
           
 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, boolean usesPageFlowScopedFormBean)
           
 FormBeanModel[] getFormBeans()
          Returns all of the form beans that are defined for this StrutsApp.
 List<FormBeanModel> getFormBeansAsList()
          Returns a list of all the form beans that are defined for this StrutsApp.
protected  Map getFormBeansMap()
           
 String getFormNameForType(String formType, boolean isPageFlowScoped)
           
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  List<ActionModel> getSortedActionMappings()
           
protected static String getStrutsConfigURI(String containingPackage, boolean isSharedFlow)
           
static File getWebappRootFromJpf(File jpf)
           
 boolean isReturnToActionDisabled()
           
 boolean isReturnToPageDisabled()
           
protected  boolean isSharedFlow()
           
protected static String makeFullyQualifiedBeanName(String formType)
           
 void setAdditionalValidatorConfigs(List<String> additionalValidatorConfigs)
           
 void setLongLivedPageFlow(boolean longLivedPageFlow)
           
protected  void setMultipartHandlerClassName(String multipartHandlerClassName)
           
 void setNestedPageFlow(boolean nestedPageFlow)
           
 void setReturnToActionDisabled(boolean disabled)
           
 void setReturnToPageDisabled(boolean disabled)
           
protected  void setSharedFlow(boolean sharedFlow)
           
protected  void setSharedFlows(Map<String,String> sharedFlows)
           
 void setTilesDefinitionsConfigs(List<String> tilesDefinitionsConfigs)
           
 void setValidationModel(ValidationModel validationModel)
           
protected  void writeControllerElement(StrutsConfigDocument.StrutsConfig scElement)
           
 void writeForwards(ForwardDocument.Forward[] existingForwards, XmlObject xmlForwardContainer)
           
protected  void writeTilesInit(StrutsConfigDocument.StrutsConfig scElement)
           
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

TILES_PLUG_IN_CLASSNAME

protected static final String TILES_PLUG_IN_CLASSNAME
See Also:
Constant Field Values

TILES_DEFINITIONS_CONFIG_PROPERTY

protected static final String TILES_DEFINITIONS_CONFIG_PROPERTY
See Also:
Constant Field Values

TILES_MODULE_AWARE_PROPERTY

protected static final String TILES_MODULE_AWARE_PROPERTY
See Also:
Constant Field Values

NETUI_VALIDATOR_RULES_URI

protected static final String NETUI_VALIDATOR_RULES_URI
See Also:
Constant Field Values

STRUTS_VALIDATOR_RULES_URI

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

StrutsApp

public StrutsApp(String controllerClassName)
Method Detail

addMessageResources

public void addMessageResources(MessageResourcesModel mr)

addActionMapping

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


getBeanType

public String getBeanType(ActionModel actionMapping)

getFormQualifiedActionPath

protected String getFormQualifiedActionPath(ActionModel action)

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<FormBeanModel> 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,
                                             boolean usesPageFlowScopedFormBean)

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,
                                 boolean isPageFlowScoped)

makeFullyQualifiedBeanName

protected static String makeFullyQualifiedBeanName(String formType)

addNewForward

protected ForwardDocument.Forward addNewForward(XmlObject xmlObject)

getFormBeansMap

protected Map getFormBeansMap()

getExceptionCatchesList

protected List getExceptionCatchesList()

getSortedActionMappings

protected List<ActionModel> getSortedActionMappings()

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()

setReturnToPageDisabled

public void setReturnToPageDisabled(boolean disabled)

setReturnToActionDisabled

public void setReturnToActionDisabled(boolean disabled)

setAdditionalValidatorConfigs

public void setAdditionalValidatorConfigs(List<String> additionalValidatorConfigs)

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)

writeTilesInit

protected void writeTilesInit(StrutsConfigDocument.StrutsConfig scElement)

getHeaderComment

protected String getHeaderComment(File mergeFile)

setNestedPageFlow

public void setNestedPageFlow(boolean nestedPageFlow)

setLongLivedPageFlow

public void setLongLivedPageFlow(boolean longLivedPageFlow)

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)

setSharedFlows

protected void setSharedFlows(Map<String,String> sharedFlows)

getMultipartHandlerClassName

public String getMultipartHandlerClassName()

setMultipartHandlerClassName

protected void setMultipartHandlerClassName(String multipartHandlerClassName)

setTilesDefinitionsConfigs

public void setTilesDefinitionsConfigs(List<String> tilesDefinitionsConfigs)

isSharedFlow

protected boolean isSharedFlow()

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)