DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.action
Class StandAloneSchemEditAction

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

public class StandAloneSchemEditAction
extends AbstractSchemEditAction

Metadata Editor controller for xml records to be created and edited in a particular disk directory rather than reading and writing to a indexed repository.

Author:
ostwald

Field Summary
protected static boolean debug
          Description of the Field
protected  File recordsDir
           
 
Fields inherited from class org.dlese.dpc.schemedit.action.AbstractSchemEditAction
firstPage, homePage, xmlFormat
 
Fields inherited from class org.dlese.dpc.schemedit.action.DCSAction
accessManager, collectionRegistry, dcsDataManager, frameworkRegistry, ndrServiceEnabled, repositoryManager, repositoryService, requiredRole, sessionRegistry, userManager
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
StandAloneSchemEditAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(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  File getFileToEdit(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemaHelper schemaHelper)
          Gets the fileToEdit attribute of the StandAloneSchemEditAction object
protected  File getRecordsDir()
          Gets the recordsDir attribute of the StandAloneSchemEditAction object
protected  Document getRemoteRecord(String recId)
          Obtain a record via Web Service.
protected  String getXmlFormat()
          Gets the xmlFormat attribute of the StandAloneSchemEditAction object
protected  org.apache.struts.action.ActionForward handleCancelRequest(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.ActionForward handleChangeIdRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, SchemaHelper schemaHelper, SchemEditValidator validator)
          Description of the Method
protected  org.apache.struts.action.ActionForward handleEditRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Description of the Method
protected  org.apache.struts.action.ActionForward handleMissingCommand(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Requests without a command forward control to the home page for this framework.
protected  org.apache.struts.action.ActionForward handleNewRecordRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Description of the Method
protected  org.apache.struts.action.ActionForward handleOtherCommands(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Description of the Method
protected  org.apache.struts.action.ActionForward handleSaveRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response, SchemEditValidator validator)
          Description of the Method
protected  void prtln(String s)
          Print a line to standard out.
protected  void putRecord(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request)
          Saves a metadata record either to disk
protected  org.apache.struts.action.ActionErrors saveRecord(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response, SchemEditValidator validator)
          Save a record to disk.
 
Methods inherited from class org.dlese.dpc.schemedit.action.AbstractSchemEditAction
attachNewElement, getEditorMapping, getMetaDataFramework, getValidator, handleDeleteElement, handleExitCommand, handleGuardedExit, handleMissingLockException, handleTimedOutGuardedExit, isDocDirty, prtlnErr, uniqueUrlCheck, uniqueValueCheck
 
Methods inherited from class org.dlese.dpc.schemedit.action.DCSAction
getMetaDataFramework, getRequiredContextAttributeValue, getSessionBean, getSessionUser, getSessionUser, getSessionUserName, initializeFromContext
 
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
 

Field Detail

debug

protected static boolean debug
Description of the Field


recordsDir

protected File recordsDir
Constructor Detail

StandAloneSchemEditAction

public StandAloneSchemEditAction()
Method Detail

getXmlFormat

protected String getXmlFormat()
Gets the xmlFormat attribute of the StandAloneSchemEditAction object

Specified by:
getXmlFormat in class AbstractSchemEditAction
Returns:
The xmlFormat value

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
Description copied from class: AbstractSchemEditAction
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 AbstractSchemEditAction
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

getRecordsDir

protected File getRecordsDir()
Gets the recordsDir attribute of the StandAloneSchemEditAction object

Returns:
The recordsDir value

getRemoteRecord

protected Document getRemoteRecord(String recId)
                            throws ServletException
Obtain a record via Web Service.

Parameters:
recId - Description of the Parameter
Returns:
Description of the Return Value
Throws:
ServletException - Description of the Exception

handleMissingCommand

protected org.apache.struts.action.ActionForward handleMissingCommand(org.apache.struts.action.ActionMapping mapping,
                                                                      org.apache.struts.action.ActionForm form,
                                                                      HttpServletRequest request,
                                                                      HttpServletResponse response)
                                                               throws ServletException
Requests without a command forward control to the home page for this framework.

Specified by:
handleMissingCommand in class AbstractSchemEditAction
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:
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
Description of the Method

Overrides:
handleOtherCommands in class AbstractSchemEditAction
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:
ServletException - Description of the Exception
MissingLockException - NOT YET DOCUMENTED

saveRecord

protected org.apache.struts.action.ActionErrors saveRecord(org.apache.struts.action.ActionMapping mapping,
                                                           org.apache.struts.action.ActionForm form,
                                                           HttpServletRequest request,
                                                           HttpServletResponse response,
                                                           SchemEditValidator validator)
                                                    throws MissingLockException
Save a record to disk. With the exception of MissingLock errors and Exceptions thrown by putRecord, exceptions are caught and returned as ActionErrors.

Throws:
MissingLockException

handleSaveRequest

protected 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 copied from class: AbstractSchemEditAction
Description of the Method

Specified by:
handleSaveRequest in class AbstractSchemEditAction
Parameters:
mapping - Description of the Parameter
form - Description of the Parameter
request - Description of the Parameter
response - Description of the Parameter
validator - Description of the Parameter
Returns:
Description of the Return Value
Throws:
ServletException - Description of the Exception
MissingLockException - Description of the Exception

getFileToEdit

protected File getFileToEdit(org.apache.struts.action.ActionMapping mapping,
                             org.apache.struts.action.ActionForm form,
                             HttpServletRequest request,
                             SchemaHelper schemaHelper)
                      throws Exception
Gets the fileToEdit attribute of the StandAloneSchemEditAction object

Parameters:
mapping - Description of the Parameter
form - Description of the Parameter
request - Description of the Parameter
schemaHelper - Description of the Parameter
Returns:
The fileToEdit value
Throws:
Exception - Description of the Exception

handleNewRecordRequest

protected 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

Specified by:
handleNewRecordRequest in class AbstractSchemEditAction
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:
ServletException - Description of the Exception

handleCancelRequest

protected org.apache.struts.action.ActionForward handleCancelRequest(org.apache.struts.action.ActionMapping mapping,
                                                                     org.apache.struts.action.ActionForm form,
                                                                     HttpServletRequest request,
                                                                     HttpServletResponse response)
                                                              throws ServletException
Description copied from class: AbstractSchemEditAction
Cancels editing of current metadata record.

Specified by:
handleCancelRequest in class AbstractSchemEditAction
Parameters:
mapping - the ActionMapping
form - the ActionForm
request - the Request
response - the Response
Returns:
NOT YET DOCUMENTED
Throws:
ServletException - NOT YET DOCUMENTED

handleEditRequest

protected org.apache.struts.action.ActionForward handleEditRequest(org.apache.struts.action.ActionMapping mapping,
                                                                   org.apache.struts.action.ActionForm form,
                                                                   HttpServletRequest request,
                                                                   HttpServletResponse response)
                                                            throws ServletException
Description of the Method

Specified by:
handleEditRequest in class AbstractSchemEditAction
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:
ServletException - Description of the Exception

putRecord

protected void putRecord(org.apache.struts.action.ActionMapping mapping,
                         org.apache.struts.action.ActionForm form,
                         HttpServletRequest request)
                  throws Exception
Saves a metadata record either to disk

Specified by:
putRecord in class AbstractSchemEditAction
Parameters:
mapping - Description of the Parameter
form - Description of the Parameter
request - Description of the Parameter
Throws:
Exception - if save operation is unsuccessful

handleChangeIdRequest

protected org.apache.struts.action.ActionForward handleChangeIdRequest(org.apache.struts.action.ActionMapping mapping,
                                                                       org.apache.struts.action.ActionForm form,
                                                                       HttpServletRequest request,
                                                                       SchemaHelper schemaHelper,
                                                                       SchemEditValidator validator)
Description of the Method

Parameters:
mapping - Description of the Parameter
form - Description of the Parameter
request - Description of the Parameter
schemaHelper - Description of the Parameter
validator - Description of the Parameter
Returns:
Description of the Return Value

prtln

protected void prtln(String s)
Print a line to standard out.

Overrides:
prtln in class AbstractSchemEditAction
Parameters:
s - The String to print.

DLESE Tools
v1.6.0