Class CmsTypeAnalyzer


  • public class CmsTypeAnalyzer
    extends java.lang.Object
    Analyzes content type and formatter usage in a site / folder.
    • 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 context
        siteRoot - the site root
        path - 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 context
        path - the path
        skipDetailOnly - true if detail only pages should be skipped
        excludeContainersStr - 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