org.mycore.frontend.servlets
Class MCRStartEditorServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mycore.frontend.servlets.MCRServlet
              extended by org.mycore.frontend.servlets.MCRStartEditorServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
MCRDFGViewerServlet, MCRStartMetsModsServlet, MCRStartZoomifyServlet

public class MCRStartEditorServlet
extends MCRServlet

The servlet start the MyCoRe editor session or other workflow actions with some parameters from a HTML form. The parameters are:

  • type - the MCRObjectID type like schrift, text ...

  • step - the name of the step like author, editor ...

  • layout - the name of the layout like firststep, secondstep ...

  • todo - the mode of the editor start like new or edit or change or delete

  • tf_mcrid - the MCRObjectID of the data they came from a input field

  • se_mcrid - the MCRObjectID of the data they came from a select field

  • re_mcrid - the MCRObjectID of the data they is in relation to tf_mcrid/se_mcrid

  • Version:
    $Revision: 15604 $ $Date: 2009-01-26 12:02:59 +0100 (Mo, 26. Jan 2009) $
    Author:
    Jens Kupferschmidt
    See Also:
    Serialized Form

    Nested Class Summary
    protected static class MCRStartEditorServlet.CommonData
               
     
    Field Summary
    protected static String cancelpage
               
    protected static String deleteerrorpage
               
    protected static String deletepage
               
    protected static Logger LOGGER
               
    protected static String mcriderrorpage
               
    protected static String pagedir
               
    protected static String SLASH
               
    protected static String storeerrorpage
               
    protected static String usererrorpage
               
    protected static MCRSimpleWorkflowManager WFM
               
     
    Fields inherited from class org.mycore.frontend.servlets.MCRServlet
    BASE_URL_ATTRIBUTE, trustedProxies
     
    Constructor Summary
    MCRStartEditorServlet()
               
     
    Method Summary
     void deleteDedivate(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify a derivate object that is stored in the server.
     void deleteObject(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify a derivate object that is stored in the server.
     void doGetPost(MCRServletJob job)
              This method overrides doGetPost of MCRServlet.
    protected  String getNextMCRTFID(String myproject, String mytype)
              This method return a next new MCRObjectID for the given type and project ID.
     void init()
              Initialisation of the servlet
     void saddfile(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor add a file to a derivate object that is stored in the server.
     void saddnbn(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method add a new NBN to the dataset with type document or disshab.
     void sdelder(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method delete a derivate object that is stored in the server.
     void sdelfile(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method delete a file from a derivate object that is stored in the server.
     void sdelobj(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method delete a metadata object that is stored in the server.
     void seditacl(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify ACL of a metadata object that is stored in the server.
     void seditder(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify a derivate object that is stored in the server.
     void seditobj(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify a metadata object that is stored in the server.
     void snewder(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method set a new derivate object that is stored in the server.
     void ssetfile(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method set the main file of a derivate object that is stored in the server.
     void waddfile(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the file upload to add to the metadata object that is stored in the workflow.
     void wcommit(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method commit a object including all derivates that is stored in the workflow to the server.
     void wcopyobj(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method copy a object in the workflow with a a new MCRObjectID.
     void wdelder(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method delete a derivate from an object that is stored in the workflow.
     void wdelfile(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method delete a file from the derivate object that is stored in the workflow.
     void wdelobj(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method delete a metadata object that is stored in the workflow.
     void weditacl(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify the metadata object ACL that is stored in the workflow.
     void weditder(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor modify derivate metadata that is stored in the workflow.
     void weditobj(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify a metadata object that is stored in the workflow.
     void wnewder(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method build a new derivate and start the file upload to add to the metadata object that is stored in the workflow.
     void wnewobj(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to create new metadata object that will be stored in the workflow.
     void wrongtodo(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              This method implements the error exit to index.xml if the action method was not found or has an error.
     void wsetfile(MCRServletJob job, MCRStartEditorServlet.CommonData cd)
              The method start the editor to modify a derivate object that is stored in the workflow.
     
    Methods inherited from class org.mycore.frontend.servlets.MCRServlet
    buildRedirectURL, doGet, doGet, doPost, doPost, generateActiveLinkErrorpage, generateErrorPage, getBaseURL, getLastModified, getLayoutService, getProperty, getRemoteAddr, getServletBaseURL, getSession, handleException, initTrustedProxies, render, reportException, think
     
    Methods inherited from class javax.servlet.http.HttpServlet
    doDelete, doHead, doOptions, doPut, doTrace, service, service
     
    Methods inherited from class javax.servlet.GenericServlet
    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    LOGGER

    protected static Logger LOGGER

    WFM

    protected static MCRSimpleWorkflowManager WFM

    SLASH

    protected static String SLASH

    pagedir

    protected static String pagedir

    cancelpage

    protected static String cancelpage

    deletepage

    protected static String deletepage

    usererrorpage

    protected static String usererrorpage

    mcriderrorpage

    protected static String mcriderrorpage

    storeerrorpage

    protected static String storeerrorpage

    deleteerrorpage

    protected static String deleteerrorpage
    Constructor Detail

    MCRStartEditorServlet

    public MCRStartEditorServlet()
    Method Detail

    init

    public void init()
              throws ServletException
    Initialisation of the servlet

    Overrides:
    init in class MCRServlet
    Throws:
    ServletException

    doGetPost

    public void doGetPost(MCRServletJob job)
                   throws Exception
    This method overrides doGetPost of MCRServlet.

    The todo value corresponds with tf_mcrid or se_mcridor value and with the type of the data model for the permissions that the user need. For some actions you need a third value of re_mcrid for relations (object - derivate).
  • If the permission is not correct it calls editor_error_user.xml.

  • If the MCRObjectID is not correct it calls editor_error_mcrid.xml.

  • If a store error is occurred it calls editor_error_store.xml .

  • If CANCEL was pressed it calls editor_cancel.xml.

  • If the permission is correct it starts the file editor_form_ step-type .xml.

  • Overrides:
    doGetPost in class MCRServlet
    Throws:
    Exception

    getNextMCRTFID

    protected final String getNextMCRTFID(String myproject,
                                          String mytype)
    This method return a next new MCRObjectID for the given type and project ID.

    Parameters:
    projectid - The MCRObjectID project ID
    Returns:
    the next free MCRObject for the given parameter

    saddfile

    public void saddfile(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor add a file to a derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and re_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    saddnbn

    public void saddnbn(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws Exception
    The method add a new NBN to the dataset with type document or disshab. The access right is writedb.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    Exception

    sdelder

    public void sdelder(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method delete a derivate object that is stored in the server. The method use the input parameter: type,step and tf_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    sdelfile

    public void sdelfile(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method delete a file from a derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and re_mcrid. Access rights must be 'deletedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    sdelobj

    public void sdelobj(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method delete a metadata object that is stored in the server. The method use the input parameter: type,step and tf_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    seditacl

    public void seditacl(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor to modify ACL of a metadata object that is stored in the server. The method use the input parameter: type,step and tf_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    seditder

    public void seditder(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor to modify a derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and se_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    deleteDedivate

    public void deleteDedivate(MCRServletJob job,
                               MCRStartEditorServlet.CommonData cd)
                        throws IOException
    The method start the editor to modify a derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and se_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    deleteObject

    public void deleteObject(MCRServletJob job,
                             MCRStartEditorServlet.CommonData cd)
                      throws IOException
    The method start the editor to modify a derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and se_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    seditobj

    public void seditobj(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor to modify a metadata object that is stored in the server. The method use the input parameter: type,step and tf_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    snewder

    public void snewder(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method set a new derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and re_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    ssetfile

    public void ssetfile(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method set the main file of a derivate object that is stored in the server. The method use the input parameter: type,step se_mcrid and re_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    waddfile

    public void waddfile(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the file upload to add to the metadata object that is stored in the workflow. The method use the input parameter: type, step, re_mcrid and se_mcrid. Access rights must be 'create-'type.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wcommit

    public void wcommit(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method commit a object including all derivates that is stored in the workflow to the server. The method use the input parameter: type,step and se_mcrid. Access rights must be 'writedb'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wdelder

    public void wdelder(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method delete a derivate from an object that is stored in the workflow. The method use the input parameter: type,step se_mcrid and re_mcrid. Access rights must be 'deletewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wdelfile

    public void wdelfile(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method delete a file from the derivate object that is stored in the workflow. The method use the input parameter: type,step se_mcrid and re_mcrid. Access rights must be 'deletewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wdelobj

    public void wdelobj(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method delete a metadata object that is stored in the workflow. The method use the input parameter: type,step and se_mcrid. Access rights must be 'deletewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    weditacl

    public void weditacl(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor to modify the metadata object ACL that is stored in the workflow. The method use the input parameter: type,step and se_mcrid. Access rights must be 'writewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    weditder

    public void weditder(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor modify derivate metadata that is stored in the workflow. The method use the input parameter: type,step re_mcrid and se_mcrid. Access rights must be 'writewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wcopyobj

    public void wcopyobj(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method copy a object in the workflow with a a new MCRObjectID.

    Parameters:
    cd - the common data stack
    job - the MCRServletJob instance
    Throws:
    IOException

    weditobj

    public void weditobj(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor to modify a metadata object that is stored in the workflow. The method use the input parameter: type,step and se_mcrid. Access rights must be 'writewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wnewder

    public void wnewder(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method build a new derivate and start the file upload to add to the metadata object that is stored in the workflow. The method use the input parameter: type, step, re_mcrid and se_mcrid. Access rights must be 'create-'type.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wnewobj

    public void wnewobj(MCRServletJob job,
                        MCRStartEditorServlet.CommonData cd)
                 throws IOException
    The method start the editor to create new metadata object that will be stored in the workflow. The method use the input parameter: type,step and tf_mcrid. Access rights must be 'create-'type.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wsetfile

    public void wsetfile(MCRServletJob job,
                         MCRStartEditorServlet.CommonData cd)
                  throws IOException
    The method start the editor to modify a derivate object that is stored in the workflow. The method use the input parameter: type,step re_mcrid and se_mcrid. Access rights must be 'writewf'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException

    wrongtodo

    public void wrongtodo(MCRServletJob job,
                          MCRStartEditorServlet.CommonData cd)
                   throws IOException
    This method implements the error exit to index.xml if the action method was not found or has an error. It implements the TODO 'wrongtodo'.

    Parameters:
    job - the MCRServletJob instance
    Throws:
    IOException