updates for menu management and institutional internal class

This commit is contained in:
hjkhjk54 2011-07-14 03:18:06 +00:00
parent c44fae1552
commit 3e30283d6b
7 changed files with 138 additions and 50 deletions

View file

@ -6,6 +6,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.io.StringWriter; import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -22,6 +23,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItem;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.json.JSONObject;
import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.OntModelSpec; import com.hp.hpl.jena.ontology.OntModelSpec;
@ -79,7 +81,7 @@ public class MenuManagementEdit extends VitroHttpServlet {
String command = getCommand(vreq); String command = getCommand(vreq);
if(command != null) { if(command != null) {
processCommand(command, vreq); processCommand(command, vreq, resp);
} else { } else {
System.out.println("Command is null"); System.out.println("Command is null");
} }
@ -119,7 +121,7 @@ public class MenuManagementEdit extends VitroHttpServlet {
//Parameter retrieval is identical, but in one case an entirey new menu item needs to be created //Parameter retrieval is identical, but in one case an entirey new menu item needs to be created
//along with a new page //along with a new page
public void processCommand(String command, VitroRequest vreq) { public void processCommand(String command, VitroRequest vreq, HttpServletResponse resp) {
//Get parameters for menu item being edited //Get parameters for menu item being edited
String menuItem = vreq.getParameter("menuItem"); String menuItem = vreq.getParameter("menuItem");
OntModel displayModel = getDisplayModel(vreq); OntModel displayModel = getDisplayModel(vreq);
@ -139,7 +141,7 @@ public class MenuManagementEdit extends VitroHttpServlet {
} else if(isDelete(command)) { } else if(isDelete(command)) {
processDelete(menuItem, displayModel, command, vreq); processDelete(menuItem, displayModel, command, vreq);
} else if(isReorder(command)) { } else if(isReorder(command)) {
processReorder(displayModel, vreq); processReorder(displayModel, vreq, resp);
} }
//Edits to model occur here //Edits to model occur here
@ -166,17 +168,34 @@ public class MenuManagementEdit extends VitroHttpServlet {
} }
private void processReorder(OntModel displayModel, VitroRequest vreq) { private void processReorder(OntModel displayModel, VitroRequest vreq, HttpServletResponse resp) {
//Get the new menu positions for all the elements //Get the new menu positions for all the elements
String predicate = vreq.getParameter("predicate"); String predicate = vreq.getParameter("predicate");
//Assuming these two are in the same order //Assuming these two are in the same order
String[]individuals = vreq.getParameterValues("individuals"); String[]individuals = vreq.getParameterValues("individuals");
String[] positions = vreq.getParameterValues("positions"); String[] positions = vreq.getParameterValues("positions");
String errorMessage = null;
if(individuals.length > 0 && positions.length > 0 && individuals.length == positions.length) { if(individuals.length > 0 && positions.length > 0 && individuals.length == positions.length) {
removeStatements = removePositionStatements(displayModel, individuals); removeStatements = removePositionStatements(displayModel, individuals);
addStatements = addPositionStatements(displayModel, individuals, positions); addStatements = addPositionStatements(displayModel, individuals, positions);
} else { } else {
//Throw an error? errorMessage = "Number of individuals and positions is out of synch";
}
try{
JSONObject rObj = new JSONObject();
resp.setCharacterEncoding("UTF-8");
resp.setContentType("application/json;charset=UTF-8");
if( errorMessage != null ){
rObj.put("errorMessage", errorMessage);
resp.setStatus(500 /*HttpURLConnection.HTTP_SERVER_ERROR*/);
}else{
rObj.put("errorMessage", "");
}
Writer writer = resp.getWriter();
writer.write(rObj.toString());
} catch(Exception ex) {
log.error("Error creating JSON object for response", ex);
} }
} }
@ -347,7 +366,9 @@ public class MenuManagementEdit extends VitroHttpServlet {
Model addModel, OntModel displayModel) { Model addModel, OntModel displayModel) {
String[] selectedClasses = vreq.getParameterValues("classInClassGroup"); String[] selectedClasses = vreq.getParameterValues("classInClassGroup");
Model dgModel = ModelFactory.createDefaultModel(); Model dgModel = ModelFactory.createDefaultModel();
dgModel.add(dgModel.createStatement(dataGetterResource, RDF.type, DisplayVocabulary.CLASSINDIVIDUALS_PAGE_TYPE)); dgModel.add(dgModel.createStatement(dataGetterResource,
RDF.type,
ResourceFactory.createResource(DisplayVocabulary.CLASSINDIVIDUALS_PAGE_TYPE)));
for(String classUri: selectedClasses) { for(String classUri: selectedClasses) {
dgModel.add(dgModel.createStatement( dgModel.add(dgModel.createStatement(
dataGetterResource, dataGetterResource,
@ -370,7 +391,9 @@ public class MenuManagementEdit extends VitroHttpServlet {
private Model getClassGroupDataGetter(VitroRequest vreq, Resource dataGetterResource, Model addModel, private Model getClassGroupDataGetter(VitroRequest vreq, Resource dataGetterResource, Model addModel,
OntModel displayModel) { OntModel displayModel) {
Model dgModel = ModelFactory.createDefaultModel(); Model dgModel = ModelFactory.createDefaultModel();
dgModel.add(dgModel.createStatement(dataGetterResource, RDF.type, DisplayVocabulary.CLASSGROUP_PAGE_TYPE)); dgModel.add(dgModel.createStatement(dataGetterResource,
RDF.type,
ResourceFactory.createResource(DisplayVocabulary.CLASSGROUP_PAGE_TYPE)));
return dgModel; return dgModel;
} }
@ -471,7 +494,9 @@ public class MenuManagementEdit extends VitroHttpServlet {
DisplayVocabulary.MENU_POSITION, DisplayVocabulary.MENU_POSITION,
addModel.createTypedLiteral(getLastPosition(displayModel)))); addModel.createTypedLiteral(getLastPosition(displayModel))));
//page resource, type, title and url mapping, and what data getter associated //page resource, type, title and url mapping, and what data getter associated
addModel.add(addModel.createStatement(pageResource, RDF.type, DisplayVocabulary.PAGE_TYPE)); addModel.add(addModel.createStatement(pageResource,
RDF.type,
ResourceFactory.createResource(DisplayVocabulary.PAGE_TYPE)));
//Need to create a data getter //Need to create a data getter
Model dataGetterStatements = generateDataGetter(pageResource, displayModel); Model dataGetterStatements = generateDataGetter(pageResource, displayModel);
addModel.add(dataGetterStatements); addModel.add(dataGetterStatements);

View file

@ -7,10 +7,12 @@ import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import edu.cornell.mannlib.vedit.beans.Option; import edu.cornell.mannlib.vedit.beans.Option;
import edu.cornell.mannlib.vitro.webapp.beans.Ontology;
import edu.cornell.mannlib.vitro.webapp.beans.ResourceBean; import edu.cornell.mannlib.vitro.webapp.beans.ResourceBean;
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean; import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean;
import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.OntologyDao;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -18,16 +20,17 @@ import org.apache.commons.logging.LogFactory;
public class LocalNamespaceClassUtils { public class LocalNamespaceClassUtils {
private static final Log log = LogFactory.getLog(LocalNamespaceClassUtils.class.getName()); private static final Log log = LogFactory.getLog(LocalNamespaceClassUtils.class.getName());
public static List<VClass> getLocalNamespacesClasses(VitroRequest vreq, List<String> namespace) { //Expects hash where key = namespace uri
HashMap<String, String> namespaceHash = convertToHash(namespace); //return hash where key = class uri, and value = display Name + (prefix) of ontology
List<VClass> localClasses = new ArrayList<VClass>(); public static HashMap<String, String> getLocalNamespacesClasses(VitroRequest vreq, HashMap<String, String> namespaces) {
HashMap<String, String> localClasses = new HashMap<String, String>();
List<VClass> allClasses = vreq.getWebappDaoFactory().getVClassDao().getAllVclasses(); List<VClass> allClasses = vreq.getWebappDaoFactory().getVClassDao().getAllVclasses();
for(VClass v: allClasses) { for(VClass v: allClasses) {
String classNamespace = v.getNamespace(); String classNamespace = v.getNamespace();
String classUri = v.getURI(); String classUri = v.getURI();
System.out.println("uri is " + classUri + " and namespace is " + classNamespace); System.out.println("uri is " + classUri + " and namespace is " + classNamespace);
if(namespaceHash.containsKey(classNamespace)){ if(namespaces.containsKey(classNamespace)){
localClasses.add(v); localClasses.put(classUri, v.getName() + " ( " + namespaces.get(classNamespace) + ")");
} }
} }
return localClasses; return localClasses;
@ -43,24 +46,32 @@ public class LocalNamespaceClassUtils {
//Retrieve all VClasses and sort into local namespaces //Retrieve all VClasses and sort into local namespaces
//TODO: Check better mechanism utilizing sparql query //TODO: Check better mechanism utilizing sparql query
public static List<String> getLocalOntologyNamespaces(VitroRequest vreq) { //Can't depend on retrieval of classes b/c an ontology may not have any classes yet
//Display name and URI, with URI being key
public static HashMap<String, String> getLocalOntologyNamespaces(VitroRequest vreq) {
HashMap<String, String> foundNamespaces = new HashMap<String, String>(); HashMap<String, String> foundNamespaces = new HashMap<String, String>();
String defaultNamespacePattern = getDefaultOntologyNamespace(vreq); String defaultNamespacePattern = getDefaultOntologyNamespace(vreq);
List<String> localNamespaces = new ArrayList<String>();
List<VClass> allClasses = vreq.getWebappDaoFactory().getVClassDao().getAllVclasses(); //Get all namespacs
for(VClass v: allClasses) { //There's an APP for that!
String namespace = v.getNamespace(); OntologyDao dao = vreq.getFullWebappDaoFactory().getOntologyDao();
if(namespace.startsWith(defaultNamespacePattern) && !foundNamespaces.containsKey(namespace)) { List<Ontology> onts = dao.getAllOntologies();
foundNamespaces.put(namespace, "true"); for(Ontology on: onts) {
String uri = on.getURI();
if(uri.startsWith(defaultNamespacePattern)) {
String name = on.getName();
String prefix = on.getPrefix();
foundNamespaces.put(uri, name + " (" + prefix + ")");
} }
} }
localNamespaces.addAll(foundNamespaces.keySet());
return localNamespaces; return foundNamespaces;
} }
public static String getDefaultOntologyNamespace(VitroRequest vreq) { public static String getDefaultOntologyNamespace(VitroRequest vreq) {
String defaultNamespace= vreq.getWebappDaoFactory().getDefaultNamespace(); String defaultNamespace= vreq.getWebappDaoFactory().getDefaultNamespace();
defaultNamespace = defaultNamespace.substring(0, defaultNamespace.lastIndexOf("/")) + "ontology/"; //Assuming following linked data approach so expects /individual at end
defaultNamespace = defaultNamespace.substring(0, defaultNamespace.lastIndexOf("/individual")) + "/ontology/";
return defaultNamespace; return defaultNamespace;
} }
} }

View file

@ -6,9 +6,15 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import javax.servlet.http.HttpServletResponse;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.shared.Lock; import com.hp.hpl.jena.shared.Lock;
import com.hp.hpl.jena.rdf.model.RDFNode;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -18,6 +24,7 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageMenu
import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
@ -36,8 +43,8 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
private static final String EDIT_FORM = "/processInstitutionalInternalClass"; private static final String EDIT_FORM = "/processInstitutionalInternalClass";
public final static Actions REQUIRED_ACTIONS = new Actions(new ManageMenus()); public final static Actions REQUIRED_ACTIONS = new Actions(new ManageMenus());
private static final String DISPLAY_FORM = "/institutionalInternalClassForm.ftl"; private static final String DISPLAY_FORM = "/institutionalInternalClassForm.ftl";
private static List<String> localNamespaces = new ArrayList<String>(); private static HashMap<String, String> localNamespaces = new HashMap<String, String>();
private static List<VClass> localNamespaceClasses = new ArrayList<VClass>(); private static HashMap<String, String> localNamespaceClasses = new HashMap<String, String>();
private static final String CREATE_CLASS_PARAM = "createClass"; private static final String CREATE_CLASS_PARAM = "createClass";
private static final String REDIRECT_PAGE = "/siteAdmin"; private static final String REDIRECT_PAGE = "/siteAdmin";
@Override @Override
@ -54,9 +61,12 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
Map<String, Object> data = new HashMap<String,Object>(); Map<String, Object> data = new HashMap<String,Object>();
//Get all local classes and namespace information //Get all local classes and namespace information
retrieveLocalClasses(vreq, data); retrieveLocalClasses(vreq, data);
if(isSelectExistingClass(vreq)) { if(isSubmission(vreq)){
processSubmission(vreq, data);
} else if(isSelectExistingClass(vreq)) {
//Local namespace(s) exist and user can select an existing class //Local namespace(s) exist and user can select an existing class
processSelectExistingClass(vreq, data); processSelectExistingClass(vreq, data);
} else if(isCreateNewClass(vreq)) { } else if(isCreateNewClass(vreq)) {
//Local namespace(s) exist and user wishes to create a new class //Local namespace(s) exist and user wishes to create a new class
//Either cmd = create new or no local classes exist at all and one must be created //Either cmd = create new or no local classes exist at all and one must be created
@ -65,8 +75,6 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
//Not being handled expliclity but message will display indicating //Not being handled expliclity but message will display indicating
//no local namespaces exist and one must be created //no local namespaces exist and one must be created
processCreateOntologies(vreq, data); processCreateOntologies(vreq, data);
} else if(isSubmission(vreq)){
processSubmission(vreq, data);
} else { } else {
} }
@ -75,7 +83,8 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
//Check if existing local namespaces //Check if existing local namespaces
data.put("formUrl", EDIT_FORM); data.put("formUrl", vreq.getContextPath() + EDIT_FORM);
data.put("cancelUrl", vreq.getContextPath() + REDIRECT_PAGE);
//if no local namespaces, then provide message to display //if no local namespaces, then provide message to display
//if existing namespace(s), then check //if existing namespace(s), then check
@ -83,6 +92,9 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
//if multiple namespaces, generate select list with namespaces //if multiple namespaces, generate select list with namespaces
//for instertion: VClassDaoJena.insertVClass //for instertion: VClassDaoJena.insertVClass
// //
if(isSubmission(vreq)){
return redirectToSiteAdmin();
}
return new TemplateResponseValues(DISPLAY_FORM, data); return new TemplateResponseValues(DISPLAY_FORM, data);
} }
@ -105,7 +117,7 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
private void processCreateNewClass(VitroRequest vreq, Map<String, Object> data) { private void processCreateNewClass(VitroRequest vreq, Map<String, Object> data) {
//this may need to be changed on the basis of how new classes interact with new ontologies //this may need to be changed on the basis of how new classes interact with new ontologies
data.put("submitAction", "createClass"); data.put("submitAction", "Create Class");
data.put("createNewClass", true); data.put("createNewClass", true);
} }
@ -121,7 +133,7 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
private void processSelectExistingClass(VitroRequest vreq, Map<String, Object> data) { private void processSelectExistingClass(VitroRequest vreq, Map<String, Object> data) {
//Check if internal class is already set and be sure to include that in the data to be returned //Check if internal class is already set and be sure to include that in the data to be returned
data.put("useExistingInternalClass", true); data.put("useExistingInternalClass", true);
data.put("submitAction", "save"); data.put("submitAction", "Save");
} }
private boolean isSelectExistingClass(VitroRequest vreq) { private boolean isSelectExistingClass(VitroRequest vreq) {
@ -135,8 +147,8 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
localNamespaces = LocalNamespaceClassUtils.getLocalOntologyNamespaces(vreq); localNamespaces = LocalNamespaceClassUtils.getLocalOntologyNamespaces(vreq);
//Get classes for local namespaces //Get classes for local namespaces
localNamespaceClasses = LocalNamespaceClassUtils.getLocalNamespacesClasses(vreq, localNamespaces); localNamespaceClasses = LocalNamespaceClassUtils.getLocalNamespacesClasses(vreq, localNamespaces);
data.put("existingLocalClasses", localNamespaces); data.put("existingLocalClasses", localNamespaceClasses);
data.put("existingLocalNamespaces", localNamespaceClasses); data.put("existingLocalNamespaces", localNamespaces);
String noLocalOntologiesMessage = "There are currently no local ontologies. You must create a new ontology"; String noLocalOntologiesMessage = "There are currently no local ontologies. You must create a new ontology";
data.put("noLocalOntologiesMessage", noLocalOntologiesMessage); data.put("noLocalOntologiesMessage", noLocalOntologiesMessage);
if(localNamespaces.size() == 0) { if(localNamespaces.size() == 0) {
@ -146,7 +158,12 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
data.put("ontologiesExist", true); data.put("ontologiesExist", true);
if(localNamespaces.size() > 1) { if(localNamespaces.size() > 1) {
data.put("multipleLocalNamespaces", true); data.put("multipleLocalNamespaces", true);
} else {
data.put("multipleLocalNamespaces", false);
data.put("existingLocalNamespace", localNamespaces.keySet().iterator().next());
} }
//Get current internal class if it exists
data.put("existingInternalClass", retrieveCurrentInternalClass());
} }
} }
@ -172,6 +189,12 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
Model writeModel = ModelContext.getBaseOntModelSelector(getServletContext()).getTBoxModel(); Model writeModel = ModelContext.getBaseOntModelSelector(getServletContext()).getTBoxModel();
writeModel.enterCriticalSection(Lock.WRITE); writeModel.enterCriticalSection(Lock.WRITE);
try { try {
//remove existing internal classes if there are any as assuming only one
writeModel.remove(
writeModel.listStatements(null,
ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT),
(RDFNode) null));
writeModel.add( writeModel.add(
writeModel.createStatement( writeModel.createStatement(
ResourceFactory.createResource(classUri), ResourceFactory.createResource(classUri),
@ -205,4 +228,21 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
} }
private RedirectResponseValues redirectToSiteAdmin() {
return new RedirectResponseValues(REDIRECT_PAGE, HttpServletResponse.SC_SEE_OTHER);
}
//Get current internal class
private String retrieveCurrentInternalClass() {
String internalClassUri = "";
OntModel mainModel = (OntModel) getServletContext().getAttribute("jenaOntModel");
StmtIterator internalIt = mainModel.listStatements(null,
ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT),
(RDFNode) null);
if(internalIt.hasNext()){
internalClassUri = internalIt.nextStatement().getResource().getURI();
}
return internalClassUri;
}
} }

View file

@ -289,6 +289,8 @@ public class MenuManagementController extends FreemarkerHttpServlet {
private void retrieveIndividualsForClassesPage(OntModel writeModel, private void retrieveIndividualsForClassesPage(OntModel writeModel,
Resource dataGetter, Map<String, Object> data) { Resource dataGetter, Map<String, Object> data) {
data.put("isIndividualsForClassesPage", true); data.put("isIndividualsForClassesPage", true);
data.put("isClassGroupPage", false);
data.put("includeAllClasses", false);
//Get the classes and put them here //Get the classes and put them here
this.getClassesForDataGetter(writeModel, dataGetter, data); this.getClassesForDataGetter(writeModel, dataGetter, data);
//Also save the class group for display //Also save the class group for display

View file

@ -11,9 +11,9 @@ edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.Institu
<h3>Institutional Internal Class</h3> <h3>Institutional Internal Class</h3>
<section id="introMessage" role="region"> <section id="introMessage" role="region">
This class will be used to designate those individuals internal to your institution. <p>This class will be used to designate those individuals internal to your institution.
This will allow you to limit the individuals displayed on your menu pages (People, Research, etc.) This will allow you to limit the individuals displayed on your menu pages (People, Research, etc.)
to only those within your institution. to only those within your institution.</p>
</section> </section>
<section> <section>
@ -21,17 +21,19 @@ edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.Institu
<input type="hidden" name="submitForm" id="submitForm" value="true" /> <input type="hidden" name="submitForm" id="submitForm" value="true" />
<#if ontologiesExist = false> <#if ontologiesExist = false>
<section id="noLocalOntologyExists"> <section id="noLocalOntologyExists">
${noLocalOntologiesMessage} <p>${noLocalOntologiesMessage}</p>
</section> </section>
<#elseif useExistingInternalClass?has_content> <#elseif useExistingInternalClass?has_content>
<section id="existingLocalClass"> <section id="existingLocalClass">
<#--Populated based on class list returned--> <#--Populated based on class list returned-->
<select id="existingLocalClasses" name="existingLocalClasses"> <select id="existingLocalClasses" name="existingLocalClasses">
<#list localClasses as localClass> <#assign classUris = existingLocalClasses?keys />
<option value="${localClass.URI}" <#if existingInternalClass.URI = localClass.URI>selected</#if> >${localClass.name}</option> <#list classUris as localClassUri>
<option value="${localClassUri}" <#if existingInternalClass = localClassUri>selected</#if> >${existingLocalClasses[localClassUri]}</option>
</#list> </#list>
</select> </select>
<p>Can't find an appropriate class? Create a <a href="${formUrl}?cmd=createClass">new one</a>.</p>
</section> </section>
<#elseif createNewClass?has_content> <#elseif createNewClass?has_content>
<section id="createNewLocalClass"> <section id="createNewLocalClass">
@ -42,20 +44,26 @@ edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.Institu
<#--If more than one local namespace, generate select--> <#--If more than one local namespace, generate select-->
<#if multipleLocalNamespaces = true> <#if multipleLocalNamespaces = true>
<select id="existingLocalNamespaces" name="existingLocalNamespaces"> <select id="existingLocalNamespaces" name="existingLocalNamespaces">
<#list existingLocalNamespaces as existingNamespace> <#assign namespaceUris = existingLocalNamespaces?keys />
<option value="${existingNamespace.URI}">"${existingNamespace.URI}"</option> <#list namespaceUris as existingNamespace>
<option value="${existingNamespace}">${existingLocalNamespaces[existingNamespace]}</option>
</#list> </#list>
</select> </select>
<#else> <#else>
<input type="hidden" id="existingLocalNamespaces" name="existingLocalNamespaces" value="{existingLocalNamespaces[0]}"/> <input type="hidden" id="existingLocalNamespaces" name="existingLocalNamespaces" value="${existingLocalNamespace}"/>
</#if> </#if>
</section> </section>
<#else> <#else>
Problematic section as above should all have been handled Problematic section as above should all have been handled
</#if> </#if>
<#if ontologiesExist = true>
<input type="submit" name="submit-internalClass" value="${submitAction}" class="submit" /> or <a class="cancel" href="${cancelUrl}">Cancel</a> <input type="submit" name="submit-internalClass" value="${submitAction}" class="submit" /> or <a class="cancel" href="${cancelUrl}">Cancel</a>
<p class="requiredHint">* required fields</p> <p class="requiredHint">* required fields</p>
</#if>
</form> </form>
</section> </section>

View file

@ -7,8 +7,10 @@
<section id="remove-menu-item" role="region"> <section id="remove-menu-item" role="region">
<form method="POST" action="${formUrls}" class="customForm" role="remove menu item"> <form method="POST" action="${formUrls}" class="customForm" role="remove menu item">
<input type="hidden" name="menuItem" id="menuItem" value="${menuItem}" role="input" /> <input type="hidden" name="menuItem" id="menuItem" value="${menuItem}" role="input" />
<input type="hidden" name="cmd" id="cmd" value="Remove" role="input" />
<input type="hidden" name="switchToDisplayModel" id="switchToDisplayModel" value="true" role="input" />
<p>Are you sure you want to remove <em>${menuItem}</em> menu item?</p> <p>Are you sure you want to remove <em>${menuName}</em> menu item?</p>
<input type="submit" name="removeMenuItem" value="Remove menu item" class="submit" role="input" /> or <a class="cancel" href="${cancelUrl}">Cancel</a> <input type="submit" name="removeMenuItem" value="Remove menu item" class="submit" role="input" /> or <a class="cancel" href="${cancelUrl}">Cancel</a>
</form> </form>

View file

@ -74,14 +74,14 @@
</li> </li>
<#list classGroup as classInClassGroup> <#list classGroup as classInClassGroup>
<li class="ui-state-default" role="menuitem"> <li class="ui-state-default" role="menuitem">
<input type="checkbox" id="classInClassGroup" name="classInClassGroup" value="${classInClassGroup.URI}" <#if includeAllClasses = true>checked</#if> /> <input type="checkbox" id="classInClassGroup" name="classInClassGroup" value="${classInClassGroup.URI}" <#if includeAllClasses = true>checked</#if>
<#if isIndividualsForClassesPage?has_content> <#if isIndividualsForClassesPage?has_content>
<#list includeClasses as includeClass> <#list includeClasses as includeClass>
<#if includeClass = classInClassGroup.URI> <#if includeClass = classInClassGroup.URI>
checked checked
</#if> </#if>
</#list> </#list>
</#if> </#if> />
<label class="inline" for="${classInClassGroup.name}"> ${classInClassGroup.name}</label> <label class="inline" for="${classInClassGroup.name}"> ${classInClassGroup.name}</label>
<span class="ui-icon-sortable"></span> <#--sortable icon for dragging and dropping menu items--> <span class="ui-icon-sortable"></span> <#--sortable icon for dragging and dropping menu items-->
</li> </li>