Package org.opencms.ade.containerpage
Class CmsTypeAnalyzer
- java.lang.Object
-
- org.opencms.ade.containerpage.CmsTypeAnalyzer
-
public class CmsTypeAnalyzer extends java.lang.Object
Analyzes content type and formatter usage in a site / folder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsTypeAnalyzer.FormatterBean
Bean for formatter information.static class
CmsTypeAnalyzer.ResourceBean
Data for a single resource.static class
CmsTypeAnalyzer.State
Represents all data collected by the CmsTypeAnalyzer class.static class
CmsTypeAnalyzer.TypeBean
Data for a single content type.
-
Field Summary
Fields Modifier and Type Field Description static CmsUUID
UNKNOWN_FORMATTER
The Constant UNKNOWN_FORMATTER.
-
Constructor Summary
Constructors Constructor Description CmsTypeAnalyzer(CmsObject cms, java.lang.String siteRoot, java.lang.String path, boolean skipDetailOnly, java.util.Set<java.lang.String> excludedContainers, java.lang.String templateRegex)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsTypeAnalyzer.State
getState()
Gets the state.CmsTypeAnalyzer.State
processFolder()
Process folder.static CmsTypeAnalyzer.State
readState(byte[] data)
Deserializes the state from a byte array.static CmsTypeAnalyzer.State
run(CmsObject cms, java.lang.String path, boolean skipDetailOnly, java.lang.String excludeContainersStr, java.lang.String templateRegex)
Runs the type analysis and returns the state object with all the collected data.static byte[]
writeState(CmsTypeAnalyzer.State state)
Serializes a state to a byte array.
-
-
-
Field Detail
-
UNKNOWN_FORMATTER
public static final CmsUUID UNKNOWN_FORMATTER
The Constant UNKNOWN_FORMATTER.
-
-
Constructor Detail
-
CmsTypeAnalyzer
public CmsTypeAnalyzer(CmsObject cms, java.lang.String siteRoot, java.lang.String path, boolean skipDetailOnly, java.util.Set<java.lang.String> excludedContainers, java.lang.String templateRegex) throws CmsException
Creates a new instance.- Parameters:
cms
- the CMS contextsiteRoot
- the site rootpath
- the site path to analyze- Throws:
CmsException
- if something goes wrong
-
-
Method Detail
-
readState
public static CmsTypeAnalyzer.State readState(byte[] data) throws java.lang.Exception
Deserializes the state from a byte array.- Parameters:
data
- the data- Returns:
- the deserialized state
- Throws:
java.lang.Exception
- if something goes wrong
-
run
public static CmsTypeAnalyzer.State run(CmsObject cms, java.lang.String path, boolean skipDetailOnly, java.lang.String excludeContainersStr, java.lang.String templateRegex) throws CmsException
Runs the type analysis and returns the state object with all the collected data.- Parameters:
cms
- the CMS contextpath
- the pathskipDetailOnly
- true if detail only pages should be skippedexcludeContainersStr
- a comma-separated list of container names to exclude from analysis (only direct elements)templateRegex
- a regular expression such that only pages whose template matches that regex should be processed- Returns:
- the state
- Throws:
CmsException
- if something goes wrong
-
writeState
public static byte[] writeState(CmsTypeAnalyzer.State state) throws java.io.IOException
Serializes a state to a byte array.- Parameters:
state
- the state- Returns:
- the serialized data
- Throws:
java.io.IOException
- if something goes wrong with serialization
-
getState
public CmsTypeAnalyzer.State getState()
Gets the state.- Returns:
- the state
-
processFolder
public CmsTypeAnalyzer.State processFolder() throws CmsException
Process folder.- Returns:
- the state
- Throws:
CmsException
- the cms exception
-
-