Package com.jalios.jcms
Class StartupDataGenerator
- java.lang.Object
-
- com.jalios.jcms.ChannelListener
-
- com.jalios.jcms.StartupDataGenerator
-
- All Implemented Interfaces:
PluginComponent,java.lang.Comparable
public abstract class StartupDataGenerator extends ChannelListener
-
-
Field Summary
Fields Modifier and Type Field Description protected Channelchannelprotected static org.apache.log4j.Loggerloggerprotected static java.lang.StringNAME_SUFFIXprotected JPropertiespropToSave-
Fields inherited from class com.jalios.jcms.ChannelListener
order
-
-
Constructor Summary
Constructors Constructor Description StartupDataGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected AccessControlListbuildAcl(java.lang.String vid, java.lang.String resource)protected CategorybuildCategory(java.lang.String vid, Category parent)protected GroupbuildGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)protected AccessControlListcreateAcl(java.lang.String vid, java.lang.String resource)Create an ACLprotected CategorycreateCategory(java.lang.String vid)protected CategorycreateCategory(java.lang.String vid, Category parent)Crate a categoryprotected abstract voidcreateData()This method is called to generate the Dataprotected GroupcreateGroup(java.lang.String vid)Create a groupprotected GroupcreateGroup(java.lang.String vid, AccessControlList acl)Create a groupprotected GroupcreateGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap)Create a groupprotected GroupcreateGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)Create a groupvoidhandleFinalize()Called when the channel is finalizedvoidinitAfterStartup()Called at the end of JPlatform startup.voidinitAfterStoreLoad()Called just after the store has been loaded and the channel has been initialized.voidinitBeforeStoreLoad()Called just before the store has been loaded.protected <T extends Data>
TsaveData(java.lang.String vid, T data)Save a Dataprotected <T extends Data>
ControllerStatussaveData(T data)protected voidsetProperty(java.lang.String key, java.lang.String value)Set a property to save-
Methods inherited from class com.jalios.jcms.ChannelListener
compareTo, equals, init, initBeforeHibernateFactoryBuild
-
-
-
-
Field Detail
-
logger
protected static final org.apache.log4j.Logger logger
-
NAME_SUFFIX
protected static final java.lang.String NAME_SUFFIX
- See Also:
- Constant Field Values
-
channel
protected Channel channel
-
propToSave
protected JProperties propToSave
-
-
Method Detail
-
initAfterStartup
public void initAfterStartup()
Description copied from class:ChannelListenerCalled at the end of JPlatform startup.- Overrides:
initAfterStartupin classChannelListener
-
createData
protected abstract void createData()
This method is called to generate the Data- Since:
- jcms-10.0.5
-
createCategory
protected Category createCategory(java.lang.String vid)
-
createCategory
protected Category createCategory(java.lang.String vid, Category parent)
Crate a category- Parameters:
vid- the virtual IDparent- the parent category- Returns:
- the category
- Since:
- jcms-10.0.5
-
createAcl
protected AccessControlList createAcl(java.lang.String vid, java.lang.String resource)
Create an ACL- Parameters:
vid- the virtual IDresource- the resource controled by this ACL- Returns:
- the ACL
- Since:
- jcms-10.0.5
-
buildAcl
protected AccessControlList buildAcl(java.lang.String vid, java.lang.String resource)
-
createGroup
protected Group createGroup(java.lang.String vid)
Create a group- Parameters:
vid- the virtual ID- Returns:
- the group
- Since:
- jcms-10.0.5
-
createGroup
protected Group createGroup(java.lang.String vid, AccessControlList acl)
Create a group- Parameters:
vid- the virtual IDacl- the ACL- Returns:
- the group
- Since:
- jcms-10.0.5
-
createGroup
protected Group createGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap)
Create a group- Parameters:
vid- the virtual IDrightFromClassMap- the map of DataRight- Returns:
- the group
- Since:
- jcms-10.0.5
-
createGroup
protected Group createGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)
Create a group- Parameters:
vid- the virtual IDrightFromClassMap- the map of DataRightacl- the ACLvisibility- the group visibility- Returns:
- the group
- Since:
- jcms-10.0.5
-
buildGroup
protected Group buildGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)
-
saveData
protected <T extends Data> T saveData(java.lang.String vid, T data)
Save a Data- Type Parameters:
T- A class inherited from Data- Parameters:
vid- the virtual IDdata- the Data- Returns:
- the Data
- Since:
- jcms-10.0.5
-
setProperty
protected void setProperty(java.lang.String key, java.lang.String value)Set a property to save- Parameters:
key- the keyvalue- the value- Since:
- jcms-10.0.5
-
saveData
protected <T extends Data> ControllerStatus saveData(T data)
-
handleFinalize
public void handleFinalize()
Description copied from class:ChannelListenerCalled when the channel is finalized- Overrides:
handleFinalizein classChannelListener
-
initBeforeStoreLoad
public void initBeforeStoreLoad() throws java.lang.ExceptionDescription copied from class:ChannelListenerCalled just before the store has been loaded. If for any reason you want to interrupt JCMS startup, you can throw an exception. The exception's message will be displayed in JCMS status page (to any user!).- Overrides:
initBeforeStoreLoadin classChannelListener- Throws:
java.lang.Exception- any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.
-
initAfterStoreLoad
public void initAfterStoreLoad() throws java.lang.ExceptionDescription copied from class:ChannelListenerCalled just after the store has been loaded and the channel has been initialized. If for any reason you want to interrupt JCMS startup, you can throw an exception. The exception's message will be displayed in JCMS status page (to any user!).- Overrides:
initAfterStoreLoadin classChannelListener- Throws:
java.lang.Exception- any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.
-
-