Class AbstractAppPluginRootResource<T extends AppPlugin>
java.lang.Object
org.camunda.bpm.webapp.plugin.resource.AbstractAppPluginRootResource<T>
- Direct Known Subclasses:
AbstractAdminPluginRootResource
,AbstractCockpitPluginRootResource
,AbstractTasklistPluginRootResource
,AbstractWelcomePluginRootResource
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
-
Constructor Summary
ConstructorDescriptionAbstractAppPluginRootResource
(String pluginName, AppRuntimeDelegate<T> runtimeDelegate) -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStream
applyResourceOverrides
(String file, InputStream assetStream) Returns the list of allowed assets to be served by thegetAsset(String)
method.javax.ws.rs.core.Response
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 Details
-
MIME_TYPE_TEXT_PLAIN
- See Also:
-
MIME_TYPE_TEXT_HTML
- See Also:
-
MIME_TYPE_TEXT_CSS
- See Also:
-
MIME_TYPE_TEXT_JAVASCRIPT
- See Also:
-
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
-
allowedAssets
-
-
Constructor Details
-
AbstractAppPluginRootResource
-
-
Method Details
-
getAllowedAssets
Returns the list of allowed assets to be served by the
getAsset(String)
method.The default implementation includes:
["app/plugin.js","app/plugin.css"]
- Returns:
- list of allowed assets
-
subResource
- 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
.Assets must be explicitly declared in the
getAllowedAssets()
method.- Parameters:
file
-- Returns:
-
applyResourceOverrides
- Parameters:
file
-assetStream
-
-
getContentType
-
getPluginAssetAsStream
Returns an input stream for a given resource- Parameters:
resourceName
-- Returns:
-
getWebResourceAsStream
-
getClasspathResourceAsStream
protected InputStream getClasspathResourceAsStream(AppPlugin plugin, String assetDirectory, String fileName)
-