Updates for NIHVIVO-3406 and NIHVIVO-3408 - the Vitro NewIndividualFormGenerator needed to be updated to add label to the set of fields (the code for creating the field was there but it wasn't assigned to the edit configuration object) and the freemarker template needed to be updated to include the correct name/id for the label field

This commit is contained in:
hjkhjk54 2011-12-02 20:11:22 +00:00
parent 3502db6219
commit 5d7f8486b8
2 changed files with 21 additions and 11 deletions

View file

@ -204,8 +204,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
List<String> urisOnForm = new ArrayList<String>();
List<String> literalsOnForm = new ArrayList<String>();
literalsOnForm.add("label");
literalsOnForm.add("firstName");
literalsOnForm.add("lastName");
editConfiguration.setUrisOnform(urisOnForm);
editConfiguration.setLiteralsOnForm(literalsOnForm);
}
@ -237,11 +235,11 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) {
Map<String, FieldVTwo> fields = new HashMap<String, FieldVTwo>();
getLabelField(editConfiguration, vreq, fields);
setLabelField(editConfiguration, vreq, fields);
}
private void getLabelField(EditConfigurationVTwo editConfiguration,
private void setLabelField(EditConfigurationVTwo editConfiguration,
VitroRequest vreq, Map<String, FieldVTwo> fields) {
FieldVTwo field = new FieldVTwo();
field.setName("label");
@ -264,6 +262,7 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
field.setLiteralOptions(new ArrayList<List<String>>());
fields.put(field.getName(), field);
editConfiguration.setFields(fields);
}