VIVO-112
This commit is contained in:
parent
4047b4e8a9
commit
fca87953d2
15 changed files with 804 additions and 736 deletions
|
@ -608,9 +608,10 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
|||
if(rangeUri.equals(getPrincipalInvestigatorURI())) {
|
||||
return getVivoOntologyCoreNamespace() + "PrincipalInvestigatorRole";
|
||||
}
|
||||
else if(predicateUri.equals(getCoPrincipalInvestigatorURI())) {
|
||||
else if(rangeUri.equals(getCoPrincipalInvestigatorURI())) {
|
||||
return getVivoOntologyCoreNamespace() + "CoPrincipalInvestigatorRole";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return getVivoOntologyCoreNamespace() + "InvestigatorRole";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,64 +1,64 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions;
|
||||
|
||||
public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator {
|
||||
|
||||
private static String OBJECT_VCLASS_URI = "http://vivoweb.org/ontology/core#InformationResource";
|
||||
|
||||
@Override
|
||||
String getTemplate() { return "addReviewerRoleToPerson.ftl"; }
|
||||
|
||||
//The default activityToRolePredicate and roleToActivityPredicates are
|
||||
//correct for this subclass so they don't need to be overwritten
|
||||
|
||||
@Override
|
||||
public String getRoleToActivityPredicate(VitroRequest vreq) {
|
||||
return "<http://vivoweb.org/ontology/core#forInformationResource>";
|
||||
}
|
||||
|
||||
//role type will always be set based on particular form
|
||||
@Override
|
||||
public String getRoleType() {
|
||||
//TODO: Get dynamic way of including vivoweb ontology
|
||||
return "http://vivoweb.org/ontology/core#ReviewerRole";
|
||||
}
|
||||
|
||||
/**
|
||||
* Each subclass generator will return its own type of option here:
|
||||
* whether literal hardcoded, based on class group, or subclasses of a specific class
|
||||
*/
|
||||
@Override
|
||||
FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception {
|
||||
return new ChildVClassesOptions(OBJECT_VCLASS_URI)
|
||||
.setDefaultOptionLabel("Select type");
|
||||
}
|
||||
|
||||
//isShowRoleLabelField remains true for this so doesn't need to be overwritten
|
||||
public boolean isShowRoleLabelField() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use the methods below to change the date/time precision in the
|
||||
* custom form associated with this generator. When not used, the
|
||||
* precision will be YEAR. The other precisons are MONTH, DAY, HOUR,
|
||||
* MINUTE, TIME and NONE.
|
||||
*/
|
||||
/*
|
||||
public String getStartDatePrecision() {
|
||||
String precision = VitroVocabulary.Precision.MONTH.uri();
|
||||
return precision;
|
||||
}
|
||||
|
||||
public String getEndDatePrecision() {
|
||||
String precision = VitroVocabulary.Precision.DAY.uri();
|
||||
return precision;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions;
|
||||
|
||||
public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator {
|
||||
|
||||
private static String OBJECT_VCLASS_URI = "http://purl.org/ontology/bibo/Document";
|
||||
|
||||
@Override
|
||||
String getTemplate() { return "addReviewerRoleToPerson.ftl"; }
|
||||
|
||||
//The default activityToRolePredicate and roleToActivityPredicates are
|
||||
//correct for this subclass so they don't need to be overwritten
|
||||
|
||||
/* @Override
|
||||
public String getRoleToActivityPredicate(VitroRequest vreq) {
|
||||
return "<http://purl.obolibrary.org/obo/BFO_0000054>";
|
||||
}
|
||||
*/
|
||||
//role type will always be set based on particular form
|
||||
@Override
|
||||
public String getRoleType() {
|
||||
//TODO: Get dynamic way of including vivoweb ontology
|
||||
return "http://vivoweb.org/ontology/core#ReviewerRole";
|
||||
}
|
||||
|
||||
/**
|
||||
* Each subclass generator will return its own type of option here:
|
||||
* whether literal hardcoded, based on class group, or subclasses of a specific class
|
||||
*/
|
||||
@Override
|
||||
FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception {
|
||||
return new ChildVClassesOptions(OBJECT_VCLASS_URI)
|
||||
.setDefaultOptionLabel("Select type");
|
||||
}
|
||||
|
||||
//isShowRoleLabelField remains true for this so doesn't need to be overwritten
|
||||
public boolean isShowRoleLabelField() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use the methods below to change the date/time precision in the
|
||||
* custom form associated with this generator. When not used, the
|
||||
* precision will be YEAR. The other precisons are MONTH, DAY, HOUR,
|
||||
* MINUTE, TIME and NONE.
|
||||
*/
|
||||
/*
|
||||
public String getStartDatePrecision() {
|
||||
String precision = VitroVocabulary.Precision.MONTH.uri();
|
||||
return precision;
|
||||
}
|
||||
|
||||
public String getEndDatePrecision() {
|
||||
String precision = VitroVocabulary.Precision.DAY.uri();
|
||||
return precision;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue