com.liferay.portlet.communities.model
Class CommunityTemplateModelListener
java.lang.Object
com.liferay.portal.model.BaseModelListener<com.liferay.portal.model.LayoutSet>
com.liferay.portlet.communities.model.CommunityTemplateModelListener
- All Implemented Interfaces:
- com.liferay.portal.model.ModelListener<com.liferay.portal.model.LayoutSet>
public class CommunityTemplateModelListener
- extends com.liferay.portal.model.BaseModelListener<com.liferay.portal.model.LayoutSet>
View Source
A ModelListener that listens for creation of communities and attempts to
prepopulate the community pages from a template community.
The template community should be a private community to avoid unauthorized
access. The templated pages are stored in the community's staging area to
avoid users accidentally coming to this community.
You may create a separate template for private, open, and protected
communities. You may also create a default template that will apply if the
open, private, and restricted templates are not defined. The template
community names must be: DEFAULT_TEMPLATE, OPEN_TEMPLATE, PRIVATE_TEMPLATE,
or RESTRICTED_TEMPLATE.
A newly created community will have its layouts preconfigured based on its
type. If community is public, templates pages from OPEN_TEMPLATE will be
used. If community is restricted, template pages from RESTRICTED_TEMPLATE
will be used. If community is private, template pages from PRIVATE_TEMPLATE
will be used. If any of the above templates are not found, the
DEFAULT_TEMPLATE will be used. If there are no templates, then nothing is
done.
- Author:
- Michael C. Han
Method Summary |
protected com.liferay.portal.model.Group |
getTemplateGroup(com.liferay.portal.model.Group group)
|
protected java.util.Map<java.lang.String,java.lang.String[]> |
getTemplateParameters()
|
void |
onAfterCreate(com.liferay.portal.model.LayoutSet layoutSet)
|
Methods inherited from class com.liferay.portal.model.BaseModelListener |
onAfterAddAssociation, onAfterRemove, onAfterRemoveAssociation, onAfterUpdate, onBeforeAddAssociation, onBeforeCreate, onBeforeRemove, onBeforeRemoveAssociation, onBeforeUpdate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommunityTemplateModelListener
public CommunityTemplateModelListener()
onAfterCreate
public void onAfterCreate(com.liferay.portal.model.LayoutSet layoutSet)
- Specified by:
onAfterCreate
in interface com.liferay.portal.model.ModelListener<com.liferay.portal.model.LayoutSet>
- Overrides:
onAfterCreate
in class com.liferay.portal.model.BaseModelListener<com.liferay.portal.model.LayoutSet>
getTemplateGroup
protected com.liferay.portal.model.Group getTemplateGroup(com.liferay.portal.model.Group group)
throws com.liferay.portal.PortalException,
com.liferay.portal.SystemException
- Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException
getTemplateParameters
protected java.util.Map<java.lang.String,java.lang.String[]> getTemplateParameters()