public class CmsAddCategoriesPostCreateHandler extends java.lang.Object implements I_CmsCollectorPostCreateHandler
To configure it for adding the categories with category paths "cat1/subcat1/", "cat1/subcat2/" and "cat2/"
add the attribute
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.postCreateHandler="org.opencms.file.collectors.CmsAddCategoriesPostCreateHandler|cat1/subcat1/,cat1/subcat2/,cat2/"
to the tag that provides the create option (i.e.,
| Constructor and Description |
|---|
CmsAddCategoriesPostCreateHandler() |
| Modifier and Type | Method and 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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsplitClassAndConfigpublic CmsAddCategoriesPostCreateHandler()
public void onCreate(CmsObject cms, CmsResource createdResource, boolean copyMode)
I_CmsCollectorPostCreateHandleronCreate in interface I_CmsCollectorPostCreateHandlercms - the current user's CMS contextcreatedResource - the resource which has been createdcopyMode - true if the user chose one of the elements in the collector list as a modelI_CmsCollectorPostCreateHandler.onCreate(org.opencms.file.CmsObject, org.opencms.file.CmsResource, boolean)public void onCreate(CmsObject cms, CmsResource createdResource, boolean copyMode, java.lang.String config)
config to the newly created resource iff not in copy mode.onCreate in interface I_CmsCollectorPostCreateHandlercms - the current user's CMS contextcreatedResource - the resource which has been createdcopyMode - true if the user chose one of the elements in the collector list as a modelconfig - a comma separted list of category, site or root paths that specify the categories to be added to the created resource
if copyMode is false.I_CmsCollectorPostCreateHandler.onCreate(org.opencms.file.CmsObject, org.opencms.file.CmsResource, boolean, java.lang.String)