use of org.pentaho.platform.api.engine.IContentGenerator in project pentaho-platform by pentaho.
the class RepositoryResource method getContentGeneratorResponse.
protected Response getContentGeneratorResponse(CGFactory fac) {
// $NON-NLS-1$
rsc("Is [{0}] a content generator ID?", fac.getContentGeneratorId());
final IContentGenerator contentGenerator;
try {
contentGenerator = fac.create();
} catch (NoSuchBeanDefinitionException e) {
// $NON-NLS-1$
rsc("Nope, [{0}] is not a content generator ID.", fac.getContentGeneratorId());
return null;
}
if (contentGenerator == null) {
// $NON-NLS-1$
rsc("Nope, [{0}] is not a content generator ID.", fac.getContentGeneratorId());
return null;
}
rsc("Yep, [{0}] is a content generator ID. Executing (where command path is {1})..", fac.getContentGeneratorId(), // $NON-NLS-1$
fac.getCommand());
GeneratorStreamingOutput gso = fac.getStreamingOutput(contentGenerator);
return Response.ok(gso).build();
}
Aggregations