// write components to JSON
for (String resourceType : ComponentUtils.getNestedComponentTypes(jcrContentResource)) {
// get dependent component
DependentComponent dependentComponent =
dependentComponentManager.getDependentComponentForResourceType(resourceType).orNull();
if(dependentComponent != null) {
// found dependent component, write it to JSON
jsonNodes.put(DomainToJSONUtil.buildJsonComponent(dependentComponent));
// add all dependencies to categories list, add edges from component to categories
String componentResourceType = dependentComponent.getResourceType();
Set<String> dependencies = dependentComponent.getDependencies();
for(String dependency : dependencies) {
JSONObject jsonEdge =
DomainToJSONUtil.buildJsonEdge(componentResourceType, dependency, EdgeType.DEPENDS_ON);
jsonEdges.put(jsonEdge);