Package org.dlese.dpc.schemedit.action
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
Abstract controller for Metadata Editors.
- Author:
- ostwald
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanDescription of the Fieldprotected Stringwhere to go when the user clicks "edit"protected StringDescription of the Fieldprotected StringNOT YET DOCUMENTEDFields inherited from class org.dlese.dpc.schemedit.action.DCSAction
accessManager, collectionRegistry, dcsDataManager, frameworkRegistry, ndrServiceEnabled, repositoryManager, repositoryService, requiredRole, sessionRegistry, userManagerFields inherited from class org.apache.struts.action.Action
defaultLocale, servlet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattachNewElement(String pathArg, SchemEditForm sef, SchemaHelper schemaHelper) Create a new element and attach it to the instance documentorg.apache.struts.action.ActionForwardexecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP that will create it.protected org.apache.struts.action.ActionForwardgetEditorMapping(org.apache.struts.action.ActionMapping mapping) Determines the appropriate editor mapping depending on whether the editor is configured to use a frame-based display.protected MetaDataFrameworkGets the metaDataFramework attribute of the record being edited.protected SchemEditValidatorgetValidator(org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping, HttpServletRequest request) Gets the validator attribute of the AbstractSchemEditAction objectprotected abstract StringGets the xmlFormat attribute of the AbstractSchemEditAction object, which identifies the MetaDataFramework of the record being edited.protected abstract org.apache.struts.action.ActionForwardhandleCancelRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Cancels editing of current metadata record.protected org.apache.struts.action.ActionForwardhandleDeleteElement(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) A hook for extensions of AbstractSchemEditAction to handle misc unanticipated requests.protected abstract org.apache.struts.action.ActionForwardhandleEditRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Loads a record into the MetaDataEditorprotected org.apache.struts.action.ActionForwardhandleExitCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) protected org.apache.struts.action.ActionForwardhandleGuardedExit(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) Check to see if the document has been modified in editor.protected abstract org.apache.struts.action.ActionForwardhandleMissingCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Handle the case where the request contains a command that is not processed by this Class by calling the "handleMissingCommand" method of a subclass.protected org.apache.struts.action.ActionForwardhandleMissingLockException(MissingLockException mle, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) NOT YET DOCUMENTEDprotected abstract org.apache.struts.action.ActionForwardhandleNewRecordRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Description of the Methodprotected org.apache.struts.action.ActionForwardhandleOtherCommands(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) A hook for extensions of AbstractSchemEditAction to handle misc unanticipated requests.protected abstract org.apache.struts.action.ActionForwardhandleSaveRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response, SchemEditValidator validator) Description of the Methodprotected org.apache.struts.action.ActionForwardhandleTimedOutGuardedExit(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request) NOT YET DOCUMENTEDprotected org.apache.struts.action.ActionForwardisDocDirty(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemEditValidator validator) Check to see if the document has been modified in editor.protected voidPrint a line to standard out.protected voidprotected abstract voidputRecord(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request) Abstract call to save record.protected org.apache.struts.action.ActionErrorsuniqueUrlCheck(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.protected org.apache.struts.action.ActionErrorsuniqueValueCheck(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.Methods inherited from class org.dlese.dpc.schemedit.action.DCSAction
getMetaDataFramework, getRequiredContextAttributeValue, getSessionBean, getSessionUser, getSessionUser, getSessionUserName, initializeFromContextMethods 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
-
Field Details
-
debug
protected static boolean debugDescription of the Field -
firstPage
where to go when the user clicks "edit" -
homePage
Description of the Field -
xmlFormat
NOT YET DOCUMENTED
-
-
Constructor Details
-
AbstractSchemEditAction
public AbstractSchemEditAction()
-
-
Method Details
-
getXmlFormat
Gets the xmlFormat attribute of the AbstractSchemEditAction object, which identifies the MetaDataFramework of the record being edited.- Returns:
- The xmlFormat value
-
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 DOCUMENTEDmapping- NOT YET DOCUMENTEDrequest- 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 Parameterform- Description of the Parameterrequest- 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 anActionForwardinstance 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:
executein classorg.apache.struts.action.Action- Parameters:
mapping- Description of the Parameterform- Description of the Parameterrequest- Description of the Parameterresponse- Description of the Parameter- Returns:
- Description of the Return Value
- Throws:
IOException- Description of the ExceptionServletException- 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 actionMappingform- the actionFormrequest- the requestvalidator- 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 actionMappingform- the actionFormrequest- 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 actionMappingform- the actionFormrequest- the requestvalidator- 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 actionMappingform- the actionFormrequest- the requestvalidator- 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 actionMappingform- the actionFormrequest- 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 handlingmapping- the actionMappingform- the actionFormrequest- the requestresponse- 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 actionMappingform- the actionFormrequest- the requestvalidator- 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 actionMappingform- the actionFormrequest- the requestresponse- Description of the Parameter- Returns:
- Description of the Return Value
- Throws:
ServletException- Description of the ExceptionMissingLockException- 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 ActionMappingform- the ActionFormrequest- the Requestresponse- 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 ActionMappingform- the ActionFormrequest- the Requestresponse- 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 ActionMappingform- the ActionFormrequest- the Requestresponse- 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 ActionMappingform- the ActionFormrequest- the Requestresponse- 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 ActionMappingform- the ActionFormrequest- the Requestresponse- the Responsevalidator- Description of the Parameter- Returns:
- Description of the Return Value
- Throws:
ServletException- Description of the ExceptionMissingLockException- 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 attachedsef- the form beanschemaHelper- the schemaHelper- Throws:
Exception- if new element could not be created and attached
-
prtln
Print a line to standard out.- Parameters:
s- The String to print.
-
prtlnErr
-