use of org.codehaus.enunciate.Facet in project pentaho-platform by pentaho.
the class UserConsoleResource method setSessionVariable.
@POST
@Path("/session-variable")
@Facet(name = "Unsupported")
public Response setSessionVariable(@QueryParam("key") String key, @QueryParam("value") String value) {
if (setSessionVarWhiteList.contains(key)) {
IPentahoSession session = UserConsoleService.getPentahoSession();
session.setAttribute(key, value);
return Response.ok(session.getAttribute(key)).build();
}
return Response.status(FORBIDDEN).build();
}
use of org.codehaus.enunciate.Facet in project pentaho-platform by pentaho.
the class SystemRefreshResource method purgeReportingDataCache.
/**
* @deprecated use org.pentaho.reporting.platform.plugin.CacheManagerEndpoint instead
*/
@Deprecated
@GET
@Path("/reportingDataCache")
@Produces({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON })
@Facet(name = "Unsupported")
public Response purgeReportingDataCache() {
if (canAdminister()) {
ICacheManager cacheManager = PentahoSystem.get(ICacheManager.class);
cacheManager.clearRegionCache("report-dataset-cache");
cacheManager.clearRegionCache("report-output-handlers");
Runnable clearCacheAction = PentahoSystem.get(Runnable.class, "_ClearCacheAction", PentahoSessionHolder.getSession());
if (clearCacheAction != null) {
clearCacheAction.run();
}
return Response.ok().type(MediaType.TEXT_PLAIN).build();
} else {
return Response.status(UNAUTHORIZED).build();
}
}
use of org.codehaus.enunciate.Facet in project pentaho-platform by pentaho.
the class SystemRefreshResource method flushMondrianSchemaCache.
@GET
@Path("/mondrianSchemaCache")
@Produces({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON })
@Facet(name = "Unsupported")
public Response flushMondrianSchemaCache() {
if (canAdminister()) {
IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
if (canAdminister()) {
// Flush the catalog helper (legacy)
IMondrianCatalogService mondrianCatalogService = // $NON-NLS-1$
PentahoSystem.get(IMondrianCatalogService.class, "IMondrianCatalogService", pentahoSession);
mondrianCatalogService.reInit(pentahoSession);
// Flush the IOlapService
IOlapService olapService = // $NON-NLS-1$
PentahoSystem.get(IOlapService.class, "IOlapService", pentahoSession);
olapService.flushAll(pentahoSession);
}
return Response.ok().type(MediaType.TEXT_PLAIN).build();
} else {
return Response.status(UNAUTHORIZED).build();
}
}
use of org.codehaus.enunciate.Facet in project pentaho-platform by pentaho.
the class SystemRefreshResource method refreshMetadata.
@GET
@Path("/metadata")
@Facet(name = "Unsupported")
@Produces(TEXT_PLAIN)
public String refreshMetadata() {
String result = null;
IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
if (canAdminister()) {
result = PentahoSystem.publish(pentahoSession, org.pentaho.platform.engine.services.metadata.MetadataPublisher.class.getName());
}
return result;
}
use of org.codehaus.enunciate.Facet 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();
}
Aggregations