- CMSConfig aufgeräumt (new Boolean(...) Aufrufe entfernt)

- nicht mehr benötigte Klassen (nicht erfolgreicher Ansatz für Publizieren von Assoziationen) enfernt


git-svn-id: https://svn.libreccm.org/ccm/trunk@1577 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2012-04-10 10:44:55 +00:00
parent ced5ee10c2
commit ca3337c6d9
6 changed files with 230 additions and 367 deletions

View File

@ -1,37 +0,0 @@
package com.arsdigita.cms;
import com.arsdigita.persistence.metadata.Property;
/**
*
* @author Jens Pelzetter
* @version $Id$
*/
public interface AssociationCopier {
/**
* <p>
* Return the property which is handled by this implementation. Format:
* </p>
* <p>
* {@code $type::$property}
* </p>
* <p>
* Where {@code $type} is the fully qualified name of the class/type owing
* the property and {@code property} is the name the property. Example
* </p>
* <p>
* {@code com.arsdigita.cms.contenttypes.GenericPerson::publications}
* </p>
* <p>
* This indicates that the implementation handles a property
* {@code publications} added to the {@code GenericPerson} type by some
* module via an PDL association.
* </p>
*
* @return
*/
String forProperty();
boolean copyProperty(CustomCopy source, Property property, ItemCopier copier);
}

View File

@ -1,77 +0,0 @@
package com.arsdigita.cms;
import com.arsdigita.persistence.metadata.Property;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
/**
*
* @author Jens Pelzetter
* @version $Id$
*/
public final class AssociationCopierLoader {
private static final AssociationCopierLoader INSTANCE =
new AssociationCopierLoader();
private static final Logger logger =
Logger.getLogger(AssociationCopierLoader.class);
private Map<String, AssociationCopier> copiers =
new HashMap<String, AssociationCopier>();
private AssociationCopierLoader() {
final String[] assocCopierNames = CMSConfig.getInstance().
getAssocCopiers();
for (String assocCopierName : assocCopierNames) {
loadAssocCopier(assocCopierName);
}
}
private void loadAssocCopier(final String name) {
final Class<?> clazz;
try {
clazz = Class.forName(name);
} catch (ClassNotFoundException ex) {
logger.warn(String.format("No class found for name '%s'. Skiping.",
name),
ex);
return;
}
if (clazz.isAssignableFrom(AssociationCopier.class)) {
try {
final AssociationCopier copier = (AssociationCopier) clazz.
newInstance();
copiers.put(copier.forProperty(), copier);
} catch (InstantiationException ex) {
logger.warn(String.format(
"Failed to instaniate copier '%s'. Skiping.",
name),
ex);
} catch (IllegalAccessException ex) {
logger.warn(String.format(
"Failed to instaniate copier '%s'. Skiping.",
name),
ex);
}
} else {
logger.warn(String.format("Class '%s' is not an implementation of "
+ "the AssociationCopier interface. "
+ "Skiping",
name));
}
}
public static AssociationCopierLoader getInstance() {
return INSTANCE;
}
public AssociationCopier getAssociationCopierFor(final Property property,
final CustomCopy source) {
return copiers.get(String.format("%s::%s",
source.getClass().getName(),
property.getName()));
}
}

View File

