org.dspace.app.xmlui.aspect.submission
Class AbstractStep

java.lang.Object
  extended by org.apache.cocoon.util.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by org.apache.cocoon.transformation.AbstractTransformer
                  extended by org.dspace.app.xmlui.wing.AbstractWingTransformer
                      extended by org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
                          extended by org.dspace.app.xmlui.aspect.submission.AbstractStep
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.transformation.Transformer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer, org.apache.excalibur.xml.sax.XMLConsumer, DSpaceTransformer, WingTransformer, ContentHandler, LexicalHandler
Direct Known Subclasses:
AbstractSubmissionStep, EditFileStep, PerformTaskStep, RejectTaskStep, RemovedStep, ResumeStep, SaveOrRemoveStep

public abstract class AbstractStep
extends AbstractDSpaceTransformer

This abstract class represents an abstract page in the submission or workflow processes. This class provides a place for common resources to be shared such as i18n tags, progress bars, and a common setup.

Author:
Scott Phillips, Tim Donohue (updated for Configurable Submission)

Field Summary
protected  List<String> errorFields
          A list of fields that may be in error, not all stages support errored fields but if they do then this is where a list of all fields in error may be found.
protected  int errorFlag
          The error flag which was returned by the processing of this step
protected  String handle
          The handle being processed by the current step.
protected  String id
          The id of the currently active workspace or workflow, this contains the incomplete DSpace item
protected  boolean requireHandle
           
protected  boolean requireStep
           
protected  boolean requireSubmission
          The parameters that are required by this submissions / workflow step
protected  boolean requireWorkflow
           
protected  boolean requireWorkspace
           
protected  StepAndPage stepAndPage
          The current step and page's numeric values that it is at currently.
protected  InProgressSubmission submission
          The in progress submission, if one is available, this may be either a workflowItem or a workspaceItem.
protected  SubmissionInfo submissionInfo
          The current DSpace SubmissionInfo
protected static Message T_complete
           
protected static Message T_creative_commons
           
protected static Message T_default_title
           
protected static Message T_default_trail
           
protected static Message T_describe
           
protected static Message T_dspace_home
           
protected static Message T_initial_questions
          Progress Bar Language Strings
protected static Message T_license
           
protected static Message T_next
           
protected static Message T_previous
           
protected static Message T_review
           
protected static Message T_save
           
protected static Message T_showfull
           
protected static Message T_showsimple
           
protected static Message T_submission_head
           
protected static Message T_submission_title
          General Language Strings
protected static Message T_submission_trail
           
protected static Message T_upload
           
protected static Message T_workflow_head
           
protected static Message T_workflow_title
           
protected static Message T_workflow_trail
           
 
Fields inherited from class org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
context, contextPath, eperson, knot, objectModel, parameters, servletPath, sitemapURI, url
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
AbstractStep()
           
 
Method Summary
 void addControlButtons(List controls)
          Adds the "<-Previous", "Save/Cancel" and "Next->" buttons to a given form.
 void addJumpButton(List list, Message buttonText, StepAndPage stepAndPage)
          Adds a single "jump-to" button, which when clicked will jump the user directly to a particular step within the submission process.
 void addPageMeta(PageMeta pageMeta)
          Base pageMeta that is added to ALL submission stages
 void addSubmissionProgressList(Division div)
          Add a submission progress list to the current div for this step.
 List<String> getErrorFields(org.apache.avalon.framework.parameters.Parameters parameters)
          Retrieve error fields from the list of parameters and return a List of all fields which had errors
 StepAndPage getMaxStepAndPageReached()
          Find the maximum step and page that the user has reached in the submission processes.
 int getPage()
          Get number of the current page within the current step
 int getStep()
          Get current step number
 boolean isFirstStep()
          Return whether this is the first step in the submission process (the first step is currently considered the first that appears in the progress bar)
 boolean isLastStep()
          Return whether this is the last step in the submission process (the last step is currently considered the one directly *before* the Complete step in the progress bar)
 void recycle()
          Recycle
 void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, org.apache.avalon.framework.parameters.Parameters parameters)
          Grab all the page's parameters from the sitemap.
 
Methods inherited from class org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
addBody, addOptions, addUserMeta, decodeFromURL, dispose, encodeForURL, generateURL, getComponentName, getObjectManager, handleException
 
Methods inherited from class org.dspace.app.xmlui.wing.AbstractWingTransformer
createWingDocument, endDocument, endElement, endPrefixMapping, getDefaultMessageCatalogue, message, message, setupWing, startDocument, startElement, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

T_submission_title

protected static final Message T_submission_title
General Language Strings


T_submission_trail

protected static final Message T_submission_trail

T_submission_head

protected static final Message T_submission_head

T_previous

protected static final Message T_previous

T_save

protected static final Message T_save

T_next

protected static final Message T_next

T_complete

protected static final Message T_complete

T_dspace_home

protected static final Message T_dspace_home

