Package org.opencms.staticexport
Class CmsStaticExportExportRule
java.lang.Object
org.opencms.staticexport.CmsStaticExportExportRule
Help class for storing of export-rules.
- Since:
- 6.0.0
-
Constructor Summary
ConstructorDescriptionCmsStaticExportExportRule
(String name, String description) Default constructor.CmsStaticExportExportRule
(String name, String description, List<Pattern> modifiedResources, List<String> exportResourcePatterns) Full Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExportResourcePattern
(String exportResource) Adds a export Resource expression.void
addModifiedResource
(String modifiedRegex) Adds a modified Resource regular expression.Returns the description.Returns the export Resources list.Returns a set of
objects containing all resources specified by theCmsPublishedResource
<export-resources>
node of this rule.Returns the modified Resources list as list of
.Pattern
getName()
Returns the name.getRelatedResources
(CmsObject cms, CmsPublishedResource publishedResource) Returns a set of
objects specified by theCmsPublishedResource
<export-resources>
node of this rule, if the publishedResource matches a modified Resource regular expression.boolean
Checks if a vfsName matches the given modified resource patterns.toString()
-
Constructor Details
-
CmsStaticExportExportRule
Default constructor.- Parameters:
name
- the name of the ruledescription
- the description for the rule
-
CmsStaticExportExportRule
public CmsStaticExportExportRule(String name, String description, List<Pattern> modifiedResources, List<String> exportResourcePatterns) Full Constructor.- Parameters:
name
- the name of the ruledescription
- the description of the rulemodifiedResources
- a list of patterns to identify modified resourcesexportResourcePatterns
- a list of strings to export resources
-
-
Method Details
-
addExportResourcePattern
Adds a export Resource expression.- Parameters:
exportResource
- the export Resource expression to add
-
addModifiedResource
Adds a modified Resource regular expression.- Parameters:
modifiedRegex
- the modified Resource regular expression to add
-
getDescription
Returns the description.- Returns:
- the description
-
getExportResourcePatterns
Returns the export Resources list.- Returns:
- the export Resources list
-
getExportResources
Returns a set of
objects containing all resources specified by theCmsPublishedResource
<export-resources>
node of this rule.- Parameters:
cms
- the current OpenCms context- Returns:
- a set of matching resources
- Throws:
CmsException
- if something goes wrong
-
getModifiedResources
Returns the modified Resources list as list of
.Pattern
- Returns:
- the modified Resources list as list of
Pattern
-
getName
Returns the name.- Returns:
- the name
-
getRelatedResources
public Set<CmsPublishedResource> getRelatedResources(CmsObject cms, CmsPublishedResource publishedResource) throws CmsException Returns a set of
objects specified by theCmsPublishedResource
<export-resources>
node of this rule, if the publishedResource matches a modified Resource regular expression.- Parameters:
cms
- the cms contextpublishedResource
- a published resource to test- Returns:
- a set of matching resources, or
null
if resource does not match - Throws:
CmsException
- if something goes wrong
-
match
Checks if a vfsName matches the given modified resource patterns.- Parameters:
vfsName
- the vfs name of a resource to check- Returns:
- true if the name matches one of the given modified resource patterns
-
toString
-