diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg
index ca00effd10..b9a74dc52f 100644
--- a/dspace/config/dspace.cfg
+++ b/dspace/config/dspace.cfg
@@ -94,3 +94,8 @@ webui.site.authenticator = edu.mit.dspace.MITAuthenticator
# omitted, SFX support is switched off.
sfx.server.url = http://owens.mit.edu:8888/sfx_local?
+
+##### Ingest settings #####
+
+# Default language for content of submissions
+default.language = en_US
diff --git a/dspace/etc/database_schema.sql b/dspace/etc/database_schema.sql
index 14dbc9a7da..9c1546489a 100644
--- a/dspace/etc/database_schema.sql
+++ b/dspace/etc/database_schema.sql
@@ -64,6 +64,18 @@ CREATE TABLE BitstreamFormatRegistry
internal BOOL
);
+-------------------------------------------------------
+-- FormatIdentifier table
+-------------------------------------------------------
+DROP TABLE FormatIdentifier;
+
+CREATE TABLE FormatIdentifier
+(
+ id INTEGER PRIMARY KEY,
+ bitstream_format_id INTEGER REFERENCES BitstreamFormatRegistry(bitstream_format_id),
+ extension VARCHAR(16)
+);
+
-------------------------------------------------------
-- Bitstream table
-------------------------------------------------------
diff --git a/dspace/jsp/WEB-INF/dspace-tags.tld b/dspace/jsp/WEB-INF/dspace-tags.tld
index 2953d284a4..761fbc4933 100644
--- a/dspace/jsp/WEB-INF/dspace-tags.tld
+++ b/dspace/jsp/WEB-INF/dspace-tags.tld
@@ -54,11 +54,6 @@
http://www.dspace.org/dspace-tags.tldDSpace JSP tags
-
-
@@ -134,6 +132,10 @@
org.dspace.app.webui.servlet.SimpleSearchServlet
+
+ submit
+ org.dspace.app.webui.servlet.SubmitServlet
+
@@ -193,6 +195,11 @@
/simple-search
+
+ submit
+ /submit
+
+
diff --git a/dspace/jsp/error/authorize.jsp b/dspace/jsp/error/authorize.jsp
new file mode 100644
index 0000000000..7471ad06d0
--- /dev/null
+++ b/dspace/jsp/error/authorize.jsp
@@ -0,0 +1,64 @@
+<%--
+ - authorize.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Page representing an authorization error
+ --%>
+
+<%@ page isErrorPage="true" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
+
Authorization Required
+
+
You do not have permission to perform the action you just attempted.
+
+
If you think you should have authorization, please feel free to
+ contact the DSpace administrators:
+
+ <%@ include file="/components/contact-info.jsp" %>
+
+
+
+
diff --git a/dspace/jsp/error/integrity.jsp b/dspace/jsp/error/integrity.jsp
new file mode 100644
index 0000000000..6fdb04f3e2
--- /dev/null
+++ b/dspace/jsp/error/integrity.jsp
@@ -0,0 +1,82 @@
+<%--
+ - internal.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Page representing an integrity error - an inconsistency or error in the
+ - data received from the browser
+ --%>
+
+<%@ page isErrorPage="true" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
System Error: Malformed Request
+
+
There was an inconsistency in the data received from your browser.
+ This may be due to one of several things:
+
+
+
Sometimes, if you used your browser's "back" button during an operation like a
+ submission, clicking on a button may try and do something that's already
+ been done, such as commit the submission to the archive.
+ Clicking your browsers "reload" or "refresh" button may have similar
+ results.
+
If you got here by following a link or bookmark provided by someone
+ else, the link may be incorrect or you mistyped the link. Please check
+ the link and try again.
+
If you have more than one browser window open with DSpace, this can cause
+ a similar problem whereby a button clicked in one window may make a button
+ click in the other window invalid.
+
Of course, you may have uncovered a problem with the system! All of
+ these errors are logged, and we'll be checking them regularly to see
+ if there is a problem.
+
+
+
If the problem persists, please contact the DSpace site administrators:
+
+ <%@ include file="/components/contact-info.jsp" %>
+
+
+
+
+
diff --git a/dspace/jsp/image/submit/complete-current.gif b/dspace/jsp/image/submit/complete-current.gif
new file mode 100644
index 0000000000..2af37be7ef
Binary files /dev/null and b/dspace/jsp/image/submit/complete-current.gif differ
diff --git a/dspace/jsp/image/submit/complete-done.gif b/dspace/jsp/image/submit/complete-done.gif
new file mode 100644
index 0000000000..e7836e8519
Binary files /dev/null and b/dspace/jsp/image/submit/complete-done.gif differ
diff --git a/dspace/jsp/image/submit/complete-notdone.gif b/dspace/jsp/image/submit/complete-notdone.gif
new file mode 100644
index 0000000000..2de0f6111f
Binary files /dev/null and b/dspace/jsp/image/submit/complete-notdone.gif differ
diff --git a/dspace/jsp/image/submit/describe-current.gif b/dspace/jsp/image/submit/describe-current.gif
new file mode 100644
index 0000000000..e9eb41dc1e
Binary files /dev/null and b/dspace/jsp/image/submit/describe-current.gif differ
diff --git a/dspace/jsp/image/submit/describe-done.gif b/dspace/jsp/image/submit/describe-done.gif
new file mode 100644
index 0000000000..f830014cdd
Binary files /dev/null and b/dspace/jsp/image/submit/describe-done.gif differ
diff --git a/dspace/jsp/image/submit/describe-notdone.gif b/dspace/jsp/image/submit/describe-notdone.gif
new file mode 100644
index 0000000000..e4924b7cb3
Binary files /dev/null and b/dspace/jsp/image/submit/describe-notdone.gif differ
diff --git a/dspace/jsp/image/submit/license-current.gif b/dspace/jsp/image/submit/license-current.gif
new file mode 100644
index 0000000000..810d3ee2ad
Binary files /dev/null and b/dspace/jsp/image/submit/license-current.gif differ
diff --git a/dspace/jsp/image/submit/license-done.gif b/dspace/jsp/image/submit/license-done.gif
new file mode 100644
index 0000000000..8eea8f8976
Binary files /dev/null and b/dspace/jsp/image/submit/license-done.gif differ
diff --git a/dspace/jsp/image/submit/license-notdone.gif b/dspace/jsp/image/submit/license-notdone.gif
new file mode 100644
index 0000000000..8534374d26
Binary files /dev/null and b/dspace/jsp/image/submit/license-notdone.gif differ
diff --git a/dspace/jsp/image/submit/upload-current.gif b/dspace/jsp/image/submit/upload-current.gif
new file mode 100644
index 0000000000..b4d0509e02
Binary files /dev/null and b/dspace/jsp/image/submit/upload-current.gif differ
diff --git a/dspace/jsp/image/submit/upload-done.gif b/dspace/jsp/image/submit/upload-done.gif
new file mode 100644
index 0000000000..ecbb7286b0
Binary files /dev/null and b/dspace/jsp/image/submit/upload-done.gif differ
diff --git a/dspace/jsp/image/submit/upload-notdone.gif b/dspace/jsp/image/submit/upload-notdone.gif
new file mode 100644
index 0000000000..1396715baf
Binary files /dev/null and b/dspace/jsp/image/submit/upload-notdone.gif differ
diff --git a/dspace/jsp/image/submit/verify-current.gif b/dspace/jsp/image/submit/verify-current.gif
new file mode 100644
index 0000000000..48295cd94d
Binary files /dev/null and b/dspace/jsp/image/submit/verify-current.gif differ
diff --git a/dspace/jsp/image/submit/verify-done.gif b/dspace/jsp/image/submit/verify-done.gif
new file mode 100644
index 0000000000..e87d31035d
Binary files /dev/null and b/dspace/jsp/image/submit/verify-done.gif differ
diff --git a/dspace/jsp/image/submit/verify-notdone.gif b/dspace/jsp/image/submit/verify-notdone.gif
new file mode 100644
index 0000000000..d57593c1fa
Binary files /dev/null and b/dspace/jsp/image/submit/verify-notdone.gif differ
diff --git a/dspace/jsp/layout/footer-default.jsp b/dspace/jsp/layout/footer-default.jsp
index e68a797bf4..4ac3535c5d 100644
--- a/dspace/jsp/layout/footer-default.jsp
+++ b/dspace/jsp/layout/footer-default.jsp
@@ -1,9 +1,16 @@
<%
String sidebar = (String) request.getAttribute("dspace.layout.sidebar");
- int overallColSpan = 3;
+ String navbar = (String) request.getAttribute("dspace.layout.navbar");
+ int overallColSpan = 1;
+
if (sidebar == null)
{
- overallColSpan = 2;
+ overallColSpan++;
+ }
+
+ if (!navbar.equals("off"))
+ {
+ overallColSpan++;
}
%>
<%-- End of page content --%>
diff --git a/dspace/jsp/layout/header-default.jsp b/dspace/jsp/layout/header-default.jsp
index 3b785912af..8c33b746c6 100644
--- a/dspace/jsp/layout/header-default.jsp
+++ b/dspace/jsp/layout/header-default.jsp
@@ -1,5 +1,5 @@
<%--
- - home.jsp
+ - header-default.jsp
-
- Version: $Revision$
-
@@ -103,10 +103,16 @@
<%-- Navigation bar --%>
+<%
+ if (!navbar.equals("off"))
+ {
+%>
-
+<%
+ }
+%>
<%-- Page Content --%>
<%-- HACK: width specified here for non-CSS compliant Netscape 4.x --%>
diff --git a/dspace/jsp/submit/cancel.jsp b/dspace/jsp/submit/cancel.jsp
new file mode 100644
index 0000000000..14d636b027
--- /dev/null
+++ b/dspace/jsp/submit/cancel.jsp
@@ -0,0 +1,108 @@
+<%--
+ - cancel.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Cancel or save submission page
+ -
+ - This page is displayed whenever the user clicks "cancel" during a
+ - submission. It asks them whether they want to delete the incomplete
+ - item or leave it so they can continue later.
+ -
+ - Attributes to pass in:
+ - submission.info - the SubmissionInfo object
+ - step - the step the user was at when the cancelled
+ - (as a String)
+ - display.step - - this is the step to display in the progress bar
+ - (i.e. the step from the user's perspective, rather
+ - than the exact JSP the user clicked cancel on)
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ String step = (String) request.getAttribute("step");
+ String displayStep = (String) request.getAttribute("display.step");
+
+ if (displayStep==null) displayStep = step;
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/cancelled-removed.jsp b/dspace/jsp/submit/cancelled-removed.jsp
new file mode 100644
index 0000000000..6fea8cd265
--- /dev/null
+++ b/dspace/jsp/submit/cancelled-removed.jsp
@@ -0,0 +1,57 @@
+<%--
+ - cancelled-removed.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Submission cancelled and removed page - displayed whenever the user has
+ - clicked "cancel/save" during a submission and elected to remove the item.
+ --%>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
+
Submission Cancelled
+
+
Your submission has been cancelled, and the incomplete item removed
+ from the system.
+
+
diff --git a/dspace/jsp/submit/change-file-description.jsp b/dspace/jsp/submit/change-file-description.jsp
new file mode 100644
index 0000000000..bffd3c3f5b
--- /dev/null
+++ b/dspace/jsp/submit/change-file-description.jsp
@@ -0,0 +1,112 @@
+<%--
+ - change-file-description.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Change file description form
+ -
+ - Attributes to pass in:
+ - submission.info - the SubmissionInfo object - bitstream field must be set
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.Bitstream" %>
+<%@ page import="org.dspace.content.BitstreamFormat" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/choose-file.jsp b/dspace/jsp/submit/choose-file.jsp
new file mode 100644
index 0000000000..cf15dd409b
--- /dev/null
+++ b/dspace/jsp/submit/choose-file.jsp
@@ -0,0 +1,146 @@
+<%--
+ - choose-file.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Select file to upload
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/complete.jsp b/dspace/jsp/submit/complete.jsp
new file mode 100644
index 0000000000..7d3df9a6f2
--- /dev/null
+++ b/dspace/jsp/submit/complete.jsp
@@ -0,0 +1,65 @@
+<%--
+ - complete.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Submission complete message
+ --%>
+
+
+
+
+
+
+
+
+
+
Submit: Submission Complete!
+
+ <%-- FIXME Probably should say something specific to workflow --%>
+
Your submission will now go through the workflow process designated for
+ the collection to which you are submitting. You will receive e-mail
+ notification as soon as your submission has become a part of the collection,
+ or if for some reason there is a problem with your submission. You can also
+ check on the status of your submission by going to the My DSpace page.
+
+
diff --git a/dspace/jsp/submit/edit-metadata-1.jsp b/dspace/jsp/submit/edit-metadata-1.jsp
new file mode 100644
index 0000000000..6688e7942f
--- /dev/null
+++ b/dspace/jsp/submit/edit-metadata-1.jsp
@@ -0,0 +1,625 @@
+<%--
+ - edit-metadata-1.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Edit metadata form, page 1
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ --%>
+
+<%@ page import="java.util.HashMap" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.Map" %>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.DCDate" %>
+<%@ page import="org.dspace.content.DCLanguage" %>
+<%@ page import="org.dspace.content.DCPersonName" %>
+<%@ page import="org.dspace.content.DCSeriesNumber" %>
+<%@ page import="org.dspace.content.DCValue" %>
+<%@ page import="org.dspace.content.Item" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ Item item = si.submission.getItem();
+
+ final int lastNameWidth = 23;
+ final int firstNamesWidth = 23;
+ final int formWidth = 50;
+%>
+
+
+
+
+
diff --git a/dspace/jsp/submit/edit-metadata-2.jsp b/dspace/jsp/submit/edit-metadata-2.jsp
new file mode 100644
index 0000000000..a2ca4e6af5
--- /dev/null
+++ b/dspace/jsp/submit/edit-metadata-2.jsp
@@ -0,0 +1,274 @@
+<%--
+ - edit-metadata-2.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Edit metadata form page 2
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.DCValue" %>
+<%@ page import="org.dspace.content.Item" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ Item item = si.submission.getItem();
+
+ final int formWidth = 50;
+ final int subjectWidth = 15;
+%>
+
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/get-file-format.jsp b/dspace/jsp/submit/get-file-format.jsp
new file mode 100644
index 0000000000..5242530338
--- /dev/null
+++ b/dspace/jsp/submit/get-file-format.jsp
@@ -0,0 +1,168 @@
+<%--
+ - get-file-format.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Select type of uploaded file
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ - guessed.format - the system's guess as to the format - null if it
+ - doesn't know (BitstreamFormat)
+ - bitstream.formats - the (non-internal) formats known by the system
+ - (BitstreamFormat[])
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.Bitstream" %>
+<%@ page import="org.dspace.content.BitstreamFormat" %>
+<%@ page import="org.dspace.content.Bundle" %>
+<%@ page import="org.dspace.content.Item" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+ BitstreamFormat guess =
+ (BitstreamFormat) request.getAttribute("guessed.format");
+ BitstreamFormat[] formats =
+ (BitstreamFormat[]) request.getAttribute("bitstream.formats");
+
+ Item item = si.submission.getItem();
+%>
+
+
+
+
+
+<%-- Option list put in a separate form --%>
+
+
diff --git a/dspace/jsp/submit/initial-questions.jsp b/dspace/jsp/submit/initial-questions.jsp
new file mode 100644
index 0000000000..25a3f5b540
--- /dev/null
+++ b/dspace/jsp/submit/initial-questions.jsp
@@ -0,0 +1,150 @@
+<%--
+ - initial-questions.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Initial questions for keeping UI as simple as possible.
+ -
+ - Attributes to pass in:
+ - submission.info - the SubmissionInfo object
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/license-rejected.jsp b/dspace/jsp/submit/license-rejected.jsp
new file mode 100644
index 0000000000..a9a421a530
--- /dev/null
+++ b/dspace/jsp/submit/license-rejected.jsp
@@ -0,0 +1,62 @@
+<%--
+ - license-rejected.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - License rejected page
+ --%>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
+
Submit: License Rejected
+
+
You have chosen not to grant the license to distribute your submission
+ via the DSpace system. Your submission has not been deleted and can be
+ accessed from the My DSpace page.
+
+
If you wish to contact us to discuss the license, please use one
+ of the methods below:
+
+ <%@ include file="/components/contact-info.jsp" %>
+
+
+
+
diff --git a/dspace/jsp/submit/no-theses.jsp b/dspace/jsp/submit/no-theses.jsp
new file mode 100644
index 0000000000..a4a81017a8
--- /dev/null
+++ b/dspace/jsp/submit/no-theses.jsp
@@ -0,0 +1,79 @@
+<%--
+ - no-theses.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - "No Theses" message
+ -
+ - This page displays a message informing the user that theses are not
+ - presently accepted in DSpace, and that their submission has been removed.
+ - FIX-ME: MIT-SPECIFIC
+ --%>
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
+
Theses Not Accepted in DSpace
+
+
DSpace does not currently accept individually-submitted
+ theses, but you are encouraged to use the separate electronic thesis
+ submission site supported by the Libraries and by MIT Information Systems to
+ submit your thesis to the Digital Library of
+ MIT Theses. To learn how to submit your thesis to that system, see Submitting
+ an Electronic Thesis at MIT.
+
+
Because DSpace does not accept individually-submitted theses, your
+ submission will not proceed; any files you have uploaded for the current item
+ will not be stored.
+
+
Please note that printed copies of your thesis are still the official
+ requirement for your degree. Due to important legal and record-keeping
+ reasons, it is likely that in the future DSpace will work directly with the
+ electronic thesis system to load groups of theses which have been officially
+ vetted and approved. Thanks for understanding.
+
+
For more information please contact the DSpace site
+ administrators:
+
+ <%@ include file="/components/contact-info.jsp" %>
+
+
Thank you for your interest in DSpace!
+
+
diff --git a/dspace/jsp/submit/progressbar.jsp b/dspace/jsp/submit/progressbar.jsp
new file mode 100644
index 0000000000..935fc7f466
--- /dev/null
+++ b/dspace/jsp/submit/progressbar.jsp
@@ -0,0 +1,159 @@
+<%--
+ - progressbar.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Progress bar for submission form. Note this must be included within
+ - the FORM element in the submission form, since it contains navigation
+ - buttons.
+ -
+ - Parameters:
+ - step (int): The current step. One of constants in
+ - org.dspace.app.webui.servlets.SubmitServlet.
+ - stage_reached: The most advanced step the user has reached (i.e. the
+ - most advanced step they can jump to)
+ - One of constants in org.dspace.servlets.SubmitServlet.
+ - It can also be "-1" - in this case, the progress bar
+ - is in "Workflow Item" mode - i.e. the "license" and
+ - "complete" stages aren't shown
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ // These are the filename stubs for the images used for each step
+ String[] imageNames =
+ {
+ "select",
+ "describe",
+ "describe",
+ "describe",
+ "upload",
+ "verify",
+ "license",
+ "complete"
+ };
+
+ // Step names for ALT text in images
+ String[] stepNames =
+ {
+ "Select",
+ "Describe",
+ "Describe",
+ "Describe",
+ "Upload",
+ "Verify",
+ "License",
+ "Complete"
+ };
+
+ int step = Integer.parseInt(request.getParameter("step"));
+ int stageReached = Integer.parseInt(request.getParameter("stage_reached"));
+
+ // Are we in workflow mode?
+ boolean workflowMode = false;
+ if (stageReached == -1)
+ {
+ workflowMode = true;
+ stageReached = SubmitServlet.REVIEW_SUBMISSION;
+ }
+%>
+
+
+
+<%
+ // Show previous (done by definition!) steps
+ for (int i = 1; i < step; i++)
+ {
+ // If the step has been done, and we're not on the final step,
+ // the user can jump back
+ if (step != SubmitServlet.SUBMISSION_COMPLETE)
+ {
+ %>
+ <%-- HACK: border=0 for non-CSS compliant Netscape 4.x --%>
+
+ <%
+ }
+ else
+ {
+ // User has reached final step, cannot jump back
+ %>
+
+ <%
+ }
+ }
+
+ // Show current step, but only if it's not the select collection step,
+ // which isn't shown in the progress bar
+ if (step > 0)
+ {
+%>
+
+<%
+ }
+
+ // We only go up to the "verify" step if we're on a workflow item
+ int lastStep = (workflowMode ? SubmitServlet.REVIEW_SUBMISSION+1
+ : stepNames.length);
+
+ // Show next steps (some of which may have been done)
+ for (int i = step + 1; i < lastStep; i++)
+ {
+ if (i <= stageReached)
+ {
+ // Stage has been previously accessed, so user may jump to it
+%>
+<%-- HACK: border=0 for non-CSS compliant Netscape 4.x --%>
+
+<%
+ }
+ else
+ {
+ // Stage hasn't been reached yet (can't be jumped to)
+%>
+
+<%
+ }
+ }
+%>
+
+
+
diff --git a/dspace/jsp/submit/review.jsp b/dspace/jsp/submit/review.jsp
new file mode 100644
index 0000000000..8698a49f6a
--- /dev/null
+++ b/dspace/jsp/submit/review.jsp
@@ -0,0 +1,445 @@
+<%--
+ - review.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Review submission page
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ --%>
+
+<%@ page import="java.util.HashMap" %>
+<%@ page import="java.util.Map" %>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.Bitstream" %>
+<%@ page import="org.dspace.content.BitstreamFormat" %>
+<%@ page import="org.dspace.content.DCDate" %>
+<%@ page import="org.dspace.content.DCLanguage" %>
+<%@ page import="org.dspace.content.DCValue" %>
+<%@ page import="org.dspace.content.Item" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ Item item = si.submission.getItem();
+
+ // Names of each identifier type
+ Map identifierQualNames = new HashMap();
+ identifierQualNames.put( "govdoc", "Gov't Doc #" );
+ identifierQualNames.put( "uri", "URI" );
+ identifierQualNames.put( "isbn", "ISBN" );
+ identifierQualNames.put( "issn", "ISSN" );
+ identifierQualNames.put( "ismn", "ISMN" );
+ identifierQualNames.put( "other", "Other" );
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/saved.jsp b/dspace/jsp/submit/saved.jsp
new file mode 100644
index 0000000000..627e83b20e
--- /dev/null
+++ b/dspace/jsp/submit/saved.jsp
@@ -0,0 +1,58 @@
+<%--
+ - saved.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Submission saved message - displayed whenever the user has clicked
+ - "cancel/save" during a submission and elected to save the item.
+ --%>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
+
Submission Saved
+
+
Your submission has been saved for you to finish later. You can continue
+ the submission by going to your "My DSpace" page and clicking on the
+ relevant "Resume" button.
+
+
diff --git a/dspace/jsp/submit/select-collection.jsp b/dspace/jsp/submit/select-collection.jsp
new file mode 100644
index 0000000000..01def0a7e1
--- /dev/null
+++ b/dspace/jsp/submit/select-collection.jsp
@@ -0,0 +1,119 @@
+<%--
+ - select-collection.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - UI page for selection of collection.
+ -
+ - Required attributes:
+ - collections - Array of collection objects to show in the drop-down.
+ --%>
+
+<%@ page import="org.dspace.content.Collection" %>
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ Collection[] collections =
+ (Collection[]) request.getAttribute("collections");
+%>
+
+
+
+
+
+
+
+
+
Submit: Choose Collection
+
+
+
+
diff --git a/dspace/jsp/submit/show-license.jsp b/dspace/jsp/submit/show-license.jsp
new file mode 100644
index 0000000000..2f107c7c1c
--- /dev/null
+++ b/dspace/jsp/submit/show-license.jsp
@@ -0,0 +1,101 @@
+<%--
+ - show-license.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Show the user a license which they may grant or reject
+ -
+ - Attributes to pass in:
+ - submission.info - the SubmissionInfo object
+ - license - the license text to display
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ String license = (String) request.getAttribute("license");
+%>
+
+
+
+
+
diff --git a/dspace/jsp/submit/show-uploaded-file.jsp b/dspace/jsp/submit/show-uploaded-file.jsp
new file mode 100644
index 0000000000..e476ee86b3
--- /dev/null
+++ b/dspace/jsp/submit/show-uploaded-file.jsp
@@ -0,0 +1,209 @@
+<%--
+ - show-uploaded-file.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Show uploaded file (single-file submission mode)
+ -
+ - Attributes to pass in
+ - submission.info - the SubmissionInfo object
+ - just.uploaded - Boolean indicating whether the user has just
+ - uploaded a file OK
+ - show.checksums - Boolean indicating whether to show checksums
+ -
+ - FIXME: Merely iterates through bundles, treating all bit-streams as
+ - separate documents. Shouldn't be a problem for early adopters.
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.Bitstream" %>
+<%@ page import="org.dspace.content.BitstreamFormat" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ boolean justUploaded = ((Boolean) request.getAttribute("just.uploaded")).booleanValue();
+ boolean showChecksums = ((Boolean) request.getAttribute("show.checksums")).booleanValue();
+
+ // Get the bitstream
+ Bitstream[] all = si.submission.getItem().getNonInternalBitstreams();
+ Bitstream bitstream = all[0];
+ BitstreamFormat format = bitstream.getFormat();
+%>
+
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/thesis-removed-workaround.jsp b/dspace/jsp/submit/thesis-removed-workaround.jsp
new file mode 100644
index 0000000000..e734723568
--- /dev/null
+++ b/dspace/jsp/submit/thesis-removed-workaround.jsp
@@ -0,0 +1,66 @@
+<%--
+ - thesis-removed-workaround.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Submission removed message - this is displayed when the user has checked
+ - the "This is a thesis" option on the first submission page, had their
+ - submission removed, used the back button to go back to the submission
+ - page, and tried carry on. Normally this would result in an integrity error
+ - since the workspace ID is no longer valid but in this special case we
+ - will display a decent message.
+ -
+ - This page displays a message informing the user that theses are not
+ - presently accepted in DSpace, and that their submission has been removed.
+ - FIXME: MIT-SPECIFIC
+ --%>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+
+
Submission Stopped: Theses Not Accepted in DSpace
+
+
Since DSpace does not accept theses, your submission has been stopped.
+ To start submitting something else click below.
+
+
diff --git a/dspace/jsp/submit/upload-error.jsp b/dspace/jsp/submit/upload-error.jsp
new file mode 100644
index 0000000000..a774adb50b
--- /dev/null
+++ b/dspace/jsp/submit/upload-error.jsp
@@ -0,0 +1,85 @@
+<%--
+ - upload-error.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - List of uploaded files
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ -
+ - FIXME: Merely iterates through bundles, treating all bit-streams as
+ - separate documents. Shouldn't be a problem for early adopters.
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/upload-file-list.jsp b/dspace/jsp/submit/upload-file-list.jsp
new file mode 100644
index 0000000000..8e066dd227
--- /dev/null
+++ b/dspace/jsp/submit/upload-file-list.jsp
@@ -0,0 +1,248 @@
+<%--
+ - upload-file-list.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - List of uploaded files
+ -
+ - Attributes to pass in to this page:
+ - submission.info - the SubmissionInfo object
+ - just.uploaded - Boolean indicating if a file has just been uploaded
+ - so a nice thank you can be displayed.
+ - show.checksums - Boolean indicating whether to show checksums
+ -
+ - FIXME: Assumes each bitstream in a separate bundle.
+ - Shouldn't be a problem for early adopters.
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+<%@ page import="org.dspace.content.Bitstream" %>
+<%@ page import="org.dspace.content.BitstreamFormat" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ boolean justUploaded = ((Boolean) request.getAttribute("just.uploaded")).booleanValue();
+ boolean showChecksums = ((Boolean) request.getAttribute("show.checksums")).booleanValue();
+%>
+
+
+
+
+
+
diff --git a/dspace/jsp/submit/verify-prune.jsp b/dspace/jsp/submit/verify-prune.jsp
new file mode 100644
index 0000000000..aeeb56ed2b
--- /dev/null
+++ b/dspace/jsp/submit/verify-prune.jsp
@@ -0,0 +1,147 @@
+<%--
+ - verify-prune.jsp
+ -
+ - Version: $Revision$
+ -
+ - Date: $Date$
+ -
+ - Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ - Institute of Technology. All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are
+ - met:
+ -
+ - - Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ -
+ - - Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in the
+ - documentation and/or other materials provided with the distribution.
+ -
+ - - Neither the name of the Hewlett-Packard Company nor the name of the
+ - Massachusetts Institute of Technology nor the names of their
+ - contributors may be used to endorse or promote products derived from
+ - this software without specific prior written permission.
+ -
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ - DAMAGE.
+ --%>
+
+<%--
+ - Verify that it's OK to "prune" the item after changing the answer to a
+ - question on the first page
+ -
+ - Attributes to pass in:
+ - submission.info - the SubmissionInfo object
+ - multiple.titles, published.before, multiple.files - Booleans, indicating
+ - the user's choices on the initial questions page
+ - will.remove.titles, will.remove.date, will.remove.files - Booleans,
+ - indicating consequences of new answers to questions
+ --%>
+
+<%@ page import="org.dspace.app.webui.servlet.SubmitServlet" %>
+<%@ page import="org.dspace.app.webui.util.SubmissionInfo" %>
+
+<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
+
+<%
+ SubmissionInfo si =
+ (SubmissionInfo) request.getAttribute("submission.info");
+
+ boolean multipleTitles = ((Boolean) request.getAttribute("multiple.titles")).booleanValue();
+ boolean publishedBefore = ((Boolean) request.getAttribute("published.before")).booleanValue();
+ boolean multipleFiles = ((Boolean) request.getAttribute("multiple.files")).booleanValue();
+
+ boolean willRemoveTitles = ((Boolean) request.getAttribute("will.remove.titles")).booleanValue();
+ boolean willRemoveDate = ((Boolean) request.getAttribute("will.remove.date")).booleanValue();
+ boolean willRemoveFiles = ((Boolean) request.getAttribute("will.remove.files")).booleanValue();
+
+ String buttonPressed = (String) request.getAttribute("button.pressed");
+%>
+
+
+
+
Submit: Caution
+
+
The changes you've made to the first "Describe Your Item" page
+ will affect your submission:
+
+<%
+ if (willRemoveTitles)
+ {
+%>
+
You've indicated that your submission does not have alternative titles,
+ but you've already entered some. If you proceed with this change, the
+ alternative titles you've entered will be removed.
+<%
+ }
+
+ if (willRemoveDate)
+ {
+%>
+
You've indicated that your submission has not been published or publicly
+ distributed before, but you've already entered a date for this. If you
+ proceed, the date you've entered will be removed, and DSpace will assign
+ a date.
+<%
+ }
+
+ if (willRemoveFiles)
+ {
+%>
+
You've indicated that the item you're submitting consists of only a single
+ file, but you've already uploaded more than one file. If you proceed, only
+ the first file you uploaded will be kept, and the rest will be discarded by
+ the system. (The files on your local hard drive will not be affected.)
+<%
+ }
+%>
+
+
Are you sure you want to proceed with the changes?
+
+
+
+
+
diff --git a/dspace/src/org/dspace/app/webui/servlet/SubmitServlet.java b/dspace/src/org/dspace/app/webui/servlet/SubmitServlet.java
new file mode 100644
index 0000000000..5ab46a6c61
--- /dev/null
+++ b/dspace/src/org/dspace/app/webui/servlet/SubmitServlet.java
@@ -0,0 +1,2327 @@
+/*
+ * SubmitServlet.java
+ *
+ * Version: $Revision$
+ *
+ * Date: $Date$
+ *
+ * Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ * Institute of Technology. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Hewlett-Packard Company nor the name of the
+ * Massachusetts Institute of Technology nor the names of their
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+package org.dspace.app.webui.servlet;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.LinkedList;
+import java.util.List;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+
+import com.oreilly.servlet.MultipartWrapper;
+
+import org.dspace.app.webui.util.Authenticate;
+import org.dspace.app.webui.util.JSPManager;
+import org.dspace.app.webui.util.SubmissionInfo;
+import org.dspace.app.webui.util.UIUtil;
+import org.dspace.authorize.AuthorizeException;
+import org.dspace.content.Bitstream;
+import org.dspace.content.BitstreamFormat;
+import org.dspace.content.Bundle;
+import org.dspace.content.Collection;
+import org.dspace.content.Community;
+import org.dspace.content.DCDate;
+import org.dspace.content.DCPersonName;
+import org.dspace.content.DCSeriesNumber;
+import org.dspace.content.DCValue;
+import org.dspace.content.FormatIdentifier;
+import org.dspace.content.InProgressSubmission;
+import org.dspace.content.Item;
+import org.dspace.core.Constants;
+import org.dspace.core.Context;
+import org.dspace.core.LogManager;
+import org.dspace.ingest.WorkspaceItem;
+import org.dspace.workflow.WorkflowItem;
+import org.dspace.workflow.WorkflowManager;
+
+
+/**
+ * Submission servlet for DSpace. Handles the initial submission of items, as
+ * well as the editing of items further down the line.
+ *
+ * Whenever the submit servlet receives a GET request, this is taken to
+ * indicate the start of a fresh new submission, where no collection has been
+ * selected, and the submission process is started from scratch.
+ *
+ * All other interactions happen via POSTs. Part of the post will normally be
+ * a (hidden) "step" parameter, which will correspond to the form that the
+ * user has just filled out. If this is absent, step 0 (select collection)
+ * is assumed, meaning that it's simple to place "Submit to this collection"
+ * buttons on collection home pages.
+ *
+ * According to the step number of the incoming form, the values posted from
+ * the form are processed (using the process* methods), and the item updated
+ * as appropriate. The servlet then forwards control of the request to the
+ * appropriate JSP (from jsp/submit) to render the next stage
+ * of the process or an error if appropriate. Each of these JSPs may
+ * require that attributes be passed in. Check the comments at the top of a
+ * JSP to see which attributes are needed. All submit-related forms require a
+ * properly initialised SubmissionInfo object to be present in the the
+ * "submission.info" attribute. This holds the core information relevant to
+ * the submission, e.g. the item, personal workspace or workflow item, the
+ * submitting "e-person", and the target collection.
+ *
+ * When control of the request reaches a JSP, it is assumed that all checks,
+ * interactions with the database and so on have been performed and that all
+ * necessary information to render the form is in memory. e.g. The
+ * SubmitFormInfo object passed in must be correctly filled out. Thus the
+ * JSPs do no error or integrity checking; it is the servlet's responsibility
+ * to ensure that everything is prepared. The servlet is fairly diligent
+ * about ensuring integrity at each step.
+ *
+ * Each step has an integer constant defined below. The main sequence of the
+ * submission procedure always runs from 0 upwards, until SUBMISSION_COMPLETE.
+ * Other, not-in-sequence steps (such as the cancellation screen and the
+ * "previous version ID verification" screen) have numbers much higher than
+ * SUBMISSION_COMPLETE. These conventions allow the progress bar component
+ * of the submission forms to render the user's progress through the process.
+ *
+ * @author Robert Tansley
+ * @version $Revision$
+ */
+public class SubmitServlet extends DSpaceServlet
+{
+ // Steps in the submission process
+
+ /** Selection collection step */
+ public static final int SELECT_COLLECTION = 0;
+
+ /** Ask initial questions about the submission step */
+ public static final int INITIAL_QUESTIONS = 1;
+
+ /** Edit DC metadata page 1 step */
+ public static final int EDIT_METADATA_1 = 2;
+
+ /** Edit DC metadata page 2 step */
+ public static final int EDIT_METADATA_2 = 3;
+
+ /**
+ * Upload files step. Note this doesn't correspond to an actual
+ * page, since the upload file step consists of a number of
+ * pages with no definite order. This is just used for the progress
+ * bar.
+ */
+ public static final int UPLOAD_FILES = 4;
+
+ /** Review submission step */
+ public static final int REVIEW_SUBMISSION = 5;
+
+ /** Grant license step */
+ public static final int GRANT_LICENSE = 6;
+
+ /** Submission completed step */
+ public static final int SUBMISSION_COMPLETE = 7;
+
+ // Steps which aren't part of the main sequence, but rather
+ // short "diversions" are given high step numbers. The main sequence
+ // is defined as being steps 0 to SUBMISSION_COMPLETE.
+
+ /** Cancellation of a submission */
+ public static final int SUBMISSION_CANCELLED = 101;
+
+ /** List of uploaded files */
+ public static final int FILE_LIST = 102;
+
+ /** Choose file page */
+ public static final int CHOOSE_FILE = 103;
+
+ /** File format page */
+ public static final int GET_FILE_FORMAT = 104;
+
+ /** Error uploading file */
+ public static final int UPLOAD_ERROR = 105;
+
+ /** Change file description page */
+ public static final int CHANGE_FILE_DESCRIPTION = 106;
+
+ /**
+ * Verify pruning of extra files, titles, dates as a result of
+ * changing an answer to one of the initial questions
+ */
+ public static final int VERIFY_PRUNE = 107;
+
+ /** log4j logger */
+ private static Logger log = Logger.getLogger(SubmitServlet.class);
+
+
+ protected void doDSGet(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ /*
+ * A GET on a submit servlet starts a new submission. What happens
+ * depends on the context of the user (where they are.) If they're not
+ * in a community or collection, they can choose any collection
+ * from the list of all collections. If they're in a community,
+ * the list of collections they can choose from will be limited to
+ * those within the current community. If the user has selected
+ * a collection, a new submission will be started in that collection.
+ */
+
+ Community com = UIUtil.getCommunityLocation(request);
+ Collection col = UIUtil.getCollectionLocation(request);
+
+ if (col != null)
+ {
+ // In a collection, skip the "choose selection" stage
+ // Create a workspace item
+ WorkspaceItem wi = WorkspaceItem.create(context, col, true);
+
+ // Proceed to first step
+ SubmissionInfo si = new SubmissionInfo();
+ si.submission = wi;
+ doStep(context, request, response, si, INITIAL_QUESTIONS);
+ context.complete();
+ }
+ else
+ {
+ Collection[] collections;
+
+ if (com != null)
+ {
+ // In a community. Show collections in that community only.
+ collections = com.getCollections();
+ }
+ else
+ {
+ // Show all collections
+ collections = Collection.findAll(context);
+ }
+
+ log.info(LogManager.getHeader(context,
+ "select_collection",
+ ""));
+
+ request.setAttribute("collections", collections);
+ JSPManager.showJSP(request, response,
+ "/submit/select-collection.jsp");
+ }
+ }
+
+
+ protected void doDSPost(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ // First of all, we need to work out if this is a multipart request
+ // The file upload page uses those
+ String contentType = request.getContentType();
+
+ if (contentType != null &&
+ contentType.indexOf("multipart/form-data") != -1)
+ {
+ // This is a multipart request, so it's a file upload
+ processChooseFile(context, request, response);
+ return;
+ }
+
+ // First get the step
+ int step = UIUtil.getIntParameter(request, "step");
+
+ // select collection is a special case - no submissioninfo object
+ if (step == SELECT_COLLECTION)
+ {
+ processSelectCollection(context, request, response);
+ return;
+ }
+
+ // Get submission info
+ SubmissionInfo subInfo = getSubmissionInfo(context, request);
+
+ if (subInfo == null)
+ {
+ /*
+ * Work around for problem where people select "is a thesis",
+ * see the error page, and then use their "back" button thinking
+ * they can start another submission - it's been removed so the ID
+ * in the form is invalid. If we detect the "removed_thesis"
+ * attribute we display a friendly message instead of an integrity
+ * error.
+ */
+ if (request.getSession().getAttribute("removed_thesis") != null)
+ {
+ request.getSession().removeAttribute("removed_thesis");
+ JSPManager.showJSP(request,
+ response,
+ "/submit/thesis-removed-workaround.jsp");
+ return;
+ }
+ else
+ {
+ /*
+ * If the submission info was invalid, set the step to an
+ * invalid number so an integrity error will be shown
+ */
+ step = -1;
+ }
+ }
+
+
+ switch (step)
+ {
+ case INITIAL_QUESTIONS:
+ processInitialQuestions(context, request, response, subInfo);
+ break;
+
+ case EDIT_METADATA_1:
+ processEditMetadataOne(context, request, response, subInfo);
+ break;
+
+ case EDIT_METADATA_2:
+ processEditMetadataTwo(context, request, response, subInfo);
+ break;
+
+ case GET_FILE_FORMAT:
+ processGetFileFormat(context, request, response, subInfo);
+ break;
+
+ case FILE_LIST:
+ processFileList(context, request, response, subInfo);
+ break;
+
+ case UPLOAD_ERROR:
+ processUploadError(context, request, response, subInfo);
+ break;
+
+ case CHANGE_FILE_DESCRIPTION:
+ processChangeFileDescription(context, request, response, subInfo);
+ break;
+
+ case REVIEW_SUBMISSION:
+ processReview(context, request, response, subInfo);
+ break;
+
+ case GRANT_LICENSE:
+ processLicense(context, request, response, subInfo);
+ break;
+
+ case SUBMISSION_CANCELLED:
+ processCancellation(context, request, response, subInfo);
+ break;
+
+ case VERIFY_PRUNE:
+ processVerifyPrune(context, request, response, subInfo);
+ break;
+
+ default:
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ }
+ }
+
+
+ //****************************************************************
+ //****************************************************************
+ // METHODS FOR PROCESSING POSTED FORMS
+ //****************************************************************
+ //****************************************************************
+
+ /**
+ * Process the selection collection stage, or the clicking of a
+ * "submit to this collection" button on a collection home page.
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ */
+ private void processSelectCollection(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ // The user might have clicked cancel. We don't do a
+ // standard cancellation at this stage, since we don't
+ // actually have an item to keep or remove yet.
+ if (request.getParameter("submit_cancel") != null)
+ {
+ // Just send them to their "My DSpace" for now.
+ response.sendRedirect(response.encodeRedirectURL(
+ request.getContextPath() + "/mydspace"));
+ return;
+ }
+
+ // First we find the collection
+ int id = UIUtil.getIntParameter(request, "collection");
+ Collection col = Collection.find(context, id);
+
+ // Show an error if we don't have a collection
+ if (col == null)
+ {
+ JSPManager.showInvalidIDError(request,
+ response,
+ request.getParameter("collection"),
+ Constants.COLLECTION);
+ }
+ else
+ {
+ WorkspaceItem wi = WorkspaceItem.create(context, col, true);
+
+ // Proceed to first step
+ SubmissionInfo si = new SubmissionInfo();
+ si.submission = wi;
+ doStep(context, request, response, si, INITIAL_QUESTIONS);
+
+ context.complete();
+ }
+ }
+
+
+ /**
+ * process input from initial-questions.jsp
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processInitialQuestions(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_next");
+
+ // Firstly, check for a click of the cancel button.
+ if (buttonPressed.equals("submit_cancel"))
+ {
+ doCancellation(request,
+ response,
+ subInfo,
+ INITIAL_QUESTIONS,
+ INITIAL_QUESTIONS);
+ return;
+ }
+
+ // Get the values from the form
+ boolean multipleTitles =
+ UIUtil.getBoolParameter(request, "multiple_titles");
+ boolean publishedBefore =
+ UIUtil.getBoolParameter(request, "published_before");
+ boolean multipleFiles =
+ UIUtil.getBoolParameter(request, "multiple_files");
+ boolean isThesis =
+ UIUtil.getBoolParameter(request, "is_thesis");
+
+ if (isWorkflow(subInfo))
+ {
+ // Thesis question does not appear in workflow mode..
+ isThesis = false;
+ }
+
+ // First and foremost - if it's a thesis, reject the submission
+ // FIXME: MIT-SPECIFIC
+ if (isThesis)
+ {
+ WorkspaceItem wi = (WorkspaceItem) subInfo.submission;
+ wi.delete();
+
+ // Remember that we've removed a thesis in the session
+ request.getSession().setAttribute(
+ "removed_thesis",
+ new Boolean(true));
+
+ // Display appropriate message
+ JSPManager.showJSP(request, response, "/submit/no-theses.jsp");
+
+ context.complete();
+ return;
+ }
+
+ // Now check to see if the changes will remove any values
+ // (i.e. multiple files, titles or an issue date.)
+ boolean willRemoveTitles = false;
+ boolean willRemoveDate = false;
+ boolean willRemoveFiles = false;
+
+ if (multipleTitles == false)
+ {
+ DCValue[] altTitles = subInfo.submission.getItem().getDC(
+ "title", "alternative", Item.ANY);
+
+ willRemoveTitles = altTitles.length > 0;
+ }
+
+ if (publishedBefore == false)
+ {
+ DCValue[] dateIssued = subInfo.submission.getItem().getDC(
+ "date", "issued", Item.ANY);
+
+ willRemoveDate = dateIssued.length > 0;
+ }
+
+ if (multipleFiles == false)
+ {
+ // FIXME: Assuming each bundle has but one bitstream in it
+ Bundle[] bundles = subInfo.submission.getItem().getBundles();
+
+ willRemoveFiles = bundles.length > 1;
+ }
+
+ // If anything is going to be removed from the item as a result
+ // of changing the answer to one of the questions, we need
+ // to inform the user and make sure that's OK
+ if (willRemoveTitles || willRemoveDate || willRemoveFiles)
+ {
+ // Verify pruning of extra bits
+ request.setAttribute("submission.info", subInfo);
+ request.setAttribute(
+ "multiple.titles", new Boolean(multipleTitles));
+ request.setAttribute(
+ "published.before", new Boolean(publishedBefore));
+ request.setAttribute(
+ "multiple.files", new Boolean(multipleFiles));
+ request.setAttribute(
+ "will.remove.titles", new Boolean(willRemoveTitles));
+ request.setAttribute(
+ "will.remove.date", new Boolean(willRemoveDate));
+ request.setAttribute(
+ "will.remove.files", new Boolean(willRemoveFiles));
+ request.setAttribute("button.pressed",
+ UIUtil.getSubmitButton(request, "submit_next"));
+
+ JSPManager.showJSP(request, response, "/submit/verify-prune.jsp");
+ }
+ else
+ {
+ // Nothing needs removing, so just make the changes
+ subInfo.submission.setMultipleTitles(multipleTitles);
+ subInfo.submission.setPublishedBefore(publishedBefore);
+
+ // "Multiple files" irrelevant in workflow mode
+ if (!isWorkflow(subInfo))
+ {
+ subInfo.submission.setMultipleFiles(multipleFiles);
+ }
+
+ subInfo.submission.update();
+
+ // On to the next stage
+ if (buttonPressed.equals("submit_next"))
+ {
+ // Update user's progress
+ userHasReached(subInfo, EDIT_METADATA_1);
+
+ // User has clicked "Next"
+ doStep(context, request, response, subInfo, EDIT_METADATA_1);
+ }
+ else
+ {
+ // Progress bar button clicked
+ doStepJump(context, request, response, subInfo);
+ }
+
+ context.complete();
+ }
+ }
+
+
+ /**
+ * Process input from "verify prune" step
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processVerifyPrune(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ if (request.getParameter("do_not_proceed") != null)
+ {
+ // User cancelled
+ doStep(context, request, response, subInfo, INITIAL_QUESTIONS);
+ return;
+ }
+
+ // User elected to proceed - do the pruning
+ // Get the values from the form
+ boolean multipleTitles =
+ UIUtil.getBoolParameter(request, "multiple_titles");
+ boolean publishedBefore =
+ UIUtil.getBoolParameter(request, "published_before");
+
+ // Multiple files question does not appear in workflow mode.
+ // Since the submission will have a license, the answer to
+ // this question will always be "yes"
+ boolean multipleFiles = (isWorkflow(subInfo) ||
+ UIUtil.getBoolParameter(request, "multiple_files"));
+
+ if (!multipleTitles)
+ {
+ subInfo.submission.getItem().clearDC("title",
+ "alternative", Item.ANY);
+ }
+
+ if (publishedBefore == false)
+ {
+ subInfo.submission.getItem().clearDC("date", "issued", Item.ANY);
+ }
+
+ if (multipleFiles == false)
+ {
+ // FIXME: Assuming each bundle has but one bitstream in it
+ Bundle[] bundles = subInfo.submission.getItem().getBundles();
+
+ // Remove all but the first bundle
+ for (int i = 1; i < bundles.length; i++)
+ {
+ bundles[i].deleteWithContents();
+ }
+ }
+
+ // Nothing needs removing, so just make the changes
+ subInfo.submission.setMultipleTitles(multipleTitles);
+ subInfo.submission.setPublishedBefore(publishedBefore);
+
+ // "Multiple files" irrelevant in workflow mode
+ if (!isWorkflow(subInfo))
+ {
+ subInfo.submission.setMultipleFiles(multipleFiles);
+ }
+
+ subInfo.submission.update();
+
+ // Everything went OK if we get to here, so now response
+ // to the original button press
+ if (request.getParameter("submit_next") != null)
+ {
+ // Update user's progress
+ userHasReached(subInfo, EDIT_METADATA_1);
+
+ // User has clicked "Next"
+ doStep(context, request, response, subInfo, EDIT_METADATA_1);
+
+ context.complete();
+ }
+ else
+ {
+ // Progress bar button clicked
+ doStepJump(context, request, response, subInfo);
+
+ context.complete();
+ }
+ }
+
+
+ /**
+ * process input from edit-metadata-1.jsp
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processEditMetadataOne(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_next");
+
+ // Firstly, check for a click of the cancel button.
+ if (buttonPressed.equals("submit_cancel"))
+ {
+ doCancellation(request,
+ response,
+ subInfo,
+ EDIT_METADATA_1,
+ EDIT_METADATA_1);
+ return;
+ }
+
+ Item item = subInfo.submission.getItem();
+
+ // Update the item metadata.
+ readNames(request, item, "contributor", "author", true);
+ readText(request, item, "title", null, false);
+
+ if (subInfo.submission.hasMultipleTitles())
+ {
+ readText(request, item, "title", "alternative", true);
+ }
+
+ if (subInfo.submission.isPublishedBefore())
+ {
+ readDate(request, item, "date", "issued");
+ }
+
+ readSeriesNumbers(request, item, "relation", "ispartofseries", true);
+
+ // FIXME: Maybe should do integrity check using language object
+ readText(request, item, "language", "iso", false);
+
+ // Identifiers - A special case so do this here
+ // First, remove existing identifiers.
+ subInfo.submission.getItem().clearDC("identifier", Item.ANY, Item.ANY);
+
+ // Get qualifiers and values
+ List quals = getRepeatedParameter(request, "identifier_qualifier");
+ List vals = getRepeatedParameter(request, "identifier_value");
+
+ // Add to item DC
+ for (int i = 0; i -1)
+ {
+ // Remove button pressed - stay with same form
+ nextStep = EDIT_METADATA_1;
+ }
+
+ // Write changes to database
+ subInfo.submission.update();
+
+ if (nextStep != -1)
+ {
+ doStep(context, request, response, subInfo, nextStep);
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+
+ context.complete();
+ }
+
+
+ /**
+ * process input from edit-metadata-2.jsp
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processEditMetadataTwo(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_next");
+
+ // Firstly, check for a click of the cancel button.
+ if (buttonPressed.equals("submit_cancel"))
+ {
+ doCancellation(request,
+ response,
+ subInfo,
+ EDIT_METADATA_2,
+ EDIT_METADATA_2);
+ return;
+ }
+
+ Item item = subInfo.submission.getItem();
+
+ // Update object from form values
+ readText(request, item, "subject", null, true);
+ readText(request, item, "description", "abstract", false);
+ readText(request, item, "description", "sponsorship", false);
+ readText(request, item, "description", null, false);
+
+ // Proceed according to button pressed
+ int nextStep = -1;
+
+ if (buttonPressed.equals("submit_subject_more"))
+ {
+ // "Add more" clicked for subject keywords
+ subInfo.moreBoxesFor = "subject";
+ subInfo.jumpToField = "subject";
+ nextStep = EDIT_METADATA_2;
+ }
+ else if (buttonPressed.equals("submit_prev"))
+ {
+ nextStep = EDIT_METADATA_1;
+ }
+ else if (buttonPressed.equals("submit_next"))
+ {
+ userHasReached(subInfo, UPLOAD_FILES);
+ nextStep = UPLOAD_FILES;
+ }
+ else if (buttonPressed.indexOf("remove") > -1)
+ {
+ // Remove button pressed - stay with same form
+ nextStep = EDIT_METADATA_2;
+ }
+
+ // Write changes to database
+ subInfo.submission.update();
+
+ if (nextStep != -1)
+ {
+ doStep(context, request, response, subInfo, nextStep);
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+
+ context.complete();
+ }
+
+
+ /**
+ * Process the input from the choose file page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ */
+ private void processChooseFile(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ // Wrap multipart request to get the submission info
+ // FIXME: /tmp hardcoded and platform-specific
+ // FIXME: Ensure this works with large files (no small limit)
+ MultipartWrapper wrapper = new MultipartWrapper(request, "/tmp");
+ SubmissionInfo subInfo = getSubmissionInfo(context, wrapper);
+ String buttonPressed = UIUtil.getSubmitButton(wrapper, "submit_next");
+
+ if (subInfo == null)
+ {
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ return;
+ }
+
+ Item item = subInfo.submission.getItem();
+
+ if (buttonPressed.equals("submit_cancel"))
+ {
+ doCancellation(request,
+ response,
+ subInfo,
+ SubmitServlet.CHOOSE_FILE,
+ SubmitServlet.UPLOAD_FILES);
+ }
+ else if (buttonPressed.equals("submit_prev"))
+ {
+ // Slightly tricky; if the user clicks on "previous,"
+ // and they haven't uploaded any files yet, the previous
+ // screen is the edit metadata 2 page. If there are
+ // upload files, we go back to the file list page,
+ // without uploading the file they've specified.
+ if (item.getBundles().length > 0)
+ {
+ // Have files, go to list
+ showUploadFileList(request,
+ response,
+ subInfo,
+ false,
+ false);
+ }
+ else
+ {
+ // No files, go back to edit metadata 2
+ doStep(context, request, response, subInfo, EDIT_METADATA_2);
+ }
+ }
+ else if (buttonPressed.equals("submit_next"))
+ {
+ boolean ok = false;
+ Bitstream b = null;
+ BitstreamFormat bf = null;
+
+ try
+ {
+ File temp = wrapper.getFile("file");
+
+ if (temp == null)
+ {
+ // No file specified
+ doStep(context, request, response, subInfo, UPLOAD_FILES);
+ return;
+ }
+
+ // Read the temp file into a bitstream
+ InputStream is = new BufferedInputStream(new FileInputStream(
+ temp));
+ b = item.createSingleBitstream(is);
+
+ // Strip all but the last filename. It would be nice
+ // to know which OS the file came from.
+ String noPath = wrapper.getFilesystemName("file");
+ while (noPath.indexOf('/') > -1)
+ {
+ noPath = noPath.substring(
+ noPath.indexOf('/') + 1);
+ }
+ while (noPath.indexOf('\\') > -1)
+ {
+ noPath = noPath.substring(
+ noPath.indexOf('\\') + 1);
+ }
+
+ b.setName(noPath);
+ b.setSource(wrapper.getFilesystemName("file"));
+ b.setDescription(wrapper.getParameter("description"));
+
+ // Identify the format
+ bf = FormatIdentifier.guessFormat(context, b);
+ b.setFormat(bf);
+
+ // Update to DB
+ b.update();
+ item.update();
+
+ ok = true;
+ }
+ catch (IOException ie)
+ {
+ // Error storing bitstream - log it, leave ok=false
+ log.warn(LogManager.getHeader(context,
+ "upload_error",
+ ""),
+ ie);
+ }
+
+ if (ok)
+ {
+ // Uploaded etc. OK
+ if (bf != null)
+ {
+ // Format was identified
+ showUploadFileList(request, response, subInfo, true, false);
+ }
+ else
+ {
+ // Format couldn't be identified
+ showGetFileFormat(context, request, response, subInfo, b);
+ }
+ context.complete();
+ }
+ else
+ {
+ request.setAttribute("submission.info", subInfo);
+ JSPManager.showJSP(request,
+ response,
+ "/submit/upload_error.jsp");
+ }
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ }
+
+
+ /**
+ * Process input from get file type page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processGetFileFormat(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit");
+
+ if (subInfo.bitstream != null)
+ {
+ // Did the user select a format?
+ int typeID = UIUtil.getIntParameter(request, "format");
+
+ BitstreamFormat format = BitstreamFormat.find(context, typeID);
+
+ if (format != null)
+ {
+ subInfo.bitstream.setFormat(format);
+ }
+ else
+ {
+ String userDesc = request.getParameter("format_description");
+ subInfo.bitstream.setUserFormatDescription(userDesc);
+ }
+
+ subInfo.bitstream.update();
+
+ if (buttonPressed.equals("submit"))
+ {
+ showUploadFileList(request, response, subInfo, true, false);
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ context.complete();
+ }
+ else
+ {
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ }
+ }
+
+
+ /**
+ * Process input from file list page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processFileList(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_next");
+ Item item = subInfo.submission.getItem();
+
+ if (buttonPressed.equals("submit_cancel"))
+ {
+ doCancellation(request,
+ response,
+ subInfo,
+ SubmitServlet.FILE_LIST,
+ SubmitServlet.UPLOAD_FILES);
+ }
+ else if (buttonPressed.equals("submit_prev"))
+ {
+ // In some cases, this might be expected to go back
+ // to the "choose file" page, but that doesn't make
+ // a great deal of sense, so go back to edit metadata 2.
+ doStep(context, request, response, subInfo, EDIT_METADATA_2);
+ }
+ else if (buttonPressed.equals("submit_next"))
+ {
+ // Finished the uploading of files
+ // FIXME Validation check here
+ userHasReached(subInfo, REVIEW_SUBMISSION);
+ doStep(context, request, response, subInfo, REVIEW_SUBMISSION);
+ context.complete();
+ }
+ else if (buttonPressed.equals("submit_more"))
+ {
+ // Upload another file
+ request.setAttribute("submission.info", subInfo);
+ JSPManager.showJSP(request, response, "/submit/choose-file.jsp");
+ }
+ else if (buttonPressed.equals("submit_show_checksums"))
+ {
+ // Show the checksums
+ showUploadFileList(request, response, subInfo, false, true);
+ }
+ else if (buttonPressed.startsWith("submit_describe_"))
+ {
+ // Change the description of a bitstream
+ Bitstream bitstream;
+
+ // Which bitstream does the user want to describe?
+ try
+ {
+ int id = Integer.parseInt(buttonPressed.substring(16));
+ bitstream = Bitstream.find(context, id);
+ }
+ catch (NumberFormatException nfe)
+ {
+ bitstream = null;
+ }
+
+ if (bitstream == null)
+ {
+ // Invalid or mangled bitstream ID
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ return;
+ }
+
+ // Display the form letting them change the description
+ subInfo.bitstream = bitstream;
+ request.setAttribute("submission.info", subInfo);
+ JSPManager.showJSP(request, response,
+ "/submit/change-file-description.jsp");
+ }
+ else if (buttonPressed.startsWith("submit_remove_"))
+ {
+ // A "remove" button must have been pressed
+ Bitstream bitstream;
+
+ // Which bitstream does the user want to describe?
+ try
+ {
+ int id = Integer.parseInt(buttonPressed.substring(14));
+ bitstream = Bitstream.find(context, id);
+ }
+ catch (NumberFormatException nfe)
+ {
+ bitstream = null;
+ }
+
+ if (bitstream == null)
+ {
+ // Invalid or mangled bitstream ID
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ return;
+ }
+
+ // FIXME: Assumes: 1 bitstream in each bundle
+ Bundle[] bundles = bitstream.getBundles();
+ item.removeBundle(bundles[0]);
+ bundles[0].deleteWithContents();
+ item.update();
+
+ showFirstUploadPage(context,request, response, subInfo);
+ context.complete();
+ }
+ else if (buttonPressed.startsWith("submit_format_"))
+ {
+ // A "format is wrong" button must have been pressed
+ Bitstream bitstream;
+
+ // Which bitstream does the user want to describe?
+ try
+ {
+ int id = Integer.parseInt(buttonPressed.substring(14));
+ bitstream = Bitstream.find(context, id);
+ }
+ catch (NumberFormatException nfe)
+ {
+ bitstream = null;
+ }
+
+ if (bitstream == null)
+ {
+ // Invalid or mangled bitstream ID
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ return;
+ }
+
+ subInfo.bitstream = bitstream;
+ showGetFileFormat(context, request, response, subInfo, bitstream);
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ }
+
+
+ /**
+ * Process input from the upload error page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processUploadError(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_next");
+
+ // no real options on the page, just retry!
+ if (buttonPressed.equals("submit"))
+ {
+ request.setAttribute("submission.info", subInfo);
+ JSPManager.showJSP(request, response, "/submit/choose-file.jsp");
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ }
+
+
+ /**
+ * Process input from the "change file description" page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processChangeFileDescription(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ if (subInfo.bitstream != null)
+ {
+ subInfo.bitstream.setDescription(
+ request.getParameter("description"));
+ subInfo.bitstream.update();
+
+ if (request.getParameter("submit") != null)
+ {
+ showUploadFileList(request, response, subInfo, false, false);
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+
+ context.complete();
+ }
+ else
+ {
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ }
+ }
+
+
+ /**
+ * Process information from "submission cancelled" page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processCancellation(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_back");
+
+ if (buttonPressed.equals("submit_back"))
+ {
+ // User wants to continue with submission
+ int previous = UIUtil.getIntParameter(request, "previous_step");
+
+ doStep(context, request, response, subInfo, previous);
+ }
+ else if (buttonPressed.equals("submit_remove"))
+ {
+ // User wants to cancel and remove
+ // Cancellation page only applies to workspace items
+ WorkspaceItem wi = (WorkspaceItem) subInfo.submission;
+
+ wi.delete();
+
+ JSPManager.showJSP(request, response,
+ "/submit/cancelled-removed.jsp");
+
+ context.complete();
+ }
+ else if (buttonPressed.equals("submit_keep"))
+ {
+ // Save submission for later - just show message
+ JSPManager.showJSP(request, response,
+ "/submit/saved.jsp");
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ }
+
+
+ /**
+ * Process button click on "review submission" page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processReview(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_cancel");
+
+ if (buttonPressed.equals("submit_cancel"))
+ {
+ doCancellation(request,
+ response,
+ subInfo,
+ REVIEW_SUBMISSION,
+ REVIEW_SUBMISSION);
+ }
+ else if (buttonPressed.equals("submit_next"))
+ {
+ // If the user is performing the initial submission
+ // of an item, we go to the grant license stage
+ if (!isWorkflow(subInfo))
+ {
+ userHasReached(subInfo, GRANT_LICENSE);
+ doStep(context, request, response, subInfo, GRANT_LICENSE);
+ context.complete();
+ }
+ else
+ {
+ // The user is performing an edit as part
+ // of a workflow task, so we take them
+ // back to the relevant perform task page
+/* FIXME EPerson user = getCurrentUser(request);
+
+ MyDSpaceServlet.showPerformTask(
+ request,
+ response,
+ user,
+ subInfo.workflowItem);
+*/ }
+ }
+ else if (buttonPressed.equals("submit_prev"))
+ {
+ // Back to file upload
+ doStep(context, request, response, subInfo, UPLOAD_FILES);
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ }
+
+ /**
+ * Process the input from the license page
+ *
+ * @param context current DSpace context
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo submission info object
+ */
+ private void processLicense(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException, AuthorizeException
+ {
+ String buttonPressed = UIUtil.getSubmitButton(request, "submit_cancel");
+
+ if (buttonPressed.equals("submit_grant"))
+ {
+ // License granted
+ log.info(LogManager.getHeader(context,
+ "accept_license",
+ getSubmissionLogInfo(subInfo)));
+
+ WorkflowManager.start(context, (WorkspaceItem) subInfo.submission);
+
+ // FIXME: pass in more information about what happens next?
+ JSPManager.showJSP(request, response, "/submit/complete.jsp");
+ }
+ else if (request.getParameter("submit_reject") != null)
+ {
+ // User has rejected license.
+ log.info(LogManager.getHeader(context,
+ "reject_license",
+ getSubmissionLogInfo(subInfo)));
+
+ // Show information page.
+ JSPManager.showJSP(request,
+ response,
+ "/submit/license-rejected.jsp");
+ }
+ else
+ {
+ doStepJump(context, request, response, subInfo);
+ }
+ }
+
+
+ //****************************************************************
+ //****************************************************************
+ // METHODS FOR SHOWING FORMS
+ //****************************************************************
+ //****************************************************************
+
+ /**
+ * Process a click on a buttonin the progress bar. to jump to a step.
+ * This method should be called when it has been determined that no
+ * other button has been pressed.
+ *
+ * @param context DSpace context object
+ * @param request the request object
+ * @param response the response object
+ * @param subInfo SubmissionInfo pertaining to this submission
+ */
+ private void doStepJump(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws ServletException, IOException, SQLException
+ {
+ // Find the button that was pressed. It would start with
+ // "submit_jump_".
+ String buttonPressed = UIUtil.getSubmitButton(request, "");
+
+ int nextStep = -1;
+
+ if (buttonPressed.startsWith("submit_jump_"))
+ {
+ // Button on progress bar pressed
+ try
+ {
+ nextStep = Integer.parseInt(buttonPressed.substring(12, 13));
+ }
+ catch (NumberFormatException ne)
+ {
+ // mangled number
+ nextStep = -1;
+ }
+
+ // Integrity check: make sure they aren't going
+ // forward or backward too far
+ if (nextStep <= SubmitServlet.SELECT_COLLECTION)
+ {
+ nextStep = -1;
+ }
+
+ if (nextStep > getStepReached(subInfo))
+ {
+ nextStep = -1;
+ }
+ }
+
+ if (nextStep == -1)
+ {
+ // Either no button pressed, or an illegal stage
+ // reached. UI doesn't allow this, so something's
+ // wrong if that happens.
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ }
+ else
+ {
+ // Do the relevant step
+ doStep(context, request, response, subInfo, nextStep);
+ }
+ }
+
+ /**
+ * Display the page for the relevant step. Pass in a step number
+ * between SubmitServlet.INITIAL_QUESTIONS and
+ * SubmitServlet.SUBMISSION_COMPLETE - other cases (such as cancellations
+ * and multi-file upload interactions) are handled elsewhere.
+ *
+ * @param context DSpace context
+ * @param request the request object
+ * @param response the response object
+ * @param subInfo SubmissionInfo pertaining to this submission
+ * @param step the step number to display
+ */
+ private void doStep(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo,
+ int step)
+ throws ServletException, IOException, SQLException
+ {
+ // All steps require the submitforminfo
+ request.setAttribute("submission.info", subInfo);
+
+ switch (step)
+ {
+ case INITIAL_QUESTIONS:
+ JSPManager.showJSP(request,
+ response,
+ "/submit/initial-questions.jsp");
+ break;
+
+ case EDIT_METADATA_1:
+ JSPManager.showJSP(request,
+ response,
+ "/submit/edit-metadata-1.jsp");
+ break;
+
+ case EDIT_METADATA_2:
+ JSPManager.showJSP(request,
+ response,
+ "/submit/edit-metadata-2.jsp");
+ break;
+
+ case UPLOAD_FILES:
+ showFirstUploadPage(context, request, response, subInfo);
+ break;
+
+ case CHOOSE_FILE:
+ JSPManager.showJSP(request, response, "/submit/choose-file.jsp");
+ break;
+
+ case FILE_LIST:
+ showUploadFileList(request,
+ response,
+ subInfo,
+ false,
+ false);
+ break;
+
+ case REVIEW_SUBMISSION:
+ JSPManager.showJSP(request, response, "/submit/review.jsp");
+ break;
+
+ case GRANT_LICENSE:
+ Collection c = subInfo.submission.getCollection();
+ request.setAttribute("license", c.getLicense());
+ JSPManager.showJSP(request, response, "submit/show-license.jsp");
+ break;
+
+ case SUBMISSION_COMPLETE:
+ JSPManager.showJSP(request, response, "submit/complete.jsp");
+ break;
+
+ default:
+ log.warn(LogManager.getHeader(context,
+ "integrity_error",
+ UIUtil.getRequestLogInfo(request)));
+ JSPManager.showIntegrityError(request, response);
+ }
+ }
+
+ /**
+ * Respond to the user clicking "cancel".
+ *
+ * @param request current servlet request object
+ * @param response current servlet response object
+ * @param subInfo SubmissionInfo object
+ * @param step step corresponding to the page the user
+ * clicked "cancel" on.
+ * @param displayStep the step the user had reached in terms
+ * of the progress bar.
+ */
+ private void doCancellation(HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo,
+ int step,
+ int displayStep)
+ throws ServletException, IOException, SQLException
+ {
+ // If this is a workflow item, we need to return the
+ // user to the "perform task" page
+ if (isWorkflow(subInfo))
+ {
+/* // Get the user
+ EPerson user = getCurrentUser(request);
+
+ MyDSpaceServlet.showPerformTask(
+ request,
+ response,
+ user,
+ subInfo.workflowItem);
+*/ }
+ else
+ {
+ request.setAttribute("submission.info", subInfo);
+ request.setAttribute("step", String.valueOf(step));
+ request.setAttribute("display.step",
+ String.valueOf(displayStep));
+ JSPManager.showJSP(request, response, "/submit/cancel.jsp");
+ }
+ }
+
+ /**
+ * Display the first appropriate page in the file upload sequence.
+ * Which page this is depends on whether the user has uploaded
+ * any files in this item already.
+ *
+ * @param context the DSpace context object
+ * @param request the request object
+ * @param response the response object
+ * @param subInfo the SubmissionInfo object
+ */
+ private void showFirstUploadPage(Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo)
+ throws SQLException, ServletException, IOException
+ {
+ Bundle[] bundles = subInfo.submission.getItem().getBundles();
+
+ if (bundles.length > 0)
+ {
+ // The item has files associated with it.
+ showUploadFileList(request,
+ response,
+ subInfo,
+ false,
+ false);
+ }
+ else
+ {
+ // No items uploaded yet; show the "choose file" page
+ doStep(context, request, response, subInfo, CHOOSE_FILE);
+ }
+ }
+
+ /**
+ * Show the upload file page
+ *
+ * @param request the request object
+ * @param response the response object
+ * @param subInfo the SubmissionInfo object
+ * @param justUploaded pass in true if the user just successfully
+ * uploaded a file
+ * @param showChecksums pass in true if checksums should be displayed
+ */
+ private void showUploadFileList(HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo,
+ boolean justUploaded,
+ boolean showChecksums)
+ throws SQLException, ServletException, IOException
+ {
+ // Set required attributes
+ request.setAttribute("submission.info", subInfo);
+ request.setAttribute("just.uploaded", new Boolean(justUploaded));
+ request.setAttribute("show.checksums", new Boolean(showChecksums));
+
+ // Always go to advanced view in workflow mode
+ if (subInfo.submission.hasMultipleFiles())
+ {
+ JSPManager.showJSP(request,
+ response,
+ "/submit/upload-file-list.jsp");
+ }
+ else
+ {
+ // FIXME: Assume one and only one bitstream
+ JSPManager.showJSP(request,
+ response,
+ "/submit/show-uploaded-file.jsp");
+ }
+ }
+
+ /**
+ * Get the type of a file from the user
+ *
+ * @param context context object
+ * @param request the request object
+ * @param response the response object
+ * @param subInfo the SubmissionInfo object
+ * @param bitstream the Bitstream to get the type of
+ */
+ private void showGetFileFormat(
+ Context context,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ SubmissionInfo subInfo,
+ Bitstream bitstream)
+ throws SQLException, ServletException, IOException
+ {
+ BitstreamFormat[] formats = BitstreamFormat.findNonInternal(context);
+
+ subInfo.bitstream = bitstream;
+
+ request.setAttribute("submission.info", subInfo);
+ request.setAttribute("bitstream.formats", formats);
+
+ // What does the system think it is?
+ BitstreamFormat guess =
+ FormatIdentifier.guessFormat(context, bitstream);
+
+ request.setAttribute("guessed.format", guess);
+
+ JSPManager.showJSP(request, response, "/submit/get-file-format.jsp");
+ }
+
+
+ //****************************************************************
+ //****************************************************************
+ // MISCELLANEOUS CONVENIENCE METHODS
+ //****************************************************************
+ //****************************************************************
+
+ /**
+ * Get a filled-out submission info object from the parameters
+ * in the current request. If there is a problem, null
+ * is returned.
+ *
+ * @param context DSpace context
+ * @param request HTTP request
+ *
+ * @return filled-out submission info, or null
+ */
+ private SubmissionInfo getSubmissionInfo(Context context,
+ HttpServletRequest request)
+ throws SQLException
+ {
+ SubmissionInfo info = new SubmissionInfo();
+
+ if (request.getParameter("workflow_id") != null)
+ {
+ int workflowID = UIUtil.getIntParameter(request, "workflow_id");
+ info.submission = WorkflowItem.find(context, workflowID);
+ }
+ else
+ {
+ int workspaceID = UIUtil.getIntParameter(request,
+ "workspace_item_id");
+ info.submission = WorkspaceItem.find(context, workspaceID);
+ }
+
+ // Is something wrong?
+ if (info.submission == null)
+ {
+ return null;
+ }
+
+ if (request.getParameter("bundle_id") != null)
+ {
+ int bundleID = UIUtil.getIntParameter(request, "bundle_id");
+ info.bundle = Bundle.find(context, bundleID);
+ }
+
+ if (request.getParameter("bitstream_id") != null)
+ {
+ int bitstreamID = UIUtil.getIntParameter(request, "bitstream_id");
+ info.bitstream = Bitstream.find(context, bitstreamID);
+ }
+
+ return info;
+ }
+
+
+ /**
+ * Is the submission in the workflow process?
+ *
+ * @param si the submission info
+ * @return true if the submission is in the workflow process
+ */
+ public static boolean isWorkflow(SubmissionInfo si)
+ {
+ return (si.submission != null && si.submission instanceof WorkflowItem);
+ }
+
+
+ /**
+ * Return the submission info as hidden parameters for an HTML form
+ *
+ * @param si the submission info
+ * @return HTML hidden parameters
+ */
+ public static String getSubmissionParameters(SubmissionInfo si)
+ {
+ String info = "";
+
+ if (isWorkflow(si))
+ {
+ info = info + "";
+ }
+ else
+ {
+ info = info + "";
+ }
+
+ if (si.bundle != null)
+ {
+ info = info + "";
+ }
+
+ if (si.bitstream != null)
+ {
+ info = info + "";
+ }
+
+ return info;
+ }
+
+
+
+ /**
+ * Return text information suitable for logging
+ *
+ * @param si the submission info
+ * @return the type and ID of the submission, bundle and/or bitstream
+ * for logging
+ */
+ public String getSubmissionLogInfo(SubmissionInfo si)
+ {
+ String info = "";
+
+ if (isWorkflow(si))
+ {
+ info = info + "workflow_id=" + si.submission.getID();
+ }
+ else
+ {
+ info = info + "workspace_item_id" + si.submission.getID();
+ }
+
+ if (si.bundle != null)
+ {
+ info = info + ",bundle_id=" + si.bundle.getID();
+ }
+
+ if (si.bitstream != null)
+ {
+ info = info + ",bitstream_id=" + si.bitstream.getID();
+ }
+
+ return info;
+ }
+
+
+ /**
+ * Indicate the user has advanced to the given stage. This will
+ * only actually do anything when it's a user initially entering
+ * a submission. It will only increase the "stage reached" column -
+ * it will not "set back" where a user has reached.
+ *
+ * @param subInfo the SubmissionInfo object pertaining to the current
+ * submission
+ * @param step the step the user has just reached
+ */
+ private void userHasReached(SubmissionInfo subInfo, int step)
+ throws SQLException, AuthorizeException
+ {
+ if (!isWorkflow(subInfo))
+ {
+ WorkspaceItem wi = (WorkspaceItem) subInfo.submission;
+ if (step > wi.getStageReached())
+ {
+ wi.setStageReached(step);
+ wi.update();
+ }
+ }
+ }
+
+
+ /**
+ * Find out which step a user has reached in the submission process. If
+ * the submission is in the workflow process, this returns
+ * REVIEW_SUBMISSION.
+ *
+ * @param subInfo submission info object
+ *
+ * @return step reached, between SELECT_COLLECTION and SUBMISSION_COMPLETE
+ */
+ public static int getStepReached(SubmissionInfo subInfo)
+ {
+ if (isWorkflow(subInfo))
+ {
+ return REVIEW_SUBMISSION;
+ }
+ else
+ {
+ WorkspaceItem wi = (WorkspaceItem) subInfo.submission;
+ int i = wi.getStageReached();
+
+ // Uninitialised workspace items give "-1" as the stage reached
+ // this is a special value used by the progress bar, so we change
+ // it to "INITIAL_QUESTIONS"
+ if (i == -1)
+ {
+ i = INITIAL_QUESTIONS;
+ }
+
+System.err.println("GOOOOO: " + i);
+ return i;
+ }
+ }
+
+
+ //****************************************************************
+ //****************************************************************
+ // METHODS FOR FILLING DC FIELDS FROM METADATA FORMS
+ //****************************************************************
+ //****************************************************************
+
+ /**
+ * Set relevant DC fields in an item from name values in the form.
+ * Some fields are repeatable in the form. If this is the case, and
+ * the field is "contributor.author", the names in the request
+ * will be from the fields as follows:
+ *
+ * contributor_author_last_0 -> last name of first author
+ * contributor_author_first_0 -> first name(s) of first author
+ * contributor_author_last_1 -> last name of second author
+ * contributor_author_first_1 -> first name(s) of second author
+ *
+ * and so on. If the field is unqualified:
+ *
+ * contributor_last_0 -> last name of first contributor
+ * contributor_first_0 -> first name(s) of first contributor
+ *
+ * If the parameter "submit_contributor_author_remove_n" is set, that
+ * value is removed.
+ *
+ * Otherwise the parameters are of the form:
+ *
+ * contributor_author_last
+ * contributor_author_first
+ *
+ * The values will be put in separate DCValues, in the form
+ * "last name, first name(s)", ordered as they appear in the list.
+ * These will replace any existing values.
+ *
+ * @param request the request object
+ * @param item the item to update
+ * @param element the DC element
+ * @param qualifier the DC qualifier, or null if unqualified
+ * @param repeated set to true if the field is repeatable on the form
+ */
+ private void readNames(HttpServletRequest request,
+ Item item,
+ String element,
+ String qualifier,
+ boolean repeated)
+ {
+ String dcname = element;
+ if (qualifier != null)
+ {
+ dcname = element + "_" + qualifier;
+ }
+
+ // Names to add
+ List firsts = new LinkedList();
+ List lasts = new LinkedList();
+
+ if (repeated)
+ {
+ firsts = getRepeatedParameter(request, dcname + "_first");
+ lasts = getRepeatedParameter(request, dcname + "_last");
+
+ // Find out if the relevant "remove" button was pressed
+ String buttonPressed = UIUtil.getSubmitButton(request, "");
+ String removeButton = "submit_" + dcname + "_remove_";
+
+ if (buttonPressed.startsWith(removeButton))
+ {
+ int valToRemove = Integer.parseInt(
+ buttonPressed.substring(removeButton.length()));
+
+ firsts.remove(valToRemove);
+ lasts.remove(valToRemove);
+ }
+ }
+ else
+ {
+ // Just a single name
+ String lastName = request.getParameter(dcname + "_last");
+ String firstNames = request.getParameter(dcname + "_first");
+
+ // Only put it in if there was a name present
+ if (lastName != null && !lastName.equals(""))
+ {
+ lasts.add(lastName);
+ firsts.add(firstNames);
+ }
+ }
+
+ // Remove existing values
+ item.clearDC(element, qualifier, Item.ANY);
+
+ // Put the names in the correct form
+ for (int i = 0; i < lasts.size(); i++)
+ {
+ String f = ((String) firsts.get(i)).trim();
+ String l = ((String) lasts.get(i)).trim();
+
+ // If there is a comma in the last name, we take everything
+ // after that comma, and add it to the right of the
+ // first name
+ int comma = l.indexOf(',');
+
+ if (comma >= 0)
+ {
+ f = f + l.substring(comma + 1);
+ l = l.substring(0, comma);
+
+ // Remove leading whitespace from first name
+ while (f.startsWith(" "))
+ {
+ f = f.substring(1);
+ }
+ }
+
+ // Add to the database
+ item.addDC(element, qualifier, null,
+ new DCPersonName(l, f).toString());
+ }
+ }
+
+
+ /**
+ * Fill out an item's DC values from a plain standard text field.
+ * If the field isn't repeatable, the input field name is called:
+ *
+ * element_qualifier
+ *
+ * or for an unqualified element:
+ *
+ * element
+ *
+ * Repeated elements are appended with an underscore then an integer.
+ * e.g.:
+ *
+ * title_alternative_0
+ * title_alternative_1
+ *
+ * The values will be put in separate DCValues, ordered as they appear
+ * in the list. These will replace any existing values.
+ *
+ * @param request the request object
+ * @param item the item to update
+ * @param element the DC element
+ * @param qualifier the DC qualifier, or null if unqualified
+ * @param repeated set to true if the field is repeatable on the form
+ */
+ private void readText(HttpServletRequest request,
+ Item item,
+ String element,
+ String qualifier,
+ boolean repeated)
+ {
+ String dcname = element;
+ if (qualifier != null)
+ {
+ dcname = element + "_" + qualifier;
+ }
+
+ // Values to add
+ List vals = new LinkedList();
+
+ if (repeated)
+ {
+ vals = getRepeatedParameter(request, dcname);
+
+ // Find out if the relevant "remove" button was pressed
+ String buttonPressed = UIUtil.getSubmitButton(request, "");
+ String removeButton = "submit_" + dcname + "_remove_";
+
+ if (buttonPressed.startsWith(removeButton))
+ {
+ int valToRemove = Integer.parseInt(
+ buttonPressed.substring(removeButton.length()));
+
+ vals.remove(valToRemove);
+ }
+ }
+ else
+ {
+ // Just a single name
+ String s = request.getParameter(dcname);
+
+ // Only put it in if there was a name present
+ if (s != null && !s.equals(""))
+ {
+ vals.add(s);
+ }
+ }
+
+ // Remove existing values
+ item.clearDC(element, qualifier, Item.ANY);
+
+ // Put the names in the correct form
+ for (int i = 0; i < vals.size(); i++)
+ {
+ // Add to the database
+ item.addDC(element, qualifier, null, (String) vals.get(i));
+ }
+ }
+
+
+ /**
+ * Fill out a DC date field with the value from a form. The date is
+ * taken from the three parameters:
+ *
+ * element_qualifier_year
+ * element_qualifier_month
+ * element_qualifier_day
+ *
+ * The granularity is determined by the values that are actually set.
+ * If the year isn't set (or is invalid)
+ *
+ * @param request the request object
+ * @param item the item to update
+ * @param element the DC element
+ * @param qualifier the DC qualifier, or null if unqualified
+ */
+ private void readDate(HttpServletRequest request,
+ Item item,
+ String element,
+ String qualifier)
+ throws SQLException
+ {
+ String dcname = element;
+ if (qualifier != null)
+ {
+ dcname = element + "_" + qualifier;
+ }
+
+ int year = UIUtil.getIntParameter(request, dcname + "_year");
+ int month = UIUtil.getIntParameter(request, dcname + "_month");
+ int day = UIUtil.getIntParameter(request, dcname + "_day");
+
+ // FIXME: Probably should be some more validation
+ // Make a standard format date
+ DCDate d = new DCDate();
+
+ d.setDateLocal(year, month, day, -1, -1, -1);
+
+ item.clearDC(element, qualifier, Item.ANY);
+
+ if (year > 0)
+ {
+ // Only put in date if there is one!
+ item.addDC(element, qualifier, null, d.toString());
+ }
+ }
+
+
+ /**
+ * Set relevant DC fields in an item from series/number values in the
+ * form. Some fields are repeatable in the form. If this is the case,
+ * and the field is "relation.ispartof", the names in the request
+ * will be from the fields as follows:
+ *
+ * relation_ispartof_series_0
+ * relation_ispartof_number_0
+ * relation_ispartof_series_1
+ * relation_ispartof_number_1
+ *
+ * and so on. If the field is unqualified:
+ *
+ * relation_series_0
+ * relation_number_0
+ *
+ * Otherwise the parameters are of the form:
+ *
+ * relation_ispartof_series
+ * relation_ispartof_number
+ *
+ * The values will be put in separate DCValues, in the form
+ * "last name, first name(s)", ordered as they appear in the list.
+ * These will replace any existing values.
+ *
+ * @param request the request object
+ * @param item the item to update
+ * @param element the DC element
+ * @param qualifier the DC qualifier, or null if unqualified
+ * @param repeated set to true if the field is repeatable on the form
+ */
+ private void readSeriesNumbers(HttpServletRequest request,
+ Item item,
+ String element,
+ String qualifier,
+ boolean repeated)
+ {
+ String dcname = element;
+ if (qualifier != null)
+ {
+ dcname = element + "_" + qualifier;
+ }
+
+ // Names to add
+ List series = new LinkedList();
+ List numbers = new LinkedList();
+
+ if (repeated)
+ {
+ series = getRepeatedParameter(request, dcname + "_series");
+ numbers = getRepeatedParameter(request, dcname + "_number");
+
+ // Find out if the relevant "remove" button was pressed
+ String buttonPressed = UIUtil.getSubmitButton(request, "");
+ String removeButton = "submit_" + dcname + "_remove_";
+
+ if (buttonPressed.startsWith(removeButton))
+ {
+ int valToRemove = Integer.parseInt(
+ buttonPressed.substring(removeButton.length()));
+
+ series.remove(valToRemove);
+ numbers.remove(valToRemove);
+ }
+ }
+ else
+ {
+ // Just a single name
+ String s = request.getParameter(dcname + "_series");
+ String n = request.getParameter(dcname + "_number");
+
+ // Only put it in if there was a name present
+ if (s != null && !s.equals(""))
+ {
+ series.add(s);
+ numbers.add(n);
+ }
+ }
+
+ // Remove existing values
+ item.clearDC(element, qualifier, Item.ANY);
+
+ // Put the names in the correct form
+ for (int i = 0; i < series.size(); i++)
+ {
+ String s = ((String) series.get(i)).trim();
+ String n = ((String) numbers.get(i)).trim();
+
+ item.addDC(element, qualifier, null,
+ new DCSeriesNumber(s, n).toString());
+ }
+ }
+
+
+ /**
+ * Get repeated values from a form. If "foo" is passed in, values in
+ * the form of parameters "foo_0", "foo_1", etc. are returned.
+ *
+ * @param request the HTTP request containing the form information
+ * @param param the repeated parameter
+ *
+ * @return a List of Strings
+ */
+ private List getRepeatedParameter(HttpServletRequest request,
+ String param)
+ {
+ List vals = new LinkedList();
+
+ int i = 0;
+ boolean foundLast = false;
+
+ // Iterate through the values in the form.
+ while (!foundLast)
+ {
+ String s = request.getParameter(param + "_" + i);
+
+ // We're only going to add non-empty names
+ if (s != null && !s.equals(""))
+ {
+ vals.add(s);
+ }
+
+ // If the value was null (as opposed to present,
+ // but empty) we've reached the last name
+ foundLast = (s == null);
+ i++;
+ }
+
+ // Make into an array
+ return vals;
+ }
+}
diff --git a/dspace/src/org/dspace/app/webui/util/SubmissionInfo.java b/dspace/src/org/dspace/app/webui/util/SubmissionInfo.java
new file mode 100644
index 0000000000..7173be09d9
--- /dev/null
+++ b/dspace/src/org/dspace/app/webui/util/SubmissionInfo.java
@@ -0,0 +1,75 @@
+/*
+ * SubmissionInfo.java
+ *
+ * Version: $Revision$
+ *
+ * Date: $Date$
+ *
+ * Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ * Institute of Technology. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Hewlett-Packard Company nor the name of the
+ * Massachusetts Institute of Technology nor the names of their
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+package org.dspace.app.webui.util;
+
+import org.dspace.content.Bitstream;
+import org.dspace.content.Bundle;
+import org.dspace.content.InProgressSubmission;
+
+/**
+ * Information about an item being editing with the submission UI
+ *
+ * @author Robert Tansley
+ * @version $Revision$
+ */
+public class SubmissionInfo
+{
+ /** The submission */
+ public InProgressSubmission submission;
+
+ /** The step reached in the submission process (where the user can jump) */
+ public int stepReached;
+
+ /** The element or element_qualifier to show more input boxes for */
+ public String moreBoxesFor;
+
+ /** The element or element_qualifier to scroll to initially using anchor */
+ public String jumpToField;
+
+ /** If true, something on the form is missing */
+ public boolean missing;
+
+ /** Specific bundle we're dealing with */
+ public Bundle bundle;
+
+ /** Specific bitstream we're dealing with */
+ public Bitstream bitstream;
+}
diff --git a/dspace/src/org/dspace/app/webui/util/UIUtil.java b/dspace/src/org/dspace/app/webui/util/UIUtil.java
index ec51a0ae13..702b3ed049 100644
--- a/dspace/src/org/dspace/app/webui/util/UIUtil.java
+++ b/dspace/src/org/dspace/app/webui/util/UIUtil.java
@@ -40,7 +40,9 @@
package org.dspace.app.webui.util;
+
import java.sql.SQLException;
+import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
@@ -60,6 +62,7 @@ import org.dspace.eperson.EPerson;
*/
public class UIUtil
{
+
/** log4j category */
private static Logger log = Logger.getLogger(UIUtil.class);
@@ -90,6 +93,7 @@ public class UIUtil
if (userID != null)
{
EPerson e = EPerson.find(c, userID.intValue());
+
Authenticate.loggedIn(c, request, e);
}
@@ -103,7 +107,6 @@ public class UIUtil
return c;
}
-
/**
* Get the current community location, that is, where the user "is".
* This returns null if there is no location, i.e. "all of
@@ -118,7 +121,6 @@ public class UIUtil
return ((Community) request.getAttribute("dspace.community"));
}
-
/**
* Get the current collection location, that is, where the user "is".
* This returns null if there is no collection location, i.e. the
@@ -133,7 +135,6 @@ public class UIUtil
return ((Collection) request.getAttribute("dspace.collection"));
}
-
/**
* Put the original request URL into the request object as an attribute
* for later use. This is necessary because forwarding a request removes
@@ -149,6 +150,7 @@ public class UIUtil
if (orig == null)
{
String fullURL = request.getServletPath();
+
if (request.getQueryString() != null)
{
fullURL = fullURL + "?" + request.getQueryString();
@@ -158,7 +160,6 @@ public class UIUtil
}
}
-
/**
* Get the original request URL.
*
@@ -174,8 +175,6 @@ public class UIUtil
return ((String) request.getAttribute("dspace.original.url"));
}
-
-
/**
* Utility method to convert spaces in a string to HTML non-break space
* elements.
@@ -191,6 +190,7 @@ public class UIUtil
for (int i = 0; i < s.length(); i++)
{
char ch = s.charAt(i);
+
if (ch == ' ')
{
newString.append(" ");
@@ -204,7 +204,6 @@ public class UIUtil
return newString.toString();
}
-
/**
* Write a human-readable version of a DCDate.
*
@@ -286,4 +285,114 @@ public class UIUtil
return (sb.toString());
}
+
+ /**
+ * Return a string for logging, containing useful information about the
+ * current request - the URL, the method and parameters.
+ *
+ * @param request the request object.
+ * @return a multi-line string containing information about
+ * the request.
+ */
+ public static String getRequestLogInfo(HttpServletRequest request)
+ {
+ String report;
+
+ report = "-- URL Was: " + getOriginalURL(request) + "\n";
+ report = report + "-- Method: " + request.getMethod() + "\n";
+
+ // First write the parameters we had
+ report = report + "-- Parameters were:\n";
+ Enumeration e = request.getParameterNames();
+
+ while (e.hasMoreElements())
+ {
+ String name = (String) e.nextElement();
+
+ if (name.equals("login_password"))
+ {
+ // We don't want to write a clear text password
+ // to the log, even if it's wrong!
+ report = report + "-- " + name + ": *not logged*\n";
+ }
+ else
+ {
+ report = report + "-- " + name + ": \"" + request.getParameter(name) + "\"\n";
+ }
+ }
+
+ return report;
+ }
+
+
+ /**
+ * Obtain a parameter from the given request as an int. -1
+ * is returned if the parameter is garbled or does not exist.
+ *
+ * @param request the HTTP request
+ * @param param the name of the parameter
+ *
+ * @return the integer value of the parameter, or -1
+ */
+ public static int getIntParameter(HttpServletRequest request, String param)
+ {
+ String val = request.getParameter(param);
+
+ try
+ {
+ return Integer.parseInt(val);
+ }
+ catch (Exception e)
+ {
+ // Problem with parameter
+ return -1;
+ }
+ }
+
+
+ /**
+ * Obtain a parameter from the given request as a boolean.
+ * false is returned if the parameter is garbled or does not
+ * exist.
+ *
+ * @param request the HTTP request
+ * @param param the name of the parameter
+ *
+ * @return the integer value of the parameter, or -1
+ */
+ public static boolean getBoolParameter(HttpServletRequest request,
+ String param)
+ {
+ return (request.getParameter(param) != null &&
+ request.getParameter(param).equals("true"));
+ }
+
+
+ /**
+ * Get the button the user pressed on a submitted form. All buttons
+ * should start with the text submit for this to work.
+ * A default should be supplied, since often the browser will submit a form
+ * with no submit button pressed if the user presses enter.
+ *
+ * @param request the HTTP request
+ * @param def the default button
+ *
+ * @return the button pressed
+ */
+ public static String getSubmitButton(HttpServletRequest request, String def)
+ {
+ Enumeration e = request.getParameterNames();
+
+ while (e.hasMoreElements())
+ {
+ String parameterName = (String) e.nextElement();
+
+ if (parameterName.startsWith("submit"))
+ {
+ return parameterName;
+ }
+ }
+
+ return def;
+ }
}
diff --git a/dspace/src/org/dspace/content/DCLanguage.java b/dspace/src/org/dspace/content/DCLanguage.java
new file mode 100644
index 0000000000..f831bbadbc
--- /dev/null
+++ b/dspace/src/org/dspace/content/DCLanguage.java
@@ -0,0 +1,145 @@
+/*
+ * DCLanguage.java
+ *
+ * Version: $Revision$
+ *
+ * Date: $Date$
+ *
+ * Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ * Institute of Technology. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Hewlett-Packard Company nor the name of the
+ * Massachusetts Institute of Technology nor the names of their
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+package org.dspace.content;
+
+import java.util.Locale;
+
+
+/**
+ * Utility class for dealing with languages
+ *
+ * @author Robert Tansley
+ * @version $Revision$
+ */
+public class DCLanguage
+{
+
+ /** The country code */
+ private String country;
+
+ /** The language code. Special values: "" and "other". */
+ private String language;
+
+ /**
+ * Construct a language object from a database entry
+ *
+ * @param l the language text from the database
+ */
+ public DCLanguage(String l)
+ {
+ setLanguage(l);
+ }
+
+ /**
+ * Write the language out to the database
+ *
+ * @return the language in a form for writing to the DCValue table
+ */
+ public String toString()
+ {
+ if (language.equals(""))
+ {
+ return "";
+ }
+ else if (country.equals(""))
+ {
+ return language;
+ }
+ else
+ {
+ return country + "_" + language;
+ }
+ }
+
+ /**
+ * Set the language and country
+ *
+ * @param l The language and country code, e.g. "en_US" or "fr"
+ */
+ public void setLanguage(String l)
+ {
+ if (l.equals("other"))
+ {
+ language = "other";
+ country = "";
+ }
+ else if (l.length() == 2)
+ {
+ language = l;
+ country = "";
+ }
+ else if (l.length() == 5)
+ {
+ language = l.substring(0, 2);
+ country = l.substring(3);
+ }
+ else
+ {
+ language = "";
+ country = "";
+ }
+ }
+
+ /**
+ * Get the displayable name for this language
+ *
+ * @return the displayable name
+ */
+ public String getDisplayName()
+ {
+ Locale locale;
+
+ if (language.equals("other"))
+ {
+ return "(Other)";
+ }
+ else if (language.equals(""))
+ {
+ return "N/A";
+ }
+ else
+ {
+ locale = new Locale(language, country);
+ return locale.getDisplayName();
+ }
+ }
+
+}
diff --git a/dspace/src/org/dspace/content/DCSeriesNumber.java b/dspace/src/org/dspace/content/DCSeriesNumber.java
new file mode 100644
index 0000000000..39bf98b31f
--- /dev/null
+++ b/dspace/src/org/dspace/content/DCSeriesNumber.java
@@ -0,0 +1,137 @@
+/*
+ * SeriesNumber.java
+ *
+ * Version: $Revision$
+ *
+ * Date: $Date$
+ *
+ * Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ * Institute of Technology. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Hewlett-Packard Company nor the name of the
+ * Massachusetts Institute of Technology nor the names of their
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+package org.dspace.content;
+
+
+/**
+ * Series and report number, as stored in relation.ispartofseries
+ *
+ * @author Robert Tansley
+ * @version $Id$
+ */
+public class DCSeriesNumber
+{
+ /** Series */
+ private String series;
+
+ /** Number */
+ private String number;
+
+ /** Construct clean series number */
+ public DCSeriesNumber()
+ {
+ series = null;
+ number = null;
+ }
+
+ /**
+ * Construct from raw DC value
+ *
+ * @param value value from database
+ */
+ public DCSeriesNumber(String value)
+ {
+ this();
+
+ int semicolon = -1;
+
+ if (value != null) semicolon = value.indexOf(';');
+
+ if (semicolon >= 0)
+ {
+ series = value.substring(0, semicolon);
+ number = value.substring(semicolon + 1);
+ }
+ else
+ {
+ series = value;
+ }
+ }
+
+ /**
+ * Construct from given values
+ *
+ * @param s the series
+ * @param n the number
+ */
+ public DCSeriesNumber(String s, String n)
+ {
+ series = s;
+ number = n;
+ }
+
+ /**
+ * Write as raw DC value
+ *
+ * @return the series and number as they should be stored in the DB
+ */
+ public String toString()
+ {
+ if (series == null)
+ {
+ return (null);
+ }
+ else if (number == null)
+ {
+ return (series);
+ }
+ else
+ {
+ return (series + ";" + number);
+ }
+ }
+
+ /**
+ * Get the series name - guaranteed non-null
+ */
+ public String getSeries()
+ {
+ return (series == null ? "" : series);
+ }
+
+ /**
+ * Get the number - guaranteed non-null
+ */
+ public String getNumber()
+ {
+ return (number == null ? "" : number);
+ }
+}
diff --git a/dspace/src/org/dspace/content/FormatIdentifier.java b/dspace/src/org/dspace/content/FormatIdentifier.java
new file mode 100644
index 0000000000..1251946b64
--- /dev/null
+++ b/dspace/src/org/dspace/content/FormatIdentifier.java
@@ -0,0 +1,122 @@
+/*
+ * FormatIdentifier.java
+ *
+ * Version: $Revision$
+ *
+ * Date: $Date$
+ *
+ * Copyright (c) 2001, Hewlett-Packard Company and Massachusetts
+ * Institute of Technology. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Hewlett-Packard Company nor the name of the
+ * Massachusetts Institute of Technology nor the names of their
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+package org.dspace.content;
+
+import java.sql.SQLException;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.dspace.core.Context;
+import org.dspace.core.LogManager;
+import org.dspace.storage.rdbms.DatabaseManager;
+import org.dspace.storage.rdbms.TableRow;
+import org.dspace.storage.rdbms.TableRowIterator;
+
+
+/**
+ * This class handles the recognition of bitstream formats, using the format
+ * registry in the database. For the moment, the format identifier simply
+ * uses file extensions stored in the "BitstreamFormatIdentifier" table.
+ * This probably isn't a particularly satisfactory long-term solution.
+ *
+ * @author Robert Tansley
+ * @version $Revision$
+ */
+public class FormatIdentifier
+{
+ /**
+ * Attempt to identify the format of a particular bitstream. If the format
+ * is unknown, null is returned.
+ *
+ * @param bitstream the bitstream to identify the format of
+ *
+ * @return a format from the bitstream format registry, or null
+ */
+ public static BitstreamFormat guessFormat(Context context,
+ Bitstream bitstream)
+ throws SQLException
+ {
+ // FIXME: Just setting format to first guess
+ // For now just get the file name
+ String filename = bitstream.getName().toLowerCase();
+
+ // Gracefully handle the null case
+ if (filename == null)
+ {
+ return null;
+ }
+
+ // This isn't rocket science. We just get the name of the
+ // bitstream, get the extension, and see if we know the type.
+ String extension = filename;
+ int lastDot = filename.lastIndexOf('.');
+
+ if (lastDot != -1)
+ {
+ extension = filename.substring(lastDot + 1);
+ }
+
+ // If the last character was a dot, then extension will now be
+ // an empty string. If this is the case, we don't know what
+ // file type it is.
+ if (extension.equals(""))
+ {
+ return null;
+ }
+
+ // See if the extension is in the BitstreamFormatIdentifier table
+ TableRowIterator tri = DatabaseManager.query(context,
+ "SELECT bitstreamformatregistry.* FROM bitstreamformatregistry, " +
+ "formatidentifier WHERE formatidentifier.extension LIKE '" +
+ extension +"'");
+
+ if (tri.hasNext())
+ {
+ // Return first match
+ return new BitstreamFormat(context, tri.next());
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
diff --git a/dspace/src/org/dspace/content/Item.java b/dspace/src/org/dspace/content/Item.java
index 4b1872a87c..803c5fb2b6 100644
--- a/dspace/src/org/dspace/content/Item.java
+++ b/dspace/src/org/dspace/content/Item.java
@@ -812,7 +812,7 @@ public class Item
{
Bitstream[] bitstreams = bundles[i].getBitstreams();
- for (int j = 0; j < bundles.length; j++)
+ for (int j = 0; j < bitstreams.length; j++)
{
if (!bitstreams[j].getFormat().isInternal())
{
diff --git a/dspace/src/org/dspace/core/ConfigurationManager.java b/dspace/src/org/dspace/core/ConfigurationManager.java
index 679da6c5fb..6b44efe2b6 100644
--- a/dspace/src/org/dspace/core/ConfigurationManager.java
+++ b/dspace/src/org/dspace/core/ConfigurationManager.java
@@ -307,7 +307,7 @@ public class ConfigurationManager
while ((lineIn = br.readLine()) != null)
{
- license = license + lineIn;
+ license = license + lineIn + '\n';
}
is.close();