T_workflow_title

protected static final Message T_workflow_title

T_workflow_trail

protected static final Message T_workflow_trail

T_workflow_head

protected static final Message T_workflow_head

T_showfull

protected static final Message T_showfull

T_showsimple

protected static final Message T_showsimple

T_default_title

protected static final Message T_default_title

T_default_trail

protected static final Message T_default_trail

T_initial_questions

protected static final Message T_initial_questions
Progress Bar Language Strings


T_describe

protected static final Message T_describe

T_upload

protected static final Message T_upload

T_review

protected static final Message T_review

T_creative_commons

protected static final Message T_creative_commons

T_license

protected static final Message T_license

id

protected String id
The id of the currently active workspace or workflow, this contains the incomplete DSpace item


submissionInfo

protected SubmissionInfo submissionInfo
The current DSpace SubmissionInfo


submission

protected InProgressSubmission submission
The in progress submission, if one is available, this may be either a workflowItem or a workspaceItem.


stepAndPage

protected StepAndPage stepAndPage
The current step and page's numeric values that it is at currently. This number is dynamic between submissions.


handle

protected String handle
The handle being processed by the current step.


errorFlag

protected int errorFlag
The error flag which was returned by the processing of this step


errorFields

protected List<String> errorFields
A list of fields that may be in error, not all stages support errored fields but if they do then this is where a list of all fields in error may be found.


requireSubmission

protected boolean requireSubmission
The parameters that are required by this submissions / workflow step


requireWorkflow

protected boolean requireWorkflow

requireWorkspace

protected boolean requireWorkspace

requireStep

protected boolean requireStep

requireHandle

protected boolean requireHandle
Constructor Detail

AbstractStep

public AbstractStep()
Method Detail

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  Map objectModel,
                  String src,
                  org.apache.avalon.framework.parameters.Parameters parameters)
           throws org.apache.cocoon.ProcessingException,
                  SAXException,
                  IOException
Grab all the page's parameters from the sitemap. This includes workspaceID, step, and a list of errored fields. If the implementer set any required parameters then insure that they are all present.

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Overrides:
setup in class AbstractDSpaceTransformer
Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException

addPageMeta

public void addPageMeta(PageMeta pageMeta)
                 throws SAXException,
                        WingException,
                        UIException,
                        SQLException,
                        IOException,
                        AuthorizeException
Base pageMeta that is added to ALL submission stages

Specified by:
addPageMeta in interface DSpaceTransformer
Specified by:
addPageMeta in interface WingTransformer
Overrides:
addPageMeta in class AbstractDSpaceTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException

addSubmissionProgressList

public void addSubmissionProgressList(Division div)
                               throws WingException
Add a submission progress list to the current div for this step.

Parameters:
div - The division to add the list to.
Throws:
WingException

addJumpButton

public void addJumpButton(List list,
                          Message buttonText,
                          StepAndPage stepAndPage)
                   throws WingException
Adds a single "jump-to" button, which when clicked will jump the user directly to a particular step within the submission process.

This method is used by the addSubmissionProgressList() method to create the progress bar at the top of the submission process.

This method is also used by the ReviewStep to add buttons to jump back to a particular step in the submission process

Parameters:
list - The List which the button will be added to
buttonText - The text to be displayed on the button
stepAndPage - The step and page (a double of the form 'step.page', e.g. 1.2) which this button will jump back to
Throws:
WingException

addControlButtons

public void addControlButtons(List controls)
                       throws WingException
Adds the "<-Previous", "Save/Cancel" and "Next->" buttons to a given form. This method ensures that the same default control/paging buttons appear on each submission page.

Note: A given step may define its own buttons as necessary, and not call this method (since it must be explicitly invoked by the step's addBody() method)

Parameters:
controls - The List which will contain all control buttons
Throws:
WingException

getStep

public int getStep()
Get current step number

Returns:
step number

getPage

public int getPage()
Get number of the current page within the current step

Returns:
page number (within current step)

isFirstStep

public boolean isFirstStep()
Return whether this is the first step in the submission process (the first step is currently considered the first that appears in the progress bar)

Returns:
true if first step

isLastStep

public boolean isLastStep()
Return whether this is the last step in the submission process (the last step is currently considered the one directly *before* the Complete step in the progress bar)

Returns:
true if last step

getMaxStepAndPageReached

public StepAndPage getMaxStepAndPageReached()
                                     throws SQLException
Find the maximum step and page that the user has reached in the submission processes. If this submission is a workflow then return max-int.

Throws:
SQLException

getErrorFields

public List<String> getErrorFields(org.apache.avalon.framework.parameters.Parameters parameters)
Retrieve error fields from the list of parameters and return a List of all fields which had errors

Returns:
java.util.List of field names with errors

recycle

public void recycle()
Recycle

Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable
Overrides:
recycle in class AbstractDSpaceTransformer


Copyright © 2012 DuraSpace. All Rights Reserved.