continuing to improve ontology editing forms and console pages
This commit is contained in:
parent
ea3e05fb80
commit
c47949a980
4 changed files with 148 additions and 123 deletions
|
@ -40,7 +40,7 @@ public class DatapropEditController extends BaseEditController {
|
|||
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
|
||||
final int NUM_COLS=15;
|
||||
final int NUM_COLS=17;
|
||||
|
||||
String datapropURI = request.getParameter("uri");
|
||||
|
||||
|
@ -49,25 +49,40 @@ public class DatapropEditController extends BaseEditController {
|
|||
PropertyGroupDao pgDao = vreq.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
results.add("data property");
|
||||
results.add("ontology");
|
||||
results.add("display name");
|
||||
results.add("group");
|
||||
results.add("domain");
|
||||
results.add("range datatype");
|
||||
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");
|
||||
results.add("data property"); // column 1
|
||||
results.add("public display label"); // column 2
|
||||
results.add("property group"); // column 3
|
||||
results.add("ontology"); // column 4
|
||||
results.add("RDF local name"); // column 5
|
||||
results.add("domain class"); // column 6
|
||||
results.add("range datatype"); // column 7
|
||||
results.add("functional"); // column 8
|
||||
results.add("public description"); // column 9
|
||||
results.add("example"); // column 10
|
||||
results.add("editor description"); // column 11
|
||||
results.add("display level"); // column 12
|
||||
results.add("update level"); // column 13
|
||||
results.add("display tier"); // column 14
|
||||
results.add("display limit"); // column 15
|
||||
results.add("custom entry form"); // column 16
|
||||
results.add("URI"); // column 17
|
||||
|
||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||
|
||||
results.add(dp.getLocalNameWithPrefix());
|
||||
results.add(dp.getLocalNameWithPrefix()); // column 1
|
||||
results.add(dp.getPublicName() == null ? "(no public label)" : dp.getPublicName()); // column 2
|
||||
|
||||
if (dp.getGroupURI() != null) {
|
||||
PropertyGroup pGroup = pgDao.getGroupByURI(dp.getGroupURI());
|
||||
if (pGroup != null) {
|
||||
results.add(pGroup.getName()); // column 3
|
||||
} else {
|
||||
results.add(dp.getGroupURI());
|
||||
}
|
||||
} else {
|
||||
results.add("(unspecified)");
|
||||
}
|
||||
|
||||
String ontologyName = null;
|
||||
if (dp.getNamespace() != null) {
|
||||
Ontology ont = vreq.getFullWebappDaoFactory().getOntologyDao().getOntologyByURI(dp.getNamespace());
|
||||
|
@ -75,19 +90,9 @@ public class DatapropEditController extends BaseEditController {
|
|||
ontologyName = ont.getName();
|
||||
}
|
||||
}
|
||||
results.add(ontologyName==null ? "(not identified)" : ontologyName);
|
||||
results.add(dp.getPublicName() == null ? "(no public name)" : dp.getPublicName());
|
||||
results.add(ontologyName==null ? "(not identified)" : ontologyName); // column 4
|
||||
|
||||
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(dp.getLocalName()); // column 5
|
||||
|
||||
// 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
|
||||
|
@ -100,24 +105,26 @@ public class DatapropEditController extends BaseEditController {
|
|||
} catch (UnsupportedEncodingException e) {
|
||||
log.error(e, e);
|
||||
}
|
||||
results.add(domainStr);
|
||||
results.add(domainStr); // column 6
|
||||
|
||||
String rangeStr = (dp.getRangeDatatypeURI() == null) ? "<i>untyped</i> (rdfs:Literal)" : dp.getRangeDatatypeURI(); // TODO
|
||||
results.add(rangeStr);
|
||||
String rangeStr = (dp.getRangeDatatypeURI() == null) ? "<i>untyped</i> (rdfs:Literal)" : dp.getRangeDatatypeURI();
|
||||
results.add(rangeStr); // column 7
|
||||
|
||||
String publicDescriptionStr = (dp.getPublicDescription() == null) ? "" : dp.getPublicDescription();
|
||||
results.add(dp.getFunctional() ? "true" : "false"); // column 8
|
||||
|
||||
String publicDescriptionStr = (dp.getPublicDescription() == null) ? "" : dp.getPublicDescription(); // column 9
|
||||
results.add(publicDescriptionStr);
|
||||
String exampleStr = (dp.getExample() == null) ? "" : dp.getExample();
|
||||
String exampleStr = (dp.getExample() == null) ? "" : dp.getExample(); // column 10
|
||||
results.add(exampleStr);
|
||||
String descriptionStr = (dp.getDescription() == null) ? "" : dp.getDescription();
|
||||
String descriptionStr = (dp.getDescription() == null) ? "" : dp.getDescription(); // column 11
|
||||
results.add(descriptionStr);
|
||||
|
||||
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());
|
||||
results.add(dp.getHiddenFromDisplayBelowRoleLevel() == null ? "(unspecified)" : dp.getHiddenFromDisplayBelowRoleLevel().getLabel()); // column 12
|
||||
results.add(dp.getProhibitedFromUpdateBelowRoleLevel() == null ? "(unspecified)" : dp.getProhibitedFromUpdateBelowRoleLevel().getLabel()); // column 13
|
||||
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
|
||||
request.setAttribute("results",results);
|
||||
request.setAttribute("columncount",NUM_COLS);
|
||||
request.setAttribute("suppressquery","true");
|
||||
|
|
|
@ -22,6 +22,7 @@ import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
|||
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Ontology;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||
|
@ -41,7 +42,7 @@ public class PropertyEditController extends BaseEditController {
|
|||
return;
|
||||
}
|
||||
|
||||
final int NUM_COLS=17;
|
||||
final int NUM_COLS=24;
|
||||
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
|
||||
|
@ -53,32 +54,33 @@ public class PropertyEditController extends BaseEditController {
|
|||
request.setAttribute("property",p);
|
||||
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("property"); // column 1
|
||||
results.add("parent property"); // column 2
|
||||
results.add("domain"); // column 3
|
||||
results.add("range"); // column 4
|
||||
results.add("display name"); // column 5
|
||||
results.add("group"); // column 6
|
||||
results.add("display tier"); // column 7
|
||||
results.add("public description"); // column 8
|
||||
results.add("example"); // column 9
|
||||
results.add("editor description"); // column 10
|
||||
results.add("display level"); //column 11
|
||||
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"); // column 15
|
||||
results.add("sort direction"); // column 16
|
||||
results.add("URI"); // column 17
|
||||
|
||||
String displayName = (p.getDomainPublic()==null) ? p.getLocalName() : p.getDomainPublic();
|
||||
try {
|
||||
results.add("<a href=\"propertyEdit?uri="+URLEncoder.encode(p.getURI(),"UTF-8")+"\">"+displayName+"</a> <em>"+p.getLocalNameWithPrefix()+"</em>");// column 1
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("Could not encode URI for property (domain public: "+p.getDomainPublic()+", local name with prefix: "+p.getLocalNameWithPrefix()+", URI: "+p.getURI()+").");
|
||||
results.add(displayName + "<em>"+p.getLocalNameWithPrefix()+"</em>"); // column 1
|
||||
}
|
||||
results.add("property"); // column 1
|
||||
results.add("parent property"); // column 2
|
||||
results.add("property group"); // column 3
|
||||
results.add("ontology"); // column 4
|
||||
results.add("RDF local name"); // column 5
|
||||
results.add("public display label"); // column 6
|
||||
results.add("domain class"); // column 7
|
||||
results.add("range class"); // column 8
|
||||
results.add("transitive"); // column 9
|
||||
results.add("symmetric"); // column 10
|
||||
results.add("functional"); // column 11
|
||||
results.add("inverse functional"); // column 12
|
||||
results.add("public description"); // column 13
|
||||
results.add("example"); // column 14
|
||||
results.add("editor description"); // column 15
|
||||
results.add("display level"); // column 16
|
||||
results.add("update level"); // column 17
|
||||
results.add("display tier"); // column 18
|
||||
results.add("collate by subclass"); // column 19
|
||||
results.add("custom entry form"); // column 20
|
||||
results.add("select from existing"); // column 21
|
||||
results.add("offer create new"); // column 22
|
||||
results.add("sort direction"); // column 23
|
||||
results.add("URI"); // column 24
|
||||
|
||||
results.add(p.getLocalNameWithPrefix()); // column 1
|
||||
|
||||
String parentPropertyStr = "";
|
||||
if (p.getParentURI() != null) {
|
||||
ObjectProperty parent = propDao.getObjectPropertyByURI(p.getParentURI());
|
||||
|
@ -92,6 +94,30 @@ public class PropertyEditController extends BaseEditController {
|
|||
}
|
||||
results.add(parentPropertyStr); // column 2
|
||||
|
||||
if (p.getGroupURI() != null) {
|
||||
PropertyGroup pGroup = pgDao.getGroupByURI(p.getGroupURI());
|
||||
if (pGroup != null){
|
||||
results.add(pGroup.getName()); // column 3
|
||||
} else {
|
||||
results.add("(unnamed group)"); // column 3
|
||||
}
|
||||
} else {
|
||||
results.add("(unspecified)"); // column 3
|
||||
}
|
||||
|
||||
String ontologyName = null;
|
||||
if (p.getNamespace() != null) {
|
||||
Ontology ont = vreq.getFullWebappDaoFactory().getOntologyDao().getOntologyByURI(p.getNamespace());
|
||||
if ( (ont != null) && (ont.getName() != null) ) {
|
||||
ontologyName = ont.getName();
|
||||
}
|
||||
}
|
||||
results.add(ontologyName==null ? "(not identified)" : ontologyName); // column 4
|
||||
|
||||
results.add(p.getLocalName()); // column 5
|
||||
|
||||
results.add(p.getDomainPublic() == null ? "(no public label)" : p.getDomainPublic()); // column 6
|
||||
|
||||
String domainStr = "";
|
||||
if (p.getDomainVClassURI() != null) {
|
||||
VClass domainClass = vcDao.getVClassByURI(p.getDomainVClassURI());
|
||||
|
@ -107,7 +133,7 @@ public class PropertyEditController extends BaseEditController {
|
|||
}
|
||||
}
|
||||
}
|
||||
results.add(domainStr); // column 3
|
||||
results.add(domainStr); // column 7
|
||||
|
||||
String rangeStr = "";
|
||||
if (p.getRangeVClassURI() != null) {
|
||||
|
@ -124,34 +150,30 @@ public class PropertyEditController extends BaseEditController {
|
|||
}
|
||||
}
|
||||
}
|
||||
results.add(rangeStr); // column 4
|
||||
results.add(rangeStr); // column 8
|
||||
|
||||
results.add(p.getTransitive() ? "true" : "false"); // column 9
|
||||
results.add(p.getSymmetric() ? "true" : "false"); // column 10
|
||||
results.add(p.getFunctional() ? "true" : "false"); // column 11
|
||||
results.add(p.getInverseFunctional() ? "true" : "false"); // column 12
|
||||
|
||||
results.add(p.getDomainPublic() == null ? "" : p.getDomainPublic()); // column 5
|
||||
if (p.getGroupURI() != null) {
|
||||
PropertyGroup pGroup = pgDao.getGroupByURI(p.getGroupURI());
|
||||
if (pGroup != null){
|
||||
results.add(pGroup.getName()); // column 6
|
||||
} else {
|
||||
results.add("(unnamed group)"); // column 6
|
||||
}
|
||||
} else {
|
||||
results.add("(unspecified)"); // column 6
|
||||
}
|
||||
results.add("domain: "+p.getDomainDisplayTier() + ", range: "+p.getRangeDisplayTier()); // column 7
|
||||
String publicDescriptionStr = (p.getPublicDescription() == null) ? "" : p.getPublicDescription();
|
||||
results.add(publicDescriptionStr); // column 8
|
||||
results.add(publicDescriptionStr); // column 13
|
||||
String exampleStr = (p.getExample() == null) ? "" : p.getExample();
|
||||
results.add(exampleStr); // column 9
|
||||
results.add(exampleStr); // column 14
|
||||
String descriptionStr = (p.getDescription() == null) ? "" : p.getDescription();
|
||||
results.add(descriptionStr); // column 10
|
||||
results.add(descriptionStr); // column 15
|
||||
|
||||
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 16
|
||||
results.add(p.getProhibitedFromUpdateBelowRoleLevel() == null ? "(unspecified)" : p.getProhibitedFromUpdateBelowRoleLevel().getLabel()); // column 17
|
||||
|
||||
results.add("property: "+p.getDomainDisplayTier() + ", inverse: "+p.getRangeDisplayTier()); // column 18
|
||||
|
||||
results.add(p.getCollateBySubclass() ? "true" : "false"); // column 19
|
||||
|
||||
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
|
||||
results.add(p.getCustomEntryForm() == null ? "(unspecified)" : p.getCustomEntryForm()); // column 20
|
||||
results.add(p.getSelectFromExisting() ? "true" : "false"); // column 21
|
||||
results.add(p.getOfferCreateNewOption() ? "true" : "false"); // column 22
|
||||
|
||||
/*
|
||||
String datapropStr = "";
|
||||
|
@ -169,9 +191,9 @@ public class PropertyEditController extends BaseEditController {
|
|||
results.add("name (rdfs:label)"); // column 16
|
||||
}
|
||||
*/
|
||||
results.add(p.getDomainEntitySortDirection() == null ? "ascending" : p.getDomainEntitySortDirection()); // column 16
|
||||
results.add(p.getDomainEntitySortDirection() == null ? "ascending" : p.getDomainEntitySortDirection()); // column 23
|
||||
|
||||
results.add(p.getURI()); // column 17
|
||||
results.add(p.getURI()); // column 24
|
||||
request.setAttribute("results",results);
|
||||
request.setAttribute("columncount",NUM_COLS);
|
||||
request.setAttribute("suppressquery","true");
|
||||
|
|
|
@ -32,7 +32,7 @@ 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 = 12;
|
||||
private static final int NUM_COLS = 13;
|
||||
|
||||
public void doPost (HttpServletRequest req, HttpServletResponse response) {
|
||||
if (!isAuthorizedToDisplayPage(req, response, SimplePermission.EDIT_ONTOLOGY.ACTIONS)) {
|
||||
|
@ -56,20 +56,19 @@ public class VclassEditController extends BaseEditController {
|
|||
|
||||
ArrayList results = new ArrayList();
|
||||
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"); //
|
||||
results.add("display level"); // 8
|
||||
results.add("update level"); // 9
|
||||
results.add("display rank"); // 10
|
||||
results.add("custom entry form"); // 11
|
||||
results.add("URI"); // 12
|
||||
|
||||
String name = vcl.getLocalNameWithPrefix();
|
||||
results.add("class label"); // 2
|
||||
results.add("class group"); // 3
|
||||
results.add("ontology"); // 4
|
||||
results.add("RDF local name"); // 5
|
||||
results.add("short definition"); // 6
|
||||
results.add("example"); // 7
|
||||
results.add("editor description"); // 8
|
||||
//results.add("curator comments");
|
||||
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 ontologyName = null;
|
||||
if (vcl.getNamespace() != null) {
|
||||
|
@ -116,19 +115,20 @@ public class VclassEditController extends BaseEditController {
|
|||
|
||||
String uri = (vcl.getURI() == null) ? "" : vcl.getURI();
|
||||
|
||||
results.add(name); // 1
|
||||
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(vcl.getLocalNameWithPrefix()); // 1
|
||||
results.add(vcl.getName() == null ? "(no public label)" : vcl.getName()); // 2
|
||||
results.add(groupName); // 3
|
||||
results.add(ontologyName==null ? "(not identified)" : ontologyName); // 4
|
||||
results.add(vcl.getLocalName()); // 5
|
||||
results.add(shortDef); // 6
|
||||
results.add(example); // 7
|
||||
results.add(description); // 8
|
||||
//results.add(commSb.toString()); //
|
||||
results.add(hiddenFromDisplay); // 8
|
||||
results.add(ProhibitedFromUpdate); // 9
|
||||
results.add(String.valueOf(vcl.getDisplayRank())); // 10
|
||||
results.add(customEntryForm); // 11
|
||||
results.add(uri); // 12
|
||||
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");
|
||||
|
|
|
@ -400,24 +400,20 @@ ul.ingestMenu {
|
|||
tr.editformcell td input[type="text"] {
|
||||
width: 30% !important;
|
||||
}
|
||||
|
||||
tr.editformcell td input.fullWidthInput {
|
||||
width: 70% !important;
|
||||
margin-top: 0.7em !important;
|
||||
}
|
||||
|
||||
tr.editformcell td input.shortInput {
|
||||
width: 20% !important;
|
||||
margin-top: 0.7em !important;
|
||||
}
|
||||
|
||||
tr.editformcell td textarea.matchingInput {
|
||||
width: 95%;
|
||||
height:10ex;
|
||||
margin-top:0.7em;
|
||||
font-style: normal !important;
|
||||
}
|
||||
|
||||
hr.formDivider {
|
||||
background-color: #3196C4;
|
||||
border: 0 none;
|
||||
|
|
Loading…
Add table
Reference in a new issue