Merge pull request #138 from vivo-project/bugfix/VIVO-1756
[VIVO-1756] - Make data property richtext editor option selectable from UI
This commit is contained in:
commit
7981d24da7
4 changed files with 29 additions and 6 deletions
|
@ -42,7 +42,7 @@ public class DatapropEditController extends BaseEditController {
|
|||
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
|
||||
final int NUM_COLS=18;
|
||||
final int NUM_COLS=19;
|
||||
|
||||
String datapropURI = request.getParameter("uri");
|
||||
|
||||
|
@ -73,8 +73,9 @@ public class DatapropEditController extends BaseEditController {
|
|||
results.add("display tier"); // column 14
|
||||
results.add("display limit"); // column 15
|
||||
results.add("custom entry form"); // column 16
|
||||
results.add("URI"); // column 17
|
||||
results.add("publish level"); // column 18
|
||||
results.add("editing"); // column 17
|
||||
results.add("URI"); // column 18
|
||||
results.add("publish level"); // column 19
|
||||
|
||||
results.add(dp.getPickListName()); // column 1
|
||||
results.add(dp.getPublicName() == null ? "(no public label)" : dp.getPublicName()); // column 2
|
||||
|
@ -142,9 +143,10 @@ public class DatapropEditController extends BaseEditController {
|
|||
results.add(String.valueOf(dp.getDisplayTier())); // column 14
|
||||
results.add(String.valueOf(dp.getDisplayLimit())); // column 15
|
||||
results.add(dp.getCustomEntryForm() == null ? "(unspecified)" : dp.getCustomEntryForm()); // column 16
|
||||
results.add(dp.getURI() == null ? "" : dp.getURI()); // column 17
|
||||
results.add(dp.getEditing() == null ? "" : dp.getEditing()); // column 17
|
||||
results.add(dp.getURI() == null ? "" : dp.getURI()); // column 18
|
||||
results.add(dp.getHiddenFromPublishBelowRoleLevel() == null ? "(unspecified)"
|
||||
: dp.getHiddenFromPublishBelowRoleLevel().getDisplayLabel()); // column 18
|
||||
: dp.getHiddenFromPublishBelowRoleLevel().getDisplayLabel()); // column 19
|
||||
request.setAttribute("results",results);
|
||||
request.setAttribute("columncount",NUM_COLS);
|
||||
request.setAttribute("suppressquery","true");
|
||||
|
|
|
@ -168,13 +168,26 @@ public class DatapropRetryController extends BaseEditController {
|
|||
optionMap.put("ProhibitedFromUpdateBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getUpdateOptionsList(objectForEditing));
|
||||
optionMap.put("HiddenFromPublishBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getPublishOptionsList(objectForEditing));
|
||||
|
||||
// Set the value of the editing parameter (as defined in VitroVocabulary.java).
|
||||
// Use value to control form types as in defaultDataPropertyForm.ftl
|
||||
String editingVal = objectForEditing.getEditing();
|
||||
List<Option> editingOptList = new ArrayList<Option>();
|
||||
editingOptList.add(0,new Option("","plaintext"));
|
||||
editingOptList.add(1,new Option("HTML","rich text"));
|
||||
for (Option val : editingOptList) {
|
||||
if(editingVal != null && editingVal.equals(val.getValue())) {
|
||||
val.setSelected(true);
|
||||
}
|
||||
}
|
||||
optionMap.put("Editing", editingOptList);
|
||||
|
||||
foo.setOptionLists(optionMap);
|
||||
|
||||
request.setAttribute("functional",objectForEditing.getFunctional());
|
||||
|
||||
//checkboxes are pretty annoying : we don't know if someone *unchecked* a box, so we have to default to false on updates.
|
||||
if (objectForEditing.getURI() != null) {
|
||||
objectForEditing.setFunctional(false);
|
||||
objectForEditing.setFunctional(false);
|
||||
}
|
||||
|
||||
foo.setErrorMap(epo.getErrMsgMap());
|
||||
|
|
|
@ -514,6 +514,7 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements
|
|||
addPropertyStringValue(jDataprop, EXAMPLE, dtp.getExample(), ontModel);
|
||||
addPropertyStringValue(jDataprop, DESCRIPTION_ANNOT, dtp.getDescription(), ontModel);
|
||||
addPropertyStringValue(jDataprop, PUBLIC_DESCRIPTION_ANNOT, dtp.getPublicDescription(), ontModel);
|
||||
addPropertyStringValue(jDataprop, EDITING, dtp.getEditing(), ontModel);
|
||||
addPropertyNonNegativeIntValue(jDataprop, DISPLAY_RANK_ANNOT, dtp.getDisplayTier(), ontModel);
|
||||
addPropertyNonNegativeIntValue(jDataprop, DISPLAY_LIMIT, dtp.getDisplayLimit(), ontModel);
|
||||
//addPropertyStringValue(jDataprop, HIDDEN_ANNOT, dtp.getHidden(), ontModel);
|
||||
|
@ -584,6 +585,7 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements
|
|||
updatePropertyStringValue(jDataprop, EXAMPLE, dtp.getExample(), ontModel);
|
||||
updatePropertyStringValue(jDataprop, DESCRIPTION_ANNOT, dtp.getDescription(), ontModel);
|
||||
updatePropertyStringValue(jDataprop, PUBLIC_DESCRIPTION_ANNOT, dtp.getPublicDescription(), ontModel);
|
||||
updatePropertyStringValue(jDataprop, EDITING, dtp.getEditing(), ontModel);
|
||||
updatePropertyNonNegativeIntValue(jDataprop, DISPLAY_RANK_ANNOT, dtp.getDisplayTier(), ontModel);
|
||||
updatePropertyNonNegativeIntValue(jDataprop, DISPLAY_LIMIT, dtp.getDisplayLimit(), ontModel);
|
||||
|
||||
|
|
|
@ -174,6 +174,12 @@
|
|||
</c:if>
|
||||
</td>
|
||||
</td>
|
||||
<td valign="top" colspan="2">
|
||||
<b>Rich text editing</b><br/>
|
||||
<select name="Editing">
|
||||
<form:option name="Editing"/>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="5"><hr class="formDivider"/></td></tr>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue