mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Fix for SF bug [1606439] Exception handling for deleting a metadata field
git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3373 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -215,6 +215,7 @@ jsp.dspace-admin.confirm-delete-format.returntoedit = Return to the
|
|||||||
jsp.dspace-admin.confirm-delete-format.title = Delete Bitstream Format
|
jsp.dspace-admin.confirm-delete-format.title = Delete Bitstream Format
|
||||||
jsp.dspace-admin.confirm-delete-format.warning = Any existing bitstreams of this format will be reverted to the <em>unknown</em> bitstream format.
|
jsp.dspace-admin.confirm-delete-format.warning = Any existing bitstreams of this format will be reverted to the <em>unknown</em> bitstream format.
|
||||||
jsp.dspace-admin.confirm-delete-mdfield.confirm = Are you sure the field <strong>{0}</strong> should be deleted?
|
jsp.dspace-admin.confirm-delete-mdfield.confirm = Are you sure the field <strong>{0}</strong> should be deleted?
|
||||||
|
jsp.dspace-admin.confirm-delete-mdfield.failed = Unable to delete this metadata field. This is most likely to be because it is referenced by at least one item.
|
||||||
jsp.dspace-admin.confirm-delete-mdfield.heading = Delete Metadata Field: <code>{0}</code>
|
jsp.dspace-admin.confirm-delete-mdfield.heading = Delete Metadata Field: <code>{0}</code>
|
||||||
jsp.dspace-admin.confirm-delete-mdfield.title = Delete Metadata Field
|
jsp.dspace-admin.confirm-delete-mdfield.title = Delete Metadata Field
|
||||||
jsp.dspace-admin.confirm-delete-mdfield.warning = This will result in an error if any items have values for this metadata field.
|
jsp.dspace-admin.confirm-delete-mdfield.warning = This will result in an error if any items have values for this metadata field.
|
||||||
|
@@ -195,8 +195,18 @@ public class MetadataFieldRegistryServlet extends DSpaceServlet
|
|||||||
// User confirms deletion of type
|
// User confirms deletion of type
|
||||||
MetadataField dc = MetadataField.find(context, UIUtil
|
MetadataField dc = MetadataField.find(context, UIUtil
|
||||||
.getIntParameter(request, "dc_type_id"));
|
.getIntParameter(request, "dc_type_id"));
|
||||||
|
try
|
||||||
|
{
|
||||||
dc.delete(context);
|
dc.delete(context);
|
||||||
|
request.setAttribute("failed", new Boolean(false));
|
||||||
showTypes(context, request, response, schemaID);
|
showTypes(context, request, response, schemaID);
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
request.setAttribute("type", dc);
|
||||||
|
request.setAttribute("failed", true);
|
||||||
|
JSPManager.showJSP(request, response,
|
||||||
|
"/dspace-admin/confirm-delete-mdfield.jsp");
|
||||||
|
}
|
||||||
context.complete();
|
context.complete();
|
||||||
}
|
}
|
||||||
else if (button.equals("submit_move"))
|
else if (button.equals("submit_move"))
|
||||||
|
@@ -59,9 +59,15 @@
|
|||||||
|
|
||||||
String typeName = type.getElement() +
|
String typeName = type.getElement() +
|
||||||
(type.getQualifier() == null ? "" : "." + type.getQualifier());
|
(type.getQualifier() == null ? "" : "." + type.getQualifier());
|
||||||
|
|
||||||
|
boolean failed = false;
|
||||||
|
if (request.getAttribute("failed") != null)
|
||||||
|
{
|
||||||
|
failed = ((Boolean)request.getAttribute("failed")).booleanValue();
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<dspace:layout titlekey="jsp.dspace-admin.list-metadata-elements.title"
|
<dspace:layout titlekey="jsp.dspace-admin.confirm-delete-mdfield.title"
|
||||||
navbar="admin"
|
navbar="admin"
|
||||||
locbar="link"
|
locbar="link"
|
||||||
parenttitlekey="jsp.administer"
|
parenttitlekey="jsp.administer"
|
||||||
@@ -78,9 +84,10 @@
|
|||||||
<fmt:param><%= typeName %></fmt:param>
|
<fmt:param><%= typeName %></fmt:param>
|
||||||
</fmt:message></p>
|
</fmt:message></p>
|
||||||
|
|
||||||
|
<%
|
||||||
|
if (!failed) { %>
|
||||||
<%-- <P>This will result in an error if any items have values for this metadata field.</P> --%>
|
<%-- <P>This will result in an error if any items have values for this metadata field.</P> --%>
|
||||||
<p><fmt:message key="jsp.dspace-admin.confirm-delete-mdfield.warning"/></p>
|
<p><fmt:message key="jsp.dspace-admin.confirm-delete-mdfield.warning"/></p>
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<input type="hidden" name="dc_type_id" value="<%= type.getFieldID() %>">
|
<input type="hidden" name="dc_type_id" value="<%= type.getFieldID() %>">
|
||||||
<center>
|
<center>
|
||||||
@@ -95,5 +102,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
</form>
|
</form><%
|
||||||
|
} else {%>
|
||||||
|
<%-- <P>Unable to delete this metadata field. This is most likely to be because it is referenced by at least one item.</P> --%>
|
||||||
|
<p><strong><fmt:message key="jsp.dspace-admin.confirm-delete-mdfield.failed"/></strong></p><%
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
</dspace:layout>
|
</dspace:layout>
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
- Patch for SF feature request [1587270] Implicit group for all registered users
|
- Patch for SF feature request [1587270] Implicit group for all registered users
|
||||||
- Fix for SF bug [2495728] 'My Account' disappears following exports
|
- Fix for SF bug [2495728] 'My Account' disappears following exports
|
||||||
- Update XMLUI Google Analytics code to match latest tracking code
|
- Update XMLUI Google Analytics code to match latest tracking code
|
||||||
|
- Fix for SF bug [1606439] Exception handling for deleting a metadata field
|
||||||
|
|
||||||
(Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini)
|
(Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini)
|
||||||
- [2057378] Hierarchical LDAP support
|
- [2057378] Hierarchical LDAP support
|
||||||
|
Reference in New Issue
Block a user