Updates for internal institutional class
This commit is contained in:
parent
331e8c5bfa
commit
676e19b488
2 changed files with 13 additions and 8 deletions
|
@ -30,7 +30,9 @@ public class LocalNamespaceClassUtils {
|
||||||
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(namespaces.containsKey(classNamespace)){
|
if(namespaces.containsKey(classNamespace)){
|
||||||
localClasses.put(classUri, v.getName() + " ( " + namespaces.get(classNamespace) + ")");
|
String namespaceLabel = namespaces.get(classNamespace);
|
||||||
|
String prefix = namespaceLabel.substring(namespaceLabel.indexOf("(") + 1, namespaceLabel.indexOf(")"));
|
||||||
|
localClasses.put(classUri, v.getName() + " ( " + prefix + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return localClasses;
|
return localClasses;
|
||||||
|
|
|
@ -15,10 +15,11 @@ import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
||||||
import com.hp.hpl.jena.rdf.model.StmtIterator;
|
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 com.hp.hpl.jena.rdf.model.RDFNode;
|
||||||
|
import com.hp.hpl.jena.rdf.model.Statement;
|
||||||
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 edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageMenus;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageMenus;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
|
@ -63,14 +64,13 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
|
||||||
retrieveLocalClasses(vreq, data);
|
retrieveLocalClasses(vreq, data);
|
||||||
if(isSubmission(vreq)){
|
if(isSubmission(vreq)){
|
||||||
processSubmission(vreq, data);
|
processSubmission(vreq, data);
|
||||||
} else if(isSelectExistingClass(vreq)) {
|
|
||||||
//Local namespace(s) exist and user can select an existing class
|
|
||||||
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
|
||||||
processCreateNewClass(vreq, data);
|
processCreateNewClass(vreq, data);
|
||||||
|
} else if(isSelectExistingClass(vreq)) {
|
||||||
|
//Local namespace(s) exist and user can select an existing class
|
||||||
|
processSelectExistingClass(vreq, data);
|
||||||
} else if(isCreateOntologies(vreq)) {
|
} else if(isCreateOntologies(vreq)) {
|
||||||
//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
|
||||||
|
@ -240,8 +240,11 @@ public class InstitutionalInternalClassController extends FreemarkerHttpServlet
|
||||||
ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT),
|
ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT),
|
||||||
(RDFNode) null);
|
(RDFNode) null);
|
||||||
if(internalIt.hasNext()){
|
if(internalIt.hasNext()){
|
||||||
|
Statement s = internalIt.nextStatement();
|
||||||
|
if(s.getObject().isResource()){
|
||||||
internalClassUri = internalIt.nextStatement().getResource().getURI();
|
internalClassUri = internalIt.nextStatement().getResource().getURI();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return internalClassUri;
|
return internalClassUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue