Skip to content

Commit

Permalink
check whether default XSLT is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Jan 30, 2016
1 parent 490d689 commit 53f86e5
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -238,6 +238,10 @@ private String getWorkflowState(Node node) throws Exception {
*/
@Override
public View getXMLView(String viewId, InputStream xmlInputStream) throws Exception {
if (isDefaultXSLTDisabled()) {
return super.getXMLView(viewId, xmlInputStream);
}

log.warn("DEBUG: ViewId: " + viewId);
if (viewId == null || !viewId.equals("source")) {
TransformerFactory tfactory = TransformerFactory.newInstance();
Expand All @@ -256,7 +260,18 @@ public View getXMLView(String viewId, InputStream xmlInputStream) throws Excepti
return super.getXMLView(viewId, new java.io.ByteArrayInputStream(baos.toByteArray()));
}
return super.getXMLView(viewId, xmlInputStream);
}

/**
* Check whether default XSLT is disabled
* @return true when default XSLT is disabled and false otherwise
*/
private boolean isDefaultXSLTDisabled() throws Exception {
String disabledStr = getResourceConfigProperty("default-xslt_disabled");
if (disabledStr != null && disabledStr.equals("true")) {
return true;
}
return false;
}

/**
Expand Down

0 comments on commit 53f86e5

Please sign in to comment.