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 Channel
channel
protected static org.apache.log4j.Logger
logger
protected static java.lang.String
NAME_SUFFIX
protected JProperties
propToSave
-
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 AccessControlList
buildAcl(java.lang.String vid, java.lang.String resource)
protected Category
buildCategory(java.lang.String vid, Category parent)
protected Group
buildGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)
protected AccessControlList
createAcl(java.lang.String vid, java.lang.String resource)
Create an ACLprotected Category
createCategory(java.lang.String vid)
protected Category
createCategory(java.lang.String vid, Category parent)
Crate a categoryprotected abstract void
createData()
This method is called to generate the Dataprotected Group
createGroup(java.lang.String vid)
Create a groupprotected Group
createGroup(java.lang.String vid, AccessControlList acl)
Create a groupprotected Group
createGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap)
Create a groupprotected Group
createGroup(java.lang.String vid, java.util.HashMap<java.lang.String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)
Create a groupvoid
handleFinalize()
Called when the channel is finalizedvoid
initAfterStartup()
Called at the end of JPlatform startup.void
initAfterStoreLoad()
Called just after the store has been loaded and the channel has been initialized.void
initBeforeStoreLoad()
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 void
setProperty(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:ChannelListener
Called at the end of JPlatform startup.- Overrides:
initAfterStartup
in 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:ChannelListener
Called when the channel is finalized- Overrides:
handleFinalize
in classChannelListener
-
initBeforeStoreLoad
public void initBeforeStoreLoad() throws java.lang.Exception
Description copied from class:ChannelListener
Called 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:
initBeforeStoreLoad
in 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.Exception
Description copied from class:ChannelListener
Called 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:
initAfterStoreLoad
in classChannelListener
- Throws:
java.lang.Exception
- any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.
-
-