org.objectweb.jonas.webapp.jonasadmin.xml
Class ApplyArchiveConfigAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction
          extended by org.objectweb.jonas.webapp.jonasadmin.xml.ApplyArchiveConfigAction

public class ApplyArchiveConfigAction
extends JonasBaseAction

Action to process the input when either the advanced or the form view of the archive configuration feature is submitted. If the user selected the 'Apply' button the action validates and saves the updated deployment descriptor. If the user selected the 'Switch to Form/Advanced" the input is validated updated in the form and the user is forwarded to the other view.

Author:
Patrick Smith, Gregory Lapouchnian

Field Summary
 
Fields inherited from class org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction
DEPTH_DOMAIN, DEPTH_SERVER, m_Errors, m_Resources, m_Session, m_WhereAreYou
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ApplyArchiveConfigAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward executeAction(org.apache.struts.action.ActionMapping p_Mapping, org.apache.struts.action.ActionForm p_Form, javax.servlet.http.HttpServletRequest p_Request, javax.servlet.http.HttpServletResponse p_Response)
          Executes the struts action.
protected  java.lang.String getCurrentPageForward(ArchiveConfigForm form)
          Get the ActionForward name for the current page.
protected  java.lang.String getSwitchForward(ArchiveConfigForm form)
          Get the ActionForward name to switch views from the current page.
protected  org.apache.struts.action.ActionForward reportError(java.lang.String sForward, ArchiveConfigForm oForm, java.lang.String errorMessage, org.apache.struts.action.ActionMapping p_Mapping, javax.servlet.http.HttpServletRequest p_Request)
          Report an error and forward to the given JSP page.
protected  java.lang.String serializeDocument(org.w3c.dom.Document doc)
          Serialize a DOM tree into plaint text.
protected  void validateDocument(org.w3c.dom.Document doc, java.lang.String serverName)
          Validate the document using appropriate schemas.
 
Methods inherited from class org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction
addGlobalError, execute, getBooleanAttribute, getBooleanAttribute, getBooleanAttribute, getIntegerAttribute, getIntegerAttribute, getIntegerAttribute, getJonasBase, getListAttribute, getLongAttribute, getLongAttribute, getLongAttribute, getPropsFromString, getShortAttribute, getStringArrayAttribute, getStringAttribute, getStringAttribute, getStringAttribute, getTreeBranchName, initialize, refreshDomainDeployTree, refreshDomainMonitoringTree, refreshServerTree, removeChar, setBooleanAttribute, setBooleanAttribute, setIntegerAttribute, setIntegerAttribute, setIntegerAttribute, setLongAttribute, setLongAttribute, setShortAttribute, setStringAttribute, setStringAttribute, setStringAttribute, toStringBooleanAttribute, toStringIntegerAttribute, toStringLongAttribute, toStringShortAttribute
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplyArchiveConfigAction

public ApplyArchiveConfigAction()
Method Detail

executeAction

public org.apache.struts.action.ActionForward executeAction(org.apache.struts.action.ActionMapping p_Mapping,
                                                            org.apache.struts.action.ActionForm p_Form,
                                                            javax.servlet.http.HttpServletRequest p_Request,
                                                            javax.servlet.http.HttpServletResponse p_Response)
                                                     throws java.io.IOException,
                                                            javax.servlet.ServletException
Executes the struts action.

Specified by:
executeAction in class JonasBaseAction
Parameters:
p_Mapping - the struts action mapping.
p_Form - the struts action form.
p_Request - the HttpServletRequest.
p_Response - the HttpServletResponse.
Returns:
the action forward to forward to.
Throws:
java.io.IOException
javax.servlet.ServletException

getCurrentPageForward

protected java.lang.String getCurrentPageForward(ArchiveConfigForm form)
Get the ActionForward name for the current page.

Parameters:
form - Struts form
Returns:
ActionForward for the current page

getSwitchForward

protected java.lang.String getSwitchForward(ArchiveConfigForm form)
Get the ActionForward name to switch views from the current page.

Parameters:
form - Struts form
Returns:
ActionForward the user should be forwarded to if they are switching views

reportError

protected org.apache.struts.action.ActionForward reportError(java.lang.String sForward,
                                                             ArchiveConfigForm oForm,
                                                             java.lang.String errorMessage,
                                                             org.apache.struts.action.ActionMapping p_Mapping,
                                                             javax.servlet.http.HttpServletRequest p_Request)
Report an error and forward to the given JSP page.

Parameters:
sForward - what JSP page to forward to
oForm - the form bean
errorMessage - the message from the exception
p_Mapping -
p_Request -
Returns:
ActionForward found for the given forward string

serializeDocument

protected java.lang.String serializeDocument(org.w3c.dom.Document doc)
Serialize a DOM tree into plaint text.

Parameters:
doc - Document tree to convert
Returns:
a string representation of the DOM tree

validateDocument

protected void validateDocument(org.w3c.dom.Document doc,
                                java.lang.String serverName)
                         throws java.lang.Exception
Validate the document using appropriate schemas.

Parameters:
doc - the document that needs to be validated
Throws:
java.lang.Exception - an exception if the document is not valid