Class AbstractAppPluginRootResource<T extends AppPlugin>
- java.lang.Object
-
- org.camunda.bpm.webapp.plugin.resource.AbstractAppPluginRootResource<T>
-
- Direct Known Subclasses:
AbstractAdminPluginRootResource
,AbstractCockpitPluginRootResource
,AbstractTasklistPluginRootResource
,AbstractWelcomePluginRootResource
public class AbstractAppPluginRootResource<T extends AppPlugin> extends Object
A resource class that provides a plugins restful API.Subclasses of this class may provide subresources using annotated getters in order to be multi-engine aware.
Subresources must properly initialize the subresources via
subResource(AbstractAppPluginResource, String)
.- Author:
- nico.rehwaldt, Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.ws.rs.core.HttpHeaders
headers
static String
MIME_TYPE_TEXT_CSS
static String
MIME_TYPE_TEXT_HTML
static String
MIME_TYPE_TEXT_JAVASCRIPT
static String
MIME_TYPE_TEXT_PLAIN
protected AppRuntimeDelegate<T>
runtimeDelegate
protected javax.servlet.ServletContext
servletContext
protected javax.ws.rs.core.UriInfo
uriInfo
-
Constructor Summary
Constructors Constructor Description AbstractAppPluginRootResource(String pluginName, AppRuntimeDelegate<T> runtimeDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStream
applyResourceOverrides(String file, InputStream assetStream)
javax.ws.rs.core.Response
getAsset(String file)
Provides a plugins asset files via$PLUGIN_ROOT_PATH/static
.protected InputStream
getClasspathResourceAsStream(AppPlugin plugin, String assetDirectory, String fileName)
protected String
getContentType(String file)
protected InputStream
getPluginAssetAsStream(AppPlugin plugin, String fileName)
Returns an input stream for a given resourceprotected InputStream
getWebResourceAsStream(String assetDirectory, String fileName)
protected <S extends AbstractAppPluginResource<T>>
SsubResource(S subResource, String engineName)
-
-
-
Field Detail
-
MIME_TYPE_TEXT_PLAIN
public static final String MIME_TYPE_TEXT_PLAIN
- See Also:
- Constant Field Values
-
MIME_TYPE_TEXT_HTML
public static final String MIME_TYPE_TEXT_HTML
- See Also:
- Constant Field Values
-
MIME_TYPE_TEXT_CSS
public static final String MIME_TYPE_TEXT_CSS
- See Also:
- Constant Field Values
-
MIME_TYPE_TEXT_JAVASCRIPT
public static final String MIME_TYPE_TEXT_JAVASCRIPT
- See Also:
- Constant Field Values
-
servletContext
@Context protected javax.servlet.ServletContext servletContext
-
headers
@Context protected javax.ws.rs.core.HttpHeaders headers
-
uriInfo
@Context protected javax.ws.rs.core.UriInfo uriInfo
-
runtimeDelegate
protected AppRuntimeDelegate<T extends AppPlugin> runtimeDelegate
-
-
Constructor Detail
-
AbstractAppPluginRootResource
public AbstractAppPluginRootResource(String pluginName, AppRuntimeDelegate<T> runtimeDelegate)
-
-
Method Detail
-
subResource
protected <S extends AbstractAppPluginResource<T>> S subResource(S subResource, String engineName)
- Type Parameters:
T
-- Parameters:
subResource
-engineName
-- Returns:
-
getAsset
@GET @Path("/static/{file:.*}") public javax.ws.rs.core.Response getAsset(@PathParam("file") String file)
Provides a plugins asset files via$PLUGIN_ROOT_PATH/static
.- Parameters:
file
-- Returns:
-
applyResourceOverrides
protected InputStream applyResourceOverrides(String file, InputStream assetStream)
- Parameters:
file
-assetStream
-
-
getPluginAssetAsStream
protected InputStream getPluginAssetAsStream(AppPlugin plugin, String fileName)
Returns an input stream for a given resource- Parameters:
resourceName
-- Returns:
-
getWebResourceAsStream
protected InputStream getWebResourceAsStream(String assetDirectory, String fileName)
-
getClasspathResourceAsStream
protected InputStream getClasspathResourceAsStream(AppPlugin plugin, String assetDirectory, String fileName)
-
-