use of org.kie.server.services.jbpm.ui.ImageServiceBase in project droolsjbpm-integration by kiegroup.
the class JbpmUIRestApplicationComponentsService method getAppComponents.
@Override
public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) {
// skip calls from other than owning extension
if (!OWNER_EXTENSION.equals(extension)) {
return Collections.emptyList();
}
FormServiceBase formServiceBase = null;
ImageServiceBase imageServiceBase = null;
FormRendererBase formRendererBase = null;
KieServerRegistry context = null;
for (Object object : services) {
// in case given service is null (meaning was not configured) continue with next one
if (object == null) {
continue;
}
if (FormServiceBase.class.isAssignableFrom(object.getClass())) {
formServiceBase = (FormServiceBase) object;
continue;
} else if (ImageServiceBase.class.isAssignableFrom(object.getClass())) {
imageServiceBase = (ImageServiceBase) object;
continue;
} else if (FormRendererBase.class.isAssignableFrom(object.getClass())) {
formRendererBase = (FormRendererBase) object;
continue;
} else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) {
context = (KieServerRegistry) object;
continue;
}
}
List<Object> components = new ArrayList<Object>(2);
components.add(new FormResource(formServiceBase, formRendererBase, context));
components.add(new ImageResource(imageServiceBase, context));
components.add(new StaticFilesResource(formRendererBase));
return components;
}
Aggregations