Class NameHelper

java.lang.Object
org.ametys.plugins.repository.jcr.NameHelper

public final class NameHelper extends Object
Helper for implementing TraversableAmetysObject stored in JCR.
  • Method Details

    • filterName

      public static String filterName(String name)
      Filter a name for using it into an URI.
      Parameters:
      name - the name to filter.
      Returns:
      the name filtered.
    • getUniqueAmetysObjectName

      Get a unique child ametys object name under a traversable ametys object. Default parameters: Incremental mode, may not be suffixed. The name is filtered and suffixed if necessary. If a suffix is already present, it is removed to be replaced by another one.
      Parameters:
      parent - The parent
      baseName - The base name
      Returns:
      A unique ametys object name (for the given parent)
    • getUniqueAmetysObjectName

      public static String getUniqueAmetysObjectName(TraversableAmetysObject parent, String baseName, NameHelper.NameComputationMode computationMode, boolean mayBeSuffixed)
      Get a unique child ametys object name under a traversable ametys object. The name is filtered and suffixed if necessary. If a suffix is already present, it is removed to be replaced by another one.
      Parameters:
      parent - The parent
      baseName - The base name
      computationMode - The computation mode of the name: incremental (old method) or generated key
      mayBeSuffixed - true to consider that the given base name may already contains a suffix, it will be removed if needed
      Returns:
      A unique ametys object name (for the given parent)