%--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
--%>
<%--
- Edit metadata form
-
- Attributes to pass in to this page:
- submission.info - the SubmissionInfo object
- submission.inputs - the DCInputSet
- submission.page - the step in submission
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
<%@ page import="javax.servlet.jsp.PageContext" %>
<%@ page import="org.dspace.core.Context" %>
<%@ page import="org.dspace.app.util.DCInput" %>
<%@ page import="org.dspace.app.util.DCInputSet" %>
<%@ page import="org.dspace.app.webui.servlet.SubmissionController" %>
<%@ page import="org.dspace.submit.AbstractProcessingStep" %>
<%@ page import="org.dspace.core.I18nUtil" %>
<%@ page import="org.dspace.app.util.SubmissionInfo" %>
<%@ page import="org.dspace.app.webui.util.UIUtil" %>
<%@ page import="org.dspace.content.authority.Choices" %>
<%@ page import="org.dspace.core.ConfigurationManager" %>
<%@ page import="org.dspace.core.Utils" %>
<%@ page import="org.dspace.content.authority.factory.ContentAuthorityServiceFactory" %>
<%@ page import="org.dspace.content.authority.service.ChoiceAuthorityService" %>
<%@ page import="org.dspace.content.authority.service.MetadataAuthorityService" %>
<%@ page import="org.dspace.content.*" %>
<%@ page import="org.dspace.content.factory.ContentServiceFactory" %>
<%@ page import="java.io.IOException" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
request.setAttribute("LanguageSwitch", "hide");
%>
<%!
// required by Controlled Vocabulary add-on and authority addon
String contextPath;
// An unknown value of confidence for new, empty input fields,
// so no icon appears yet.
int unknownConfidence = Choices.CF_UNSET - 100;
// This method is resposible for showing a link next to an input box
// that pops up a window that to display a controlled vocabulary.
// It should be called from the doOneBox and doTwoBox methods.
// It must be extended to work with doTextArea.
String doControlledVocabulary(String fieldName, PageContext pageContext, String vocabulary, boolean readonly)
{
String link = "";
boolean enabled = ConfigurationManager.getBooleanProperty("webui.controlledvocabulary.enable");
boolean useWithCurrentField = vocabulary != null && ! "".equals(vocabulary);
if (enabled && useWithCurrentField && !readonly)
{
// Deal with the issue of _0 being removed from fieldnames in the configurable submission system
if (fieldName.endsWith("_0"))
{
fieldName = fieldName.substring(0, fieldName.length() - 2);
}
link =
"" +
"" +
LocaleSupport.getLocalizedMessage(pageContext, "jsp.submit.edit-metadata.controlledvocabulary") +
"" +
"";
}
return link;
}
boolean hasVocabulary(String vocabulary)
{
boolean enabled = ConfigurationManager.getBooleanProperty("webui.controlledvocabulary.enable");
boolean useWithCurrentField = vocabulary != null && !"".equals(vocabulary);
boolean has = false;
if (enabled && useWithCurrentField)
{
has = true;
}
return has;
}
// is this field going to be rendered as Choice-driven