Package org.opencms.staticexport
Class CmsStaticExportExportRule
- java.lang.Object
-
- org.opencms.staticexport.CmsStaticExportExportRule
-
public class CmsStaticExportExportRule extends java.lang.Object
Help class for storing of export-rules.- Since:
- 6.0.0
-
-
Constructor Summary
Constructors Constructor Description CmsStaticExportExportRule(java.lang.String name, java.lang.String description)
Default constructor.CmsStaticExportExportRule(java.lang.String name, java.lang.String description, java.util.List<java.util.regex.Pattern> modifiedResources, java.util.List<java.lang.String> exportResourcePatterns)
Full Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExportResourcePattern(java.lang.String exportResource)
Adds a export Resource expression.void
addModifiedResource(java.lang.String modifiedRegex)
Adds a modified Resource regular expression.java.lang.String
getDescription()
Returns the description.java.util.List<java.lang.String>
getExportResourcePatterns()
Returns the export Resources list.java.util.Set<CmsPublishedResource>
getExportResources(CmsObject cms)
Returns a set of
objects containing all resources specified by theCmsPublishedResource
<export-resources>
node of this rule.java.util.List<java.util.regex.Pattern>
getModifiedResources()
Returns the modified Resources list as list of
.Pattern
java.lang.String
getName()
Returns the name.java.util.Set<CmsPublishedResource>
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
match(java.lang.String vfsName)
Checks if a vfsName matches the given modified resource patterns.java.lang.String
toString()
-
-
-
Constructor Detail
-
CmsStaticExportExportRule
public CmsStaticExportExportRule(java.lang.String name, java.lang.String description)
Default constructor.- Parameters:
name
- the name of the ruledescription
- the description for the rule
-
CmsStaticExportExportRule
public CmsStaticExportExportRule(java.lang.String name, java.lang.String description, java.util.List<java.util.regex.Pattern> modifiedResources, java.util.List<java.lang.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 Detail
-
addExportResourcePattern
public void addExportResourcePattern(java.lang.String exportResource)
Adds a export Resource expression.- Parameters:
exportResource
- the export Resource expression to add
-
addModifiedResource
public void addModifiedResource(java.lang.String modifiedRegex)
Adds a modified Resource regular expression.- Parameters:
modifiedRegex
- the modified Resource regular expression to add
-
getDescription
public java.lang.String getDescription()
Returns the description.- Returns:
- the description
-
getExportResourcePatterns
public java.util.List<java.lang.String> getExportResourcePatterns()
Returns the export Resources list.- Returns:
- the export Resources list
-
getExportResources
public java.util.Set<CmsPublishedResource> getExportResources(CmsObject cms) throws CmsException
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
public java.util.List<java.util.regex.Pattern> getModifiedResources()
Returns the modified Resources list as list of
.Pattern
- Returns:
- the modified Resources list as list of
Pattern
-
getName
public java.lang.String getName()
Returns the name.- Returns:
- the name
-
getRelatedResources
public java.util.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
public boolean match(java.lang.String vfsName)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-