NIHVIVO-1630 the different role forms can now have their own datatime precisions for the start and end dates
This commit is contained in:
parent
5e69b3ac29
commit
f14e2328c1
12 changed files with 205 additions and 7 deletions
|
@ -44,5 +44,21 @@ public class AddAttendeeRoleToPersonGenerator extends AddRoleToPersonTwoStageGen
|
|||
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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -40,5 +40,22 @@ public class AddClinicalRoleToPersonGenerator extends AddRoleToPersonTwoStageGen
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
|
@ -55,4 +55,21 @@ public class AddEditorRoleToPersonGenerator extends AddRoleToPersonTwoStageGener
|
|||
@Override
|
||||
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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions;
|
||||
|
||||
|
@ -61,6 +62,21 @@ public class AddHeadOfRoleToPersonGenerator extends AddRoleToPersonTwoStageGener
|
|||
@Override
|
||||
boolean isShowRoleLabelField(){return true;}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -28,4 +28,22 @@ public class AddMemberRoleToPersonGenerator extends AddRoleToPersonTwoStageGener
|
|||
|
||||
@Override
|
||||
boolean isShowRoleLabelField(){return true;}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -45,4 +45,21 @@ public class AddOrganizerRoleToPersonGenerator extends AddRoleToPersonTwoStageGe
|
|||
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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -60,4 +60,21 @@ public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwo
|
|||
@Override
|
||||
boolean isShowRoleLabelField(){return true;}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -31,4 +31,21 @@ public class AddResearcherRoleToPersonGenerator extends AddRoleToPersonTwoStageG
|
|||
|
||||
@Override
|
||||
boolean isShowRoleLabelField() { return true; }
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -43,8 +43,22 @@ public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGen
|
|||
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;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
|
@ -89,6 +89,10 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
|
|||
|
||||
/* ***** Methods that are REQUIRED to be implemented in subclasses ***** */
|
||||
|
||||
// abstract String getStartDatePrecision();
|
||||
|
||||
// abstract String getEndDatePrecision();
|
||||
|
||||
/** Freemarker template to use */
|
||||
abstract String getTemplate();
|
||||
|
||||
|
@ -748,7 +752,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
|
|||
|
||||
field.setEditElement(
|
||||
new DateTimeWithPrecisionVTwo(field,
|
||||
VitroVocabulary.Precision.YEAR.uri(),
|
||||
getStartDatePrecision(),
|
||||
VitroVocabulary.Precision.NONE.uri()));
|
||||
|
||||
fields.put(field.getName(), field);
|
||||
|
@ -763,7 +767,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
|
|||
|
||||
field.setEditElement(
|
||||
new DateTimeWithPrecisionVTwo(field,
|
||||
VitroVocabulary.Precision.YEAR.uri(),
|
||||
getEndDatePrecision(),
|
||||
VitroVocabulary.Precision.NONE.uri()));
|
||||
|
||||
fields.put(field.getName(), field);
|
||||
|
@ -878,4 +882,16 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
|
|||
};
|
||||
|
||||
private final String N3_PREFIX = "@prefix core: <http://vivoweb.org/ontology/core#> .";
|
||||
|
||||
protected String getStartDatePrecision() {
|
||||
String precision = VitroVocabulary.Precision.YEAR.uri();
|
||||
return precision;
|
||||
}
|
||||
|
||||
protected String getEndDatePrecision() {
|
||||
String precision = VitroVocabulary.Precision.YEAR.uri();
|
||||
return precision;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -57,5 +57,21 @@ public class AddServiceProviderRoleToPersonGenerator extends AddRoleToPersonTwoS
|
|||
@Override
|
||||
boolean isShowRoleLabelField(){return true;}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -35,4 +35,21 @@ public class AddTeacherRoleToPersonGenerator extends AddRoleToPersonTwoStageGene
|
|||
@Override
|
||||
boolean isShowRoleLabelField(){return true;}
|
||||
|
||||
/*
|
||||
* 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
Reference in a new issue