private TreeNode getSiteTypeNode(ManagementController controller, String siteType) throws Exception {
try {
ManagedRequest request = ManagedRequest.Factory.create(OperationNames.READ_RESOURCE,
PathAddress.pathAddress("mop", siteType + "sites"), ContentType.JSON);
ManagedResponse response = controller.execute(request);
if (!response.getOutcome().isSuccess()) {
throw new Exception(response.getOutcome().getFailureDescription());
}
ReadResourceModel result = (ReadResourceModel) response.getResult();
List<TreeNode> children = new ArrayList<TreeNode>(result.getChildren().size());
for (String siteName : result.getChildren()) {
TreeNode siteNode = new TreeNode(siteName);
siteNode.setExportable(true);
siteNode.setType(siteType);