diff --git a/ccm-cms/src/com/arsdigita/cms/CMSConfig.java b/ccm-cms/src/com/arsdigita/cms/CMSConfig.java index 49d0613e8..b3210e151 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/CMSConfig.java @@ -112,19 +112,19 @@ public final class CMSConfig extends AbstractConfig { return s_config; } - /** * Storage (map) for method getAssetStepsToSkip(ContentType type) to store * mapping of steps that are deemed irrelevant for the passid in type. */ private static Map s_skipAssetSteps = null; - /** * Item category add form speciofies Subclass of ItemCategoryForm * to use for the assign categories step. * Used in c.ad.cms.ui.authoring.ItemCategoryStep */ - private final Parameter m_categoryAuthoringAddForm = new SpecificClassParameter("com.arsdigita.cms.category_authoring_add_form", + private final Parameter m_categoryAuthoringAddForm = + new SpecificClassParameter( + "com.arsdigita.cms.category_authoring_add_form", Parameter.REQUIRED, ItemCategoryForm.class, SimpleComponent.class); @@ -132,19 +132,28 @@ public final class CMSConfig extends AbstractConfig { * Path for the default item template. Path is relative to the * Template Root path. */ - private final Parameter m_defaultItemTemplatePath = new StringParameter("com.arsdigita.cms.default_item_template_path", - Parameter.REQUIRED, "/default/item.jsp"); + private final Parameter m_defaultItemTemplatePath = + new StringParameter( + "com.arsdigita.cms.default_item_template_path", + Parameter.REQUIRED, + "/default/item.jsp"); /** * Path for the default folder template. Path is relative to the * Template Root path. */ - private final Parameter m_defaultFolderTemplatePath = new StringParameter("com.arsdigita.cms.default_folder_template_path", - Parameter.REQUIRED, "/default/folder.jsp"); + private final Parameter m_defaultFolderTemplatePath = + new StringParameter( + "com.arsdigita.cms.default_folder_template_path", + Parameter.REQUIRED, + "/default/folder.jsp"); /** * Path for the default template folder. Path is relative to webapp root */ - private final Parameter m_templateRootPath = new StringParameter("com.arsdigita.cms.template_root_path", - Parameter.REQUIRED, "/packages/content-section/templates"); + private final Parameter m_templateRootPath = + new StringParameter( + "com.arsdigita.cms.template_root_path", + Parameter.REQUIRED, + "/packages/content-section/templates"); // URL resource: protocol handler removal: START // remove: // try { @@ -160,7 +169,9 @@ public final class CMSConfig extends AbstractConfig { * Item Adapters File, path to an XML resource containing adapter * specifications. Path is relative to webapp root. */ - private final Parameter m_itemAdapters = new ResourceParameter("com.arsdigita.cms.item_adapters", + private final Parameter m_itemAdapters = + new ResourceParameter( + "com.arsdigita.cms.item_adapters", Parameter.REQUIRED, "/WEB-INF/resources/cms-item-adapters.xml"); // URL resource: protocol handler removal: END @@ -168,18 +179,21 @@ public final class CMSConfig extends AbstractConfig { * Use streamlined content creation: upon item creation, * automatically open authoring steps and forward to the next step */ - private final Parameter m_useStreamlinedCreation = new BooleanParameter("com.arsdigita.cms.use_streamlined_creation", - Parameter.REQUIRED, new Boolean(true)); + private final Parameter m_useStreamlinedCreation = new BooleanParameter( + "com.arsdigita.cms.use_streamlined_creation", + Parameter.REQUIRED, + new Boolean( + true)); /** * DHTML Editor Configuration for use in CMS module, lists the * config object name and Javascript source location for its definition. */ - private final Parameter m_dhtmlEditorConfig = - new DHTMLEditorConfigParameter( - "com.arsdigita.cms.dhtml_editor_config", - Parameter.REQUIRED, - new DHTMLEditor.Config("XinhaConfig", - "/assets/xinha/CCMcmsXinhaConfig.js")); + private final Parameter m_dhtmlEditorConfig = + new DHTMLEditorConfigParameter( + "com.arsdigita.cms.dhtml_editor_config", + Parameter.REQUIRED, + new DHTMLEditor.Config("XinhaConfig", + "/assets/xinha/CCMcmsXinhaConfig.js")); // previous parameter definition: // > DHTMLEditor.Config.STANDARD); < // didn't work because of broken unmarshalling (cf. similiar problem @@ -202,108 +216,162 @@ public final class CMSConfig extends AbstractConfig { * Prevent undesirable functions from being made available, * eg images should only be added through the cms methods. */ - private final Parameter m_dhtmlEditorHiddenButtons = new StringArrayParameter("com.arsdigita.cms.dhtml_editor_hidden_buttons", + private final Parameter m_dhtmlEditorHiddenButtons = + new StringArrayParameter( + "com.arsdigita.cms.dhtml_editor_hidden_buttons", Parameter.OPTIONAL, null); /** * Hide section admin tabs from users without administrative rights. */ - private final Parameter m_hideAdminTabs = new BooleanParameter("com.arsdigita.cms.hide_admin_tabs", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_hideAdminTabs = new BooleanParameter( + "com.arsdigita.cms.hide_admin_tabs", + Parameter.REQUIRED, + new Boolean( + false)); /** * Hide Folder Index Checkbox from folder view */ - private final Parameter m_hideFolderIndexCheckbox = new BooleanParameter("com.arsdigita.cms.hide_folder_index_checkbox", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_hideFolderIndexCheckbox = new BooleanParameter( + "com.arsdigita.cms.hide_folder_index_checkbox", + Parameter.REQUIRED, + new Boolean( + false)); /** * Hide launch date parameter on all forms and displays where it's used. */ - private final Parameter m_hideLaunchDate = new BooleanParameter("com.arsdigita.cms.hide_launch_date", - Parameter.REQUIRED, new Boolean(true)); + private final Parameter m_hideLaunchDate = new BooleanParameter( + "com.arsdigita.cms.hide_launch_date", + Parameter.REQUIRED, + new Boolean( + true)); /** * Require the launch date parameter to be set by the content author. */ - private final Parameter m_requireLaunchDate = new BooleanParameter("com.arsdigita.cms.require_launch_date", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_requireLaunchDate = new BooleanParameter( + "com.arsdigita.cms.require_launch_date", + Parameter.REQUIRED, + new Boolean( + false)); /** * Hide the templates tab on the item admin page. */ - private final Parameter m_hideTemplatesTab = new BooleanParameter("com.arsdigita.cms.hide_templates_tab", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_hideTemplatesTab = new BooleanParameter( + "com.arsdigita.cms.hide_templates_tab", + Parameter.REQUIRED, + new Boolean( + false)); /** * Hide the upload file link in the editing of a text asset. */ - private final Parameter m_hideTextAssetUploadFile = new BooleanParameter("com.arsdigita.cms.hide_text_asset_upload_file", + private final Parameter m_hideTextAssetUploadFile = new BooleanParameter( + "com.arsdigita.cms.hide_text_asset_upload_file", Parameter.REQUIRED, - new Boolean(false)); + new Boolean( + false)); /** * Hide timezone labels (if, for example, all users will be in the * same timezone and such information would be unnecessary) */ - private final Parameter m_hideTimezone = new BooleanParameter("com.arsdigita.cms.hide_timezone", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_hideTimezone = new BooleanParameter( + "com.arsdigita.cms.hide_timezone", + Parameter.REQUIRED, + new Boolean( + false)); /** * Hide User Defined Content Types UI */ - private final Parameter m_hideUDCTUI = new BooleanParameter("com.arsdigita.cms.hide_udct_ui", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_hideUDCTUI = new BooleanParameter( + "com.arsdigita.cms.hide_udct_ui", + Parameter.REQUIRED, + new Boolean( + false)); /** * Specifies the name of the class to use as a PublishLifecycleListener */ - private final Parameter m_publishLifecycleListenerClass = new StringParameter("com.arsdigita.cms.publish_lifecycle_listener_class", - Parameter.OPTIONAL, PublishLifecycleListener.class.getName()); + private final Parameter m_publishLifecycleListenerClass = + new StringParameter( + "com.arsdigita.cms.publish_lifecycle_listener_class", + Parameter.OPTIONAL, + PublishLifecycleListener.class.getName()); /** * Wether the Wysiwyg editor should clear the text of MSWord tags, * everytime the user clicks on 'Save' */ - private final Parameter m_saveTextCleansWordTags = new BooleanParameter("com.arsdigita.cms.save_text_cleans_word_tags", - Parameter.OPTIONAL, new Boolean(false)); + private final Parameter m_saveTextCleansWordTags = new BooleanParameter( + "com.arsdigita.cms.save_text_cleans_word_tags", + Parameter.OPTIONAL, + new Boolean( + false)); /** * Hide Additional Resource Fields on RelatedLinkPropertyForm */ - private final Parameter m_hideAdditionalResourceFields = new BooleanParameter("com.arsdigita.cms.contentassets.ui." + private final Parameter m_hideAdditionalResourceFields = + new BooleanParameter( + "com.arsdigita.cms.contentassets.ui." + "RelatedLinkPropertyForm.hideAdditionalResourceFields", - Parameter.REQUIRED, new Boolean(false)); + Parameter.REQUIRED, + new Boolean(false)); /** * Get the search indexing not to process FileAssets, * eg to avoid PDF slowdowns */ - private final Parameter m_disableFileAssetExtraction = new BooleanParameter("com.arsdigita.cms.search.disableFileAssetExtraction", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_disableFileAssetExtraction = new BooleanParameter( + "com.arsdigita.cms.search.disableFileAssetExtraction", + Parameter.REQUIRED, + new Boolean( + false)); /** * Whether an item's workflow should be deleted, once the item * has been (re)published */ - private final Parameter m_deleteWorkflowAfterPublication = new BooleanParameter("com.arsdigita.cms.delete_workflow_after_publication", - Parameter.REQUIRED, new Boolean(true)); + private final Parameter m_deleteWorkflowAfterPublication = + new BooleanParameter( + "com.arsdigita.cms.delete_workflow_after_publication", + Parameter.REQUIRED, + new Boolean(true)); /** * Defines the number of days ahead that are covered in the * 'Soon Expired' tab */ - private final Parameter m_soonExpiredTimespanDays = new IntegerParameter("com.arsdigita.cms.soon_expired_timespan_days", - Parameter.REQUIRED, new Integer(14)); + private final Parameter m_soonExpiredTimespanDays = new IntegerParameter( + "com.arsdigita.cms.soon_expired_timespan_days", + Parameter.REQUIRED, + new Integer( + 14)); /** * Defines the number of months ahead that are covered in the * 'Soon Expired' tab */ - private final Parameter m_soonExpiredTimespanMonths = new IntegerParameter("com.arsdigita.cms.soon_expired_timespan_months", - Parameter.REQUIRED, new Integer(1)); + private final Parameter m_soonExpiredTimespanMonths = new IntegerParameter( + "com.arsdigita.cms.soon_expired_timespan_months", + Parameter.REQUIRED, + new Integer( + 1)); /** * Does a redirect to the unpublished item generate not found error? */ - private final Parameter m_unpublishedNotFound = new BooleanParameter("com.arsdigita.cms.unpublished_not_found", - Parameter.REQUIRED, new Boolean(true)); + private final Parameter m_unpublishedNotFound = new BooleanParameter( + "com.arsdigita.cms.unpublished_not_found", + Parameter.REQUIRED, + new Boolean( + true)); /** * Links created through browse interfaces should only be within the * same subsite */ - private final Parameter m_linksOnlyInSameSubsite = new BooleanParameter("com.arsdigita.cms.browse_links_in_same_subsite_only", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_linksOnlyInSameSubsite = new BooleanParameter( + "com.arsdigita.cms.browse_links_in_same_subsite_only", + Parameter.REQUIRED, + new Boolean( + false)); /** * Item category step extension hook: Subclass of ItemCategoryExtension * which adds extension actions for the category authoring step */ - private final Parameter m_categoryAuthoringExtension = new SpecificClassParameter("com.arsdigita.cms.category_authoring_extension", + private final Parameter m_categoryAuthoringExtension = + new SpecificClassParameter( + "com.arsdigita.cms.category_authoring_extension", Parameter.REQUIRED, ItemCategoryExtension.class, ItemCategoryExtension.class); @@ -311,19 +379,25 @@ public final class CMSConfig extends AbstractConfig { * Link available to reset lifecycle on republish. If false don't display * the link otherwise display. */ - private final Parameter m_hideResetLifecycleLink = new BooleanParameter("com.arsdigita.cms.hide_reset_lifecycle_link", - Parameter.OPTIONAL, new Boolean(true)); + private final Parameter m_hideResetLifecycleLink = new BooleanParameter( + "com.arsdigita.cms.hide_reset_lifecycle_link", + Parameter.OPTIONAL, + new Boolean( + true)); /** * Whether to include INPATH operators to contains clause in intermedia search */ - private final Parameter m_scoreTitleAndKeywords = new BooleanParameter("com.arsdigita.cms.search.score_title_and_keywords", + private final Parameter m_scoreTitleAndKeywords = + new BooleanParameter( + "com.arsdigita.cms.search.score_title_and_keywords", Parameter.OPTIONAL, Boolean.FALSE); /** * Title Weight, the relative weight given to title element within * cms:item when ranking search results (only used by interMedia) */ - private final Parameter m_titleWeight = new IntegerParameter("com.arsdigita.cms.search.intermedia.title_weight", + private final Parameter m_titleWeight = new IntegerParameter( + "com.arsdigita.cms.search.intermedia.title_weight", Parameter.OPTIONAL, new Integer(1)); /** @@ -331,13 +405,17 @@ public final class CMSConfig extends AbstractConfig { * within dublinCore element within cms:item element when ranking * search results (only used by interMedia) */ - private final Parameter m_keywordWeight = new IntegerParameter("com.arsdigita.cms.search.intermedia.keyword_weight", + private final Parameter m_keywordWeight = + new IntegerParameter( + "com.arsdigita.cms.search.intermedia.keyword_weight", Parameter.OPTIONAL, new Integer(1)); /** * Limit the item search to current content section */ - private final Parameter m_limitToContentSection = new BooleanParameter("com.arsdigita.cms.search.limitToContentSection", + private final Parameter m_limitToContentSection = + new BooleanParameter( + "com.arsdigita.cms.search.limitToContentSection", Parameter.OPTIONAL, Boolean.TRUE); /** @@ -349,40 +427,55 @@ public final class CMSConfig extends AbstractConfig { * Second string is the name of the bebop step component * eg com.arsdigita.cms.contenttypes.ui.ImageStep */ - private final Parameter m_skipAssetSteps = new StringArrayParameter("com.arsdigita.cms.skip_asset_steps", + private final Parameter m_skipAssetSteps = new StringArrayParameter( + "com.arsdigita.cms.skip_asset_steps", Parameter.OPTIONAL, null); /** * Mandatory Descriptions Content types may refer to this to decide * whether to validate against empty descriptions */ - private final Parameter m_mandatoryDescriptions = new BooleanParameter("com.arsdigita.cms.mandatory_descriptions", - Parameter.OPTIONAL, new Boolean(false)); + private final Parameter m_mandatoryDescriptions = new BooleanParameter( + "com.arsdigita.cms.mandatory_descriptions", + Parameter.OPTIONAL, + new Boolean( + false)); /** * Delete Finished Lifecycles. Decide whether lifecycles and their phases * should be deleted from the system when finished. */ - private final Parameter m_deleteLifecycleWhenComplete = new BooleanParameter("com.arsdigita.cms.delete_lifecycle_when_complete", - Parameter.OPTIONAL, new Boolean(false)); + private final Parameter m_deleteLifecycleWhenComplete = + new BooleanParameter( + "com.arsdigita.cms.delete_lifecycle_when_complete", + Parameter.OPTIONAL, + new Boolean(false)); /** * Contacts for content items. Allows you to add a Contact authoring step * to all items */ - private final Parameter m_hasContactsAuthoringStep = new BooleanParameter("com.arsdigita.cms.has_contacts_authoring_step", - Parameter.REQUIRED, new Boolean(false)); + private final Parameter m_hasContactsAuthoringStep = new BooleanParameter( + "com.arsdigita.cms.has_contacts_authoring_step", + Parameter.REQUIRED, + new Boolean( + false)); /** * Ordering for nodes in assign category tree. Decide whether entries * should be ordered alphabetically or according to sort key * (maintained in category admin tab in content centre) * SortKey|Alphabetical is initialized in constructor! See below. */ - private final Parameter m_categoryTreeOrdering = new EnumerationParameter("com.arsdigita.cms.category_tree_order", - Parameter.OPTIONAL, Category.SORT_KEY); + private final Parameter m_categoryTreeOrdering = + new EnumerationParameter( + "com.arsdigita.cms.category_tree_order", + Parameter.OPTIONAL, + Category.SORT_KEY); /** * Allow content creation in section listing. Allows you to turn off * the ability to create content in the section listing */ - private final Parameter m_allowContentCreateInSectionListing = new BooleanParameter("com.arsdigita.cms.allow_content_create_in_section_listing", + private final Parameter m_allowContentCreateInSectionListing = + new BooleanParameter( + "com.arsdigita.cms.allow_content_create_in_section_listing", Parameter.REQUIRED, new Boolean(true)); // /////////////////////////////////////////// @@ -392,26 +485,38 @@ public final class CMSConfig extends AbstractConfig { * Delete Sent Workflow Notifications. Decide whether successfully sent * notifications and messages should be deleted from the system */ - private final Parameter m_deleteWorkflowNotificationsWhenSent = new BooleanParameter("com.arsdigita.cms.delete_workflow_notification_when_sent", - Parameter.OPTIONAL, new Boolean(false)); + private final Parameter m_deleteWorkflowNotificationsWhenSent = + new BooleanParameter( + "com.arsdigita.cms.delete_workflow_notification_when_sent", + Parameter.OPTIONAL, + new Boolean(false)); /** * Decide whether successfully sent notifications and messages * should be deleted from the system */ - private final Parameter m_deleteExpiryNotificationsWhenSent = new BooleanParameter("com.arsdigita.cms.delete_expiry_notification_when_sent", - Parameter.OPTIONAL, new Boolean(false)); + private final Parameter m_deleteExpiryNotificationsWhenSent = + new BooleanParameter( + "com.arsdigita.cms.delete_expiry_notification_when_sent", + Parameter.OPTIONAL, + new Boolean(false)); /** * Amount of time (in hours) before the expiration of a content item * that users in the Alert Recipient role are alerted via email */ - private final Parameter m_defaultNotificationTime = new IntegerParameter("com.arsdigita.cms.default_notification_time", - Parameter.REQUIRED, new Integer(0)); + private final Parameter m_defaultNotificationTime = new IntegerParameter( + "com.arsdigita.cms.default_notification_time", + Parameter.REQUIRED, + new Integer( + 0)); /** * Wether a content item's author should be notified * by the item's LifecycleListener; defaults to true */ - private final Parameter m_notifyAuthorOnLifecycle = new BooleanParameter("com.arsdigita.cms.notify_author_on_lifecycle", - Parameter.OPTIONAL, new Boolean(true)); + private final Parameter m_notifyAuthorOnLifecycle = new BooleanParameter( + "com.arsdigita.cms.notify_author_on_lifecycle", + Parameter.OPTIONAL, + new Boolean( + true)); // //////////////////////////////////////////////////// // Content Center (Workspace) config related parameters // //////////////////////////////////////////////////// @@ -426,8 +531,10 @@ public final class CMSConfig extends AbstractConfig { // /////////////////////////////////////////// // Content Section config related parameters // /////////////////////////////////////////// - private final Parameter m_defaultSection = new StringParameter("com.arsdigita.cms.default_content_section", - Parameter.REQUIRED, "content"); + private final Parameter m_defaultSection = new StringParameter( + "com.arsdigita.cms.default_content_section", + Parameter.REQUIRED, + "content"); // /////////////////////////////////////////// // Content Section creation parameters // XXX these are probably temporary parameters, as the @@ -435,32 +542,49 @@ public final class CMSConfig extends AbstractConfig { // to SectionInitializer. However, it still may be useful to // keep these for the default values. // /////////////////////////////////////////// - private final Parameter m_defaultItemResolverClass = new SpecificClassParameter - ("com.arsdigita.cms.default_item_resolver_class", - Parameter.REQUIRED, - MultilingualItemResolver.class, - ItemResolver.class); - private final Parameter m_defaultTemplateResolverClass = new SpecificClassParameter("com.arsdigita.cms.default_template_resolver_class", + private final Parameter m_defaultItemResolverClass = + new SpecificClassParameter( + "com.arsdigita.cms.default_item_resolver_class", + Parameter.REQUIRED, + MultilingualItemResolver.class, + ItemResolver.class); + private final Parameter m_defaultTemplateResolverClass = + new SpecificClassParameter( + "com.arsdigita.cms.default_template_resolver_class", Parameter.REQUIRED, DefaultTemplateResolver.class, TemplateResolver.class); ///////////////////////////////////////////// // ItemSearchWidget ///////////////////////////////////////////// - private final Parameter m_itemSearchDefaultTab = new StringParameter("com.arsdigita.cms.item_search.default_tab", + private final Parameter m_itemSearchDefaultTab = + new StringParameter( + "com.arsdigita.cms.item_search.default_tab", Parameter.REQUIRED, "browse"); - ///////////////////////////////////////////// // FolderBrowse ///////////////////////////////////////////// - private final Parameter m_folderBrowseListSize = new IntegerParameter("com.arsdigita.cms.folder_browse_list_size", - Parameter.REQUIRED, 20); - + private final Parameter m_folderBrowseListSize = new IntegerParameter( + "com.arsdigita.cms.folder_browse_list_size", + Parameter.REQUIRED, + 20); ///////////////////////////////////////////// // Folder A to Z show limit: Display a A to Z filter bar when a folder has more than x items ///////////////////////////////////////////// - private final Parameter m_folderAtoZShowLimit = new IntegerParameter("com.arsdigita.cms.folder_atoz_show_limit", - Parameter.REQUIRED, 100); + private final Parameter m_folderAtoZShowLimit = new IntegerParameter( + "com.arsdigita.cms.folder_atoz_show_limit", + Parameter.REQUIRED, + 100); + ////////////////////////////////////////////// + //If set to true the old style ItemLifecycleItemPane (allows you to + //republish and withdraw items) is used. Otherwise the new style form is + //used, which is more secure against wrong clicks. + ////////////////////////////////////////////// + private final Parameter m_useOldStyleItemLifecycleItemPane = + new BooleanParameter( + "com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane", + Parameter.REQUIRED, + false); // /////////////////////////////////////////// // publishToFile package related parameter @@ -478,8 +602,10 @@ public final class CMSConfig extends AbstractConfig { // Initialize m_categoryTreeOrdering parameter here! // 2 valid values at the moment - enumeration used rather than boolean // in case other possible orders are deemed valid - ((EnumerationParameter) m_categoryTreeOrdering).put("SortKey", Category.SORT_KEY); - ((EnumerationParameter) m_categoryTreeOrdering).put("Alphabetical", Category.NAME); + ((EnumerationParameter) m_categoryTreeOrdering).put("SortKey", + Category.SORT_KEY); + ((EnumerationParameter) m_categoryTreeOrdering).put("Alphabetical", + Category.NAME); register(m_templateRootPath); @@ -523,7 +649,7 @@ public final class CMSConfig extends AbstractConfig { register(m_categoryTreeOrdering); register(m_hasContactsAuthoringStep); register(m_hideTextAssetUploadFile); - register(m_allowContentCreateInSectionListing); + register(m_allowContentCreateInSectionListing); // Content Center (Workspace) config related parameters register(m_contentCenterMap); @@ -539,6 +665,8 @@ public final class CMSConfig extends AbstractConfig { register(m_folderBrowseListSize); register(m_folderAtoZShowLimit); + + register(m_useOldStyleItemLifecycleItemPane); // publishToFile package related parameter // Moved to publishToFile.PublishToFileConfig as of version 6.0.2 @@ -720,8 +848,8 @@ public final class CMSConfig extends AbstractConfig { private class DHTMLEditorConfigParameter extends StringParameter { public DHTMLEditorConfigParameter(final String name, - final int multiplicity, - final Object defaultObj) { + final int multiplicity, + final Object defaultObj) { super(name, multiplicity, defaultObj); } @@ -739,7 +867,8 @@ public final class CMSConfig extends AbstractConfig { protected static HashMap extraXMLGenerators = new HashMap(); /** Add one ExtraXMLGenerator to the list. */ - public static void registerExtraXMLGenerator(String type, ExtraXMLGenerator gen) { + public static void registerExtraXMLGenerator(String type, + ExtraXMLGenerator gen) { List gens = (List) extraXMLGenerators.get(type); if (gens == null) { gens = new LinkedList(); @@ -807,7 +936,8 @@ public final class CMSConfig extends AbstractConfig { * @return */ public Collection getAssetStepsToSkip(ContentType type) { - s_log.debug("getting asset steps to skip for type " + type.getClassName()); + s_log.debug("getting asset steps to skip for type " + + type.getClassName()); if (s_skipAssetSteps == null) { // populate static map once based on config parameter value s_log.debug("loading skipsteps"); @@ -819,8 +949,10 @@ public final class CMSConfig extends AbstractConfig { for (int i = 0; i < skipSteps.length; i++) { String[] pair = StringUtils.split(skipSteps[i], ':'); // 1st string is name of content type, 2nd string is name of asset step - s_log.debug("parameter read - type = " + pair[0] + " - step = " + pair[1]); - Collection typeSteps = (Collection) s_skipAssetSteps.get(pair[0]); + s_log.debug("parameter read - type = " + pair[0] + + " - step = " + pair[1]); + Collection typeSteps = + (Collection) s_skipAssetSteps.get(pair[0]); if (typeSteps == null) { typeSteps = new HashSet(); s_skipAssetSteps.put(pair[0], typeSteps); @@ -832,7 +964,8 @@ public final class CMSConfig extends AbstractConfig { } } - Collection skipSteps = (Collection) s_skipAssetSteps.get(type.getClassName()); + Collection skipSteps = (Collection) s_skipAssetSteps.get(type. + getClassName()); if (skipSteps == null) { s_log.debug("no steps to skip"); skipSteps = new HashSet(); @@ -884,7 +1017,8 @@ public final class CMSConfig extends AbstractConfig { * */ public boolean deleteWorkflowNotifications() { - return ((Boolean) get(m_deleteWorkflowNotificationsWhenSent)).booleanValue(); + return ((Boolean) get(m_deleteWorkflowNotificationsWhenSent)). + booleanValue(); } public String getCategoryTreeOrder() { @@ -910,7 +1044,8 @@ public final class CMSConfig extends AbstractConfig { } public final boolean getAllowContentCreateInSectionListing() { - return ((Boolean) get(m_allowContentCreateInSectionListing)).booleanValue(); + return ((Boolean) get(m_allowContentCreateInSectionListing)). + booleanValue(); } public String getItemSearchDefaultTab() { @@ -924,4 +1059,8 @@ public final class CMSConfig extends AbstractConfig { public Integer getFolderAtoZShowLimit() { return (Integer) get(m_folderAtoZShowLimit); } + + public Boolean getUseOldStyleItemLifecycleItemPane() { + return (Boolean) get(m_useOldStyleItemLifecycleItemPane); + } } diff --git a/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties b/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties index 99befca0c..c8da5c18f 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties @@ -248,6 +248,11 @@ com.arsdigita.cms.folder_atoz_show_limit.purpose=Show a a to z filter bar when a com.arsdigita.cms.folder_atoz_show_limit.example=100 com.arsdigita.cms.folder_atoz_show_limit.format=[integer] +com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane.title = Use old style ItemLifecycleItemPane +com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane.purpose = If set to true the old style ItemLifecycleItemPane will be used (with the two links), otherwise the new style ItemLifecycleItemPane if used (with a selectbox for the action and a submit button) +com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane.example = false +com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane.format = [Boolean] + com.arsdigita.cms.xx.title= com.arsdigita.cms.xx.purpose= com.arsdigita.cms.xx.example= diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index 39532efd8..a60fb72fb 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -1085,3 +1085,5 @@ cms.contenttypes.ui.contact.alias.select.add=Select former name cms.contenttypes.person.alias.select.wrong_type=No person selected cms.contenttypes.person.alias.select.same_as_person=Selected person is the same as the current person. Alias and person can't be identical. cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant. +cms.ui.item.lifecycle.do=Execute +cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item. diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index a9bba9a7c..ae2c5f567 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -1076,3 +1076,5 @@ cms.contenttypes.ui.contact.alias.select.add=Fr\u00fcheren Namen ausw\u00e4hlen cms.contenttypes.person.alias.select.wrong_type=Kein Personendatensatz ausgew\u00e4hlt cms.contenttypes.person.alias.select.same_as_person=Der ausgew\u00e4hlte Datensatz ist der gleiche Datensatz wie der aktuelle Datensatz. Alias und Person k\u00f6nnen nicht identisch sein. cms.contenttypes.person.alias.select.no_suitable_language_variant=Das ausgew\u00e4hlte Item hat keine passende Sprachvariante. +cms.ui.item.lifecycle.do=Ausf\u00fchren +cms.ui.item.lifecycle.do.not_authorized=Sie sind nicht berechtigt, dieses Item zu publizieren. diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties index 73fb8f8d7..6a99dd290 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties @@ -24,3 +24,5 @@ cms.contenttypes.ui.contact.alias.select.add= cms.contenttypes.person.alias.select.wrong_type= cms.contenttypes.person.alias.select.same_as_person= cms.contenttypes.person.alias.select.no_suitable_language_variant= +cms.ui.item.lifecycle.do= +cms.ui.item.lifecycle.do.not_authorized= diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties index 64de5c8a5..01b0e3b6f 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties @@ -555,3 +555,5 @@ cms.contenttypes.ui.contact.alias.select.add= cms.contenttypes.person.alias.select.wrong_type= cms.contenttypes.person.alias.select.same_as_person= cms.contenttypes.person.alias.select.no_suitable_language_variant= +cms.ui.item.lifecycle.do= +cms.ui.item.lifecycle.do.not_authorized= diff --git a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java index 7526ea85f..52bc2ed82 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java @@ -18,12 +18,17 @@ */ package com.arsdigita.cms.ui.lifecycle; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.event.FormSectionEvent; import java.text.DateFormat; import org.apache.log4j.Logger; import com.arsdigita.bebop.ActionLink; +import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.RequestLocal; @@ -31,6 +36,13 @@ import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.Table; import com.arsdigita.bebop.event.ActionEvent; import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.form.Select; +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.form.Submit; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.SecurityManager; @@ -64,9 +76,8 @@ import com.arsdigita.xml.Element; */ class ItemLifecycleItemPane extends BaseItemPane { - private static final Logger s_log = Logger.getLogger - (ItemLifecycleItemPane.class); - + private static final Logger s_log = Logger.getLogger( + ItemLifecycleItemPane.class); private final ContentItemRequestLocal m_item; private final LifecycleRequestLocal m_lifecycle; private final SimpleContainer m_detailPane; @@ -85,45 +96,51 @@ class ItemLifecycleItemPane extends BaseItemPane { } private class SummarySection extends Section { + public SummarySection() { setHeading(new Label(gz("cms.ui.lifecycle.details"))); final ActionGroup group = new ActionGroup(); setBody(group); - group.setSubject(new Properties()); - group.addAction(new UnpublishLink()); - group.addAction(new RepublishLink()); - if (!ContentSection.getConfig().hideResetLifecycleLink()){ - group.addAction(new RepublishAndResetLink()); + if (CMS.getConfig().getUseOldStyleItemLifecycleItemPane()) { + group.setSubject(new Properties()); + group.addAction(new UnpublishLink()); + group.addAction(new RepublishLink()); + if (!ContentSection.getConfig().hideResetLifecycleLink()) { + group.addAction(new RepublishAndResetLink()); + } + } else { + group.addAction(new ActionForm()); } + } private class Properties extends PropertyList { + protected final java.util.List properties(final PageState state) { final java.util.List props = super.properties(state); final Lifecycle cycle = m_lifecycle.getLifecycle(state); - final DateFormat format = DateFormat.getDateTimeInstance - (DateFormat.FULL, - ContentSection.getConfig().getHideTimezone() ? DateFormat.SHORT : DateFormat.FULL); + final DateFormat format = + DateFormat.getDateTimeInstance(DateFormat.FULL, + ContentSection. + getConfig().getHideTimezone() ? DateFormat.SHORT + : DateFormat.FULL); props.add(new Property(gz("cms.ui.name"), cycle.getLabel())); - props.add(new Property - (gz("cms.ui.item.lifecycle.start_date"), - format.format(cycle.getStartDate()))); + props.add(new Property(gz("cms.ui.item.lifecycle.start_date"), + format.format(cycle.getStartDate()))); final java.util.Date endDate = cycle.getEndDate(); if (endDate == null) { - props.add(new Property - (gz("cms.ui.item.lifecycle.end_date"), - lz("cms.ui.none"))); + props.add(new Property(gz("cms.ui.item.lifecycle.end_date"), + lz("cms.ui.none"))); } else { - props.add(new Property - (gz("cms.ui.item.lifecycle.end_date"), - format.format(endDate))); + props.add(new Property(gz("cms.ui.item.lifecycle.end_date"), + format.format(endDate))); } return props; @@ -132,9 +149,12 @@ class ItemLifecycleItemPane extends BaseItemPane { } private class PublishLink extends ActionLink { + private RequestLocal m_canPublish = new RequestLocal(); - PublishLink(Component c) { super(c); } + PublishLink(Component c) { + super(c); + } public void generateXML(PageState ps, Element parent) { Boolean canPublish = (Boolean) m_canPublish.get(ps); @@ -155,18 +175,19 @@ class ItemLifecycleItemPane extends BaseItemPane { if (canPublish.booleanValue()) { if (s_log.isDebugEnabled()) { ContentItem item = m_item.getContentItem(ps); - s_log.debug ("User can publish " + item.getOID()); + s_log.debug("User can publish " + item.getOID()); } super.generateXML(ps, parent); } else if (s_log.isDebugEnabled()) { ContentItem item = m_item.getContentItem(ps); - s_log.debug ("User cannot publish " + item.getOID()); + s_log.debug("User cannot publish " + item.getOID()); } } } private class UnpublishLink extends PublishLink { + UnpublishLink() { super(new Label(gz("cms.ui.item.lifecycle.unpublish"))); @@ -174,15 +195,16 @@ class ItemLifecycleItemPane extends BaseItemPane { } private class Listener implements ActionListener { + public final void actionPerformed(final ActionEvent e) { final PageState state = e.getPageState(); final ContentItem item = m_item.getContentItem(state); item.unpublish(); - final String target = URL.getDispatcherPath() + - ContentItemPage.getItemURL(item, - ContentItemPage.AUTHORING_TAB); + final String target = URL.getDispatcherPath() + ContentItemPage. + getItemURL(item, + ContentItemPage.AUTHORING_TAB); throw new RedirectSignal(target, true); } @@ -193,14 +215,15 @@ class ItemLifecycleItemPane extends BaseItemPane { item.republish(reset); Workflow workflow = Workflow.getObjectWorkflow(item); try { - ItemLifecycleSelectForm.finish(workflow, item, Web - .getContext().getUser()); + ItemLifecycleSelectForm.finish(workflow, item, Web.getContext(). + getUser()); } catch (TaskException te) { throw new UncheckedWrapperException(te); } } private class RepublishLink extends PublishLink { + RepublishLink() { super(new Label(gz("cms.ui.item.lifecycle.republish"))); @@ -208,20 +231,23 @@ class ItemLifecycleItemPane extends BaseItemPane { } private class Listener implements ActionListener { + public final void actionPerformed(final ActionEvent e) { final PageState state = e.getPageState(); final ContentItem item = m_item.getContentItem(state); republish(item, false); if (ContentSection.getConfig().getUseStreamlinedCreation()) { - throw new RedirectSignal(URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), true); + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); } } } } private class RepublishAndResetLink extends PublishLink { + RepublishAndResetLink() { super(new Label(gz("cms.ui.item.lifecycle.republish_and_reset"))); @@ -233,20 +259,23 @@ class ItemLifecycleItemPane extends BaseItemPane { } private class Listener implements ActionListener { + public final void actionPerformed(final ActionEvent e) { final PageState state = e.getPageState(); final ContentItem item = m_item.getContentItem(state); republish(item, true); if (ContentSection.getConfig().getUseStreamlinedCreation()) { - throw new RedirectSignal(URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), true); + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); } } } } private class PhaseSection extends Section { + PhaseSection() { super(gz("cms.ui.lifecycle.phases")); @@ -258,14 +287,108 @@ class ItemLifecycleItemPane extends BaseItemPane { } private class PhaseTable extends Table { + PhaseTable() { super(new ItemPhaseTableModelBuilder(m_lifecycle), - new String[] { - lz("cms.ui.name"), - lz("cms.ui.description"), - lz("cms.ui.item.lifecycle.start_date"), - lz("cms.ui.item.lifecycle.end_date") - }); + new String[]{ + lz("cms.ui.name"), + lz("cms.ui.description"), + lz("cms.ui.item.lifecycle.start_date"), + lz("cms.ui.item.lifecycle.end_date") + }); + } + } + + private class ActionForm + extends Form + implements FormProcessListener, + FormInitListener { + + private static final String LIFECYCLE_ACTION = + "itemLifecycleItemPaneActionSelect"; + private static final String REPUBLISH = "republish"; + private static final String UNPUBLISH = "unpublish"; + private static final String REPUBLISH_AND_RESET = "republishAndReset"; + private final Submit submit; + private final Label notAuthorized; + + public ActionForm() { + super("itemLifecycleItemPaneActionForm"); + + final BoxPanel actionPanel = new BoxPanel(BoxPanel.HORIZONTAL); + final SingleSelect actionSelect = new SingleSelect( + LIFECYCLE_ACTION); + + actionSelect.addOption(new Option(REPUBLISH, (String) gz( + "cms.ui.item.lifecycle.republish").localize())); + if (!ContentSection.getConfig().hideResetLifecycleLink()) { + actionSelect.addOption(new Option(REPUBLISH_AND_RESET, + (String) gz( + "cms.ui.item.lifecycle.republish_and_reset"). + localize())); + } + actionSelect.addOption(new Option(UNPUBLISH, (String) gz( + "cms.ui.item.lifecycle.unpublish").localize())); + + submit = new Submit(gz("cms.ui.item.lifecycle.do")); + notAuthorized = new Label(gz( + "cms.ui.item.lifecycle.do.not_authorized")); + + actionPanel.add(actionSelect); + actionPanel.add(submit); + actionPanel.add(notAuthorized); + add(actionPanel); + + addInitListener(this); + addProcessListener(this); + } + + public void init(FormSectionEvent fse) throws FormProcessException { + final PageState state = fse.getPageState(); + final ContentItem item = m_item.getContentItem(state); + + final SecurityManager sm = Utilities.getSecurityManager(state); + + if (sm.canAccess(state.getRequest(), + SecurityManager.PUBLISH, + item)) { + submit.setVisible(state, true); + notAuthorized.setVisible(state, false); + } else { + submit.setVisible(state, false); + notAuthorized.setVisible(state, true); + } + } + + public void process(final FormSectionEvent fse) throws + FormProcessException { + final PageState state = fse.getPageState(); + final FormData data = fse.getFormData(); + + String selected = (String) data.get(LIFECYCLE_ACTION); + final ContentItem item = m_item.getContentItem(state); + + if (REPUBLISH.equals(selected)) { + republish(item, false); + + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); + } + } else if (REPUBLISH_AND_RESET.equals(selected)) { + republish(item, true); + + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); + } + } else if (UNPUBLISH.equals(selected)) { + item.unpublish(); + } else { + throw new IllegalArgumentException("Illegal selection"); + } } } } diff --git a/ccm-core/src/log4j.properties b/ccm-core/src/log4j.properties index 585d642c2..42d3a852c 100755 --- a/ccm-core/src/log4j.properties +++ b/ccm-core/src/log4j.properties @@ -35,6 +35,8 @@ log4j.logger.com.arsdigita.web.CCMApplicationContextListener=INFO log4j.logger.com.arsdigita.runtime.CCMResourceManager=INFO log4j.logger.com.arsdigita.runtime.Runtime=INFO +log4j.logger.com.arsdigita.bundle.Loader=INFO + # For seeing progress of the 'ccm load' command log4j.logger.com.arsdigita.packaging.Loader=INFO # log4j.logger.com.arsdigita.core.Loader=INFO