More changes to ontology editing forms and console pages based on help from Manolo
This commit is contained in:
parent
4602b4364d
commit
32cd580d81
7 changed files with 184 additions and 142 deletions
|
@ -49,19 +49,19 @@ public class DatapropEditController extends BaseEditController {
|
|||
PropertyGroupDao pgDao = vreq.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
results.add("Data Property");
|
||||
results.add("data property");
|
||||
results.add("ontology");
|
||||
results.add("display name");
|
||||
results.add("group");
|
||||
results.add("domain");
|
||||
results.add("range datatype");
|
||||
results.add("group");
|
||||
results.add("display tier");
|
||||
results.add("data entry limit");
|
||||
results.add("example");
|
||||
results.add("description");
|
||||
results.add("public description");
|
||||
results.add("example");
|
||||
results.add("editor description");
|
||||
results.add("display level");
|
||||
results.add("update level");
|
||||
results.add("display tier");
|
||||
results.add("display limit");
|
||||
results.add("custom entry form");
|
||||
results.add("URI");
|
||||
|
||||
|
@ -78,6 +78,17 @@ public class DatapropEditController extends BaseEditController {
|
|||
results.add(ontologyName==null ? "(not identified)" : ontologyName);
|
||||
results.add(dp.getPublicName() == null ? "(no public name)" : dp.getPublicName());
|
||||
|
||||
if (dp.getGroupURI() != null) {
|
||||
PropertyGroup pGroup = pgDao.getGroupByURI(dp.getGroupURI());
|
||||
if (pGroup != null) {
|
||||
results.add(pGroup.getName());
|
||||
} else {
|
||||
results.add(dp.getGroupURI());
|
||||
}
|
||||
} else {
|
||||
results.add("(unspecified)");
|
||||
}
|
||||
|
||||
// we support parents now, but not the simple getParent() style method
|
||||
//String parentPropertyStr = "<i>(datatype properties are not yet modeled in a property hierarchy)</i>"; // TODO - need multiple inheritance
|
||||
//results.add(parentPropertyStr);
|
||||
|
@ -90,30 +101,22 @@ public class DatapropEditController extends BaseEditController {
|
|||
log.error(e, e);
|
||||
}
|
||||
results.add(domainStr);
|
||||
|
||||
|
||||
String rangeStr = (dp.getRangeDatatypeURI() == null) ? "<i>untyped</i> (rdfs:Literal)" : dp.getRangeDatatypeURI(); // TODO
|
||||
results.add(rangeStr);
|
||||
if (dp.getGroupURI() != null) {
|
||||
PropertyGroup pGroup = pgDao.getGroupByURI(dp.getGroupURI());
|
||||
if (pGroup != null) {
|
||||
results.add(pGroup.getName());
|
||||
} else {
|
||||
results.add(dp.getGroupURI());
|
||||
}
|
||||
} else {
|
||||
results.add("unspecified");
|
||||
}
|
||||
results.add(String.valueOf(dp.getDisplayTier()));
|
||||
results.add(String.valueOf(dp.getDisplayLimit()));
|
||||
|
||||
String publicDescriptionStr = (dp.getPublicDescription() == null) ? "" : dp.getPublicDescription();
|
||||
results.add(publicDescriptionStr);
|
||||
String exampleStr = (dp.getExample() == null) ? "" : dp.getExample();
|
||||
results.add(exampleStr);
|
||||
String descriptionStr = (dp.getDescription() == null) ? "" : dp.getDescription();
|
||||
results.add(descriptionStr);
|
||||
String publicDescriptionStr = (dp.getPublicDescription() == null) ? "" : dp.getPublicDescription();
|
||||
results.add(publicDescriptionStr);
|
||||
results.add(dp.getHiddenFromDisplayBelowRoleLevel() == null ? "unspecified" : dp.getHiddenFromDisplayBelowRoleLevel().getLabel());
|
||||
results.add(dp.getProhibitedFromUpdateBelowRoleLevel() == null ? "unspecified" : dp.getProhibitedFromUpdateBelowRoleLevel().getLabel());
|
||||
results.add(dp.getCustomEntryForm() == null ? "unspecified" : dp.getCustomEntryForm());
|
||||
|
||||
results.add(dp.getHiddenFromDisplayBelowRoleLevel() == null ? "(unspecified)" : dp.getHiddenFromDisplayBelowRoleLevel().getLabel());
|
||||
results.add(dp.getProhibitedFromUpdateBelowRoleLevel() == null ? "(unspecified)" : dp.getProhibitedFromUpdateBelowRoleLevel().getLabel());
|
||||
results.add(String.valueOf(dp.getDisplayTier()));
|
||||
results.add(String.valueOf(dp.getDisplayLimit()));
|
||||
results.add(dp.getCustomEntryForm() == null ? "(unspecified)" : dp.getCustomEntryForm());
|
||||
results.add(dp.getURI() == null ? "" : dp.getURI());
|
||||
request.setAttribute("results",results);
|
||||
request.setAttribute("columncount",NUM_COLS);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class PropertyEditController extends BaseEditController {
|
|||
request.setAttribute("property",p);
|
||||
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("Property"); // column 1
|
||||
results.add("property"); // column 1
|
||||
results.add("parent property"); // column 2
|
||||
results.add("domain"); // column 3
|
||||
results.add("range"); // column 4
|
||||
|
@ -67,8 +67,8 @@ public class PropertyEditController extends BaseEditController {
|
|||
results.add("update level"); // column 12
|
||||
results.add("custom entry form"); // column 13
|
||||
results.add("select from existing"); // column 14
|
||||
results.add("offer create new option"); // column 15
|
||||
results.add("relatedsort direction"); // column 16
|
||||
results.add("offer create new"); // column 15
|
||||
results.add("sort direction"); // column 16
|
||||
results.add("URI"); // column 17
|
||||
|
||||
String displayName = (p.getDomainPublic()==null) ? p.getLocalName() : p.getDomainPublic();
|
||||
|
@ -132,10 +132,10 @@ public class PropertyEditController extends BaseEditController {
|
|||
if (pGroup != null){
|
||||
results.add(pGroup.getName()); // column 6
|
||||
} else {
|
||||
results.add("unnamed group"); // column 6
|
||||
results.add("(unnamed group)"); // column 6
|
||||
}
|
||||
} else {
|
||||
results.add("unspecified"); // column 6
|
||||
results.add("(unspecified)"); // column 6
|
||||
}
|
||||
results.add("domain: "+p.getDomainDisplayTier() + ", range: "+p.getRangeDisplayTier()); // column 7
|
||||
String publicDescriptionStr = (p.getPublicDescription() == null) ? "" : p.getPublicDescription();
|
||||
|
@ -145,10 +145,10 @@ public class PropertyEditController extends BaseEditController {
|
|||
String descriptionStr = (p.getDescription() == null) ? "" : p.getDescription();
|
||||
results.add(descriptionStr); // column 10
|
||||
|
||||
results.add(p.getHiddenFromDisplayBelowRoleLevel() == null ? "unspecified" : p.getHiddenFromDisplayBelowRoleLevel().getLabel()); // column 11
|
||||
results.add(p.getProhibitedFromUpdateBelowRoleLevel() == null ? "unspecified" : p.getProhibitedFromUpdateBelowRoleLevel().getLabel()); // column 12
|
||||
results.add(p.getHiddenFromDisplayBelowRoleLevel() == null ? "(unspecified)" : p.getHiddenFromDisplayBelowRoleLevel().getLabel()); // column 11
|
||||
results.add(p.getProhibitedFromUpdateBelowRoleLevel() == null ? "(unspecified)" : p.getProhibitedFromUpdateBelowRoleLevel().getLabel()); // column 12
|
||||
|
||||
results.add(p.getCustomEntryForm() == null ? "unspecified" : p.getCustomEntryForm()); // column 13
|
||||
results.add(p.getCustomEntryForm() == null ? "(unspecified)" : p.getCustomEntryForm()); // column 13
|
||||
results.add(p.getSelectFromExisting() ? "true" : "false"); // column 14
|
||||
results.add(p.getOfferCreateNewOption() ? "true" : "false"); // column 15
|
||||
//results.add(p.getStubObjectRelation() ? "true" : "false"); // column 16
|
||||
|
|
|
@ -27,11 +27,12 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassGroupDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Ontology;
|
||||
|
||||
public class VclassEditController extends BaseEditController {
|
||||
|
||||
private static final Log log = LogFactory.getLog(VclassEditController.class.getName());
|
||||
private static final int NUM_COLS = 10;
|
||||
private static final int NUM_COLS = 13;
|
||||
|
||||
public void doPost (HttpServletRequest req, HttpServletResponse response) {
|
||||
if (!isAuthorizedToDisplayPage(req, response, SimplePermission.EDIT_ONTOLOGY.ACTIONS)) {
|
||||
|
@ -54,24 +55,31 @@ public class VclassEditController extends BaseEditController {
|
|||
request.setAttribute("VClass",vcl);
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
results.add("Class"); // 1
|
||||
results.add("short definition"); // 2
|
||||
results.add("example"); // 3
|
||||
results.add("description"); // 4
|
||||
results.add("editor comments"); // 5
|
||||
results.add("group"); // 6
|
||||
results.add("display level"); // 7
|
||||
results.add("update level"); // 8
|
||||
results.add("custom entry form"); // 9
|
||||
results.add("URI"); // 10
|
||||
results.add("class"); // 1
|
||||
results.add("ontology"); // 2
|
||||
results.add("display name"); // 3
|
||||
results.add("group"); // 4
|
||||
results.add("short definition"); // 5
|
||||
results.add("example"); // 6
|
||||
results.add("editor description"); // 7
|
||||
results.add("curator comments"); // 8
|
||||
results.add("display level"); // 9
|
||||
results.add("update level"); // 10
|
||||
results.add("display rank"); // 11
|
||||
results.add("custom entry form"); // 12
|
||||
results.add("URI"); // 13
|
||||
|
||||
String name = vcl.getLocalNameWithPrefix();
|
||||
String shortDef = (vcl.getShortDef()==null) ? "" : vcl.getShortDef();
|
||||
String example = (vcl.getExample()==null) ? "" : vcl.getExample();
|
||||
String description = (vcl.getDescription()==null) ? "" : vcl.getDescription();
|
||||
|
||||
WebappDaoFactory wadf = request.getFullWebappDaoFactory();
|
||||
String ontologyName = null;
|
||||
if (vcl.getNamespace() != null) {
|
||||
Ontology ont = request.getFullWebappDaoFactory().getOntologyDao().getOntologyByURI(vcl.getNamespace());
|
||||
if ( (ont != null) && (ont.getName() != null) ) {
|
||||
ontologyName = ont.getName();
|
||||
}
|
||||
}
|
||||
|
||||
WebappDaoFactory wadf = request.getFullWebappDaoFactory();
|
||||
String groupURI = vcl.getGroupURI();
|
||||
String groupName = "none";
|
||||
if(groupURI != null) {
|
||||
|
@ -82,6 +90,10 @@ public class VclassEditController extends BaseEditController {
|
|||
}
|
||||
}
|
||||
|
||||
String shortDef = (vcl.getShortDef()==null) ? "" : vcl.getShortDef();
|
||||
String example = (vcl.getExample()==null) ? "" : vcl.getExample();
|
||||
String description = (vcl.getDescription()==null) ? "" : vcl.getDescription();
|
||||
|
||||
boolean foundComment = false;
|
||||
StringBuffer commSb = null;
|
||||
for (Iterator<String> commIt = request.getFullWebappDaoFactory().getCommentsForResource(vcl.getURI()).iterator(); commIt.hasNext();) {
|
||||
|
@ -94,27 +106,29 @@ public class VclassEditController extends BaseEditController {
|
|||
if (!foundComment) {
|
||||
commSb = new StringBuffer("no comments yet");
|
||||
}
|
||||
|
||||
String hiddenFromDisplay = (vcl.getHiddenFromDisplayBelowRoleLevel() == null ? "unspecified" : vcl.getHiddenFromDisplayBelowRoleLevel().getLabel());
|
||||
String ProhibitedFromUpdate = (vcl.getProhibitedFromUpdateBelowRoleLevel() == null ? "unspecified" : vcl.getProhibitedFromUpdateBelowRoleLevel().getLabel());
|
||||
|
||||
String hiddenFromDisplay = (vcl.getHiddenFromDisplayBelowRoleLevel() == null ? "(unspecified)" : vcl.getHiddenFromDisplayBelowRoleLevel().getLabel());
|
||||
String ProhibitedFromUpdate = (vcl.getProhibitedFromUpdateBelowRoleLevel() == null ? "(unspecified)" : vcl.getProhibitedFromUpdateBelowRoleLevel().getLabel());
|
||||
|
||||
String customEntryForm = (vcl.getCustomEntryForm() == null ? "" : vcl.getCustomEntryForm());
|
||||
String customDisplayView = (vcl.getCustomDisplayView() == null ? "" : vcl.getCustomDisplayView());
|
||||
String customShortView = (vcl.getCustomShortView() == null ? "" : vcl.getCustomShortView());
|
||||
String customSearchView = (vcl.getCustomSearchView() == null ? "" : vcl.getCustomSearchView());
|
||||
String customEntryForm = (vcl.getCustomEntryForm() == null ? "(unspecified)" : vcl.getCustomEntryForm());
|
||||
|
||||
//String lastModified = "<i>not implemented yet</i>"; // TODO
|
||||
|
||||
String uri = (vcl.getURI() == null) ? "" : vcl.getURI();
|
||||
|
||||
results.add(name); // 1
|
||||
results.add(shortDef); // 2
|
||||
results.add(example); // 3
|
||||
results.add(description); // 4
|
||||
results.add(commSb.toString()); // 5
|
||||
results.add(groupName); // 6
|
||||
results.add(hiddenFromDisplay); // 7
|
||||
results.add(ProhibitedFromUpdate); // 8
|
||||
results.add(customEntryForm); // 9
|
||||
results.add(uri); // 10
|
||||
results.add(ontologyName==null ? "(not identified)" : ontologyName); //2
|
||||
results.add(vcl.getName() == null ? "(no public name)" : vcl.getName()); //3
|
||||
results.add(groupName); // 4
|
||||
results.add(shortDef); // 5
|
||||
results.add(example); // 6
|
||||
results.add(description); // 7
|
||||
results.add(commSb.toString()); // 8
|
||||
results.add(hiddenFromDisplay); // 9
|
||||
results.add(ProhibitedFromUpdate); // 10
|
||||
results.add(String.valueOf(vcl.getDisplayRank())); // 11
|
||||
results.add(customEntryForm); // 12
|
||||
results.add(uri); // 13
|
||||
request.setAttribute("results", results);
|
||||
request.setAttribute("columncount", NUM_COLS);
|
||||
request.setAttribute("suppressquery", "true");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue