NIHVIVO-2186 Finalize changes to custom list view queries for hiding incomplete statements from non-logged-in user
This commit is contained in:
parent
f8726be1d1
commit
49510f2a4a
3 changed files with 11 additions and 10 deletions
|
@ -327,7 +327,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
private static final String NODE_NAME_TEMPLATE = "template";
|
private static final String NODE_NAME_TEMPLATE = "template";
|
||||||
private static final String NODE_NAME_POSTPROCESSOR = "postprocessor";
|
private static final String NODE_NAME_POSTPROCESSOR = "postprocessor";
|
||||||
private static final String NODE_NAME_COLLATED = "collated";
|
private static final String NODE_NAME_COLLATED = "collated";
|
||||||
private static final String NODE_NAME_LINKED_INDIVIDUAL_REQUIRED = "linked-individual-required";
|
private static final String NODE_NAME_CRITICAL_DATA_REQUIRED = "critical-data-required";
|
||||||
|
|
||||||
/* NB The default post-processor is not the same as the post-processor for the default view. The latter
|
/* NB The default post-processor is not the same as the post-processor for the default view. The latter
|
||||||
* actually defines its own post-processor, whereas the default post-processor is used for custom views
|
* actually defines its own post-processor, whereas the default post-processor is used for custom views
|
||||||
|
@ -466,13 +466,14 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
String value = null;
|
String value = null;
|
||||||
if (selectQueryNode != null) {
|
if (selectQueryNode != null) {
|
||||||
boolean collated = ObjectPropertyTemplateModel.this instanceof CollatedObjectPropertyTemplateModel;
|
boolean collated = ObjectPropertyTemplateModel.this instanceof CollatedObjectPropertyTemplateModel;
|
||||||
/* If not editing the page (policyHelper == null), hide statements with missing linked individual; otherwise, show these
|
/* If not editing the page (policyHelper == null), hide statements with missing linked individual or other
|
||||||
* statements. We might want to refine this based on whether the user can edit the statement in question, but that
|
* critical information missing (e.g., anchor and url on a link); otherwise, show these statements.
|
||||||
|
* We might want to refine this based on whether the user can edit the statement in question, but that
|
||||||
* would require a completely different approach: include the statement in the query results, and then during the
|
* would require a completely different approach: include the statement in the query results, and then during the
|
||||||
* postprocessing phase, check the editing policy, and remove the statement if it's not editable. We would not
|
* postprocessing phase, check the editing policy, and remove the statement if it's not editable. We would not
|
||||||
* preprocess the query, as here.
|
* preprocess the query, as here.
|
||||||
*/
|
*/
|
||||||
boolean linkedIndividualRequired = policyHelper == null;
|
boolean criticalDataRequired = policyHelper == null;
|
||||||
NodeList children = selectQueryNode.getChildNodes();
|
NodeList children = selectQueryNode.getChildNodes();
|
||||||
int childCount = children.getLength();
|
int childCount = children.getLength();
|
||||||
value = "";
|
value = "";
|
||||||
|
@ -482,8 +483,8 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
if (collated) {
|
if (collated) {
|
||||||
value += node.getChildNodes().item(0).getNodeValue();
|
value += node.getChildNodes().item(0).getNodeValue();
|
||||||
} // else ignore this node
|
} // else ignore this node
|
||||||
} else if (node.getNodeName().equals(NODE_NAME_LINKED_INDIVIDUAL_REQUIRED)) {
|
} else if (node.getNodeName().equals(NODE_NAME_CRITICAL_DATA_REQUIRED)) {
|
||||||
if (linkedIndividualRequired) {
|
if (criticalDataRequired) {
|
||||||
value += node.getChildNodes().item(0).getNodeValue();
|
value += node.getChildNodes().item(0).getNodeValue();
|
||||||
} // else ignore this node
|
} // else ignore this node
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
</collated>
|
</collated>
|
||||||
OPTIONAL { ?object rdfs:label ?name }
|
OPTIONAL { ?object rdfs:label ?name }
|
||||||
OPTIONAL { ?object vitro:moniker ?moniker }
|
OPTIONAL { ?object vitro:moniker ?moniker }
|
||||||
<linked-individual-required>
|
<critical-data-required>
|
||||||
FILTER ( bound(?name) )
|
FILTER ( bound(?name) )
|
||||||
</linked-individual-required>
|
</critical-data-required>
|
||||||
} ORDER BY <collated> ?subclass </collated> ?name ?object
|
} ORDER BY <collated> ?subclass </collated> ?name ?object
|
||||||
</query-select>
|
</query-select>
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
OPTIONAL { ?link vitro:linkAnchor ?anchor }
|
OPTIONAL { ?link vitro:linkAnchor ?anchor }
|
||||||
OPTIONAL { ?link vitro:linkURL ?url }
|
OPTIONAL { ?link vitro:linkURL ?url }
|
||||||
OPTIONAL { ?link vitro:linkDisplayRank ?rank }
|
OPTIONAL { ?link vitro:linkDisplayRank ?rank }
|
||||||
<linked-individual-required>
|
<critical-data-required>
|
||||||
FILTER ( bound(?anchor) && bound(?url) )
|
FILTER ( bound(?anchor) && bound(?url) )
|
||||||
</linked-individual-required>
|
</critical-data-required>
|
||||||
} ORDER BY ?rank
|
} ORDER BY ?rank
|
||||||
</query-select>
|
</query-select>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue