Class StartupDataGenerator

java.lang.Object
com.jalios.jcms.ChannelListener
com.jalios.jcms.StartupDataGenerator
All Implemented Interfaces:
PluginComponent, Comparable

public abstract class StartupDataGenerator extends ChannelListener
  • Field Details

    • logger

      protected static final org.apache.log4j.Logger logger
    • NAME_SUFFIX

      protected static final String NAME_SUFFIX
      See Also:
    • channel

      protected Channel channel
    • propToSave

      protected JProperties propToSave
  • Constructor Details

    • StartupDataGenerator

      public StartupDataGenerator()
  • Method Details

    • initAfterStartup

      public void initAfterStartup()
      Description copied from class: ChannelListener
      Called at the end of JPlatform startup.
      Overrides:
      initAfterStartup in class ChannelListener
    • createData

      protected abstract void createData()
      This method is called to generate the Data
      Since:
      jcms-10.0.5
    • createCategory

      protected Category createCategory(String vid)
    • createCategory

      protected Category createCategory(String vid, Category parent)
      Crate a category
      Parameters:
      vid - the virtual ID
      parent - the parent category
      Returns:
      the category
      Since:
      jcms-10.0.5
    • buildCategory

      protected Category buildCategory(String vid, Category parent)
    • createAcl

      protected AccessControlList createAcl(String vid, String resource)
      Create an ACL
      Parameters:
      vid - the virtual ID
      resource - the resource controled by this ACL
      Returns:
      the ACL
      Since:
      jcms-10.0.5
    • buildAcl

      protected AccessControlList buildAcl(String vid, String resource)
    • createGroup

      protected Group createGroup(String vid)
      Create a group
      Parameters:
      vid - the virtual ID
      Returns:
      the group
      Since:
      jcms-10.0.5
    • createGroup

      protected Group createGroup(String vid, AccessControlList acl)
      Create a group
      Parameters:
      vid - the virtual ID
      acl - the ACL
      Returns:
      the group
      Since:
      jcms-10.0.5
    • createGroup

      protected Group createGroup(String vid, HashMap<String,DataRight> rightFromClassMap)
      Create a group
      Parameters:
      vid - the virtual ID
      rightFromClassMap - the map of DataRight
      Returns:
      the group
      Since:
      jcms-10.0.5
    • createGroup

      protected Group createGroup(String vid, HashMap<String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)
      Create a group
      Parameters:
      vid - the virtual ID
      rightFromClassMap - the map of DataRight
      acl - the ACL
      visibility - the group visibility
      Returns:
      the group
      Since:
      jcms-10.0.5
    • buildGroup

      protected Group buildGroup(String vid, HashMap<String,DataRight> rightFromClassMap, AccessControlList acl, int visibility)
    • saveData

      protected <T extends Data> T saveData(String vid, T data)
      Save a Data
      Type Parameters:
      T - A class inherited from Data
      Parameters:
      vid - the virtual ID
      data - the Data
      Returns:
      the Data
      Since:
      jcms-10.0.5
    • setProperty

      protected void setProperty(String key, String value)
      Set a property to save
      Parameters:
      key - the key
      value - 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 class ChannelListener
    • initBeforeStoreLoad

      public void initBeforeStoreLoad() throws 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 class ChannelListener
      Throws:
      Exception - any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.
    • initAfterStoreLoad

      public void initAfterStoreLoad() throws 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 class ChannelListener
      Throws:
      Exception - any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.