diff --git a/ccm-cms/src/com/arsdigita/cms/Loader.java b/ccm-cms/src/com/arsdigita/cms/Loader.java index beef86b4d..c7358e8bb 100755 --- a/ccm-cms/src/com/arsdigita/cms/Loader.java +++ b/ccm-cms/src/com/arsdigita/cms/Loader.java @@ -18,13 +18,14 @@ */ package com.arsdigita.cms; +import com.arsdigita.cms.contentsection.ContentSectionConfig; import com.arsdigita.cms.contentsection.ContentSectionSetup; -import com.arsdigita.cms.util.Util; import com.arsdigita.cms.contenttypes.XMLContentTypeHandler; import com.arsdigita.cms.portlet.ContentDirectoryPortlet; import com.arsdigita.cms.portlet.ContentItemPortlet; import com.arsdigita.cms.portlet.ContentSectionsPortlet; import com.arsdigita.cms.portlet.TaskPortlet; +import com.arsdigita.cms.util.Util; import com.arsdigita.formbuilder.util.FormbuilderSetup; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; @@ -38,35 +39,31 @@ import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.web.Application; import com.arsdigita.web.ApplicationType; import com.arsdigita.xml.XML; - import java.util.ArrayList; import java.util.Iterator; import java.util.List; - import org.apache.log4j.Logger; - /** *
Executes nonrecurring at install time and loads (installs and initializes) - * the Content Management System module,including the Content Center, CMS Service - * applications, and CMS Mime Types service persistently into database.
+ * the Content Management System module,including the Content Center, CMS + * Service applications, and CMS Mime Types service persistently into + * database. * *This class also optionally initializes user-defined content types.
*Additional user-defined content sections can be loaded and initilized - * using the recurring
initializerat any startup. + * using the recurring + *
initializerat any startup. * - *
The tasks to perform are:
- *The tasks to perform are:
Configuration can be modified by configuration parameters before processing, - * otherwise hardcoded default values take effect. After processing, the - * installation values can not be modified anymore without a fresh installation - * of the whole system.
+ *Configuration can be modified by configuration parameters before + * processing, otherwise hardcoded default values take effect. After processing, + * the installation values can not be modified anymore without a fresh + * installation of the whole system.
* * @author Peter Boy <pboy@barkhof.uni-bremen.de> * @since ccm-cms version 6.6.0 @@ -74,39 +71,38 @@ import org.apache.log4j.Logger; */ public class Loader extends PackageLoader { - /** Creates a s_logging category with name = full name of class */ + /** + * Creates a s_logging category with name = full name of class + */ private static final Logger s_log = Logger.getLogger(Loader.class); - - /** Loader configuration object, singleton design pattern - * NOTE: LoaderConfig only supplies unmutable hard coded defaults! It is - * not possible to alter any of the contained values by specifiying an - * configuration parameter during load step. If a configuration value - * has to be configurable at load time, the parameter must be relocated - * into this Loader class! */ + /** + * Loader configuration object, singleton design pattern NOTE: LoaderConfig + * only supplies unmutable hard coded defaults! It is not possible to alter + * any of the contained values by specifiying an configuration parameter + * during load step. If a configuration value has to be configurable at load + * time, the parameter must be relocated into this Loader class! + */ private static final LoaderConfig s_conf = LoaderConfig.getInstance(); - // /////////////////////////////////////////////////////////////////// // Configurable parameters during load step. // /////////////////////////////////////////////////////////////////// - /** * The name(s) of the content section(s). In case of more than one name the * first is treated as default section. Otherwise the section created is the * default section. More sections can always be created during a subsequent - * system startup using initialization parameters. + * system startup using initialization parameters. */ private final Parameter m_contentSectionNames = new StringArrayParameter( - "com.arsdigita.cms.loader.section_names", - Parameter.REQUIRED, - new String[] {"content"} - ); - - /** List of classnames of internal base content types (needed in every - * section created), generated while loading those content types in - * loadContentTypeDefinitions(files) for later use in register step. */ + "com.arsdigita.cms.loader.section_names", + Parameter.REQUIRED, + new String[]{"content"}); + /** + * List of classnames of internal base content types (needed in every + * section created), generated while loading those content types in + * loadContentTypeDefinitions(files) for later use in register step. + */ private ArrayList m_content_type_list = new ArrayList(); - /** * Standard constructor. */ @@ -114,12 +110,12 @@ public class Loader extends PackageLoader { s_log.debug("CMS.loader (Constructor) invoked"); register(m_contentSectionNames); - + s_log.debug("CMS.loader (Constructor) completed"); } /** - * + * */ public void run(final ScriptContext ctx) { s_log.debug("CMS.loader.run() invoked"); @@ -142,7 +138,7 @@ public class Loader extends PackageLoader { // Step 4) Load CMS content section // Loads content section application type and instance in one step - loadContentSection( (String[]) get(m_contentSectionNames) ); + loadContentSection((String[]) get(m_contentSectionNames)); // Step 5) Loading CMS portlets s_log.debug("CMS.loader going to load portlets"); @@ -154,8 +150,8 @@ public class Loader extends PackageLoader { // Loading forms widget into database FormbuilderSetup fbs = new FormbuilderSetup(); fbs.setup(s_conf.getWidgetTypes(), - s_conf.getProcessListenerTypes(), - s_conf.getDataQueries()); + s_conf.getProcessListenerTypes(), + s_conf.getDataQueries()); } @@ -165,23 +161,23 @@ public class Loader extends PackageLoader { /** * Loads the Workspace subpackage (content-center) into the database. * - * It is made public to be able to invoke it from the update script - * (e.g. 6.6.1-6.6.2). We need separate steps for loading and instantiating + * It is made public to be able to invoke it from the update script (e.g. + * 6.6.1-6.6.2). We need separate steps for loading and instantiating * because update skript requires. */ public static ApplicationType loadWorkspaceApplicationType() { s_log.debug("Creating CMS Workspace..."); - /* Create new type legacy free application type - * NOTE: The wording in the title parameter of ApplicationType - * determines the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and - * replacing blanks between words and illegal characters with an - * hyphen and converted to lower case. - * "Content Center" will become "content-center". */ - ApplicationType type = new - ApplicationType(Workspace.INSTANCE_NAME, - Workspace.BASE_DATA_OBJECT_TYPE ); + /* + * Create new type legacy free application type NOTE: The wording in the + * title parameter of ApplicationType determines the name of the + * subdirectory for the XSL stylesheets. It gets "urlized", i.e. + * trimming leading and trailing blanks and replacing blanks between + * words and illegal characters with an hyphen and converted to lower + * case. "Content Center" will become "content-center". + */ + ApplicationType type = new ApplicationType(Workspace.INSTANCE_NAME, + Workspace.BASE_DATA_OBJECT_TYPE); type.setDescription("The content center workspace for content creators."); type.save(); @@ -193,14 +189,14 @@ public class Loader extends PackageLoader { /** * Instantiates the Workspace subpackage (content-center) (in the database). * - * It is made public to be able to invoke it from the update script - * (e.g. 6.6.1-6.6.2). We need separate steps for loading and instantiating + * It is made public to be able to invoke it from the update script (e.g. + * 6.6.1-6.6.2). We need separate steps for loading and instantiating * because update skript requires. * * @param workspaceType */ public static void setupDefaultWorkspaceApplicationInstance( - ApplicationType workspaceType) { + ApplicationType workspaceType) { // create application instance // Whether a legacy compatible or a legacy free application is @@ -209,10 +205,10 @@ public class Loader extends PackageLoader { // old-style package key used as url fragment where to install the instance s_log.debug("Creating CMS Workspace instance ..."); Workspace app = (Workspace) Application.createApplication( - Workspace.BASE_DATA_OBJECT_TYPE, // type - Workspace.PACKAGE_KEY, // url fragment - Workspace.INSTANCE_NAME, // title - null); // parent + Workspace.BASE_DATA_OBJECT_TYPE, // type + Workspace.PACKAGE_KEY, // url fragment + Workspace.INSTANCE_NAME, // title + null); // parent app.setDescription("The default CMS workspace instance."); app.save(); @@ -220,44 +216,42 @@ public class Loader extends PackageLoader { s_log.debug("Done loading CMS Workspace."); } - /** * CMS Service application is used by the Content Management System as a - * store for global resources and assets. - * It is made public to be able to invoke it from the update script - * (e.g. 6.6.1-6.6.2). + * store for global resources and assets. It is made public to be able to + * invoke it from the update script (e.g. 6.6.1-6.6.2). */ public static ApplicationType loadServiceApplicationType() { s_log.debug("Loading CMS Servce Package..."); - /* Create new type legacy free application type - * NOTE: The wording in the title parameter of ApplicationType - * determines the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and - * replacing blanks between words and illegal characters with an - * hyphen and converted to lower case. - * "CMS Service" will become "cms-service". */ - ApplicationType type = new ApplicationType("CMS Service", - Service.BASE_DATA_OBJECT_TYPE ); + /* + * Create new type legacy free application type NOTE: The wording in the + * title parameter of ApplicationType determines the name of the + * subdirectory for the XSL stylesheets. It gets "urlized", i.e. + * trimming leading and trailing blanks and replacing blanks between + * words and illegal characters with an hyphen and converted to lower + * case. "CMS Service" will become "cms-service". + */ + ApplicationType type = new ApplicationType("CMS Service", + Service.BASE_DATA_OBJECT_TYPE); type.setDescription("Services to store global resources and assets."); type.save(); return type; } - /** * * @param serviceType */ public static void setupDefaultServiceApplicationInstance( - ApplicationType serviceType) { + ApplicationType serviceType) { // create legacy compatible application instance, // old-style package key used as url fragment where to install the instance Service app = (Service) Application.createApplication( - serviceType, // type - Service.PRIMARY_URL_STUB, // url fragment - "CMS Service Instance", // title + serviceType, // type + Service.PRIMARY_URL_STUB, // url fragment + "CMS Service Instance", // title null); // parent app.setDescription("The default CMS service instance."); app.save(); @@ -265,40 +259,39 @@ public class Loader extends PackageLoader { s_log.debug("Done creating CMS Service Package."); } - /** * Load a content section application type and an initial default - * content-section instance(s). - * Some configuration values which are to be considered as unmutable are - * specified in LoaderConfig. - * Uses new style application in legacy compatible mode. + * content-section instance(s). Some configuration values which are to be + * considered as unmutable are specified in LoaderConfig. Uses new style + * application in legacy compatible mode. * * NOTE: At ccm-cms load time no content type packages are available because * any content type depends on ccm-cms. Therefore, the loading step can not * process content type package assignment! Instead each content type itself - * must assign itself to an appropriate content section at it's load time. + * must assign itself to an appropriate content section at it's load time. * Cf. {@link com.arsdigita.cms.contenttype.AbstractContentTypeLoader}. - * + * * But the load step has to process the cms internal content types! */ private void loadContentSection(String[] sectionNames) { // Step 1: Create content section application type // prerequisite for concrete content-section instance creation. - - /* Create legacy-free application type - * NOTE: The wording in the title parameter of ApplicationType - * determines the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and - * replacing blanks between words and illegal characters with an - * hyphen and converted to lower case. - * "Content Section" will become "content-section". */ - ApplicationType type = new ApplicationType( - "Content Section", - ContentSection.BASE_DATA_OBJECT_TYPE ); + + /* + * Create legacy-free application type NOTE: The wording in the title + * parameter of ApplicationType determines the name of the subdirectory + * for the XSL stylesheets. It gets "urlized", i.e. trimming leading and + * trailing blanks and replacing blanks between words and illegal + * characters with an hyphen and converted to lower case. "Content + * Section" will become "content-section". + */ + ApplicationType type = new ApplicationType( + "Content Section", + ContentSection.BASE_DATA_OBJECT_TYPE); type.setDescription("The CMS Content Section application."); type.save(); - + // Step 2: Load CMS specific privileges into central (core) privilege // system. createPrivileges(); @@ -306,73 +299,27 @@ public class Loader extends PackageLoader { // Step 3: Create the installation default content section(s). // ContentSection.create creates a section with several default values // which have to be adopted for a concrete installation. - for (int i = 0 ; i < sectionNames.length ; i++) { - + for (int i = 0; i < sectionNames.length; i++) { + final String sectionName = sectionNames[i]; s_log.debug("Creating content section on /" + sectionName); // Step 1: Validate name for section Util.validateURLParameter("name", sectionName); + + ContentSectionConfig conf = new ContentSectionConfig(); + conf.load(); - // Step 2: Create a section using default values - ContentSection section = ContentSection.create(sectionName); - - // Step 3: Adopt the created section to site specific requirements - // ContentSectionSetup is a convenient class to adopt a - // section created by ContentSection.create() - ContentSectionSetup setup = new ContentSectionSetup(section); - - // Step 3a: Roles (staff group) used in this content section. - // Register roles using a complete set of default roles - // defined in ContentSectionSetup - setup.registerRoles(s_conf.getStuffGroup()); - - // ViewerGroup populated in ContentSection, public access is determined - // by parameter (affecting characteristics of the viewer group) - setup.registerViewers(s_conf.isPubliclyViewable()); - - // Page resolver class, set autonomously by ContentSection.create() - // Item resolver class, configurable, defaults in place. - // Template resolver class, configurable, defaults in place. - // We should not overwrite the default in the initial default configuration - - // register a predefined one-phase lifecycle for items. - setup.registerPublicationCycles(); - // registers predefined "Authoring", "Approval", "Publishing' steps - setup.registerWorkflowTemplates(); - setup.registerResolvers(s_conf.getItemResolverClass(), - s_conf.getTemplateResolverClass()); - // XML generator class, set autonomously by ContentSection.create() - - /* Register internal base content types. Paramter is a list of - * class names created by internal content type load method. - * @see loadContentTypeDefinitions(List) - * External content types (provided by additional packages) are - * not available at CMS load time and can not processed by Loader. - * Registration of those content types are dealt with in the - * respective Loader or in the CMS workspace GUI. - * For each created section the base types get registered. */ - setup.registerContentTypes(m_content_type_list); - - // Section specific categories, usually not used. - // During initial load at install time nor used at all! - // default value is false so no categories get loaded. - if (s_conf.getUseSectionCategories()) { - Iterator files = ((List) s_conf.getCategoryFileList()).iterator(); - while (files.hasNext()) { - setup.registerCategories((String) files.next()); - } - } - - // registers a predefined standard recipient for alerts - setup.registerAlerts(); - - // Load a list of cms tasks and associated alert events - // Currently no functionality to persist them. Not a loader task yet - // setup.loadTaskAlerts(s_conf.getTaskAlerts()); - - section.save(); //persists any changes in the database (DomainObject) - //i.e. creates an object (instance) + ContentSectionSetup.setupContentSectionAppInstance(sectionName, + conf.getDefaultRoles(), + conf.getDefaultWorkflows(), + s_conf.isPubliclyViewable(), + s_conf.getItemResolverClass(), + s_conf.getTemplateResolverClass(), + m_content_type_list, + s_conf.getUseSectionCategories(), + s_conf.getCategoryFileList()); + } } @@ -381,13 +328,13 @@ public class Loader extends PackageLoader { * Parses XML file definition of (internal) base content types and loads * them into database. It fulfills a task similiar to the Loader of external * content type packages. - * + * * The XML config looks like the example below, the "parentType" and "name" - * attributes are optional, and only required for creating - * User Defined ContentTypes. Label corresponds to ContentType's label and - * can be multiple words, and "name" to DynamicObject's name property, - * and must be a single word. The objectType attribute is ignored for - * UDCTs, as it gets dynamically generated. + * attributes are optional, and only required for creating User Defined + * ContentTypes. Label corresponds to ContentType's label and can be + * multiple words, and "name" to DynamicObject's name property, and must be + * a single word. The objectType attribute is ignored for UDCTs, as it gets + * dynamically generated. * * UDCT Copyright *
@@ -404,7 +351,7 @@ public class Loader extends PackageLoader {
* </ccm:authoring-kit>
* </ccm:content-type>
* </ccm:content-types>
- *
+ *
*
* @see XMLContentTypeHandler
*/
diff --git a/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java b/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java
index 484fe37d3..8eab3f490 100644
--- a/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java
+++ b/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java
@@ -15,8 +15,6 @@
* with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
package com.arsdigita.cms;
import com.arsdigita.runtime.AbstractConfig;
@@ -24,11 +22,8 @@ import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.StringArrayParameter;
import com.arsdigita.util.parameter.StringParameter;
-
import java.util.Arrays;
import java.util.List;
-import java.util.ArrayList;
-
import org.apache.log4j.Logger;
// IMPLEMENTATION NOTE
@@ -36,45 +31,47 @@ import org.apache.log4j.Logger;
// initialization process and not yet completed. Functionality is
// basically OK so far, but code urgently needs cleaning up and a
// check for useful bits.
-
-
/**
* Container for various configuration parameters for ccm-cms package loader.
- *
+ *
* The parameters are basically immutable for users and administrators and only
* accessible to developers and require recompilation. Specifying any of these
* parameters during installation takes no effect at all! Parameters which have
* to be modifiable must be included in Loader class itself!
*
* @author pb
- * @version $Id: LoaderConfig.java $
+ * @author Sören Bernstein (quasi@barkhof.uni-bremen.de)
+ * @version $Id: LoaderConfig.java $
*/
public final class LoaderConfig extends AbstractConfig {
- /** Local logger instance fpr debug support */
+ /**
+ * Local logger instance fpr debug support
+ */
private static final Logger s_log = Logger.getLogger(LoaderConfig.class);
-
- /** Private Object to hold one's own instance to return to users. */
+ /**
+ * Private Object to hold one's own instance to return to users.
+ */
private static LoaderConfig s_conf;
/**
* Returns the singleton configuration record for Loader configuration.
*
- * @return The ContentSectionConfig record; it cannot be null
+ * @return The
+ * ContentSectionConfig record; it cannot be null
*/
public static synchronized LoaderConfig getInstance() {
if (s_conf == null) {
s_conf = new LoaderConfig();
- /* Parameters are not stored in registry nor modified by installation
- * specification. It is not possible to process a config object at
- * Load time!
- * s_conf.load();
- */
+ /*
+ * Parameters are not stored in registry nor modified by
+ * installation specification. It is not possible to process a
+ * config object at Load time! s_conf.load();
+ */
}
return s_conf;
}
-
// /**
// * The name of the workspace package instance, i.e. URL of the workspace,
// * where authors, editors and publishers are working and from which they
@@ -91,7 +88,6 @@ public final class LoaderConfig extends AbstractConfig {
// "com.arsdigita.cms.loader.workspace_url",
// Parameter.REQUIRED,
// "content-center");
-
// /**
// * XML Mapping of the content center tabs to URLs, see
// * {@link ContentCenterDispatcher}
@@ -105,7 +101,6 @@ public final class LoaderConfig extends AbstractConfig {
// "com.arsdigita.cms.loader.content_center_map",
// Parameter.REQUIRED,
// "/WEB-INF/resources/content-center-map.xml");
-
// Update master object if upgrading from old versioning
// XXX: shouldn't we just gut this section (and
// VersioningUpgrader)? It is an upgrade fix from 5.1 or
@@ -118,7 +113,6 @@ public final class LoaderConfig extends AbstractConfig {
// if (updateMaster) {
// VersioningUpgrader.updateMasterObject();
// }
-
// XXX: ItemDispatcher is no longer used. Is the following
// still a valid enterprise.init parameter? Do we need to
// set ContentSectionServlet.s_cacheItems instead of the
@@ -128,39 +122,33 @@ public final class LoaderConfig extends AbstractConfig {
// ((Boolean)m_conf.getParameter(CACHE_ITEMS)).booleanValue();
// s_log.debug("Set cache items to " + cacheItems);
// ItemDispatcher.setCacheItems(cacheItems);
-
-
/**
- * Comma separated list of XML definition files for internal content types
+ * Comma separated list of XML definition files for internal content types
* (base types).
- *
+ *
* Each internal content type (see package com/arsdigita/cms/contenttypes)
- * requires an entry in this list in order to get CMS Loader to load it
- * into permanent storage (equivalent to the Loader of each external
- * content type package).
- *
+ * requires an entry in this list in order to get CMS Loader to load it into
+ * permanent storage (equivalent to the Loader of each external content type
+ * package).
+ *
* Each definition file name has to be fully qualified relative to
- * application (context) root.
- * Example:
- * contentTypeDefinitions = { "/WEB-INF/content-types/Template.xml" };
- *
+ * application (context) root. Example: contentTypeDefinitions = {
+ * "/WEB-INF/content-types/Template.xml" };
+ *
* This parameter should be altered only by developers!
*/
private final Parameter m_ctDefFiles =
new StringArrayParameter(
- "com.arsdigita.cms.loader.internal_cts",
- Parameter.REQUIRED,
- // Generic*.xml added by Quasi in enterprise.init for
- // new generic Basetypes in addition to article
- new String[] {"/WEB-INF/content-types/GenericAddress.xml",
- "/WEB-INF/content-types/GenericArticle.xml",
- "/WEB-INF/content-types/GenericContact.xml",
- "/WEB-INF/content-types/GenericOrganizationalUnit.xml",
- "/WEB-INF/content-types/GenericPerson.xml",
- "/WEB-INF/content-types/Template.xml"}
- );
-
-
+ "com.arsdigita.cms.loader.internal_cts",
+ Parameter.REQUIRED,
+ // Generic*.xml added by Quasi in enterprise.init for
+ // new generic Basetypes in addition to article
+ new String[]{"/WEB-INF/content-types/GenericAddress.xml",
+ "/WEB-INF/content-types/GenericArticle.xml",
+ "/WEB-INF/content-types/GenericContact.xml",
+ "/WEB-INF/content-types/GenericOrganizationalUnit.xml",
+ "/WEB-INF/content-types/GenericPerson.xml",
+ "/WEB-INF/content-types/Template.xml"});
// ///////////////////////////////////////////////////////////////////////
//
// Parameters for creating a default content section at installation time.
@@ -168,50 +156,38 @@ public final class LoaderConfig extends AbstractConfig {
// We list all information here, the code needs to create a section.
//
// ///////////////////////////////////////////////////////////////////////
-
-
// Section Name, configured by Loader parameter
-
// Root Folder, set autonomously by ContentSection.create() method
-
// Template Folder, set autonomously by ContentSection.create() method
-
/**
- * Staff Group
- * Contains roles and associated privileges. In loading step a complete
- * default configuration is persisted in database, immutable at this point.
- * See contentsection.ContentSectionSetup.registerRoles()
- * In enterprise.init: name roles, List of roles to create.
- *
+ * Staff Group Contains roles and associated privileges. In loading step a
+ * complete default configuration is persisted in database, immutable at
+ * this point. See contentsection.ContentSectionSetup.registerRoles() In
+ * enterprise.init: name roles, List of roles to create.
+ *
* Not implemented yet! We need a new parameter type "list" which must have
* multidimensional capabilities.
*/
/*
- private final Parameter
- m_staffGroup = new StringParameter(
- "com.arsdigita.cms.loader.section_staff_group",
- Parameter.REQUIRED,
- null);
+ * private final Parameter m_staffGroup = new StringParameter(
+ * "com.arsdigita.cms.loader.section_staff_group", Parameter.REQUIRED,
+ * null);
*/
- private List m_staffGroup;
-
-
+ private List m_defaultRoles;
// Viewer group, set autonomously by ContentSection.create() method. We can
// here specify, whether the first ( probalby only) content section should
// have a public viewer, i.e. without registration and login.
/**
- * Whether to make content viewable to 'The Public', ie non-registered users.
+ * Whether to make content viewable to 'The Public', ie non-registered
+ * users.
*
* Parameter name in the old initializer code: PUBLIC. Default true.
*/
- private final BooleanParameter
- m_isPublic = new BooleanParameter(
- "com.arsdigita.cms.loader.section_is_public",
- Parameter.REQUIRED,
- true);
-
+ private final BooleanParameter m_isPublic = new BooleanParameter(
+ "com.arsdigita.cms.loader.section_is_public",
+ Parameter.REQUIRED,
+ true);
// Page Resolver Class, set autonomously by ContentSection.create() method.
-
// Item Resolver Class, configurable.
/**
* Name of the item resolver class to use for the section (defaults to
@@ -220,192 +196,174 @@ public final class LoaderConfig extends AbstractConfig {
* Default value (site-wide) is handled via the parameter
* com.arsdigita.cms.default_item_resolver_class. * Section-specific override can be added here. Only do so if you are - * changing from the default for a specific content section. The class - * must implement
com.arsdigita.cms.dispatcher.ItemResolver. + * changing from the default for a specific content section. The class must + * implement + *
com.arsdigita.cms.dispatcher.ItemResolver. * * Parameter name ITEM_RESOLVER_CLASS in the old initializer system. - * Description: The ItemResolver class to use for the section - * (defaults to MultilingualItemResolver) + * Description: The ItemResolver class to use for the section (defaults to + * MultilingualItemResolver) */ - private final Parameter - m_itemResolverClass = new StringParameter( - "com.arsdigita.cms.loader.item_resolver_class", - Parameter.OPTIONAL, null ); - // , "com.arsdigita.cms.dispatcher.MultilingualItemResolver" - - + private final Parameter m_itemResolverClass = new StringParameter( + "com.arsdigita.cms.loader.item_resolver_class", + Parameter.OPTIONAL, null); + // , "com.arsdigita.cms.dispatcher.MultilingualItemResolver" // Template Resolver Class, configurable. /** - * Name of the template resolver class to use for the section - * (defaults to
com.arsdigita.cms.dispatcher.DefaultTemplateResolver) + * Name of the template resolver class to use for the section (defaults to + *
com.arsdigita.cms.dispatcher.DefaultTemplateResolver) * * Default value (site-wide) is handled via the parameter *
com.arsdigita.cms.default_template_resolver_class. * Section-specific override can be added here. Only do so if you are - * changing from the default for a specific content section. The class - * must implement
com.arsdigita.cms.dispatcher.TemplateResolver. + * changing from the default for a specific content section. The class must + * implement + *
com.arsdigita.cms.dispatcher.TemplateResolver. * * Parameter name TEMPLATE_RESOLVER_CLASS in the old initializer system. */ - private final Parameter - m_templateResolverClass = new StringParameter( - "com.arsdigita.cms.loader.template_resolver_class", - Parameter.OPTIONAL, - null ); - // "com.arsdigita.cms.dispatcher.DefaultTemplateResolver" ); - - + private final Parameter m_templateResolverClass = new StringParameter( + "com.arsdigita.cms.loader.template_resolver_class", + Parameter.OPTIONAL, + null); + // "com.arsdigita.cms.dispatcher.DefaultTemplateResolver" ); // XML Generator Class, set autonomously by ContentSection.create() method. - - /** * Determins weather to use section specific category tree(s). Defaults to - * false, so standard navigation is used. - * If set to true loader loads the categories from file(s) specified in the - * next parameter ( m_categoryFileList ) + * false, so standard navigation is used. If set to true loader loads the + * categories from file(s) specified in the next parameter ( + * m_categoryFileList ) */ - private final Parameter - m_useSectionCategories = new BooleanParameter - ("com.arsdigita.cms.loader.use_section_categories", - Parameter.REQUIRED, new Boolean(false)); - + private final Parameter m_useSectionCategories = new BooleanParameter("com.arsdigita.cms.loader.use_section_categories", + Parameter.REQUIRED, new Boolean(false)); /** * XML file containing the category tree to load for this content section. - * Usually not loaded {@see m_useSectionCategories). The files listed as - * default values are demo material and must be replaced in a production - * environment. + * Usually not loaded { + * + * @see m_useSectionCategories). The files listed as default values are demo + * material and must be replaced in a production environment. */ - private final Parameter - m_categoryFileList = new StringArrayParameter( - "com.arsdigita.cms.loader.section_categories_toload", - Parameter.REQUIRED, - new String[] {"/WEB-INF/resources/article-categories.xml", - "/WEB-INF/resources/navigation-categories.xml"} ); - + private final Parameter m_categoryFileList = new StringArrayParameter( + "com.arsdigita.cms.loader.section_categories_toload", + Parameter.REQUIRED, + new String[]{"/WEB-INF/resources/article-categories.xml", + "/WEB-INF/resources/navigation-categories.xml"}); // private final Parameter // m_widgetTypes = new StringArrayParameter( // "com.arsdigita.cms.loader.widget_types", // Parameter.REQUIRED, // new String[] {"/WEB-INF/resources/article-categories.xml", // "/WEB-INF/resources/navigation-categories.xml"} ); - - /** List of widgets used in applications forms. Each widget is described by - application indicator, widget name (singular & plural), model class name - and model ui class name. These are really not user or administrator - configurabel and therefore not implemented as ccm parameter. */ + /** + * List of widgets used in applications forms. Each widget is described by + * application indicator, widget name (singular & plural), model class name + * and model ui class name. These are really not user or administrator + * configurabel and therefore not implemented as ccm parameter. + */ private static List widgetTypes = Arrays.asList( - Arrays.asList("forms-cms", "Checkbox group", "Checkbox groups", - "com.arsdigita.formbuilder.PersistentCheckboxGroup", - "com.arsdigita.formbuilder.ui.editors.CheckboxGroupEditor"), - Arrays.asList("forms-cms", "Date field", "Date fields", - "com.arsdigita.formbuilder.PersistentDate", - "com.arsdigita.formbuilder.ui.editors.DateForm"), - Arrays.asList("forms-cms", "Hidden field", "Hidden fields", - "com.arsdigita.formbuilder.PersistentHidden", - "com.arsdigita.formbuilder.ui.editors.HiddenForm"), - Arrays.asList( "forms-cms", "Hidden ID Generator field", - "Hidden ID Generator fields", - "com.arsdigita.formbuilder.HiddenIDGenerator", - "com.arsdigita.formbuilder.ui.editors.HiddenIDGeneratorForm"), - Arrays.asList("forms-cms", "Multiple select box", - "Multiple select boxes", - "com.arsdigita.formbuilder.PersistentMultipleSelect", - "com.arsdigita.formbuilder.ui.editors.MultipleSelectEditor"), - Arrays.asList("forms-cms", "Password field", "Password fields", - "com.arsdigita.formbuilder.PersistentPassword", - "com.arsdigita.formbuilder.ui.editors.PasswordForm"), - Arrays.asList("forms-cms", "Radio group", "Radio groups", - "com.arsdigita.formbuilder.PersistentRadioGroup", - "com.arsdigita.formbuilder.ui.editors.RadioGroupEditor"), - Arrays.asList("forms-cms", "Single select box", - "Single select boxes", - "com.arsdigita.formbuilder.PersistentSingleSelect", - "com.arsdigita.formbuilder.ui.editors.SingleSelectEditor"), - Arrays.asList("forms-cms", "Submit button", "Submit buttons", - "com.arsdigita.formbuilder.PersistentSubmit", - "com.arsdigita.formbuilder.ui.editors.SubmitForm"), - Arrays.asList("forms-cms", "Text area", "Text areas", - "com.arsdigita.formbuilder.PersistentTextArea", - "com.arsdigita.formbuilder.ui.editors.TextAreaForm"), - Arrays.asList("forms-cms", "Text field", "Text fields", - "com.arsdigita.formbuilder.PersistentTextField", - "com.arsdigita.formbuilder.ui.editors.TextFieldForm"), - Arrays.asList("forms-cms", "Data Driven Select Box", - "Data Driven Select Boxes", - "com.arsdigita.formbuilder.DataDrivenSelect", - "com.arsdigita.formbuilder.ui.editors.DataDrivenSelectForm"), - Arrays.asList("forms-cms", "Text Description","Text Descriptions", - "com.arsdigita.formbuilder.PersistentText", - "com.arsdigita.formbuilder.ui.editors.TextForm"), - Arrays.asList("forms-cms", "Text Heading", "Text Headings", - "com.arsdigita.formbuilder.PersistentHeading", - "com.arsdigita.formbuilder.ui.editors.HeadingForm"), - Arrays.asList("forms-cms", "Section Break", "Section Break", - "com.arsdigita.formbuilder.PersistentHorizontalRule", - "com.arsdigita.formbuilder.ui.editors.HorizontalRuleForm"), - Arrays.asList("forms-cms", "User Email Field","User Email Fields", - "com.arsdigita.formbuilder.PersistentEmailField", - "com.arsdigita.formbuilder.ui.editors.EmailFieldForm") - ); - - /** List of process listeners used in applications forms. Each listener is - described by application indicator, process name (singular & plural), - action class name and action ui class name. These are really not user - or administrator configurabel and therefore not implemented as ccm - parameter. */ - private static List processListenerTypes = Arrays.asList( - Arrays.asList("forms-cms", "Confirmation email", - "Confirmation emails", - "com.arsdigita.formbuilder.actions.ConfirmEmailListener", - "com.arsdigita.formbuilder.ui.editors.ConfirmEmailForm"), - Arrays.asList("forms-cms", "URL redirect", "URL redirects", - "com.arsdigita.formbuilder.actions.ConfirmRedirectListener", - "com.arsdigita.formbuilder.ui.editors.ConfirmRedirectForm"), - Arrays.asList("forms-cms", "Simple email", "Simple emails", - "com.arsdigita.formbuilder.actions.SimpleEmailListener", - "com.arsdigita.formbuilder.ui.editors.SimpleEmailForm"), - Arrays.asList("forms-cms", "Templated email", "Templated emails", - "com.arsdigita.formbuilder.actions.TemplateEmailListener", - "com.arsdigita.formbuilder.ui.editors.TemplateEmailForm"), - Arrays.asList( "forms-cms", "Remote Server POST", - "Remote Server POSTs", - "com.arsdigita.formbuilder.actions.RemoteServerPostListener", - "com.arsdigita.formbuilder.ui.editors.RemoteServerPostForm" ), - Arrays.asList( "forms-cms", "XML email", "XML emails", - "com.arsdigita.formbuilder.actions.XMLEmailListener", - "com.arsdigita.formbuilder.ui.editors.XMLEmailForm" ) - ); - - - private static List dataQueries = Arrays.asList( - Arrays.asList("forms-cms", - "com.arsdigita.formbuilder.DataQueryUsers", - "List of all registered users"), - Arrays.asList("forms-cms", - "com.arsdigita.formbuilder.DataQueryPackages", - "List of all installed packages") - ); + Arrays.asList("forms-cms", "Checkbox group", "Checkbox groups", + "com.arsdigita.formbuilder.PersistentCheckboxGroup", + "com.arsdigita.formbuilder.ui.editors.CheckboxGroupEditor"), + Arrays.asList("forms-cms", "Date field", "Date fields", + "com.arsdigita.formbuilder.PersistentDate", + "com.arsdigita.formbuilder.ui.editors.DateForm"), + Arrays.asList("forms-cms", "Hidden field", "Hidden fields", + "com.arsdigita.formbuilder.PersistentHidden", + "com.arsdigita.formbuilder.ui.editors.HiddenForm"), + Arrays.asList("forms-cms", "Hidden ID Generator field", + "Hidden ID Generator fields", + "com.arsdigita.formbuilder.HiddenIDGenerator", + "com.arsdigita.formbuilder.ui.editors.HiddenIDGeneratorForm"), + Arrays.asList("forms-cms", "Multiple select box", + "Multiple select boxes", + "com.arsdigita.formbuilder.PersistentMultipleSelect", + "com.arsdigita.formbuilder.ui.editors.MultipleSelectEditor"), + Arrays.asList("forms-cms", "Password field", "Password fields", + "com.arsdigita.formbuilder.PersistentPassword", + "com.arsdigita.formbuilder.ui.editors.PasswordForm"), + Arrays.asList("forms-cms", "Radio group", "Radio groups", + "com.arsdigita.formbuilder.PersistentRadioGroup", + "com.arsdigita.formbuilder.ui.editors.RadioGroupEditor"), + Arrays.asList("forms-cms", "Single select box", + "Single select boxes", + "com.arsdigita.formbuilder.PersistentSingleSelect", + "com.arsdigita.formbuilder.ui.editors.SingleSelectEditor"), + Arrays.asList("forms-cms", "Submit button", "Submit buttons", + "com.arsdigita.formbuilder.PersistentSubmit", + "com.arsdigita.formbuilder.ui.editors.SubmitForm"), + Arrays.asList("forms-cms", "Text area", "Text areas", + "com.arsdigita.formbuilder.PersistentTextArea", + "com.arsdigita.formbuilder.ui.editors.TextAreaForm"), + Arrays.asList("forms-cms", "Text field", "Text fields", + "com.arsdigita.formbuilder.PersistentTextField", + "com.arsdigita.formbuilder.ui.editors.TextFieldForm"), + Arrays.asList("forms-cms", "Data Driven Select Box", + "Data Driven Select Boxes", + "com.arsdigita.formbuilder.DataDrivenSelect", + "com.arsdigita.formbuilder.ui.editors.DataDrivenSelectForm"), + Arrays.asList("forms-cms", "Text Description", "Text Descriptions", + "com.arsdigita.formbuilder.PersistentText", + "com.arsdigita.formbuilder.ui.editors.TextForm"), + Arrays.asList("forms-cms", "Text Heading", "Text Headings", + "com.arsdigita.formbuilder.PersistentHeading", + "com.arsdigita.formbuilder.ui.editors.HeadingForm"), + Arrays.asList("forms-cms", "Section Break", "Section Break", + "com.arsdigita.formbuilder.PersistentHorizontalRule", + "com.arsdigita.formbuilder.ui.editors.HorizontalRuleForm"), + Arrays.asList("forms-cms", "User Email Field", "User Email Fields", + "com.arsdigita.formbuilder.PersistentEmailField", + "com.arsdigita.formbuilder.ui.editors.EmailFieldForm")); + /** + * List of process listeners used in applications forms. Each listener is + * described by application indicator, process name (singular & plural), + * action class name and action ui class name. These are really not user or + * administrator configurabel and therefore not implemented as ccm + * parameter. + */ + private static List processListenerTypes = Arrays.asList( + Arrays.asList("forms-cms", "Confirmation email", + "Confirmation emails", + "com.arsdigita.formbuilder.actions.ConfirmEmailListener", + "com.arsdigita.formbuilder.ui.editors.ConfirmEmailForm"), + Arrays.asList("forms-cms", "URL redirect", "URL redirects", + "com.arsdigita.formbuilder.actions.ConfirmRedirectListener", + "com.arsdigita.formbuilder.ui.editors.ConfirmRedirectForm"), + Arrays.asList("forms-cms", "Simple email", "Simple emails", + "com.arsdigita.formbuilder.actions.SimpleEmailListener", + "com.arsdigita.formbuilder.ui.editors.SimpleEmailForm"), + Arrays.asList("forms-cms", "Templated email", "Templated emails", + "com.arsdigita.formbuilder.actions.TemplateEmailListener", + "com.arsdigita.formbuilder.ui.editors.TemplateEmailForm"), + Arrays.asList("forms-cms", "Remote Server POST", + "Remote Server POSTs", + "com.arsdigita.formbuilder.actions.RemoteServerPostListener", + "com.arsdigita.formbuilder.ui.editors.RemoteServerPostForm"), + Arrays.asList("forms-cms", "XML email", "XML emails", + "com.arsdigita.formbuilder.actions.XMLEmailListener", + "com.arsdigita.formbuilder.ui.editors.XMLEmailForm")); + private static List dataQueries = Arrays.asList( + Arrays.asList("forms-cms", + "com.arsdigita.formbuilder.DataQueryUsers", + "List of all registered users"), + Arrays.asList("forms-cms", + "com.arsdigita.formbuilder.DataQueryPackages", + "List of all installed packages")); // Currently not a Loader task. There is no way to persist tasks preferences // on a per section base. - /** - * When to generate email alerts: by default, generate email alerts - * on enable, finish, and rollback (happens on rejection) changes. - * There are four action types for each task type: enable, - * disable, finish, and rollback. Note that the values below are - * based on the task labels, and as such are not globalized. + /** + * When to generate email alerts: by default, generate email alerts on + * enable, finish, and rollback (happens on rejection) changes. There are + * four action types for each task type: enable, disable, finish, and + * rollback. Note that the values below are based on the task labels, and as + * such are not globalized. */ /* - private final Parameter - m_taskAlerts = new StringArrayParameter( - "com.arsdigita.cms.task_alerts", - Parameter.REQUIRED, new String[] { - "Authoring:enable:finish:rollback", - "Approval:enable:finish:rollback", - "Deploy:enable:finish:rollback" } ); + * private final Parameter m_taskAlerts = new StringArrayParameter( + * "com.arsdigita.cms.task_alerts", Parameter.REQUIRED, new String[] { + * "Authoring:enable:finish:rollback", "Approval:enable:finish:rollback", + * "Deploy:enable:finish:rollback" } ); */ - - // /////////////////////////////////////////////////////////////////////// // // Parameters controlling Overdue Task alerts: @@ -414,8 +372,6 @@ public final class LoaderConfig extends AbstractConfig { // per section base of to store them in the database at all. So it is // currently not a loader task and commented out here. // /////////////////////////////////////////////////////////////////////// - - // /** // * sendOverdueAlerts: Should we send alerts about overdue tasks at all? // */ @@ -424,7 +380,6 @@ public final class LoaderConfig extends AbstractConfig { // "com.arsdigita.cms.loader.send_overdue_alerts", // Parameter.REQUIRED, // new Boolean(false) ); - // /** // * taskDuration: The time between when a task is enabled (it is made // * available for completion) and when it is @@ -435,7 +390,6 @@ public final class LoaderConfig extends AbstractConfig { // "com.arsdigita.cms.loader.task_duration", // Parameter.REQUIRED, // new Integer(96) ); - // /** // * alertInterval: The time to wait between sending successive alerts on // * the same overdue task (in HOURS) @@ -445,7 +399,6 @@ public final class LoaderConfig extends AbstractConfig { // "com.arsdigita.cms.loader.overdue_alert_interval", // Parameter.REQUIRED, // new Integer(24) ); - // /** // * maxAlerts: The maximum number of alerts to send about any one // * overdue task @@ -455,35 +408,34 @@ public final class LoaderConfig extends AbstractConfig { // "com.arsdigita.cms.loader.mas_alerts", // Parameter.REQUIRED, // new Integer(5) ); - /** - * Standard Constructor. + * Standard Constructor. */ public LoaderConfig() { // register(m_workspaceURL); // register(m_contentCenterMap); - register(m_ctDefFiles); + register(m_ctDefFiles); - // Parameters for creating a content section - register(m_isPublic); - register(m_itemResolverClass); - register(m_templateResolverClass); + // Parameters for creating a content section + register(m_isPublic); + register(m_itemResolverClass); + register(m_templateResolverClass); - register(m_useSectionCategories); - register(m_categoryFileList); + register(m_useSectionCategories); + register(m_categoryFileList); - // (Currently not a loader task) + // (Currently not a loader task) // register(m_taskAlerts); - // Parameters controlling Overdue Task alerts: - // (Currently not a loader task) + // Parameters controlling Overdue Task alerts: + // (Currently not a loader task) // register(m_sendOverdueAlerts); // register(m_taskDuration); // register(m_overdueAlertInterval); // register(m_maxAlerts); - // Does not work at load time! - // loadInfo(); + // Does not work at load time! + // loadInfo(); } @@ -492,7 +444,6 @@ public final class LoaderConfig extends AbstractConfig { // Getter Methods // // ////////////////////////// - // Not used as long as we use old style application (seee above) // /** // * Fetch name (URL) of the workspace package instance, e.g. content-center @@ -501,7 +452,6 @@ public final class LoaderConfig extends AbstractConfig { // public String getWorkspaceURL() { // return (String) get(m_workspaceURL); // } - // Moved to CMSConfig as long as it is not a Loader task. (see above) // /** // * Fetch the file name contaning XML Mapping of the content center tabs @@ -511,101 +461,11 @@ public final class LoaderConfig extends AbstractConfig { // public String getContentCenterMap() { // return (String) get(m_contentCenterMap); // } - public List getCTDefFiles() { String[] ctDefFiles = (String[]) get(m_ctDefFiles); return Arrays.asList(ctDefFiles); } - - - - /** - * Retrieve the STAFF GROUP, i.e. a set of roles (author, editor, publisher, - * manager) and associated privileges for the content section to be created - * (m_contentSectionName). - * - * In loading step a complete default configuration is persisted in database, - * immutable at this point. - * See contentsection.ContentSectionSetup.registerRoles() - * In enterprise.init: name roles, List of roles to create. - * - * Set consists of a set of roles, for each role first field is the role name, - * second is the description, third is a list of privileges, and (optional) - * fourth is the workflow task to assign to. - * - * The set of roles constructed here is a complete set which reflects all - * functions of CMS and forms a necessary base for operations. When the first - * content section is created and loaded into database (during installation) - * this set is created, immutable by installer / administrator. Additional - * content section may be created using a subset. For a very special purpose - * a developer may alter the set. - * - * This method is typically used to construct the initial content section - * during installation. - * - * Not really implemented yet! We need a new parameter type "list" which - * must have multidimensional capabilities. - * - * As a temporary measure a constant list is retrieved. Until now the list - * was burried in enterprise.init and not user available for configuration. - * So it may turn into a permanent solution. - */ - public List getStuffGroup() { - - final List