Class AbstractSchemEditAction

java.lang.Object
org.apache.struts.action.Action
org.dlese.dpc.schemedit.action.DCSAction
org.dlese.dpc.schemedit.action.AbstractSchemEditAction
Direct Known Subclasses:
DCSSchemEditAction, StandAloneSchemEditAction

public abstract class AbstractSchemEditAction extends DCSAction
Abstract controller for Metadata Editors.
Author:
ostwald
  • Field Details

    • debug

      protected static boolean debug
      Description of the Field
    • firstPage

      protected String firstPage
      where to go when the user clicks "edit"
    • homePage

      protected String homePage
      Description of the Field
    • xmlFormat

      protected String xmlFormat
      NOT YET DOCUMENTED
  • Constructor Details

    • AbstractSchemEditAction

      public AbstractSchemEditAction()
  • Method Details

    • getXmlFormat

      protected abstract String getXmlFormat()
      Gets the xmlFormat attribute of the AbstractSchemEditAction object, which identifies the MetaDataFramework of the record being edited.
      Returns:
      The xmlFormat value
    • getMetaDataFramework

      protected MetaDataFramework getMetaDataFramework()
      Gets the metaDataFramework attribute of the record being edited.
      Returns:
      The metaDataFramework value
    • getValidator

      protected SchemEditValidator getValidator(org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping, HttpServletRequest request)
      Gets the validator attribute of the AbstractSchemEditAction object
      Parameters:
      form - NOT YET DOCUMENTED
      mapping - NOT YET DOCUMENTED
      request - NOT YET DOCUMENTED
      Returns:
      The validator value
    • putRecord

      protected abstract void putRecord(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request) throws Exception
      Abstract call to save record.
      Parameters:
      mapping - Description of the Parameter
      form - Description of the Parameter
      request - Description of the Parameter
      Throws:
      Exception - Description of the Exception
    • execute

      public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
      Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP that will create it. Returns an ActionForward instance that maps to the Struts forwarding name "xxx.xxx," which must be configured in struts-config.xml to forward to the JSP page that will handle the request.
      Overrides:
      execute in class org.apache.struts.action.Action
      Parameters:
      mapping - Description of the Parameter
      form - Description of the Parameter
      request - Description of the Parameter
      response - Description of the Parameter
      Returns:
      Description of the Return Value
      Throws:
      IOException - Description of the Exception
      ServletException - Description of the Exception
    • uniqueValueCheck

      protected org.apache.struts.action.ActionErrors uniqueValueCheck(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator)
      Checks each field in the instance document associated with a configured "uniqueValue" path for duplicate values in the same field in other records in the collection.
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      validator - the validator for this form
      Returns:
      errors resulting from uniqueValueCheck
    • uniqueUrlCheck

      protected org.apache.struts.action.ActionErrors uniqueUrlCheck(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request)
      Check values of schemapaths designated as "uniqueUrl"s for duplicate or similiar values within given collection. Called before executing "save" and "changeForm" commands
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      Returns:
      errors resulting from uniqueUrlCheck
    • isDocDirty

      protected org.apache.struts.action.ActionForward isDocDirty(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) throws ServletException
      Check to see if the document has been modified in editor. If so, return control to editor and prompt user to save.
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      validator - Description of the Parameter
      Returns:
      Description of the Return Value
      Throws:
      ServletException - NOT YET DOCUMENTED
    • handleGuardedExit

      protected org.apache.struts.action.ActionForward handleGuardedExit(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) throws ServletException
      Check to see if the document has been modified in editor. If so, return control to editor and prompt user to save.
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      validator - Description of the Parameter
      Returns:
      Description of the Return Value
      Throws:
      ServletException - NOT YET DOCUMENTED
    • handleExitCommand

      protected org.apache.struts.action.ActionForward handleExitCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) throws ServletException
      Throws:
      ServletException
    • handleTimedOutGuardedExit

      protected org.apache.struts.action.ActionForward handleTimedOutGuardedExit(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request) throws ServletException
      NOT YET DOCUMENTED
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      Returns:
      NOT YET DOCUMENTED
      Throws:
      ServletException - NOT YET DOCUMENTED
    • getEditorMapping

      protected org.apache.struts.action.ActionForward getEditorMapping(org.apache.struts.action.ActionMapping mapping)
      Determines the appropriate editor mapping depending on whether the editor is configured to use a frame-based display.
      Parameters:
      mapping - Description of the Parameter
      Returns:
      The editorMapping value
    • handleMissingLockException

      protected org.apache.struts.action.ActionForward handleMissingLockException(MissingLockException mle, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException
      NOT YET DOCUMENTED
      Parameters:
      mle - the missingLockException we are handling
      mapping - the actionMapping
      form - the actionForm
      request - the request
      response - NOT YET DOCUMENTED
      Returns:
      NOT YET DOCUMENTED
      Throws:
      ServletException - NOT YET DOCUMENTED
    • handleDeleteElement

      protected org.apache.struts.action.ActionForward handleDeleteElement(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) throws ServletException
      A hook for extensions of AbstractSchemEditAction to handle misc unanticipated requests.
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      validator - NOT YET DOCUMENTED
      Returns:
      Description of the Return Value
      Throws:
      ServletException - Description of the Exception
    • handleOtherCommands

      protected org.apache.struts.action.ActionForward handleOtherCommands(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException, MissingLockException
      A hook for extensions of AbstractSchemEditAction to handle misc unanticipated requests.
      Parameters:
      mapping - the actionMapping
      form - the actionForm
      request - the request
      response - Description of the Parameter
      Returns:
      Description of the Return Value
      Throws:
      ServletException - Description of the Exception
      MissingLockException - NOT YET DOCUMENTED
    • handleMissingCommand

      protected abstract org.apache.struts.action.ActionForward handleMissingCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException
      Handle the case where the request contains a command that is not processed by this Class by calling the "handleMissingCommand" method of a subclass.
      Parameters:
      mapping - the ActionMapping
      form - the ActionForm
      request - the Request
      response - the Response
      Returns:
      Description of the Return Value
      Throws:
      ServletException - If the subclass does not handle the command
    • handleEditRequest

      protected abstract org.apache.struts.action.ActionForward handleEditRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException
      Loads a record into the MetaDataEditor
      Parameters:
      mapping - the ActionMapping
      form - the ActionForm
      request - the Request
      response - the Response
      Returns:
      Description of the Return Value
      Throws:
      ServletException - Description of the Exception
    • handleCancelRequest

      protected abstract org.apache.struts.action.ActionForward handleCancelRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException
      Cancels editing of current metadata record.
      Parameters:
      mapping - the ActionMapping
      form - the ActionForm
      request - the Request
      response - the Response
      Returns:
      NOT YET DOCUMENTED
      Throws:
      ServletException - NOT YET DOCUMENTED
    • handleNewRecordRequest

      protected abstract org.apache.struts.action.ActionForward handleNewRecordRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException
      Description of the Method
      Parameters:
      mapping - the ActionMapping
      form - the ActionForm
      request - the Request
      response - the Response
      Returns:
      Description of the Return Value
      Throws:
      ServletException - Description of the Exception
    • handleSaveRequest

      protected abstract org.apache.struts.action.ActionForward handleSaveRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response, SchemEditValidator validator) throws ServletException, MissingLockException
      Description of the Method
      Parameters:
      mapping - the ActionMapping
      form - the ActionForm
      request - the Request
      response - the Response
      validator - Description of the Parameter
      Returns:
      Description of the Return Value
      Throws:
      ServletException - Description of the Exception
      MissingLockException - Description of the Exception
    • attachNewElement

      protected void attachNewElement(String pathArg, SchemEditForm sef, SchemaHelper schemaHelper) throws Exception
      Create a new element and attach it to the instance document
      Parameters:
      pathArg - path of element to be attached
      sef - the form bean
      schemaHelper - the schemaHelper
      Throws:
      Exception - if new element could not be created and attached
    • prtln

      protected void prtln(String s)
      Print a line to standard out.
      Parameters:
      s - The String to print.
    • prtlnErr

      protected void prtlnErr(String s)