diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java index e5ddfc96e..ea59a2802 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java @@ -3,6 +3,7 @@ import javax.servlet.http.HttpSession; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -60,6 +61,7 @@ protected EditConfigurationVTwo setupConfig(VitroRequest vreq, HttpSession sessi config.setVarNameForSubject("subject"); config.setVarNameForObject("vcard"); + config.addFormSpecificData("fauxContextUri", vreq.getParameter("fauxContextUri")); config.addNewResource("vcard", DEFAULT_NS_FOR_NEW_RESOURCE); config.addNewResource("link", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -238,6 +240,7 @@ private String getUrlPatternToReturnTo(VitroRequest vreq) { String rangeUri = (String) vreq.getParameter("rangeUri"); String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator"; String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq); + String fauxContextUri = vreq.getParameter("fauxContextUri"); String returnPath = editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + "&editForm=" + UrlBuilder.urlEncode(generatorName); @@ -247,6 +250,9 @@ private String getUrlPatternToReturnTo(VitroRequest vreq) { if(rangeUri != null && !rangeUri.isEmpty()) { returnPath += "&rangeUri=" + UrlBuilder.urlEncode(rangeUri); } + if (StringUtils.isNotBlank(fauxContextUri)) { + returnPath += "&fauxContextUri=" + UrlBuilder.urlEncode(fauxContextUri); + } return returnPath; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java index f62b85e13..6b204fbc6 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java @@ -38,6 +38,8 @@ * This mainly sets up pageData for the template to use. */ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { + private static final String OBO_HAS_CONTACT_INFO_URI = "http://purl.obolibrary.org/obo/ARG_2000028"; + public static Log log = LogFactory.getLog(ManageWebpagesForIndividualGenerator.class); @Override @@ -59,10 +61,12 @@ public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession config.addFormSpecificData("rankPredicate", "http://vivoweb.org/ontology/core#rank" ); config.addFormSpecificData("reorderUrl", "/edit/reorder" ); config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete"); + String fauxContextUri = vreq.getParameter("fauxContextUri"); ParamMap paramMap = new ParamMap(); paramMap.put("subjectUri", config.getSubjectUri()); paramMap.put("editForm", this.getEditForm()); + paramMap.put("fauxContextUri", fauxContextUri); paramMap.put("view", "form"); String path = UrlBuilder.getUrl( UrlBuilder.Route.EDIT_REQUEST_DISPATCH ,paramMap); @@ -76,6 +80,8 @@ public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession paramMap.put("predicateUri", config.getPredicateUri()); paramMap.put("editForm" , this.getEditForm() ); paramMap.put("cancelTo", "manage"); + paramMap.put("fauxContextUri", fauxContextUri); + if(domainUri != null && !domainUri.isEmpty()) { paramMap.put("domainUri", domainUri); } diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditWebpageForm.ftl b/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditWebpageForm.ftl index 76df09a35..d413ad8c9 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditWebpageForm.ftl +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/addEditWebpageForm.ftl @@ -50,6 +50,7 @@
+ <#assign urlTypeOpts = editConfiguration.pageData.urlType />