Skip to content

Commit

Permalink
check flag about showing resource types
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Aug 21, 2013
1 parent 464070b commit 4210fae
Showing 1 changed file with 13 additions and 4 deletions.
Expand Up @@ -131,11 +131,17 @@ protected InputStream getContentXML(String viewId) throws Exception {
realmsEl.appendChild(realmEl);
}

Element rtsEl = doc.createElement("resourcetypes");
root.appendChild(rtsEl);
boolean showResourceTypes = true;
if (getResourceConfigProperty("show-resource-types") != null) {
showResourceTypes = new Boolean(getResourceConfigProperty("show-resource-types")).booleanValue();
}

if (showResourceTypes) {
Element rtsEl = doc.createElement("resourcetypes");
root.appendChild(rtsEl);

ResourceTypeRegistry rtr = new ResourceTypeRegistry();
ResourceTypeDefinition[] rtds = rtr.getResourceTypeDefinitions();
ResourceTypeRegistry rtr = new ResourceTypeRegistry();
ResourceTypeDefinition[] rtds = rtr.getResourceTypeDefinitions();
for (ResourceTypeDefinition rt : rtds) {

if(rt == null) continue;
Expand Down Expand Up @@ -185,6 +191,9 @@ protected InputStream getContentXML(String viewId) throws Exception {
rtEl.appendChild(docuEl);
rtsEl.appendChild(rtEl);
}
} else {
Element rtsEl = doc.createElement("show-resource-types-set-to-false");
}

// Transform the DOM to actual output
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Expand Down

0 comments on commit 4210fae

Please sign in to comment.