ComponentTemplate ret = null;
IComponentSpecification spec = component.getSpecification();
boolean isFlowPage = FlowAwareSpecResolverDelegate.ID.equals(spec.getPublicId());
if (isFlowPage || spec.getComponentClassName().equals(FullFlowComponent.class.getName())) {
String type = spec.getDescription();
Flow flow = flowDefinitionsManager.getFlowDefinition(type);
// build the content for this full flow component
String content;
if (flow == null) {
content = "<div>[Flow " + type + " not found]</div>";
} else if ( CollectionUtils.isEmpty(flow.getActivities())) {
content = "<div>[Flow " + type + " has no activites]</div>";
} else {
content = isFlowPage ?
createPageTemplate(flow, cycle, component.getNamespace(), component.getLocation()) :
createComponentTemplate(flow, cycle, component.getNamespace(), component.getLocation());