@ -18,15 +18,14 @@
*/ */
package com.arsdigita.cms; package com.arsdigita.cms;
/* May 2009: /*
* This file serves as an information for developers how to replace * May 2009: This file serves as an information for developers how to replace
* the URL resource: protocol extension (which is a application specific, * the URL resource: protocol extension (which is a application specific,
* non-standard extension of the Java URL protocol) by supported, * non-standard extension of the Java URL protocol) by supported, standard
* standard compliant API. * compliant API.
* *
* Look for: * Look for: // URL resource: protocol handler removal: START Will be removed as
* // URL resource: protocol handler removal: START * soon as a stable release 6.6 is created.
* Will be removed as soon as a stable release 6.6 is created.
*/ */
import com.arsdigita.bebop.SimpleComponent; import com.arsdigita.bebop.SimpleComponent;
import com.arsdigita.bebop.form.DHTMLEditor; import com.arsdigita.bebop.form.DHTMLEditor;
@ -40,36 +39,16 @@ import com.arsdigita.cms.publishToFile.PublishToFileConfig;
import com.arsdigita.cms.ui.authoring.ItemCategoryExtension; import com.arsdigita.cms.ui.authoring.ItemCategoryExtension;
import com.arsdigita.cms.ui.authoring.ItemCategoryForm; import com.arsdigita.cms.ui.authoring.ItemCategoryForm;
import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.runtime.AbstractConfig;
// URL resource: protocol handler removal: START import com.arsdigita.util.StringUtils;
// remove
// import com.arsdigita.util.UncheckedWrapperException;
// URL resource: protocol handler removal: END
import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.EnumerationParameter; import com.arsdigita.util.parameter.EnumerationParameter;
import com.arsdigita.util.parameter.ErrorList; import com.arsdigita.util.parameter.ErrorList;
import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.IntegerParameter;
import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.Parameter;
// import com.arsdigita.util.parameter.ParameterError;
// URL resource: protocol handler removal: START
// new: import:
import com.arsdigita.util.parameter.ResourceParameter; import com.arsdigita.util.parameter.ResourceParameter;
// URL resource: protocol handler removal: END
import com.arsdigita.util.parameter.SpecificClassParameter; import com.arsdigita.util.parameter.SpecificClassParameter;
import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringArrayParameter;
import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.StringParameter;
// URL resource: protocol handler removal: START
// remove:
// import com.arsdigita.util.parameter.URLParameter;
// new: import:
import com.arsdigita.util.StringUtils;
// URL resource: protocol handler removal: END
// URL resource: protocol handler removal: START
// remove:
// import java.io.IOException;
// import java.net.MalformedURLException;
// import java.net.URL;
// URL resource: protocol handler removal: END
import java.io.InputStream; import java.io.InputStream;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
@ -78,14 +57,13 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* A record containing server-session scoped configuration properties. * A record containing server-session scoped configuration properties.
* *
* Accessors of this class may return null. Developers should take care * Accessors of this class may return null. Developers should take care to trap
* to trap null return values in their code. * null return values in their code.
* *
* @see ContentSection#getConfig() * @see ContentSection#getConfig()
* *
@ -94,16 +72,21 @@ import org.apache.log4j.Logger;
*/ */
public final class CMSConfig extends AbstractConfig { public final class CMSConfig extends AbstractConfig {
/** Private Logger instance for debugging purpose. */ /**
* Private Logger instance for debugging purpose.
*/
private static final Logger s_log = Logger.getLogger(CMSConfig.class); private static final Logger s_log = Logger.getLogger(CMSConfig.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 CMSConfig s_config; private static CMSConfig s_config;
/** /**
* Returns the singleton configuration record for the content section * Returns the singleton configuration record for the content section
* environment. * environment.
* *
* @return The <code>ContentSectionConfig</code> record; it cannot be null * @return The
* <code>ContentSectionConfig</code> record; it cannot be null
*/ */
public static synchronized CMSConfig getInstance() { public static synchronized CMSConfig getInstance() {
if (s_config == null) { if (s_config == null) {
@ -119,9 +102,9 @@ public final class CMSConfig extends AbstractConfig {
*/ */
private static Map s_skipAssetSteps = null; private static Map s_skipAssetSteps = null;
/** /**
* Item category add form speciofies Subclass of ItemCategoryForm * Item category add form speciofies Subclass of ItemCategoryForm to use for
* to use for the assign categories step. * the assign categories step. Used in
* Used in c.ad.cms.ui.authoring.ItemCategoryStep * c.ad.cms.ui.authoring.ItemCategoryStep
*/ */
private final Parameter m_categoryAuthoringAddForm = private final Parameter m_categoryAuthoringAddForm =
new SpecificClassParameter( new SpecificClassParameter(
@ -130,8 +113,8 @@ public final class CMSConfig extends AbstractConfig {
ItemCategoryForm.class, ItemCategoryForm.class,
SimpleComponent.class); SimpleComponent.class);
/** /**
* Path for the default item template. Path is relative to the * Path for the default item template. Path is relative to the Template Root
* Template Root path. * path.
*/ */
private final Parameter m_defaultItemTemplatePath = private final Parameter m_defaultItemTemplatePath =
new StringParameter( new StringParameter(
@ -139,8 +122,8 @@ public final class CMSConfig extends AbstractConfig {
Parameter.REQUIRED, Parameter.REQUIRED,
"/default/item.jsp"); "/default/item.jsp");
/** /**
* Path for the default folder template. Path is relative to the * Path for the default folder template. Path is relative to the Template
* Template Root path. * Root path.
*/ */
private final Parameter m_defaultFolderTemplatePath = private final Parameter m_defaultFolderTemplatePath =
new StringParameter( new StringParameter(
@ -148,17 +131,17 @@ public final class CMSConfig extends AbstractConfig {
Parameter.REQUIRED, Parameter.REQUIRED,
"/default/folder.jsp"); "/default/folder.jsp");
/** /**
* Path or the root folter for template folders. * Path or the root folter for template folders. Path is relative to webapp
* Path is relative to webapp root. * root.
*/ */
private final Parameter m_templateRootPath = private final Parameter m_templateRootPath =
new StringParameter("com.arsdigita.cms.template_root_path", new StringParameter(
Parameter.REQUIRED, "com.arsdigita.cms.template_root_path",
"/templates/ccm-cms/content-section"); Parameter.REQUIRED,
"/templates/ccm-cms/content-section");
// up to version 6.6.4 // up to version 6.6.4
// "/packages/content-section/templates"); // "/packages/content-section/templates");
// URL resource: protocol handler removal: START
// URL resource: protocol handler removal: START
// remove: // remove:
// try { // try {
// m_itemAdapters = new URLParameter // m_itemAdapters = new URLParameter
@ -174,22 +157,22 @@ public final class CMSConfig extends AbstractConfig {
* specifications. Path is relative to webapp root. * specifications. Path is relative to webapp root.
*/ */
private final Parameter m_itemAdapters = private final Parameter m_itemAdapters =
new ResourceParameter("com.arsdigita.cms.item_adapters", new ResourceParameter(
Parameter.REQUIRED, "com.arsdigita.cms.item_adapters",
"/WEB-INF/resources/cms-item-adapters.xml"); Parameter.REQUIRED,
"/WEB-INF/resources/cms-item-adapters.xml");
// URL resource: protocol handler removal: END // URL resource: protocol handler removal: END
/** /**
* Use streamlined content creation: upon item creation, * Use streamlined content creation: upon item creation, automatically open
* automatically open authoring steps and forward to the next step * authoring steps and forward to the next step
*/ */
private final Parameter m_useStreamlinedCreation = new BooleanParameter( private final Parameter m_useStreamlinedCreation = new BooleanParameter(
"com.arsdigita.cms.use_streamlined_creation", "com.arsdigita.cms.use_streamlined_creation",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.TRUE);
true));
/** /**
* DHTML Editor Configuration for use in CMS module, lists the * DHTML Editor Configuration for use in CMS module, lists the config object
* config object name and Javascript source location for its definition. * name and Javascript source location for its definition.
*/ */
private final Parameter m_dhtmlEditorConfig = private final Parameter m_dhtmlEditorConfig =
new DHTMLEditorConfigParameter( new DHTMLEditorConfigParameter(
@ -208,16 +191,16 @@ public final class CMSConfig extends AbstractConfig {
// be accessable by other modules which use DHTMLeditor. // be accessable by other modules which use DHTMLeditor.
// Would be bad style to configure a cms specific parameter in core. // Would be bad style to configure a cms specific parameter in core.
/** /**
* Defines which plugins to use, e.g.TableOperations,CSS * Defines which plugins to use, e.g.TableOperations,CSS Format:
* Format: [string,string,string] * [string,string,string]
*/ */
private final Parameter m_dhtmlEditorPlugins = new StringArrayParameter( private final Parameter m_dhtmlEditorPlugins = new StringArrayParameter(
"com.arsdigita.cms.dhtml_editor_plugins", "com.arsdigita.cms.dhtml_editor_plugins",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
/** /**
* Prevent undesirable functions from being made available, * Prevent undesirable functions from being made available, eg images should
* eg images should only be added through the cms methods. * only be added through the cms methods.
*/ */
private final Parameter m_dhtmlEditorHiddenButtons = private final Parameter m_dhtmlEditorHiddenButtons =
new StringArrayParameter( new StringArrayParameter(
@ -230,65 +213,57 @@ public final class CMSConfig extends AbstractConfig {
private final Parameter m_hideAdminTabs = new BooleanParameter( private final Parameter m_hideAdminTabs = new BooleanParameter(
"com.arsdigita.cms.hide_admin_tabs", "com.arsdigita.cms.hide_admin_tabs",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide Folder Index Checkbox from folder view * Hide Folder Index Checkbox from folder view
*/ */
private final Parameter m_hideFolderIndexCheckbox = new BooleanParameter( private final Parameter m_hideFolderIndexCheckbox = new BooleanParameter(
"com.arsdigita.cms.hide_folder_index_checkbox", "com.arsdigita.cms.hide_folder_index_checkbox",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide launch date parameter on all forms and displays where it's used. * Hide launch date parameter on all forms and displays where it's used.
*/ */
private final Parameter m_hideLaunchDate = new BooleanParameter( private final Parameter m_hideLaunchDate = new BooleanParameter(
"com.arsdigita.cms.hide_launch_date", "com.arsdigita.cms.hide_launch_date",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.TRUE);
true));
/** /**
* Require the launch date parameter to be set by the content author. * Require the launch date parameter to be set by the content author.
*/ */
private final Parameter m_requireLaunchDate = new BooleanParameter( private final Parameter m_requireLaunchDate = new BooleanParameter(
"com.arsdigita.cms.require_launch_date", "com.arsdigita.cms.require_launch_date",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide the templates tab on the item admin page. * Hide the templates tab on the item admin page.
*/ */
private final Parameter m_hideTemplatesTab = new BooleanParameter( private final Parameter m_hideTemplatesTab = new BooleanParameter(
"com.arsdigita.cms.hide_templates_tab", "com.arsdigita.cms.hide_templates_tab",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide the upload file link in the editing of a text asset. * Hide the upload file link in the editing of a text asset.
*/ */
private final Parameter m_hideTextAssetUploadFile = new BooleanParameter( private final Parameter m_hideTextAssetUploadFile = new BooleanParameter(
"com.arsdigita.cms.hide_text_asset_upload_file", "com.arsdigita.cms.hide_text_asset_upload_file",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide timezone labels (if, for example, all users will be in the * Hide timezone labels (if, for example, all users will be in the same
* same timezone and such information would be unnecessary) * timezone and such information would be unnecessary)
*/ */
private final Parameter m_hideTimezone = new BooleanParameter( private final Parameter m_hideTimezone = new BooleanParameter(
"com.arsdigita.cms.hide_timezone", "com.arsdigita.cms.hide_timezone",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide User Defined Content Types UI * Hide User Defined Content Types UI
*/ */
private final Parameter m_hideUDCTUI = new BooleanParameter( private final Parameter m_hideUDCTUI = new BooleanParameter(
"com.arsdigita.cms.hide_udct_ui", "com.arsdigita.cms.hide_udct_ui",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Specifies the name of the class to use as a PublishLifecycleListener * Specifies the name of the class to use as a PublishLifecycleListener
*/ */
@ -298,14 +273,13 @@ public final class CMSConfig extends AbstractConfig {
Parameter.OPTIONAL, Parameter.OPTIONAL,
PublishLifecycleListener.class.getName()); PublishLifecycleListener.class.getName());
/** /**
* Wether the Wysiwyg editor should clear the text of MSWord tags, * Wether the Wysiwyg editor should clear the text of MSWord tags, everytime
* everytime the user clicks on 'Save' * the user clicks on 'Save'
*/ */
private final Parameter m_saveTextCleansWordTags = new BooleanParameter( private final Parameter m_saveTextCleansWordTags = new BooleanParameter(
"com.arsdigita.cms.save_text_cleans_word_tags", "com.arsdigita.cms.save_text_cleans_word_tags",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean( Boolean.FALSE);
false));
/** /**
* Hide Additional Resource Fields on RelatedLinkPropertyForm * Hide Additional Resource Fields on RelatedLinkPropertyForm
*/ */
@ -314,60 +288,55 @@ public final class CMSConfig extends AbstractConfig {
"com.arsdigita.cms.contentassets.ui." "com.arsdigita.cms.contentassets.ui."
+ "RelatedLinkPropertyForm.hideAdditionalResourceFields", + "RelatedLinkPropertyForm.hideAdditionalResourceFields",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean(false)); Boolean.FALSE);
/** /**
* Get the search indexing not to process FileAssets, * Get the search indexing not to process FileAssets, eg to avoid PDF
* eg to avoid PDF slowdowns * slowdowns
*/ */
private final Parameter m_disableFileAssetExtraction = new BooleanParameter( private final Parameter m_disableFileAssetExtraction = new BooleanParameter(
"com.arsdigita.cms.search.disableFileAssetExtraction", "com.arsdigita.cms.search.disableFileAssetExtraction",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Whether an item's workflow should be deleted, once the item * Whether an item's workflow should be deleted, once the item has been
* has been (re)published * (re)published
*/ */
private final Parameter m_deleteWorkflowAfterPublication = private final Parameter m_deleteWorkflowAfterPublication =
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.delete_workflow_after_publication", "com.arsdigita.cms.delete_workflow_after_publication",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean(true)); Boolean.TRUE);
/** /**
* Defines the number of days ahead that are covered in the * Defines the number of days ahead that are covered in the 'Soon Expired'
* 'Soon Expired' tab * tab
*/ */
private final Parameter m_soonExpiredTimespanDays = new IntegerParameter( private final Parameter m_soonExpiredTimespanDays = new IntegerParameter(
"com.arsdigita.cms.soon_expired_timespan_days", "com.arsdigita.cms.soon_expired_timespan_days",
Parameter.REQUIRED, Parameter.REQUIRED,
new Integer( new Integer(14));
14));
/** /**
* Defines the number of months ahead that are covered in the * Defines the number of months ahead that are covered in the 'Soon Expired'
* 'Soon Expired' tab * tab
*/ */
private final Parameter m_soonExpiredTimespanMonths = new IntegerParameter( private final Parameter m_soonExpiredTimespanMonths = new IntegerParameter(
"com.arsdigita.cms.soon_expired_timespan_months", "com.arsdigita.cms.soon_expired_timespan_months",
Parameter.REQUIRED, Parameter.REQUIRED,
new Integer( new Integer(1));
1));
/** /**
* Does a redirect to the unpublished item generate not found error? * Does a redirect to the unpublished item generate not found error?
*/ */
private final Parameter m_unpublishedNotFound = new BooleanParameter( private final Parameter m_unpublishedNotFound = new BooleanParameter(
"com.arsdigita.cms.unpublished_not_found", "com.arsdigita.cms.unpublished_not_found",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.TRUE);
true));
/** /**
* Links created through browse interfaces should only be within the * Links created through browse interfaces should only be within the same
* same subsite * subsite
*/ */
private final Parameter m_linksOnlyInSameSubsite = new BooleanParameter( private final Parameter m_linksOnlyInSameSubsite = new BooleanParameter(
"com.arsdigita.cms.browse_links_in_same_subsite_only", "com.arsdigita.cms.browse_links_in_same_subsite_only",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Item category step extension hook: Subclass of ItemCategoryExtension * Item category step extension hook: Subclass of ItemCategoryExtension
* which adds extension actions for the category authoring step * which adds extension actions for the category authoring step
@ -385,10 +354,10 @@ public final class CMSConfig extends AbstractConfig {
private final Parameter m_hideResetLifecycleLink = new BooleanParameter( private final Parameter m_hideResetLifecycleLink = new BooleanParameter(
"com.arsdigita.cms.hide_reset_lifecycle_link", "com.arsdigita.cms.hide_reset_lifecycle_link",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean( Boolean.TRUE);
true));
/** /**
* Whether to include INPATH operators to contains clause in intermedia search * Whether to include INPATH operators to contains clause in intermedia
* search
*/ */
private final Parameter m_scoreTitleAndKeywords = private final Parameter m_scoreTitleAndKeywords =
new BooleanParameter( new BooleanParameter(
@ -396,8 +365,8 @@ public final class CMSConfig extends AbstractConfig {
Parameter.OPTIONAL, Parameter.OPTIONAL,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Title Weight, the relative weight given to title element within * Title Weight, the relative weight given to title element within cms:item
* cms:item when ranking search results (only used by interMedia) * when ranking search results (only used by interMedia)
*/ */
private final Parameter m_titleWeight = new IntegerParameter( private final Parameter m_titleWeight = new IntegerParameter(
"com.arsdigita.cms.search.intermedia.title_weight", "com.arsdigita.cms.search.intermedia.title_weight",
@ -405,8 +374,8 @@ public final class CMSConfig extends AbstractConfig {
new Integer(1)); new Integer(1));
/** /**
* Keyword Weight, the relative weight given to the dcKeywords element * Keyword Weight, the relative weight given to the dcKeywords element
* within dublinCore element within cms:item element when ranking * within dublinCore element within cms:item element when ranking search
* search results (only used by interMedia) * results (only used by interMedia)
*/ */
private final Parameter m_keywordWeight = private final Parameter m_keywordWeight =
new IntegerParameter( new IntegerParameter(
@ -423,26 +392,24 @@ public final class CMSConfig extends AbstractConfig {
Boolean.TRUE); Boolean.TRUE);
/** /**
* Asset steps to skip, specify asset steps that are not relevant for * Asset steps to skip, specify asset steps that are not relevant for
* specific content types. * specific content types. Each entry in the list is a : separated pair. The
* Each entry in the list is a : separated pair. The first string * first string is the className for the type (refer to classname column in
* is the className for the type (refer to classname column in contenttypes * contenttypes table eg com.arsdigita.cms.contenttypes.MultiPartArticle
* table eg com.arsdigita.cms.contenttypes.MultiPartArticle * Second string is the name of the bebop step component eg
* Second string is the name of the bebop step component * com.arsdigita.cms.contenttypes.ui.ImageStep
* eg com.arsdigita.cms.contenttypes.ui.ImageStep
*/ */
private final Parameter m_skipAssetSteps = new StringArrayParameter( private final Parameter m_skipAssetSteps = new StringArrayParameter(
"com.arsdigita.cms.skip_asset_steps", "com.arsdigita.cms.skip_asset_steps",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
/** /**
* Mandatory Descriptions Content types may refer to this to decide * Mandatory Descriptions Content types may refer to this to decide whether
* whether to validate against empty descriptions * to validate against empty descriptions
*/ */
private final Parameter m_mandatoryDescriptions = new BooleanParameter( private final Parameter m_mandatoryDescriptions = new BooleanParameter(
"com.arsdigita.cms.mandatory_descriptions", "com.arsdigita.cms.mandatory_descriptions",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean( Boolean.FALSE);
false));
/** /**
* Delete Finished Lifecycles. Decide whether lifecycles and their phases * Delete Finished Lifecycles. Decide whether lifecycles and their phases
* should be deleted from the system when finished. * should be deleted from the system when finished.
@ -451,56 +418,50 @@ public final class CMSConfig extends AbstractConfig {
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.delete_lifecycle_when_complete", "com.arsdigita.cms.delete_lifecycle_when_complete",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean(false)); Boolean.FALSE);
/** /**
* Contacts for content items. Allows you to add a Contact authoring step * Contacts for content items. Allows you to add a Contact authoring step to
* to all items * all items
*/ */
private final Parameter m_hasContactsAuthoringStep = new BooleanParameter( private final Parameter m_hasContactsAuthoringStep = new BooleanParameter(
"com.arsdigita.cms.has_contacts_authoring_step", "com.arsdigita.cms.has_contacts_authoring_step",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean( Boolean.FALSE);
false));
/** /**
* Ordering for nodes in assign category tree. Decide whether entries * Ordering for nodes in assign category tree. Decide whether entries should
* should be ordered alphabetically or according to sort key * be ordered alphabetically or according to sort key (maintained in
* (maintained in category admin tab in content centre) * category admin tab in content centre) SortKey|Alphabetical is initialized
* SortKey|Alphabetical is initialized in constructor! See below. * in constructor! See below.
*/ */
private final Parameter m_categoryTreeOrdering = private final Parameter m_categoryTreeOrdering =
new EnumerationParameter( new EnumerationParameter(
"com.arsdigita.cms.category_tree_order", "com.arsdigita.cms.category_tree_order",
Parameter.OPTIONAL, Parameter.OPTIONAL,
Category.SORT_KEY); Category.SORT_KEY);
/** /**
* Allow content creation in Workspace (content center) section listing. * Allow content creation in Workspace (content center) section listing.
* Allows you to turn off the ability to create content in the section listing * Allows you to turn off the ability to create content in the section
* listing
*/ */
private final Parameter m_allowContentCreateInSectionListing = private final Parameter m_allowContentCreateInSectionListing =
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.allow_content_create_in_section_listing", "com.arsdigita.cms.allow_content_create_in_section_listing",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean(true)); Boolean.TRUE);
/** /**
* Hide the legacy public site link in Workspace (content center) section * Hide the legacy public site link in Workspace (content center) section
* listing. Legacy public site display is replaced by navigation based * listing. Legacy public site display is replaced by navigation based
* presentation (or by portlets) and should be hidden in the admin ui * presentation (or by portlets) and should be hidden in the admin ui be
* be default now. * default now.
*/ */
private final Parameter m_hideLegacyPublicSiteLink = private final Parameter m_hideLegacyPublicSiteLink =
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.hide_legacy_public_site_link", "com.arsdigita.cms.hide_legacy_public_site_link",
Parameter.REQUIRED, Parameter.REQUIRED,
new Boolean(true)); Boolean.TRUE);
// /////////////////////////////////////////// // ///////////////////////////////////////////
// Notification related parameters // Notification related parameters
// /////////////////////////////////////////// // ///////////////////////////////////////////
/** /**
* Delete Sent Workflow Notifications. Decide whether successfully sent * Delete Sent Workflow Notifications. Decide whether successfully sent
* notifications and messages should be deleted from the system * notifications and messages should be deleted from the system
@ -509,34 +470,32 @@ public final class CMSConfig extends AbstractConfig {
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.delete_workflow_notification_when_sent", "com.arsdigita.cms.delete_workflow_notification_when_sent",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean(false)); Boolean.FALSE);
/** /**
* Decide whether successfully sent notifications and messages * Decide whether successfully sent notifications and messages should be
* should be deleted from the system * deleted from the system
*/ */
private final Parameter m_deleteExpiryNotificationsWhenSent = private final Parameter m_deleteExpiryNotificationsWhenSent =
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.delete_expiry_notification_when_sent", "com.arsdigita.cms.delete_expiry_notification_when_sent",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean(false)); Boolean.FALSE);
/** /**
* Amount of time (in hours) before the expiration of a content item * Amount of time (in hours) before the expiration of a content item that
* that users in the Alert Recipient role are alerted via email * users in the Alert Recipient role are alerted via email
*/ */
private final Parameter m_defaultNotificationTime = new IntegerParameter( private final Parameter m_defaultNotificationTime = new IntegerParameter(
"com.arsdigita.cms.default_notification_time", "com.arsdigita.cms.default_notification_time",
Parameter.REQUIRED, Parameter.REQUIRED,
new Integer( new Integer(0));
0));
/** /**
* Wether a content item's author should be notified * Wether a content item's author should be notified by the item's
* by the item's LifecycleListener; defaults to true * LifecycleListener; defaults to true
*/ */
private final Parameter m_notifyAuthorOnLifecycle = new BooleanParameter( private final Parameter m_notifyAuthorOnLifecycle = new BooleanParameter(
"com.arsdigita.cms.notify_author_on_lifecycle", "com.arsdigita.cms.notify_author_on_lifecycle",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Boolean( Boolean.TRUE);
true));
// //////////////////////////////////////////////////// // ////////////////////////////////////////////////////
// Content Center (Workspace) config related parameters // Content Center (Workspace) config related parameters
// //////////////////////////////////////////////////// // ////////////////////////////////////////////////////
@ -607,7 +566,6 @@ public final class CMSConfig extends AbstractConfig {
"com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane", "com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane",
Parameter.REQUIRED, Parameter.REQUIRED,
false); false);
//////////////////////////////////////////////// ////////////////////////////////////////////////
//Actives threaded publishing. If active, the publish process for //Actives threaded publishing. If active, the publish process for
//content items will run in a separate thread. May useful if you have //content items will run in a separate thread. May useful if you have
@ -620,14 +578,14 @@ public final class CMSConfig extends AbstractConfig {
"com.arsdigita.cms.lifecycle.threaded_publishing", "com.arsdigita.cms.lifecycle.threaded_publishing",
Parameter.REQUIRED, Parameter.REQUIRED,
true); true);
private final Parameter m_publishingFailureSender = new StringParameter(
/** "cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from",
* Copiers for associations not known yet. For example for associations Parameter.REQUIRED,
* with the generic types defined in this module from another module. "");
*/ private final Parameter m_publishingFailureReceiver = new StringParameter(
private final Parameter m_assocCopiers = new StringArrayParameter("com.arsdigita.cms.publish.association_copiers", "cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to",
Parameter.REQUIRED, Parameter.REQUIRED,
new String[]{}); "");
// /////////////////////////////////////////// // ///////////////////////////////////////////
// publishToFile package related parameter // publishToFile package related parameter
@ -639,7 +597,8 @@ public final class CMSConfig extends AbstractConfig {
* Constructor, but do NOT instantiate this class directly. * Constructor, but do NOT instantiate this class directly.
* *
* @see ContentSection#getConfig() * @see ContentSection#getConfig()
**/ *
*/
public CMSConfig() { public CMSConfig() {
// Initialize m_categoryTreeOrdering parameter here! // Initialize m_categoryTreeOrdering parameter here!
@ -712,7 +671,9 @@ public final class CMSConfig extends AbstractConfig {
register(m_useOldStyleItemLifecycleItemPane); register(m_useOldStyleItemLifecycleItemPane);
register(m_threadPublishing); register(m_threadPublishing);
register(m_assocCopiers); register(m_publishingFailureSender);
register(m_publishingFailureReceiver);
// publishToFile package related parameter // publishToFile package related parameter
// Moved to publishToFile.PublishToFileConfig as of version 6.0.2 // Moved to publishToFile.PublishToFileConfig as of version 6.0.2
@ -723,8 +684,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Retrieve path of the root folter for template folders. * Retrieve path of the root folter for template folders. Path is relative
* Path is relative to webapp root. * to webapp root.
*/ */
public final String getTemplateRoot() { public final String getTemplateRoot() {
return (String) get(m_templateRootPath); return (String) get(m_templateRootPath);
@ -764,8 +725,8 @@ public final class CMSConfig extends AbstractConfig {
/** /**
* *
* @deprecated * @deprecated use
* use com.arsdigita.cms.ContentSection.getDefaultSection().getName() instead * com.arsdigita.cms.ContentSection.getDefaultSection().getName() instead
*/ */
public final String getDefaultContentSection() { public final String getDefaultContentSection() {
// return (String) get(m_defaultSection); // return (String) get(m_defaultSection);
@ -880,8 +841,9 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Fetch the file name contaning XML Mapping of the content center tabs * Fetch the file name contaning XML Mapping of the content center tabs to
* to URLs * URLs
*
* @return String containig file name including path component. * @return String containig file name including path component.
*/ */
public String getContentCenterMap() { public String getContentCenterMap() {
@ -896,10 +858,9 @@ public final class CMSConfig extends AbstractConfig {
* does not process default values provided by using * does not process default values provided by using
* DHTMLEditor.Config.Standard (see parameter m_dhtmlEditorConfig above). * DHTMLEditor.Config.Standard (see parameter m_dhtmlEditorConfig above).
* May be a similiar problem as with ResourceParameter and default value, * May be a similiar problem as with ResourceParameter and default value,
* see patch provided by pbrucha. * see patch provided by pbrucha. Best solution may be to remove this
* Best solution may be to remove this special parameter class and use a * special parameter class and use a string parameter instead to directly
* string parameter instead to directly create a DHTMLEditor.Config object. * create a DHTMLEditor.Config object. (pboy, 2010-09-02)
* (pboy, 2010-09-02)
*/ */
private class DHTMLEditorConfigParameter extends StringParameter { private class DHTMLEditorConfigParameter extends StringParameter {
@ -911,6 +872,7 @@ public final class CMSConfig extends AbstractConfig {
/** /**
* WARNING: Does not correctly process default values, see above! * WARNING: Does not correctly process default values, see above!
*
* @param value * @param value
* @param errors * @param errors
* @return * @return
@ -922,7 +884,9 @@ public final class CMSConfig extends AbstractConfig {
} }
protected static HashMap extraXMLGenerators = new HashMap(); protected static HashMap extraXMLGenerators = new HashMap();
/** Add one ExtraXMLGenerator to the list. */ /**
* Add one ExtraXMLGenerator to the list.
*/
public static void registerExtraXMLGenerator(String type, public static void registerExtraXMLGenerator(String type,
ExtraXMLGenerator gen) { ExtraXMLGenerator gen) {
List gens = (List) extraXMLGenerators.get(type); List gens = (List) extraXMLGenerators.get(type);
@ -936,7 +900,9 @@ public final class CMSConfig extends AbstractConfig {
gens.add(gen.getClass()); // XXX assumes default ctor gens.add(gen.getClass()); // XXX assumes default ctor
} }
/** Get the iterator of ExtraXMLGenerators. */ /**
* Get the iterator of ExtraXMLGenerators.
*/
public static Iterator getExtraXMLGeneratorsIterator() { public static Iterator getExtraXMLGeneratorsIterator() {
return extraXMLGenerators.entrySet().iterator(); return extraXMLGenerators.entrySet().iterator();
} }
@ -946,11 +912,11 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* The relative weight given to the dcKeywords element * The relative weight given to the dcKeywords element within dublinCore
* within dublinCore element within cms:item element * element within cms:item element when ranking search results Only used by
* when ranking search results * the interMedia query engine.
* Only used by the interMedia query engine. *
**/ */
public Integer getKeywordSearchWeight() { public Integer getKeywordSearchWeight() {
return (Integer) get(m_keywordWeight); return (Integer) get(m_keywordWeight);
} }
@ -960,18 +926,20 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* The relative weight given to title element * The relative weight given to title element within cms:item element when
* within cms:item element when ranking search results * ranking search results Only used by the interMedia query engine.
* Only used by the interMedia query engine. *
**/ */
public Integer getTitleSearchWeight() { public Integer getTitleSearchWeight() {
return (Integer) get(m_titleWeight); return (Integer) get(m_titleWeight);
} }
/** /**
* Whether to include INPATH operators to contains clause in intermedia search * Whether to include INPATH operators to contains clause in intermedia
* search
* *
* NB - if true, INDEX MUST BE CREATED WITH PATH_SECTION_GROUP - upgrade 6.5.0 - 6.5.1 * NB - if true, INDEX MUST BE CREATED WITH PATH_SECTION_GROUP - upgrade
* 6.5.0 - 6.5.1
* *
* @return * @return
*/ */
@ -980,13 +948,13 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* for the given content type, returns a collection of * for the given content type, returns a collection of steps that are deemed
* steps that are deemed irrelevant for the type. * irrelevant for the type.
* *
* If no irrelevant steps, an empty set is returned. * If no irrelevant steps, an empty set is returned.
* *
* Steps are the names of the bebop step components that * Steps are the names of the bebop step components that are used by the
* are used by the authoring kit wizard * authoring kit wizard
* *
* @param type * @param type
* @return * @return
@ -1031,8 +999,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* May be used by any content type creation form to decide whether to validate * May be used by any content type creation form to decide whether to
* description field * validate description field
* *
*/ */
public boolean mandatoryDescriptions() { public boolean mandatoryDescriptions() {
@ -1040,8 +1008,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Used to decide whether lifecycles (and all asociated phases) * Used to decide whether lifecycles (and all asociated phases) should be
* should be deleted from the system when complete * deleted from the system when complete
* *
* (Deleting lifecycle means that you lose a bit of historical information * (Deleting lifecycle means that you lose a bit of historical information
* eg when was this item unpublished) * eg when was this item unpublished)
@ -1051,12 +1019,11 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Used to decide whether to delete old notification records * Used to decide whether to delete old notification records for expiry
* for expiry notifications. * notifications.
* *
* If true, notifications and messages are deleted if the * If true, notifications and messages are deleted if the notification is
* notification is successfully sent. Any send failures are * successfully sent. Any send failures are retained
* retained
* *
*/ */
public boolean deleteExpiryNotifications() { public boolean deleteExpiryNotifications() {
@ -1064,12 +1031,11 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Used to decide whether to delete old notification records * Used to decide whether to delete old notification records for workflow
* for workflow notifications. * notifications.
* *
* If true, notifications and messages are deleted if the * If true, notifications and messages are deleted if the notification is
* notification is successfully sent. Any send failures are * successfully sent. Any send failures are retained
* retained
* *
*/ */
public boolean deleteWorkflowNotifications() { public boolean deleteWorkflowNotifications() {
@ -1083,11 +1049,11 @@ public final class CMSConfig extends AbstractConfig {
/** /**
* I'am not sure for what this method is. I found it here when I tried * I'am not sure for what this method is. I found it here when I tried
* figure out how add multiple parts to an ContentType, like ccm-cms-types-contact * figure out how add multiple parts to an ContentType, like
* and the Multipart article do. I think this method should not be here because * ccm-cms-types-contact and the Multipart article do. I think this method
* it is only needed by one specific contenttype. Because of this, I think that * should not be here because it is only needed by one specific contenttype.
* this method and the contact are violating many rules of modern software design. * Because of this, I think that this method and the contact are violating
* Jens Pelzetter, 2009-06-02. * many rules of modern software design. Jens Pelzetter, 2009-06-02.
* *
* @return * @return
*/ */
@ -1105,8 +1071,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Hide the (no longer used) legacy public site link in Workspace * Hide the (no longer used) legacy public site link in Workspace (content
* (content center) section listing, true by default. * center) section listing, true by default.
*/ */
public final boolean getHideLegacyPublicSiteLink() { public final boolean getHideLegacyPublicSiteLink() {
return ((Boolean) get(m_hideLegacyPublicSiteLink)).booleanValue(); return ((Boolean) get(m_hideLegacyPublicSiteLink)).booleanValue();
@ -1132,7 +1098,11 @@ public final class CMSConfig extends AbstractConfig {
return (Boolean) get(m_threadPublishing); return (Boolean) get(m_threadPublishing);
} }
public String[] getAssocCopiers() { public String getPublicationFailureSender() {
return (String[]) get(m_assocCopiers); return (String) get(m_publishingFailureSender);
}
public String getPublicationFailureReceiver() {
return (String) get(m_publishingFailureReceiver);
} }
} }

View File

@ -259,6 +259,17 @@ com.arsdigita.cms.lifecycle.threaded_publishing.purpose = Decides if publishing
com.arsdigita.cms.lifecycle.threaded_publishing.example = false com.arsdigita.cms.lifecycle.threaded_publishing.example = false
com.arsdigita.cms.lifecycle.threaded_com.arsdigita.cms.lifecycle.threaded_publishingpublishing.format = [Boolean] com.arsdigita.cms.lifecycle.threaded_com.arsdigita.cms.lifecycle.threaded_publishingpublishing.format = [Boolean]
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.title = Publishing failed notification sender
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.purpose = Sender e-mail address for notificiation on error while publishing
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.example = webmaster@example.org
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.format = [String]
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.title = Publishing failed notification receiver
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.purpose = email address to send failure notifications to
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.example = webmaster@example.org
cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.format = [String]
com.arsdigita.cms.xx.title= com.arsdigita.cms.xx.title=
com.arsdigita.cms.xx.purpose= com.arsdigita.cms.xx.purpose=
com.arsdigita.cms.xx.example= com.arsdigita.cms.xx.example=

View File

@ -18,17 +18,6 @@
*/ */
package com.arsdigita.cms.ui.lifecycle; package com.arsdigita.cms.ui.lifecycle;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.Iterator;
import java.util.TimeZone;
import java.util.TooManyListenersException;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.BoxPanel;
import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
@ -81,6 +70,14 @@ import com.arsdigita.workflow.simple.Engine;
import com.arsdigita.workflow.simple.TaskException; import com.arsdigita.workflow.simple.TaskException;
import com.arsdigita.workflow.simple.Workflow; import com.arsdigita.workflow.simple.Workflow;
import com.arsdigita.workflow.simple.WorkflowTemplate; import com.arsdigita.workflow.simple.WorkflowTemplate;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.Iterator;
import java.util.TimeZone;
import java.util.TooManyListenersException;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
/** /**
* <p>A form to select and apply a lifecycle to a content item.</p> * <p>A form to select and apply a lifecycle to a content item.</p>

View File

@ -1,6 +1,5 @@
package com.arsdigita.cms.contenttypes; package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.AssociationCopier;
import com.arsdigita.cms.ContentBundle; import com.arsdigita.cms.ContentBundle;
import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.CustomCopy; import com.arsdigita.cms.CustomCopy;