Class CmsAddCategoriesPostCreateHandler

  • All Implemented Interfaces:

    public class CmsAddCategoriesPostCreateHandler
    extends java.lang.Object
    implements I_CmsCollectorPostCreateHandler
    A post create handler that adds categories to newly created resources (that are not a copy of an existing resource).

    To configure it for adding the categories with category paths "cat1/subcat1/", "cat1/subcat2/" and "cat2/" add the attribute postCreateHandler="org.opencms.file.collectors.CmsAddCategoriesPostCreateHandler|cat1/subcat1/,cat1/subcat2/,cat2/" to the tag that provides the create option (i.e., , or .

    Instead of providing category paths, one can also use site or root paths of the folders representing the categories. If a category path starts with "/" it is assumed to be site or root path. Otherwise it is treated as category path, i.e., the path without the category repositories base path.

    See Also:
    for more information on where post create handlers can be configured.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onCreate​(CmsObject cms, CmsResource createdResource, boolean copyMode)
      This is called after the new content has been created (and possibly already been filled with content).
      void onCreate​(CmsObject cms, CmsResource createdResource, boolean copyMode, java.lang.String config)
      Adds the categories specified via config to the newly created resource iff not in copy mode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait