001: /*
002: * CompletedStep.java
003: *
004: * Version: $Revision: 1.4 $
005: *
006: * Date: $Date: 2006/07/13 23:20:54 $
007: *
008: * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
009: * Institute of Technology. All rights reserved.
010: *
011: * Redistribution and use in source and binary forms, with or without
012: * modification, are permitted provided that the following conditions are
013: * met:
014: *
015: * - Redistributions of source code must retain the above copyright
016: * notice, this list of conditions and the following disclaimer.
017: *
018: * - Redistributions in binary form must reproduce the above copyright
019: * notice, this list of conditions and the following disclaimer in the
020: * documentation and/or other materials provided with the distribution.
021: *
022: * - Neither the name of the Hewlett-Packard Company nor the name of the
023: * Massachusetts Institute of Technology nor the names of their
024: * contributors may be used to endorse or promote products derived from
025: * this software without specific prior written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
028: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
029: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
030: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
031: * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
032: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
033: * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
034: * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
035: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
036: * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
037: * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
038: * DAMAGE.
039: */
040: package org.dspace.app.xmlui.aspect.submission.submit;
041:
042: import java.io.IOException;
043: import java.sql.SQLException;
044:
045: import org.dspace.app.xmlui.utils.UIException;
046: import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
047: import org.dspace.app.xmlui.wing.Message;
048: import org.dspace.app.xmlui.wing.WingException;
049: import org.dspace.app.xmlui.wing.element.Body;
050: import org.dspace.app.xmlui.wing.element.Division;
051: import org.dspace.app.xmlui.wing.element.List;
052: import org.dspace.authorize.AuthorizeException;
053: import org.xml.sax.SAXException;
054:
055: /**
056: * This is a conformation page informing the user that they have
057: * completed the submission of the item. It tells them what to
058: * expect next, i.e. the workflow, and gives the option to go home
059: * or start another submission.
060: *
061: * @author Scott Phillips
062: * @author Tim Donohue (updated for Configurable Submission)
063: */
064: public class CompletedStep extends AbstractSubmissionStep {
065:
066: /** Language Strings **/
067: protected static final Message T_head = message("xmlui.Submission.submit.CompletedStep.head");
068: protected static final Message T_info1 = message("xmlui.Submission.submit.CompletedStep.info1");
069: protected static final Message T_go_submission = message("xmlui.Submission.submit.CompletedStep.go_submission");
070: protected static final Message T_submit_again = message("xmlui.Submission.submit.CompletedStep.submit_again");
071:
072: /**
073: * Establish our required parameters, abstractStep will enforce these.
074: */
075: public CompletedStep() {
076: this .requireHandle = true;
077: }
078:
079: public void addBody(Body body) throws SAXException, WingException,
080: UIException, SQLException, IOException, AuthorizeException {
081: Division div = body.addInteractiveDivision("submit-complete",
082: contextPath + "/handle/" + handle + "/submit",
083: Division.METHOD_POST, "primary submission");
084: div.setHead(T_head);
085:
086: div.addPara(T_info1);
087:
088: div.addPara().addXref(contextPath + "/submissions",
089: T_go_submission);
090:
091: div.addPara().addButton("submit_again")
092: .setValue(T_submit_again);
093: div.addHidden("handle").setValue(handle);
094: }
095:
096: /**
097: * Each submission step must define its own information to be reviewed
098: * during the final Review/Verify Step in the submission process.
099: * <P>
100: * The information to review should be tacked onto the passed in
101: * List object.
102: * <P>
103: * NOTE: To remain consistent across all Steps, you should first
104: * add a sub-List object (with this step's name as the heading),
105: * by using a call to reviewList.addList(). This sublist is
106: * the list you return from this method!
107: *
108: * @param reviewList
109: * The List to which all reviewable information should be added
110: * @return
111: * The new sub-List object created by this step, which contains
112: * all the reviewable information. If this step has nothing to
113: * review, then return null!
114: */
115: public List addReviewSection(List reviewList) throws SAXException,
116: WingException, UIException, SQLException, IOException,
117: AuthorizeException {
118: //nothing to review, since submission is now Completed!
119: return null;
120: }
121: }
|