use of org.pentaho.platform.repository2.unified.webservices.ExecutableFileTypeDto in project pentaho-platform by pentaho.
the class RepositoryResourceIT method testExecutableTypes.
@Test
public void testExecutableTypes() {
WebResource webResource = resource();
System.out.println(webResource.getURI().getPath());
List<ExecutableFileTypeDto> executableTypes = webResource.path("repos/executableTypes").get(new GenericType<List<ExecutableFileTypeDto>>() {
});
assertEquals(1, executableTypes.size());
assertEquals("xjunit", executableTypes.get(0).getExtension());
}
use of org.pentaho.platform.repository2.unified.webservices.ExecutableFileTypeDto in project pentaho-platform by pentaho.
the class SystemResource method getExecutableTypes.
/**
* Retrieves the list of supported content type in the platform
*
* @return list of <code> ExecutableFileTypeDto </code>
*/
@Path("/executableTypes")
@GET
@Produces({ APPLICATION_XML, APPLICATION_JSON })
@Facet(name = "Unsupported")
public Response getExecutableTypes() {
ArrayList<ExecutableFileTypeDto> executableTypes = new ArrayList<ExecutableFileTypeDto>();
for (String contentType : pluginManager.getContentTypes()) {
IContentInfo contentInfo = pluginManager.getContentTypeInfo(contentType);
ExecutableFileTypeDto executableFileType = new ExecutableFileTypeDto();
executableFileType.setDescription(contentInfo.getDescription());
executableFileType.setExtension(contentInfo.getExtension());
executableFileType.setTitle(contentInfo.getTitle());
executableFileType.setCanSchedule(hasOperationId(contentInfo.getOperations(), "SCHEDULE_NEW"));
executableFileType.setCanEdit(hasOperationId(contentInfo.getOperations(), "EDIT"));
executableTypes.add(executableFileType);
}
final GenericEntity<List<ExecutableFileTypeDto>> entity = new GenericEntity<List<ExecutableFileTypeDto>>(executableTypes) {
};
return Response.ok(entity).build();
}
use of org.pentaho.platform.repository2.unified.webservices.ExecutableFileTypeDto in project pentaho-platform by pentaho.
the class RepositoryResource method getExecutableTypes.
/**
* Retrieves the list of supported content type in the platform
*
* @return list of <code> ExecutableFileTypeDto </code>
*/
@Path("/executableTypes")
@GET
@Produces({ APPLICATION_XML, APPLICATION_JSON })
@Facet(name = "Unsupported")
public Response getExecutableTypes() {
ArrayList<ExecutableFileTypeDto> executableTypes = new ArrayList<ExecutableFileTypeDto>();
for (String contentType : pluginManager.getContentTypes()) {
IContentInfo contentInfo = pluginManager.getContentTypeInfo(contentType);
ExecutableFileTypeDto executableFileType = new ExecutableFileTypeDto();
executableFileType.setDescription(contentInfo.getDescription());
executableFileType.setExtension(contentInfo.getExtension());
executableFileType.setTitle(contentInfo.getTitle());
executableFileType.setCanSchedule(hasOperationId(contentInfo.getOperations(), "SCHEDULE_NEW"));
executableFileType.setCanEdit(hasOperationId(contentInfo.getOperations(), "EDIT"));
executableTypes.add(executableFileType);
}
final GenericEntity<List<ExecutableFileTypeDto>> entity = new GenericEntity<List<ExecutableFileTypeDto>>(executableTypes) {
};
return Response.ok(entity).build();
}
Aggregations