org.opencms.staticexport
Class CmsStaticExportExportRule

java.lang.Object
  extended by org.opencms.staticexport.CmsStaticExportExportRule

public class CmsStaticExportExportRule
extends java.lang.Object

Help class for storing of export-rules.

Since:
6.0.0
Version:
$Revision: 1.9 $
Author:
Michael Moossen

Constructor Summary
CmsStaticExportExportRule(java.lang.String name, java.lang.String description)
          Default constructor.
CmsStaticExportExportRule(java.lang.String name, java.lang.String description, java.util.List modifiedResources, java.util.List exportResourcePatterns)
          Full Constructor.
 
Method Summary
 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 getExportResourcePatterns()
          Returns the export Resources list.
 java.util.Set getExportResources(CmsObject cms)
          Returns a set of CmsPublishedResource objects containing all resources specified by the <export-resources> node of this rule.
 java.util.List getModifiedResources()
          Returns the modified Resources list as list of Pattern.
 java.lang.String getName()
          Returns the name.
 java.util.Set getRelatedResources(CmsObject cms, CmsPublishedResource publishedResource)
          Returns a set of CmsPublishedResource objects specified by the <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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsStaticExportExportRule

public CmsStaticExportExportRule(java.lang.String name,
                                 java.lang.String description)
Default constructor.

Parameters:
name - the name of the rule
description - the description for the rule

CmsStaticExportExportRule

public CmsStaticExportExportRule(java.lang.String name,
                                 java.lang.String description,
                                 java.util.List modifiedResources,
                                 java.util.List exportResourcePatterns)
Full Constructor.

Parameters:
name - the name of the rule
description - the description of the rule
modifiedResources - a list of patterns to identify modified resources
exportResourcePatterns - 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 getExportResourcePatterns()
Returns the export Resources list.

Returns:
the export Resources list

getExportResources

public java.util.Set getExportResources(CmsObject cms)
                                 throws CmsException
Returns a set of CmsPublishedResource objects containing all resources specified by the <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 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 getRelatedResources(CmsObject cms,
                                         CmsPublishedResource publishedResource)
                                  throws CmsException
Returns a set of CmsPublishedResource objects specified by the <export-resources> node of this rule, if the publishedResource matches a modified Resource regular expression.

Parameters:
cms - the cms context
publishedResource - 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 class java.lang.Object
See Also:
Object.toString()