Class CmsAliasHelper


  • public class CmsAliasHelper
    extends java.lang.Object
    This class contains the real implementations of service methods related to aliases.

    • Method Detail

      • exportAliasesAsCsv

        public java.lang.String exportAliasesAsCsv​(CmsObject cms)
                                            throws CmsException
        Returns the comma separated alias data.

        Parameters:
        cms - the OpenCms context
        Returns:
        the comma separated alias data
        Throws:
        CmsException - if something goes wrong reading the alias data
      • setCms

        public void setCms​(CmsObject cms)
        Sets the CMS object.

        Parameters:
        cms - the CMS object
      • checkValidAliasPath

        protected java.lang.String checkValidAliasPath​(java.lang.String path,
                                                       java.util.Locale locale)
        Checks whether a given string is a valid alias path.

        Parameters:
        path - the path to check
        locale - the locale to use for validation messages
        Returns:
        null if the string is a valid alias path, else an error message
      • convertAliasToBean

        protected CmsAliasBean convertAliasToBean​(CmsAlias alias)
        Converts a server-side alias object to an alias bean.

        Parameters:
        alias - the server-side alias object
        Returns:
        the client-side alias bean
      • validateAliases

        protected java.util.Map<java.lang.String,​java.lang.String> validateAliases​(CmsUUID uuid,
                                                                                         java.util.Map<java.lang.String,​java.lang.String> aliasPaths)
                                                                                  throws CmsException
        The internal method used for validating aliases.

        Parameters:
        uuid - the structure id of the resource whose aliases are being validated
        aliasPaths - a map from (arbitrary) ids to alias paths
        Returns:
        a map from the same ids to validation error messages
        Throws:
        CmsException - if something goes wrong