public interface ConcatenatedResourceStore
Modifier and Type | Method and Description |
---|---|
void |
addCategory(String identifier,
String categoryName,
List<String> coreResources,
List<Pair<String,String>> extensionResources)
Add a category with initial resources.
|
void |
addCategoryWithPropertyResourceSupport(String identifier,
String categoryName,
List<String> coreResources,
List<Pair<String,String>> extensionResources,
String propertyResourceFallback)
Like
addCategory(String, String, List, List) but adds a category which supports the
definition of a resource as a PluginProperty. |
void |
addToCategory(String identifier,
String categoryName,
List<Pair<String,String>> resources)
Add the resources of a plugin to a category.
|
File |
getConcatenatedFile(String categoryName,
boolean minimized)
Return the concatenated file of a category.
|
long |
getConcatenatedFileLastModified(String categoryName)
Return the timestamp of the last modification of the concatenated file.
|
String |
getContentType() |
List<String> |
getCoreResources(String categoryName,
boolean minimized,
boolean timestamped)
Return the relative locations of the core resources of a given category.
|
String |
getMinimizedSuffix() |
List<String> |
getPluginResources(String categoryName,
boolean minimized,
boolean timestamped)
Return the relative locations of the plugin resources of a given category.
|
PropertyResourceContent |
getPropertyResourceContent(String identifier,
String categoryName)
Get the content of a property resource for category that was added by a given plugin.
|
File |
getPropertyResourceFile(String categoryName,
boolean minimized)
Return the file containing the current value of the property resource of a category.
|
long |
getPropertyResourceLastModified(String categoryName)
Return the timestamp of the last modification of the property resource.
|
void |
removeCategory(String identifier,
String categoryName)
Remove a category previously added by the plugin with the given identifier.
|
void |
removeFromCategory(String identifier,
String categoryName)
Remove the resources of a category that were added by the plugin with the given identifier
|
void |
updatePropertyResource(String identifier,
String categoryName,
String propertyValue)
Update the property resource for the given category and plugin.
|
void addCategory(String identifier, String categoryName, List<String> coreResources, List<Pair<String,String>> extensionResources) throws ConcatenatedResourceStoreException
Add a category with initial resources. If the category already exists because it was added by another plugin via a call to this method or it is one of the built-in categories, the initial resources passed to this method will overlay those of the existing category. That is, the existing initial resources won't be rendered until the plugin removes the category.
When rendering the resources of this category the provided initial resources will be rendered first. Afterwards any plugin resources added to this category byaddToCategory(String, String, List)
will be rendered in the order they were added.identifier
- the identifier of the plugincategoryName
- the name of the category to add or create an overlay forcoreResources
- a collection of resources which are delivered with the application and should be
added first when rendering the resources of the given category. Each entry of the
collection refers to the relative location of a resource under which it can be
downloaded. If the file of a resource cannot be resolved it will be ignored. Can
be null if the category does not need to have core resources.extensionResources
- a collection of pairs where each pair describes an initial resource provided by
the plugin. The left part refers to the relative location of the resource under
which it can be downloaded. Therefore, it has to start with the bundle name of the
plugin that is prefixed with a slash. The right part of the pair holds the
absolute file location of the resource on disk. Any resource that does not exist
on disk will be ignored. When rendering the resources of the provided category
these resources will be added after the coreResources. Can be null if the category
does not need to have plugin resources.ConcatenatedResourceStoreException
- in case adding the category failedvoid addCategoryWithPropertyResourceSupport(String identifier, String categoryName, List<String> coreResources, List<Pair<String,String>> extensionResources, String propertyResourceFallback) throws ConcatenatedResourceStoreException
addCategory(String, String, List, List)
but adds a category which supports the
definition of a resource as a PluginProperty. This so called property resource will be
rendered last.identifier
- the identifier of the plugincategoryName
- the name of the category to add or create an overlay forcoreResources
- a collection of resources which are delivered with the application and should be
added first when rendering the resources of the given category. Each entry of the
collection refers to the relative location of a resource under which it can be
downloaded. If the file of a resource cannot be resolved it will be ignored. Can
be null if the category does not need to have core resources.extensionResources
- a collection of pairs where each pair describes an initial resource provided by
the plugin. The left part refers to the relative location of the resource under
which it can be downloaded. Therefore, it has to start with the bundle name of the
plugin that is prefixed with a slash. The right part of the pair holds the
absolute file location of the resource on disk. Any resource that does not exist
on disk will be ignored. When rendering the resources of the provided category
these resources will be added after the coreResources. Can be null if the category
does not need to have plugin resources.propertyResourceFallback
- a fallback of the property resource which will be included if the property is not
set. Absolute file location of the resource on disk. If not provided or the
resource that does not exist on disk there will be no fallback for the property
resource.ConcatenatedResourceStoreException
- in case property resources are not supported by this store or adding the category
failedvoid addToCategory(String identifier, String categoryName, List<Pair<String,String>> resources) throws ConcatenatedResourceStoreException
identifier
- the identifier of the plugincategoryName
- the name of the category to which the resources should be addedresources
- a collection of pairs where each pair describes a resource of the plugin. The left
part refers to the relative location of the resource under which it can be
downloaded. Therefore, it has to start with the bundle name of the plugin that is
prefixed with a slash. The right part of the pair holds the absolute file location
of the resource on disk. Any resource that does not exist on disk will be ignored.ConcatenatedResourceStoreException
- in case adding the resources to the category failedFile getConcatenatedFile(String categoryName, boolean minimized)
categoryName
- the name of the categoryminimized
- whether the minimized version of the file should be returnedlong getConcatenatedFileLastModified(String categoryName)
categoryName
- the name of the categoryString getContentType()
List<String> getCoreResources(String categoryName, boolean minimized, boolean timestamped)
categoryName
- the name of the categoryminimized
- whether to get the location of the minimized versiontimestamped
- if true the last modification timestamp of the file will be append to the location
in the form of a request parameter with name 't'.String getMinimizedSuffix()
List<String> getPluginResources(String categoryName, boolean minimized, boolean timestamped)
addCategory(String, String, List, List)
or those added via
addToCategory(String, String, List)
. The relative location represents the location
under which the plugin resource can be downloaded. It starts with a slash followed by the
bundle name of the plugin.categoryName
- the name of the categoryminimized
- whether to get the location of the minimized versiontimestamped
- if true the last modification timestamp of the file will be append to the location
in the form of a request parameter with name 't'.PropertyResourceContent getPropertyResourceContent(String identifier, String categoryName) throws ConcatenatedResourceStoreException
#getPropertyResource(String)
should be used.identifier
- the identifier of the plugincategoryName
- the name of the categoryConcatenatedResourceStoreException
- in case getting the content failedFile getPropertyResourceFile(String categoryName, boolean minimized)
categoryName
- the name of the categoryminimized
- whether the minimized version of the file should be returnedlong getPropertyResourceLastModified(String categoryName)
categoryName
- the name of the categoryvoid removeCategory(String identifier, String categoryName) throws ConcatenatedResourceStoreException
identifier
- the identifier of the plugincategoryName
- the name of the category to removeConcatenatedResourceStoreException
- in case the category couldn't be removed. The store can be in an inconsistent
state.void removeFromCategory(String identifier, String categoryName) throws ConcatenatedResourceStoreException
identifier
- the identifier of the plugincategoryName
- the name of the category for which the resources should be removedConcatenatedResourceStoreException
- in case the resources of the category couldn't be removed. The store can be in an
inconsistent state.void updatePropertyResource(String identifier, String categoryName, String propertyValue) throws ConcatenatedResourceStoreException
identifier
- the identifier of the plugincategoryName
- the name of the categorypropertyValue
- the new value. Can be null to clear the application property and use the fallback
of the plugin.ConcatenatedResourceStoreException
- in case the update failed or the store does not support property resourcesCopyright © 2019 Communote team. All rights reserved.