[VIVO-1315] Plum print integration (#57)

This commit is contained in:
Steve McKay 2017-04-30 08:11:10 -04:00 committed by grahamtriggs
parent 7991bc3da1
commit 6db6fabdac
2 changed files with 23 additions and 2 deletions

View file

@ -6,7 +6,6 @@ import java.io.IOException;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties;
import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualTemplateModelBuilder; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualTemplateModelBuilder;
@ -88,6 +87,7 @@ class IndividualResponseBuilder {
body.put("verbosePropertySwitch", getVerbosePropertyValues()); body.put("verbosePropertySwitch", getVerbosePropertyValues());
addAltMetricOptions(body); addAltMetricOptions(body);
addPlumPrintOptions(body);
//Execute data getters that might apply to this individual, e.g. because of the class of the individual //Execute data getters that might apply to this individual, e.g. because of the class of the individual
try{ try{
@ -202,6 +202,27 @@ class IndividualResponseBuilder {
} }
} }
private void addPlumPrintOptions(Map<String, Object> body) {
ConfigurationProperties properties = ConfigurationProperties.getBean(vreq);
if (properties != null) {
String enabled = properties.getProperty("resource.plum-print", "enabled");
String displayTo = properties.getProperty("resource.plum-print.displayto", "right");
String printHideEmpty = properties.getProperty("resource.plum-print.hide-when-empty", "true");
String printPopover = properties.getProperty("resource.plum-print.popover", "right");
String printSize = properties.getProperty("resource.plum-print.size", "medium");
if (!"disabled".equalsIgnoreCase(enabled)) {
body.put("plumPrintEnabled", true);
body.put("plumPrintDisplayTo", displayTo);
body.put("plumPrintHideEmpty", "true".equalsIgnoreCase(printHideEmpty) ? "true" : "false");
body.put("plumPrintPopover", printPopover);
body.put("plumPrintSize", printSize);
}
}
}
private boolean getTemporalVisualizationFlag() { private boolean getTemporalVisualizationFlag() {
String property = ConfigurationProperties.getBean(vreq).getProperty( String property = ConfigurationProperties.getBean(vreq).getProperty(
"visualization.temporal"); "visualization.temporal");

View file

@ -19,7 +19,7 @@ section.property-group h2 {
top: 8px; /* changed for redesign, was 0 */ top: 8px; /* changed for redesign, was 0 */
right: 12px; /* changed for redesign, was -21px;*/ right: 12px; /* changed for redesign, was -21px;*/
} }
section.property-group div { section.property-group > div {
margin-top:15px; margin-top:15px;
/* display:none; */ /* display:none; */
} }