NIHVIVO-1630 the different role forms can now have their own datatime precisions for the start and end dates

This commit is contained in:
tworrall 2012-06-21 14:31:47 +00:00
parent 5e69b3ac29
commit f14e2328c1
12 changed files with 205 additions and 7 deletions

View file

@ -44,5 +44,21 @@ public class AddAttendeeRoleToPersonGenerator extends AddRoleToPersonTwoStageGen
return false; 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;
}
*/
} }

View file

@ -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;
}
*/
} }

View file

@ -55,4 +55,21 @@ public class AddEditorRoleToPersonGenerator extends AddRoleToPersonTwoStageGener
@Override @Override
boolean isShowRoleLabelField() { return false; } 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;
}
*/
} }

View file

@ -3,6 +3,7 @@
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; 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.ConstantFieldOptions;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions;
@ -61,6 +62,21 @@ public class AddHeadOfRoleToPersonGenerator extends AddRoleToPersonTwoStageGener
@Override @Override
boolean isShowRoleLabelField(){return true;} 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;
}
*/
} }

View file

@ -28,4 +28,22 @@ public class AddMemberRoleToPersonGenerator extends AddRoleToPersonTwoStageGener
@Override @Override
boolean isShowRoleLabelField(){return true;} 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;
}
*/
} }

View file

@ -45,4 +45,21 @@ public class AddOrganizerRoleToPersonGenerator extends AddRoleToPersonTwoStageGe
boolean isShowRoleLabelField() { boolean isShowRoleLabelField() {
return false; 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;
}
*/
} }

View file

@ -60,4 +60,21 @@ public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwo
@Override @Override
boolean isShowRoleLabelField(){return true;} 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;
}
*/
} }

View file

@ -31,4 +31,21 @@ public class AddResearcherRoleToPersonGenerator extends AddRoleToPersonTwoStageG
@Override @Override
boolean isShowRoleLabelField() { return true; } 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;
}
*/
} }

View file

@ -43,8 +43,22 @@ public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGen
return false; 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;
}
*/
} }

View file

@ -89,6 +89,10 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
/* ***** Methods that are REQUIRED to be implemented in subclasses ***** */ /* ***** Methods that are REQUIRED to be implemented in subclasses ***** */
// abstract String getStartDatePrecision();
// abstract String getEndDatePrecision();
/** Freemarker template to use */ /** Freemarker template to use */
abstract String getTemplate(); abstract String getTemplate();
@ -748,7 +752,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
field.setEditElement( field.setEditElement(
new DateTimeWithPrecisionVTwo(field, new DateTimeWithPrecisionVTwo(field,
VitroVocabulary.Precision.YEAR.uri(), getStartDatePrecision(),
VitroVocabulary.Precision.NONE.uri())); VitroVocabulary.Precision.NONE.uri()));
fields.put(field.getName(), field); fields.put(field.getName(), field);
@ -763,7 +767,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
field.setEditElement( field.setEditElement(
new DateTimeWithPrecisionVTwo(field, new DateTimeWithPrecisionVTwo(field,
VitroVocabulary.Precision.YEAR.uri(), getEndDatePrecision(),
VitroVocabulary.Precision.NONE.uri())); VitroVocabulary.Precision.NONE.uri()));
fields.put(field.getName(), field); 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#> ."; 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;
}
} }

View file

@ -57,5 +57,21 @@ public class AddServiceProviderRoleToPersonGenerator extends AddRoleToPersonTwoS
@Override @Override
boolean isShowRoleLabelField(){return true;} 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;
}
*/
} }

View file

@ -35,4 +35,21 @@ public class AddTeacherRoleToPersonGenerator extends AddRoleToPersonTwoStageGene
@Override @Override
boolean isShowRoleLabelField(){return true;} 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;
}
*/
} }