Adding some changes to DateTimeWidget. NIHVIVO-631

This commit is contained in:
bdc34 2011-01-05 20:45:58 +00:00
parent 5b5f855856
commit cf6d5098b4
2 changed files with 5 additions and 3 deletions

View file

@ -84,7 +84,7 @@ public class DateTimeWithPrecision extends BaseEditElement {
//it would be nice to have only the version of the constructor that takes the enum
//but this is to quickly get the JSP configuration working.
public DateTimeWithPrecision(Field field, String minimumPrecisionURI, String displayRequiredLevelUri){
super(field);
this(field);
this.minimumPrecision = toPrecision( minimumPrecisionURI);
if( this.minimumPrecision == null )
@ -116,7 +116,7 @@ public class DateTimeWithPrecision extends BaseEditElement {
/**
* This produces a map for use in the template.
*/
private Map getMapForTemplate(EditConfiguration editConfig, EditSubmission editSub) {
protected Map getMapForTemplate(EditConfiguration editConfig, EditSubmission editSub) {
Map<String,Object>map = new HashMap<String,Object>();
//always need the fieldName, required precision, and constants

View file

@ -30,10 +30,12 @@ precisionConstants.minute -- URI for precision
precisionConstants.second -- URI for precision
-->
${fieldName}
<@dateTime specificity="${minimumPrecision}" required="${requiredLevel}" />
<#macro dateTime specificity="full" required=specificity>
<#assign specLevel = 10 />
<#assign reqLevel = 10 />
<#if specificity == "${precisionConstants.year}">