some fixes and new display messages

This commit is contained in:
Kostas Stamatis
2014-10-02 11:06:04 +03:00
parent 147ec45266
commit b437af876f
4 changed files with 21 additions and 6 deletions

View File

@@ -2429,7 +2429,7 @@ public class ItemImport
//Clear these files, since it is a resume
(new File(dataZipPath)).delete();
(new File(dataZipDir)).delete();
FileDeleteStrategy.FORCE.delete(new File(dataZipDir));
OutputStream os = new FileOutputStream(dataZipPath);

View File

@@ -1871,11 +1871,14 @@ org.dspace.app.webui.jsptag.ItemTag.restrict = <span class="glyphicon glyphicon-
jsp.layout.navbar-admin.batchimport = Batch metadata import
jsp.dspace-admin.batchimport.title = Batch metadata import
jsp.dspace-admin.batchimport.resume.info = This is a resume import!
jsp.dspace-admin.batchmetadataimport.select = Select collection
jsp.dspace-admin.batchmetadataimport.selecturl = Provide the URL of the zip file
jsp.dspace-admin.batchmetadataimport.selectowningcollection = Select the owning collection of the items (Optional)
jsp.dspace-admin.batchmetadataimport.selectowningcollection.info = This field is optional meaning that if you leave it empty, you are supposed to include per item collection information in the Simple Archive Format
jsp.dspace-admin.batchmetadataimport.selectothercollections = Select other collections that the items will belong to (Optional)
jsp.layout.navbar-admin.batchimport.owningcollection = You need to provide an owning collection since you have provide secondary ones!
jsp.layout.navbar-admin.batchimport.fileurlempty = You need to provide the URL of the zip file
jsp.dspace-admin.batchimport.success = Success
jsp.dspace-admin.batchimport.failure = Failure
jsp.dspace-admin.batchimport.itemstobeimported = Items to be imported

View File

@@ -149,14 +149,21 @@ public class BatchMetadataImportServlet extends DSpaceServlet
String message = null;
String uploadId = request.getParameter("uploadid");
String uploadId = request.getParameter("uploadId");
if (uploadId != null){
request.setAttribute("uploadid", uploadId);
request.setAttribute("uploadId", uploadId);
}
String zipurl = request.getParameter("zipurl");
if (StringUtils.isEmpty(zipurl)) {
request.setAttribute("has-error", "true");
Locale locale = request.getLocale();
ResourceBundle msgs = ResourceBundle.getBundle("Messages", locale);
try {
message = msgs.getString("jsp.layout.navbar-admin.batchimport.fileurlempty");
} catch (Exception e) {
message = "???jsp.layout.navbar-admin.batchimport.fileurlempty???";
}
}
else {

View File

@@ -8,7 +8,7 @@
--%>
<%--
- Form to upload a csv metadata file
- Form to upload a metadata files
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
@@ -31,7 +31,6 @@
String message = (String)request.getAttribute("message");
int type = (Integer)request.getAttribute("type");
System.out.println("ss: " + type);
%>
@@ -44,6 +43,11 @@
<h1><fmt:message key="jsp.dspace-admin.batchimport.title"/></h1>
<% if (uploadId != null) { %>
<div style="color:red">-- <fmt:message key="jsp.dspace-admin.batchimport.resume.info"/> --</div>
<br/>
<% } %>
<%
if (hasErrorS == null){
@@ -70,7 +74,7 @@
<input type="hidden" name=type value="<%= type %>"/>
<% if (uploadId != null) { %>
<input type="hidden" name=uploadid value="<%= uploadId %>"/>
<input type="hidden" name=uploadId value="<%= uploadId %>"/>
<% } %>
<div class="form-group">
@@ -80,6 +84,7 @@
<div class="form-group">
<label for="collection"><fmt:message key="jsp.dspace-admin.batchmetadataimport.selectowningcollection"/></label>
<br/><i for="collection"><fmt:message key="jsp.dspace-admin.batchmetadataimport.selectowningcollection.info"/></i>
<select class="form-control" name="collection">
<option value="-1"><fmt:message key="jsp.dspace-admin.batchmetadataimport.select"/></option>
<%