Support for language extensions in ccm-navigation

git-svn-id: https://svn.libreccm.org/ccm/trunk@4912 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2017-08-20 10:57:17 +00:00
parent c3a9839ae5
commit e8775bb21e
7 changed files with 895 additions and 763 deletions

View File

@ -51,8 +51,8 @@ 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 to trap null return values * Accessors of this class may return null. Developers should take care to trap
* in their code. * null return values in their code.
* *
* @see ContentSection#getConfig() * @see ContentSection#getConfig()
* *
@ -71,7 +71,8 @@ public final class CMSConfig extends AbstractConfig {
private static CMSConfig s_config; private static CMSConfig s_config;
/** /**
* Returns the singleton configuration record for the content section environment. * Returns the singleton configuration record for the content section
* environment.
* *
* @return The <code>CMSConfig</code> record; it cannot be null * @return The <code>CMSConfig</code> record; it cannot be null
*/ */
@ -85,36 +86,40 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Storage (map) for method getAssetStepsToSkip(ContentType type) to store mapping of steps that * Storage (map) for method getAssetStepsToSkip(ContentType type) to store
* are deemed irrelevant for the passid in type. * mapping of steps that are deemed irrelevant for the passid in type.
*/ */
private static Map s_skipAssetSteps = null; private static Map s_skipAssetSteps = null;
/** /**
* Item category add form specifies Subclass of ItemCategoryForm to use for the assign * Item category add form specifies Subclass of ItemCategoryForm to use for
* categories step. Used in c.ad.cms.ui.authoring.ItemCategoryStep * the assign categories step. Used in
* c.ad.cms.ui.authoring.ItemCategoryStep
*/ */
private final Parameter m_categoryAuthoringAddForm = new SpecificClassParameter( private final Parameter m_categoryAuthoringAddForm
"com.arsdigita.cms.category_authoring_add_form", = new SpecificClassParameter(
Parameter.REQUIRED, "com.arsdigita.cms.category_authoring_add_form",
ItemCategoryForm.class, Parameter.REQUIRED,
SimpleComponent.class); ItemCategoryForm.class,
SimpleComponent.class);
/** /**
* Path for the default item template. Path is relative to the Template Root path. * Path for the default item template. Path is relative to the Template Root
* path.
*/ */
private final Parameter m_defaultItemTemplatePath = new StringParameter( private final Parameter m_defaultItemTemplatePath = new StringParameter(
"com.arsdigita.cms.default_item_template_path", "com.arsdigita.cms.default_item_template_path",
Parameter.REQUIRED, Parameter.REQUIRED,
"/default/item.jsp"); "/default/item.jsp");
/** /**
* Path for the default folder template. Path is relative to the Template Root path. * Path for the default folder template. Path is relative to the Template
* Root path.
*/ */
private final Parameter m_defaultFolderTemplatePath = new StringParameter( private final Parameter m_defaultFolderTemplatePath = new StringParameter(
"com.arsdigita.cms.default_folder_template_path", "com.arsdigita.cms.default_folder_template_path",
Parameter.REQUIRED, Parameter.REQUIRED,
"/default/folder.jsp"); "/default/folder.jsp");
/** /**
* Path or the root folter for template folders. Path is relative to webapp root. Modify with * Path or the root folter for template folders. Path is relative to webapp
* care! Usually modified by developers only! * root. Modify with care! Usually modified by developers only!
*/ */
private final Parameter m_templateRootPath = new StringParameter( private final Parameter m_templateRootPath = new StringParameter(
"com.arsdigita.cms.template_root_path", "com.arsdigita.cms.template_root_path",
@ -134,8 +139,8 @@ public final class CMSConfig extends AbstractConfig {
// } // }
// ADD: // ADD:
/** /**
* Item Adapters File, path to an XML resource containing adapter specifications. Path is * Item Adapters File, path to an XML resource containing adapter
* relative to webapp root. * specifications. Path is relative to webapp root.
*/ */
private final Parameter m_itemAdapters = new ResourceParameter( private final Parameter m_itemAdapters = new ResourceParameter(
"com.arsdigita.cms.item_adapters", "com.arsdigita.cms.item_adapters",
@ -143,22 +148,23 @@ public final class CMSConfig extends AbstractConfig {
"/WEB-INF/resources/cms-item-adapters.xml"); "/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, automatically open authoring steps and * Use streamlined content creation: upon item creation, automatically open
* 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,
Boolean.TRUE); Boolean.TRUE);
/** /**
* DHTML Editor Configuration for use in CMS module, lists the config object name and Javascript * DHTML Editor Configuration for use in CMS module, lists the config object
* source location for its definition. * name and Javascript source location for its definition.
*/ */
private final Parameter m_dhtmlEditorConfig = new DHTMLEditorConfigParameter( private final Parameter m_dhtmlEditorConfig
"com.arsdigita.cms.dhtml_editor_config", = new DHTMLEditorConfigParameter(
Parameter.REQUIRED, "com.arsdigita.cms.dhtml_editor_config",
new DHTMLEditor.Config("Xinha.Config", Parameter.REQUIRED,
"/assets/xinha/CCMcmsXinhaConfig.js")); new DHTMLEditor.Config("Xinha.Config",
"/assets/xinha/CCMcmsXinhaConfig.js"));
// previous parameter definition: // previous parameter definition:
// > DHTMLEditor.Config.STANDARD); < // > DHTMLEditor.Config.STANDARD); <
// didn't work because of broken unmarshalling (cf. similiar problem // didn't work because of broken unmarshalling (cf. similiar problem
@ -170,20 +176,22 @@ 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 Format: [string,string,string] * Defines which plugins to use, e.g.TableOperations,CSS Format:
* [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, eg images should only be added * Prevent undesirable functions from being made available, eg images should
* through the cms methods. * only be added through the cms methods.
*/ */
private final Parameter m_dhtmlEditorHiddenButtons = new StringArrayParameter( private final Parameter m_dhtmlEditorHiddenButtons
"com.arsdigita.cms.dhtml_editor_hidden_buttons", = new StringArrayParameter(
Parameter.OPTIONAL, "com.arsdigita.cms.dhtml_editor_hidden_buttons",
null); Parameter.OPTIONAL,
null);
/** /**
* Hide section admin tabs from users without administrative rights. * Hide section admin tabs from users without administrative rights.
*/ */
@ -227,8 +235,8 @@ public final class CMSConfig extends AbstractConfig {
Parameter.REQUIRED, Parameter.REQUIRED,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Hide timezone labels (if, for example, all users will be in the same timezone and such * Hide timezone labels (if, for example, all users will be in the same
* 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",
@ -244,47 +252,54 @@ public final class CMSConfig extends AbstractConfig {
/** /**
* Specifies the name of the class to use as a PublishLifecycleListener * Specifies the name of the class to use as a PublishLifecycleListener
*/ */
private final Parameter m_publishLifecycleListenerClass = new StringParameter( private final Parameter m_publishLifecycleListenerClass
"com.arsdigita.cms.publish_lifecycle_listener_class", = new StringParameter(
Parameter.OPTIONAL, "com.arsdigita.cms.publish_lifecycle_listener_class",
PublishLifecycleListener.class.getName()); Parameter.OPTIONAL,
PublishLifecycleListener.class.getName());
/** /**
* Wether the Wysiwyg editor should clear the text of MSWord tags, everytime the user clicks on * Wether the Wysiwyg editor should clear the text of MSWord tags, everytime
* '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,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Get the search indexing not to process FileAssets, eg to avoid PDF slowdowns * Get the search indexing not to process FileAssets, eg to avoid PDF
* 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,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Whether an item's workflow should be deleted, once the item has been (re)published. * Whether an item's workflow should be deleted, once the item has been
* * (re)published.
* jensp 2014-11-07: Default changed from true to false. Deleting the assigned workflow means *
* that the authors have to reattach a workflow using the Workflow tab, which is complicated * jensp 2014-11-07: Default changed from true to false. Deleting the
* (for some users too complicated). Also deleting the workflow means that the new convenient * assigned workflow means that the authors have to reattach a workflow
* using the Workflow tab, which is complicated (for some users too
* complicated). Also deleting the workflow means that the new convenient
* link to restart a workflow will not work. * link to restart a workflow will not work.
* *
*/ */
private final Parameter m_deleteWorkflowAfterPublication = new BooleanParameter( private final Parameter m_deleteWorkflowAfterPublication
"com.arsdigita.cms.delete_workflow_after_publication", = new BooleanParameter(
Parameter.REQUIRED, "com.arsdigita.cms.delete_workflow_after_publication",
Boolean.FALSE); Parameter.REQUIRED,
Boolean.FALSE);
/** /**
* Defines the number of days ahead that are covered in the 'Soon Expired' tab * Defines the number of days ahead that are covered in the 'Soon Expired'
* 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(14)); new Integer(14));
/** /**
* Defines the number of months ahead that are covered in the 'Soon Expired' tab * Defines the number of months ahead that are covered in the 'Soon Expired'
* 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",
@ -298,47 +313,51 @@ public final class CMSConfig extends AbstractConfig {
Parameter.REQUIRED, Parameter.REQUIRED,
Boolean.TRUE); Boolean.TRUE);
/** /**
* Links created through browse interfaces should only be within the same subsite * Links created through browse interfaces should only be within the same
* 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,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Item category step extension hook: Subclass of ItemCategoryExtension which adds extension * Item category step extension hook: Subclass of ItemCategoryExtension
* actions for the category authoring step * which adds extension actions for the category authoring step
*/ */
private final Parameter m_categoryAuthoringExtension = new SpecificClassParameter( private final Parameter m_categoryAuthoringExtension
"com.arsdigita.cms.category_authoring_extension", = new SpecificClassParameter(
Parameter.REQUIRED, "com.arsdigita.cms.category_authoring_extension",
ItemCategoryExtension.class, Parameter.REQUIRED,
ItemCategoryExtension.class); ItemCategoryExtension.class,
ItemCategoryExtension.class);
/** /**
* Link available to reset lifecycle on republish. If false don't display the link otherwise * Link available to reset lifecycle on republish. If false don't display
* display. * the link otherwise display.
*/ */
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,
Boolean.TRUE); Boolean.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 = new BooleanParameter( private final Parameter m_scoreTitleAndKeywords = new BooleanParameter(
"com.arsdigita.cms.search.score_title_and_keywords", "com.arsdigita.cms.search.score_title_and_keywords",
Parameter.OPTIONAL, Parameter.OPTIONAL,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Title Weight, the relative weight given to title element within cms:item when ranking search * Title Weight, the relative weight given to title element within cms:item
* 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",
Parameter.OPTIONAL, Parameter.OPTIONAL,
new Integer(1)); new Integer(1));
/** /**
* Keyword Weight, the relative weight given to the dcKeywords element within dublinCore element * Keyword Weight, the relative weight given to the dcKeywords element
* within cms:item element when ranking search results (only used by interMedia) * within dublinCore element within cms:item element when ranking search
* results (only used by interMedia)
*/ */
private final Parameter m_keywordWeight = new IntegerParameter( private final Parameter m_keywordWeight = new IntegerParameter(
"com.arsdigita.cms.search.intermedia.keyword_weight", "com.arsdigita.cms.search.intermedia.keyword_weight",
@ -352,74 +371,83 @@ public final class CMSConfig extends AbstractConfig {
Parameter.OPTIONAL, Parameter.OPTIONAL,
Boolean.TRUE); Boolean.TRUE);
/** /**
* Asset steps to skip, specify asset steps that are not relevant for specific content types. * Asset steps to skip, specify asset steps that are not relevant for
* Each entry in the list is a : separated pair. The first string is the className for the type * specific content types. Each entry in the list is a : separated pair. The
* (refer to classname column in contenttypes table eg * first string is the className for the type (refer to classname column in
* com.arsdigita.cms.contenttypes.MultiPartArticle Second string is the name of the bebop step * contenttypes table eg com.arsdigita.cms.contenttypes.MultiPartArticle
* component eg com.arsdigita.cms.contenttypes.ui.ImageStep * Second string is the name of the bebop step component 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 whether to validate against * Mandatory Descriptions Content types may refer to this to decide whether
* 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,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Delete Finished Lifecycles. Decide whether lifecycles and their phases should be deleted from * Delete Finished Lifecycles. Decide whether lifecycles and their phases
* the system when finished. * should be deleted from the system when finished.
*/ */
private final Parameter m_deleteLifecycleWhenComplete = new BooleanParameter( private final Parameter m_deleteLifecycleWhenComplete
"com.arsdigita.cms.delete_lifecycle_when_complete", = new BooleanParameter(
Parameter.OPTIONAL, "com.arsdigita.cms.delete_lifecycle_when_complete",
Boolean.FALSE); Parameter.OPTIONAL,
Boolean.FALSE);
/** /**
* Contacts for content items. Allows you to add a Contact authoring step to all items * Contacts for content items. Allows you to add a Contact authoring step to
* 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,
Boolean.FALSE); Boolean.FALSE);
/** /**
* Ordering for nodes in assign category tree. Decide whether entries should be ordered * Ordering for nodes in assign category tree. Decide whether entries should
* alphabetically or according to sort key (maintained in category admin tab in content centre) * be ordered alphabetically or according to sort key (maintained in
* SortKey|Alphabetical is initialized in constructor! See below. * category admin tab in content centre) SortKey|Alphabetical is initialized
* in constructor! See below.
*/ */
private final Parameter m_categoryTreeOrdering = new EnumerationParameter( private final Parameter m_categoryTreeOrdering = 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 creation of a new Use Context in category tab of content sections. "Use Context" is the * Allow creation of a new Use Context in category tab of content sections.
* construct to constitute a category hierarchy implementet in core. It is superseded by the * "Use Context" is the construct to constitute a category hierarchy
* construct "Category Domain" in Terms (ccm-ldn-terms). Global parameter for all content * implementet in core. It is superseded by the construct "Category Domain"
* sections. Default is false because all installation bundles use Terms. * in Terms (ccm-ldn-terms). Global parameter for all content sections.
* Default is false because all installation bundles use Terms.
*/ */
private final Parameter m_allowCategoryCreateUseContext = new BooleanParameter( private final Parameter m_allowCategoryCreateUseContext
"com.arsdigita.cms.allow_category_create_use_context", = new BooleanParameter(
Parameter.REQUIRED, "com.arsdigita.cms.allow_category_create_use_context",
Boolean.FALSE); Parameter.REQUIRED,
Boolean.FALSE);
/** /**
* Allow content creation in Workspace (content center) section listing. Allows you to turn off * Allow content creation in Workspace (content center) section listing.
* the ability to create content in the section listing. * Allows you to turn off the ability to create content in the section
* * listing.
* jensp 2014-11-07: Default changed to false. This feature isn't used by most users. Also *
* it has some drawbacks, for example items creating using this way are put into the root * jensp 2014-11-07: Default changed to false. This feature isn't used by
* folder. * most users. Also it has some drawbacks, for example items creating using
* this way are put into the root folder.
*/ */
private final Parameter m_allowContentCreateInSectionListing = new BooleanParameter( private final Parameter m_allowContentCreateInSectionListing
"com.arsdigita.cms.allow_content_create_in_section_listing", = new BooleanParameter(
Parameter.REQUIRED, "com.arsdigita.cms.allow_content_create_in_section_listing",
Boolean.FALSE); Parameter.REQUIRED,
Boolean.FALSE);
/** /**
* Hide the legacy public site link in Workspace (content center) section listing. Legacy public * Hide the legacy public site link in Workspace (content center) section
* site display is replaced by navigation based presentation (or by portlets) and should be * listing. Legacy public site display is replaced by navigation based
* hidden in the admin ui by default now. * presentation (or by portlets) and should be hidden in the admin ui by
* default now.
*/ */
private final Parameter m_hideLegacyPublicSiteLink = new BooleanParameter( private final Parameter m_hideLegacyPublicSiteLink = new BooleanParameter(
"com.arsdigita.cms.hide_legacy_public_site_link", "com.arsdigita.cms.hide_legacy_public_site_link",
@ -429,31 +457,34 @@ public final class CMSConfig extends AbstractConfig {
// Notification related parameters // Notification related parameters
// /////////////////////////////////////////// // ///////////////////////////////////////////
/** /**
* Delete Sent Workflow Notifications. Decide whether successfully sent notifications and * Delete Sent Workflow Notifications. Decide whether successfully sent
* messages should be deleted from the system * notifications and messages should be deleted from the system
*/ */
private final Parameter m_deleteWorkflowNotificationsWhenSent = new BooleanParameter( private final Parameter m_deleteWorkflowNotificationsWhenSent
"com.arsdigita.cms.delete_workflow_notification_when_sent", = new BooleanParameter(
Parameter.OPTIONAL, "com.arsdigita.cms.delete_workflow_notification_when_sent",
Boolean.FALSE); Parameter.OPTIONAL,
Boolean.FALSE);
/** /**
* Decide whether successfully sent notifications and messages should be deleted from the system * Decide whether successfully sent notifications and messages should be
* deleted from the system
*/ */
private final Parameter m_deleteExpiryNotificationsWhenSent = new BooleanParameter( private final Parameter m_deleteExpiryNotificationsWhenSent
"com.arsdigita.cms.delete_expiry_notification_when_sent", = new BooleanParameter(
Parameter.OPTIONAL, "com.arsdigita.cms.delete_expiry_notification_when_sent",
Boolean.FALSE); Parameter.OPTIONAL,
Boolean.FALSE);
/** /**
* Amount of time (in hours) before the expiration of a content item that users in the Alert * Amount of time (in hours) before the expiration of a content item that
* 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(0)); new Integer(0));
/** /**
* Wether a content item's author should be notified by the item's LifecycleListener; defaults * Wether a content item's author should be notified by the item's
* 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",
@ -463,7 +494,8 @@ public final class CMSConfig extends AbstractConfig {
// Content Center (Workspace) config related parameters // Content Center (Workspace) config related parameters
// //////////////////////////////////////////////////// // ////////////////////////////////////////////////////
/** /**
* XML Mapping of the content center tabs to URLs, see {@link ContentCenterDispatcher} * XML Mapping of the content center tabs to URLs, see
* {@link ContentCenterDispatcher}
*/ */
private final StringParameter m_contentCenterMap = new StringParameter( private final StringParameter m_contentCenterMap = new StringParameter(
"com.arsdigita.cms.loader.content_center_map", "com.arsdigita.cms.loader.content_center_map",
@ -485,16 +517,18 @@ public final class CMSConfig extends AbstractConfig {
// to SectionInitializer. However, it still may be useful to // to SectionInitializer. However, it still may be useful to
// keep these for the default values. // keep these for the default values.
// /////////////////////////////////////////// // ///////////////////////////////////////////
private final Parameter m_defaultItemResolverClass = new SpecificClassParameter( private final Parameter m_defaultItemResolverClass
"com.arsdigita.cms.default_item_resolver_class", = new SpecificClassParameter(
Parameter.REQUIRED, "com.arsdigita.cms.default_item_resolver_class",
MultilingualItemResolver.class, Parameter.REQUIRED,
ItemResolver.class); MultilingualItemResolver.class,
private final Parameter m_defaultTemplateResolverClass = new SpecificClassParameter( ItemResolver.class);
"com.arsdigita.cms.default_template_resolver_class", private final Parameter m_defaultTemplateResolverClass
Parameter.REQUIRED, = new SpecificClassParameter(
DefaultTemplateResolver.class, "com.arsdigita.cms.default_template_resolver_class",
TemplateResolver.class); Parameter.REQUIRED,
DefaultTemplateResolver.class,
TemplateResolver.class);
///////////////////////////////////////////// /////////////////////////////////////////////
// ItemSearchWidget // ItemSearchWidget
///////////////////////////////////////////// /////////////////////////////////////////////
@ -505,10 +539,11 @@ public final class CMSConfig extends AbstractConfig {
// "com.arsdigita.cms.item_search.flat_browse_pane.enable", // "com.arsdigita.cms.item_search.flat_browse_pane.enable",
// Parameter.REQUIRED, // Parameter.REQUIRED,
// true); // true);
private final Parameter m_itemSearchFlatBrowsePanePageSize = new IntegerParameter( private final Parameter m_itemSearchFlatBrowsePanePageSize
"com.arsdigita.cms.item_search.flat_browse_pane.page_size", = new IntegerParameter(
Parameter.REQUIRED, "com.arsdigita.cms.item_search.flat_browse_pane.page_size",
20); Parameter.REQUIRED,
20);
///////////////////////////////////////////// /////////////////////////////////////////////
// FolderBrowse // FolderBrowse
///////////////////////////////////////////// /////////////////////////////////////////////
@ -528,10 +563,11 @@ public final class CMSConfig extends AbstractConfig {
//republish and withdraw items) is used. Otherwise the new style form is //republish and withdraw items) is used. Otherwise the new style form is
//used, which is more secure against wrong clicks. //used, which is more secure against wrong clicks.
////////////////////////////////////////////// //////////////////////////////////////////////
private final Parameter m_useOldStyleItemLifecycleItemPane = new BooleanParameter( private final Parameter m_useOldStyleItemLifecycleItemPane
"com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane", = new BooleanParameter(
Parameter.REQUIRED, "com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane",
false); Parameter.REQUIRED,
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
@ -552,22 +588,25 @@ public final class CMSConfig extends AbstractConfig {
///////////////////////////////////////////////// /////////////////////////////////////////////////
// ImageBrowser Parameter // ImageBrowser Parameter
///////////////////////////////////////////////// /////////////////////////////////////////////////
private final Parameter m_imageBrowserThumbnailMaxWidth = new IntegerParameter( private final Parameter m_imageBrowserThumbnailMaxWidth
"com.arsdigita.cms.image_browser.thumbnail_max_width", = new IntegerParameter(
Parameter.REQUIRED, "com.arsdigita.cms.image_browser.thumbnail_max_width",
50); Parameter.REQUIRED,
private final Parameter m_imageBrowserThumbnailMaxHeight = new IntegerParameter( 50);
"com.arsdigita.cms.image_browser.thumbnail_max_height", private final Parameter m_imageBrowserThumbnailMaxHeight
Parameter.REQUIRED, = new IntegerParameter(
50); "com.arsdigita.cms.image_browser.thumbnail_max_height",
Parameter.REQUIRED,
50);
private final Parameter m_imageBrowserCaptionSize = new IntegerParameter( private final Parameter m_imageBrowserCaptionSize = new IntegerParameter(
"com.arsdigita.cms.image_browser.caption_size", "com.arsdigita.cms.image_browser.caption_size",
Parameter.REQUIRED, Parameter.REQUIRED,
100); 100);
private final Parameter m_imageBrowserDescriptionSize = new IntegerParameter( private final Parameter m_imageBrowserDescriptionSize
"com.arsdigita.cms.image_browser.description_size", = new IntegerParameter(
Parameter.REQUIRED, "com.arsdigita.cms.image_browser.description_size",
400); Parameter.REQUIRED,
400);
private final Parameter m_imageBrowserTitleSize = new IntegerParameter( private final Parameter m_imageBrowserTitleSize = new IntegerParameter(
"com.arsdigita.cms.image_browser.title_size", "com.arsdigita.cms.image_browser.title_size",
Parameter.REQUIRED, Parameter.REQUIRED,
@ -627,11 +666,18 @@ public final class CMSConfig extends AbstractConfig {
60 * 60 * 24); 60 * 60 * 24);
/** /**
* Max length of the description of a link (in database max length are 4000 characters) * Max length of the description of a link (in database max length are 4000
* characters)
*/ */
private final Parameter m_linkDescMaxLength = new IntegerParameter( private final Parameter m_linkDescMaxLength = new IntegerParameter(
"com.arsdigita.cms.link_description_max_length", Parameter.REQUIRED, 400); "com.arsdigita.cms.link_description_max_length", Parameter.REQUIRED, 400);
/**
* Always use language extension?
*/
private final Parameter m_useLanguageExtension = new BooleanParameter(
"com.arsdigita.cms.use_language_extension", Parameter.REQUIRED, false);
// /////////////////////////////////////////// // ///////////////////////////////////////////
// publishToFile package related parameter // publishToFile package related parameter
// /////////////////////////////////////////// // ///////////////////////////////////////////
@ -743,14 +789,17 @@ public final class CMSConfig extends AbstractConfig {
register(m_enableXmlCache); register(m_enableXmlCache);
register(m_xmlCacheSize); register(m_xmlCacheSize);
register(m_xmlCacheAge); register(m_xmlCacheAge);
register(m_linkDescMaxLength); register(m_linkDescMaxLength);
register(m_useLanguageExtension);
loadInfo(); loadInfo();
} }
/** /**
* Retrieve path of the root folder for template folders. Path is relative to webapp root. * Retrieve path of the root folder for template folders. Path is relative
* to webapp root.
*/ */
public final String getTemplateRoot() { public final String getTemplateRoot() {
return (String) get(m_templateRootPath); return (String) get(m_templateRootPath);
@ -790,7 +839,8 @@ public final class CMSConfig extends AbstractConfig {
/** /**
* *
* @deprecated use com.arsdigita.cms.ContentSection.getDefaultSection().getName() instead * @deprecated use
* 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);
@ -901,7 +951,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Fetch the file name contaning XML Mapping of the content center tabs to URLs * Fetch the file name contaning XML Mapping of the content center tabs to
* URLs
* *
* @return String containig file name including path component. * @return String containig file name including path component.
*/ */
@ -910,15 +961,16 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Internal class representing a DHTMLEditor configuration parameter. It creates a new * Internal class representing a DHTMLEditor configuration parameter. It
* DHMTLEditor Config object (internal class in DHTMLEditor). * creates a new DHMTLEditor Config object (internal class in DHTMLEditor).
* *
* XXX Method unmarshal is broken and currently does not work correctly. It does not process * XXX Method unmarshal is broken and currently does not work correctly. It
* default values provided by using DHTMLEditor.Config.Standard (see parameter * does not process default values provided by using
* m_dhtmlEditorConfig above). May be a similiar problem as with ResourceParameter and default * DHTMLEditor.Config.Standard (see parameter m_dhtmlEditorConfig above).
* value, see patch provided by pbrucha. Best solution may be to remove this special parameter * May be a similiar problem as with ResourceParameter and default value,
* class and use a string parameter instead to directly create a DHTMLEditor.Config object. * see patch provided by pbrucha. Best solution may be to remove this
* (pboy, 2010-09-02) * special parameter class and use a string parameter instead to directly
* create a DHTMLEditor.Config object. (pboy, 2010-09-02)
*/ */
private class DHTMLEditorConfigParameter extends StringParameter { private class DHTMLEditorConfigParameter extends StringParameter {
@ -973,8 +1025,9 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* The relative weight given to the dcKeywords element within dublinCore element within cms:item * The relative weight given to the dcKeywords element within dublinCore
* element when ranking search results Only used by the interMedia query engine. * element within cms:item element when ranking search results Only used by
* the interMedia query engine.
* *
*/ */
public Integer getKeywordSearchWeight() { public Integer getKeywordSearchWeight() {
@ -986,8 +1039,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* The relative weight given to title element within cms:item element when ranking search * The relative weight given to title element within cms:item element when
* results Only used by the interMedia query engine. * ranking search results Only used by the interMedia query engine.
* *
*/ */
public Integer getTitleSearchWeight() { public Integer getTitleSearchWeight() {
@ -995,9 +1048,11 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* 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
*/ */
@ -1006,12 +1061,13 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* for the given content type, returns a collection of steps that are deemed irrelevant for the * for the given content type, returns a collection of steps that are deemed
* 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 are used by the authoring kit wizard * Steps are the names of the bebop step components that are used by the
* authoring kit wizard
* *
* @param type * @param type
* *
@ -1033,7 +1089,8 @@ public final class CMSConfig extends AbstractConfig {
// 1st string is name of content type, 2nd string is name of asset step // 1st string is name of content type, 2nd string is name of asset step
s_log.debug("parameter read - type = " + pair[0] s_log.debug("parameter read - type = " + pair[0]
+ " - step = " + pair[1]); + " - step = " + pair[1]);
Collection typeSteps = (Collection) s_skipAssetSteps.get(pair[0]); Collection typeSteps = (Collection) s_skipAssetSteps.get(
pair[0]);
if (typeSteps == null) { if (typeSteps == null) {
typeSteps = new HashSet(); typeSteps = new HashSet();
s_skipAssetSteps.put(pair[0], typeSteps); s_skipAssetSteps.put(pair[0], typeSteps);
@ -1056,7 +1113,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* May be used by any content type creation form to decide whether to validate description field * May be used by any content type creation form to decide whether to
* validate description field
* *
*/ */
public boolean mandatoryDescriptions() { public boolean mandatoryDescriptions() {
@ -1064,32 +1122,35 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Used to decide whether lifecycles (and all asociated phases) should be deleted from the * Used to decide whether lifecycles (and all asociated phases) should be
* system when complete * deleted from the system when complete
* *
* (Deleting lifecycle means that you lose a bit of historical information eg when was this item * (Deleting lifecycle means that you lose a bit of historical information
* unpublished) * eg when was this item unpublished)
*/ */
public boolean deleteFinishedLifecycles() { public boolean deleteFinishedLifecycles() {
return ((Boolean) get(m_deleteLifecycleWhenComplete)).booleanValue(); return ((Boolean) get(m_deleteLifecycleWhenComplete)).booleanValue();
} }
/** /**
* Used to decide whether to delete old notification records for expiry notifications. * Used to decide whether to delete old notification records for expiry
* notifications.
* *
* If true, notifications and messages are deleted if the notification is successfully sent. Any * If true, notifications and messages are deleted if the notification is
* send failures are retained * successfully sent. Any send failures are retained
* *
*/ */
public boolean deleteExpiryNotifications() { public boolean deleteExpiryNotifications() {
return ((Boolean) get(m_deleteExpiryNotificationsWhenSent)).booleanValue(); return ((Boolean) get(m_deleteExpiryNotificationsWhenSent))
.booleanValue();
} }
/** /**
* Used to decide whether to delete old notification records for workflow notifications. * Used to decide whether to delete old notification records for workflow
* notifications.
* *
* If true, notifications and messages are deleted if the notification is successfully sent. Any * If true, notifications and messages are deleted if the notification is
* send failures are retained * successfully sent. Any send failures are retained
* *
*/ */
public boolean deleteWorkflowNotifications() { public boolean deleteWorkflowNotifications() {
@ -1102,11 +1163,12 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* I'am not sure for what this method is. I found it here when I tried figure out how add * I'am not sure for what this method is. I found it here when I tried
* multiple parts to an ContentType, like ccm-cms-types-contact and the Multipart article do. I * figure out how add multiple parts to an ContentType, like
* think this method should not be here because it is only needed by one specific contenttype. * ccm-cms-types-contact and the Multipart article do. I think this method
* Because of this, I think that this method and the contact are violating many rules of modern * should not be here because it is only needed by one specific contenttype.
* software design. Jens Pelzetter, 2009-06-02. * Because of this, I think that this method and the contact are violating
* many rules of modern software design. Jens Pelzetter, 2009-06-02.
* *
* @return * @return
*/ */
@ -1119,10 +1181,11 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Retrieve whether to allow creation of a new Use Context in category tab of content sections. * Retrieve whether to allow creation of a new Use Context in category tab
* "Use Context" is used to constitute a category hierarchy in core. It is superseded by the * of content sections. "Use Context" is used to constitute a category
* construct "Category Domain" in Terms (ccm-ldn-terms). Global parameter for all content * hierarchy in core. It is superseded by the construct "Category Domain" in
* sections. Default is false because all installation bundles use Terms. * Terms (ccm-ldn-terms). Global parameter for all content sections. Default
* is false because all installation bundles use Terms.
* *
* @return TRUE if creation is allowed, otherwise FALSE (default) * @return TRUE if creation is allowed, otherwise FALSE (default)
*/ */
@ -1137,8 +1200,8 @@ public final class CMSConfig extends AbstractConfig {
} }
/** /**
* Hide the (no longer used) legacy public site link in Workspace (content center) section * Hide the (no longer used) legacy public site link in Workspace (content
* 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();
@ -1181,15 +1244,18 @@ public final class CMSConfig extends AbstractConfig {
} }
public int getImageBrowserCaptionSize() { public int getImageBrowserCaptionSize() {
return Math.min(((Integer) get(m_imageBrowserCaptionSize)).intValue(), 100); return Math.min(((Integer) get(m_imageBrowserCaptionSize)).intValue(),
100);
} }
public int getImageBrowserDescriptionSize() { public int getImageBrowserDescriptionSize() {
return Math.min(((Integer) get(m_imageBrowserDescriptionSize)).intValue(), 400); return Math.min(((Integer) get(m_imageBrowserDescriptionSize))
.intValue(), 400);
} }
public int getImageBrowserTitleSize() { public int getImageBrowserTitleSize() {
return Math.min(((Integer) get(m_imageBrowserTitleSize)).intValue(), 200); return Math
.min(((Integer) get(m_imageBrowserTitleSize)).intValue(), 200);
} }
public Boolean getImageCacheEnabled() { public Boolean getImageCacheEnabled() {
@ -1234,9 +1300,13 @@ public final class CMSConfig extends AbstractConfig {
public Integer getXmlCacheAge() { public Integer getXmlCacheAge() {
return (Integer) get(m_xmlCacheAge); return (Integer) get(m_xmlCacheAge);
} }
public Integer getLinkDescMaxLength() { public Integer getLinkDescMaxLength() {
return (Integer) get(m_linkDescMaxLength); return (Integer) get(m_linkDescMaxLength);
} }
public Boolean getUseLanguageExtension() {
return (Boolean) get(m_useLanguageExtension);
}
} }

View File

@ -359,4 +359,9 @@ com.arsdigita.cms.xml.cache.age.format=[integer]
com.arsdigita.cms.link_description_max_length.title=Maximum length of the description of a link. com.arsdigita.cms.link_description_max_length.title=Maximum length of the description of a link.
com.arsdigita.cms.link_description_max_length.purpose=Maximum length of the description of a link. com.arsdigita.cms.link_description_max_length.purpose=Maximum length of the description of a link.
com.arsdigita.cms.link_description_max_length.example=400 com.arsdigita.cms.link_description_max_length.example=400
com.arsdigita.cms.link_description_max_length.format={Integer] com.arsdigita.cms.link_description_max_length.format={Integer]
com.arsdigita.cms.use_language_extension.title=Add language extensions
com.arsdigita.cms.use_language_extension.purpose=Always add language extension to content item URLs
com.arsdigita.cms.use_language_extension.example=true
com.arsdigita.cms.use_language_extension.format=[Boolean]

View File

@ -123,6 +123,12 @@ public class GlobalizationHelper {
return selectedLocale; return selectedLocale;
} }
public static void setSelectedLocale(final String language) {
final HttpServletRequest request = DispatcherHelper.getRequest();
request.getSession().setAttribute(LANG_PARAM, language);
}
/** /**
* Create a Locale from a browser provides language string * Create a Locale from a browser provides language string
* *

View File

@ -15,7 +15,6 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
package com.arsdigita.navigation; package com.arsdigita.navigation;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
@ -51,28 +50,40 @@ import org.apache.log4j.Logger;
/** /**
* Configuration record for the navigation app * Configuration record for the navigation app
*
* @author Daniel Berrange * @author Daniel Berrange
*/ */
public final class NavigationConfig extends AbstractConfig { public final class NavigationConfig extends AbstractConfig {
private static final Logger s_log = Logger.getLogger(NavigationConfig.class); private static final Logger s_log = Logger.getLogger(NavigationConfig.class);
/** The cache lifetime for category index pages in seconds. Default 1 hour */ /**
private final Parameter m_indexPageCacheLifetime = new IntegerParameter * The cache lifetime for category index pages in seconds. Default 1 hour
("com.arsdigita.navigation.index_page_cache_lifetime", */
Parameter.REQUIRED, new Integer(3600)); private final Parameter m_indexPageCacheLifetime = new IntegerParameter(
"com.arsdigita.navigation.index_page_cache_lifetime",
/** Generate full item URLs instead of going via search redirector. Default true */ Parameter.REQUIRED, new Integer(3600));
private final Parameter m_generateItemURL = new BooleanParameter
("com.arsdigita.navigation.generate_item_url", /**
Parameter.REQUIRED, new Boolean(true)); * Generate full item URLs instead of going via search redirector. Default
* true
/** The default category template. */ */
private final Parameter m_defaultTemplate = new StringParameter private final Parameter m_generateItemURL = new BooleanParameter(
("com.arsdigita.navigation.default_template", "com.arsdigita.navigation.generate_item_url",
Parameter.REQUIRED, "/templates/ccm-navigation/navigation/nav-default.jsp"); Parameter.REQUIRED, new Boolean(true));
/** If no template for category, should it get template from parent, or /**
* fall back on default? Default: true */ * The default category template.
*/
private final Parameter m_defaultTemplate = new StringParameter(
"com.arsdigita.navigation.default_template",
Parameter.REQUIRED,
"/templates/ccm-navigation/navigation/nav-default.jsp");
/**
* If no template for category, should it get template from parent, or fall
* back on default? Default: true
*/
private final Parameter m_inheritTemplates; private final Parameter m_inheritTemplates;
// Removed, use content-section config directly instead! // Removed, use content-section config directly instead!
// ContentSection.getConfig().getDefaultContentSection() // ContentSection.getConfig().getDefaultContentSection()
@ -92,19 +103,24 @@ public final class NavigationConfig extends AbstractConfig {
// Quasimodo: End // Quasimodo: End
private final Parameter m_dateOrderCategories; private final Parameter m_dateOrderCategories;
private final Parameter m_topLevelDateOrderCategories; private final Parameter m_topLevelDateOrderCategories;
/** Class that provides categories included in menu for any categories that private final Parameter m_useLanguageExtension;
* do not have an alternative provider registered */ /**
private final Parameter m_defaultMenuCatProvider; * Class that provides categories included in menu for any categories that
* do not have an alternative provider registered
*/
private final Parameter m_defaultMenuCatProvider;
private static Set s_fixedDateOrderCats = null; private static Set s_fixedDateOrderCats = null;
private Category m_defaultCategoryRoot = null; private Category m_defaultCategoryRoot = null;
// maybe 2 lookups in a single request so prevent double overhead // maybe 2 lookups in a single request so prevent double overhead
private RequestLocal m_allDateOrderCategories = new RequestLocal () { private RequestLocal m_allDateOrderCategories = new RequestLocal() {
public Object initialValue (PageState state) {
public Object initialValue(PageState state) {
return getCurrentDateOrderCategories(); return getCurrentDateOrderCategories();
} }
}; };
private NavigationModel m_defaultModel = null; private NavigationModel m_defaultModel = null;
@ -112,54 +128,59 @@ public final class NavigationConfig extends AbstractConfig {
private TreeCatProvider m_treeCatProvider = null; private TreeCatProvider m_treeCatProvider = null;
public NavigationConfig() { public NavigationConfig() {
// not desirable default value (IMHO) but retains existing behaviour // not desirable default value (IMHO) but retains existing behaviour
m_inheritTemplates = new BooleanParameter m_inheritTemplates = new BooleanParameter(
("com.arsdigita.navigation.inherit_templates", "com.arsdigita.navigation.inherit_templates",
Parameter.REQUIRED, new Boolean(true)); Parameter.REQUIRED, new Boolean(true));
m_relatedItemsContext = new StringParameter m_relatedItemsContext = new StringParameter(
("com.arsdigita.navigation.related_items_context", "com.arsdigita.navigation.related_items_context",
Parameter.REQUIRED, "subject"); Parameter.REQUIRED, "subject");
m_defaultModelClass = new StringParameter m_defaultModelClass = new StringParameter(
("com.arsdigita.navigation.default_nav_model", "com.arsdigita.navigation.default_nav_model",
Parameter.REQUIRED, ApplicationNavigationModel.class.getName()); Parameter.REQUIRED, ApplicationNavigationModel.class.getName());
m_defaultCatRootPath = new StringParameter m_defaultCatRootPath = new StringParameter(
("com.arsdigita.navigation.default_cat_root_path", "com.arsdigita.navigation.default_cat_root_path",
Parameter.REQUIRED, "/navigation/"); Parameter.REQUIRED, "/navigation/");
m_relatedItemsFactory = new ClassParameter m_relatedItemsFactory = new ClassParameter(
("com.arsdigita.navigation.related_items_factory", "com.arsdigita.navigation.related_items_factory",
Parameter.REQUIRED, RelatedItemsQueryFactoryImpl.class); Parameter.REQUIRED, RelatedItemsQueryFactoryImpl.class);
m_traversalAdapters = new ResourceParameter m_traversalAdapters = new ResourceParameter(
("com.arsdigita.navigation.traversal_adapters", "com.arsdigita.navigation.traversal_adapters",
Parameter.REQUIRED, Parameter.REQUIRED,
"/WEB-INF/resources/navigation-adapters.xml"); "/WEB-INF/resources/navigation-adapters.xml");
m_categoryMenuShowNephews = new BooleanParameter m_categoryMenuShowNephews = new BooleanParameter(
("com.arsdigita.navigation.category_menu_show_nephews", "com.arsdigita.navigation.category_menu_show_nephews",
Parameter.OPTIONAL, new Boolean(false)); Parameter.OPTIONAL, new Boolean(false));
// Quasimodo: Begin // Quasimodo: Begin
m_categoryMenuShowGrandChildren = new StringParameter m_categoryMenuShowGrandChildren = new StringParameter(
("com.arsdigita.navigation.category_menu_show_grand_children", "com.arsdigita.navigation.category_menu_show_grand_children",
Parameter.OPTIONAL, "false"); Parameter.OPTIONAL, "false");
m_categoryMenuShowGrandChildrenMax = new IntegerParameter m_categoryMenuShowGrandChildrenMax = new IntegerParameter(
("com.arsdigita.navigation.category_menu_show_grand_children_max", "com.arsdigita.navigation.category_menu_show_grand_children_max",
Parameter.OPTIONAL, new Integer(0)); Parameter.OPTIONAL, new Integer(0));
m_categoryMenuShowGrandChildrenMin = new IntegerParameter m_categoryMenuShowGrandChildrenMin = new IntegerParameter(
("com.arsdigita.navigation.category_menu_show_grand_children_min", "com.arsdigita.navigation.category_menu_show_grand_children_min",
Parameter.OPTIONAL, new Integer(1)); Parameter.OPTIONAL, new Integer(1));
m_categoryMenuShowGrandChildrenLimit = new IntegerParameter m_categoryMenuShowGrandChildrenLimit = new IntegerParameter(
("com.arsdigita.navigation.category_menu_show_grand_children_limit", "com.arsdigita.navigation.category_menu_show_grand_children_limit",
Parameter.OPTIONAL, new Integer(1)); Parameter.OPTIONAL, new Integer(1));
// Quasimodo: End // Quasimodo: End
m_dateOrderCategories = new StringArrayParameter m_dateOrderCategories = new StringArrayParameter(
("com.arsdigita.navigation.date_order_categories", "com.arsdigita.navigation.date_order_categories",
Parameter.OPTIONAL, new String[0]);
m_topLevelDateOrderCategories = new StringArrayParameter
("com.arsdigita.navigation.top_level_date_order_categories",
Parameter.OPTIONAL, new String[0]); Parameter.OPTIONAL, new String[0]);
m_defaultMenuCatProvider = new ClassParameter m_topLevelDateOrderCategories = new StringArrayParameter(
("com.arsdigita.navigation.default_menu_cat_provider", "com.arsdigita.navigation.top_level_date_order_categories",
Parameter.OPTIONAL, new String[0]);
m_defaultMenuCatProvider = new ClassParameter(
"com.arsdigita.navigation.default_menu_cat_provider",
Parameter.OPTIONAL, null); Parameter.OPTIONAL, null);
m_useLanguageExtension = new BooleanParameter(
"com.arsdigita.navigation.use_language_extension",
Parameter.OPTIONAL,
false);
register(m_indexPageCacheLifetime); register(m_indexPageCacheLifetime);
register(m_generateItemURL); register(m_generateItemURL);
register(m_defaultTemplate); register(m_defaultTemplate);
@ -182,35 +203,38 @@ public final class NavigationConfig extends AbstractConfig {
register(m_dateOrderCategories); register(m_dateOrderCategories);
register(m_topLevelDateOrderCategories); register(m_topLevelDateOrderCategories);
register(m_defaultMenuCatProvider); register(m_defaultMenuCatProvider);
register(m_useLanguageExtension);
loadInfo(); loadInfo();
// Quasimodo: Begin // Quasimodo: Begin
// Checking Paramter // Checking Paramter
String param = new String((String)get(m_categoryMenuShowGrandChildren)); String param = new String((String) get(m_categoryMenuShowGrandChildren));
if( param.equals("false") || param.equals("adaptive") || param.equals("true")) { if (param.equals("false") || param.equals("adaptive") || param.equals(
"true")) {
set(m_categoryMenuShowGrandChildren, param); set(m_categoryMenuShowGrandChildren, param);
} else { } else {
s_log.error("com.arsdigita.navigation.category_menu_show_grand_children: "+ s_log.error(
"Invalid setting " + param + ". Falling back to false."); "com.arsdigita.navigation.category_menu_show_grand_children: "
set(m_categoryMenuShowGrandChildren, "false"); + "Invalid setting " + param + ". Falling back to false.");
set(m_categoryMenuShowGrandChildren, "false");
} }
// Quasimodo: End // Quasimodo: End
} }
public final long getIndexPageCacheLifetime() { public final long getIndexPageCacheLifetime() {
return ((Integer)get(m_indexPageCacheLifetime)).longValue(); return ((Integer) get(m_indexPageCacheLifetime)).longValue();
} }
public final boolean getGenerateItemURL() { public final boolean getGenerateItemURL() {
return ((Boolean)get(m_generateItemURL)).booleanValue(); return ((Boolean) get(m_generateItemURL)).booleanValue();
} }
public final String getDefaultTemplate() { public final String getDefaultTemplate() {
return (String)get(m_defaultTemplate); return (String) get(m_defaultTemplate);
} }
public final boolean inheritTemplates() { public final boolean inheritTemplates() {
return ((Boolean) get(m_inheritTemplates)).booleanValue(); return ((Boolean) get(m_inheritTemplates)).booleanValue();
} }
// Removed, use content-section config directly instead! // Removed, use content-section config directly instead!
@ -218,17 +242,16 @@ public final class NavigationConfig extends AbstractConfig {
// public final String getDefaultContentSectionURL() { // public final String getDefaultContentSectionURL() {
// return (String)get(m_defaultContentSectionURL); // return (String)get(m_defaultContentSectionURL);
// } // }
public final String getRelatedItemsContext() { public final String getRelatedItemsContext() {
return (String)get(m_relatedItemsContext); return (String) get(m_relatedItemsContext);
} }
public final String getDefaultCategoryRootPath() { public final String getDefaultCategoryRootPath() {
return (String)get(m_defaultCatRootPath); return (String) get(m_defaultCatRootPath);
} }
public final Class getRelatedItemsFactory() { public final Class getRelatedItemsFactory() {
return (Class)get(m_relatedItemsFactory); return (Class) get(m_relatedItemsFactory);
} }
public final synchronized NavigationModel getDefaultModel() { public final synchronized NavigationModel getDefaultModel() {
@ -236,29 +259,27 @@ public final class NavigationConfig extends AbstractConfig {
return m_defaultModel; return m_defaultModel;
} }
String defaultModelClassName = (String)get(m_defaultModelClass); String defaultModelClassName = (String) get(m_defaultModelClass);
try { try {
Class defaultModelClass = Class.forName(defaultModelClassName); Class defaultModelClass = Class.forName(defaultModelClassName);
Constructor cons = defaultModelClass.getConstructor Constructor cons = defaultModelClass.getConstructor(new Class[]{});
( new Class[]{} ); m_defaultModel = (NavigationModel) cons.newInstance(new Object[]{});
m_defaultModel = (NavigationModel) cons.newInstance
( new Object[]{} );
} catch (Exception ex) { } catch (Exception ex) {
throw new UncheckedWrapperException( ex ); throw new UncheckedWrapperException(ex);
} }
return m_defaultModel; return m_defaultModel;
} }
public final synchronized Category getDefaultCategoryRoot() { public final synchronized Category getDefaultCategoryRoot() {
if (null != m_defaultCategoryRoot) { if (null != m_defaultCategoryRoot) {
return m_defaultCategoryRoot; return m_defaultCategoryRoot;
} }
String defaultCatRootPath = (String)get(m_defaultCatRootPath); String defaultCatRootPath = (String) get(m_defaultCatRootPath);
Application app = Application app = Application.retrieveApplicationForPath(
Application.retrieveApplicationForPath(defaultCatRootPath); defaultCatRootPath);
Assert.exists(app, Application.class); Assert.exists(app, Application.class);
Category m_defaultCategoryRoot = Category.getRootForObject(app); Category m_defaultCategoryRoot = Category.getRootForObject(app);
@ -268,33 +289,37 @@ public final class NavigationConfig extends AbstractConfig {
} }
InputStream getTraversalAdapters() { InputStream getTraversalAdapters() {
return (InputStream)get(m_traversalAdapters); return (InputStream) get(m_traversalAdapters);
} }
public final boolean getCategoryMenuShowNephews() { public final boolean getCategoryMenuShowNephews() {
return ((Boolean)get(m_categoryMenuShowNephews)).booleanValue(); return ((Boolean) get(m_categoryMenuShowNephews)).booleanValue();
} }
// Quasimodo: Begin // Quasimodo: Begin
public final String getCategoryMenuShowGrandChildren() { public final String getCategoryMenuShowGrandChildren() {
return (String)get(m_categoryMenuShowGrandChildren); return (String) get(m_categoryMenuShowGrandChildren);
} }
public final long getCategoryMenuShowGrandChildrenMax() {
return ((Integer)get(m_categoryMenuShowGrandChildrenMax)).longValue(); public final long getCategoryMenuShowGrandChildrenMax() {
} return ((Integer) get(m_categoryMenuShowGrandChildrenMax)).longValue();
public final long getCategoryMenuShowGrandChildrenMin() { }
return ((Integer)get(m_categoryMenuShowGrandChildrenMin)).longValue();
} public final long getCategoryMenuShowGrandChildrenMin() {
public final long getCategoryMenuShowGrandChildrenLimit() { return ((Integer) get(m_categoryMenuShowGrandChildrenMin)).longValue();
return ((Integer)get(m_categoryMenuShowGrandChildrenLimit)).longValue(); }
}
public final long getCategoryMenuShowGrandChildrenLimit() {
return ((Integer) get(m_categoryMenuShowGrandChildrenLimit)).longValue();
}
// Quasimodo: End // Quasimodo: End
/** /**
* retrieve a collection of categories to order by date. Collection includes * retrieve a collection of categories to order by date. Collection includes
* categories directly specified as date ordered and also all subcategories of * categories directly specified as date ordered and also all subcategories
* categories specified as being top level date ordered categories * of categories specified as being top level date ordered categories in
* in config * config
*
* @return * @return
*/ */
public Collection getDateOrderedCategories(PageState state) { public Collection getDateOrderedCategories(PageState state) {
@ -302,56 +327,57 @@ public final class NavigationConfig extends AbstractConfig {
if (state == null) { if (state == null) {
categories = getCurrentDateOrderCategories(); categories = getCurrentDateOrderCategories();
} else { } else {
categories = (Collection)m_allDateOrderCategories.get(state); categories = (Collection) m_allDateOrderCategories.get(state);
} }
return categories; return categories;
} }
public boolean isDateOrderedCategory (Category cat, PageState state) { public boolean isDateOrderedCategory(Category cat, PageState state) {
return getDateOrderedCategories(state).contains(cat.getID().toString()); return getDateOrderedCategories(state).contains(cat.getID().toString());
} }
private Collection getCurrentDateOrderCategories () { private Collection getCurrentDateOrderCategories() {
if (s_fixedDateOrderCats == null) { if (s_fixedDateOrderCats == null) {
populateFixedDateOrderCats(); populateFixedDateOrderCats();
} }
String[] topLevelCats = (String[]) get(m_topLevelDateOrderCategories); String[] topLevelCats = (String[]) get(m_topLevelDateOrderCategories);
Set allCats = new HashSet(); Set allCats = new HashSet();
allCats.addAll(s_fixedDateOrderCats); allCats.addAll(s_fixedDateOrderCats);
for (int i = 0; i < topLevelCats.length; i++) { for (int i = 0; i < topLevelCats.length; i++) {
try { try {
String[] categoryArray = StringUtils.split(topLevelCats[i], ':'); String[] categoryArray = StringUtils.split(topLevelCats[i], ':');
String order = ""; String order = "";
if (categoryArray.length > 1) { if (categoryArray.length > 1) {
order = ":" + categoryArray[1]; order = ":" + categoryArray[1];
} }
Category topLevelCat = new Category(new BigDecimal(categoryArray[0])); Category topLevelCat = new Category(new BigDecimal(
s_log.debug("retrieved top level category " + topLevelCat); categoryArray[0]));
Set childCats = new HashSet(); s_log.debug("retrieved top level category " + topLevelCat);
CategoryCollection children = topLevelCat.getDescendants(); Set childCats = new HashSet();
while (children.next()) { CategoryCollection children = topLevelCat.getDescendants();
BigDecimal id = children.getCategory().getID(); while (children.next()) {
childCats.add(id.toString() + order); BigDecimal id = children.getCategory().getID();
} childCats.add(id.toString() + order);
}
allCats.addAll(childCats); allCats.addAll(childCats);
} catch (DataObjectNotFoundException e) { } catch (DataObjectNotFoundException e) {
// non existent category id specified in configuration. Output warning to // non existent category id specified in configuration. Output warning to
// logs and continue // logs and continue
s_log.warn("Category with id " + topLevelCats[i] + s_log.warn("Category with id " + topLevelCats[i]
" specified in configuration as a top level date order category, " + + " specified in configuration as a top level date order category, "
"but the category does not exist"); + "but the category does not exist");
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// non number specified in configuration. Output warning to // non number specified in configuration. Output warning to
// logs and continue // logs and continue
s_log.warn("Category with id " + topLevelCats[i] + s_log.warn("Category with id " + topLevelCats[i]
" specified in configuration as a top level date order category, "+ + " specified in configuration as a top level date order category, "
"but this is not a valid number"); + "but this is not a valid number");
} }
} }
return allCats; return allCats;
} }
@ -360,49 +386,54 @@ public final class NavigationConfig extends AbstractConfig {
// concurrently first time after server restart // concurrently first time after server restart
private synchronized void populateFixedDateOrderCats() { private synchronized void populateFixedDateOrderCats() {
String[] catArray = (String[]) get(m_dateOrderCategories); String[] catArray = (String[]) get(m_dateOrderCategories);
s_fixedDateOrderCats = new HashSet(); s_fixedDateOrderCats = new HashSet();
for (int i = 0; i < catArray.length; i++) { for (int i = 0; i < catArray.length; i++) {
try { try {
// don't need to do this, as including invalid or non existent // don't need to do this, as including invalid or non existent
// ids will not have any adverse effects, but this gives us a chance to // ids will not have any adverse effects, but this gives us a chance to
// provide some warning to the users when they find that a category // provide some warning to the users when they find that a category
// they expected to be date ordered isn't because they mistyped etc. // they expected to be date ordered isn't because they mistyped etc.
// This only occurs once, first time navigation page is accessed after // This only occurs once, first time navigation page is accessed after
// server restart // server restart
String[] category = StringUtils.split(catArray[i], ':'); String[] category = StringUtils.split(catArray[i], ':');
Category cat = new Category(new BigDecimal(category[0])); Category cat = new Category(new BigDecimal(category[0]));
} catch (DataObjectNotFoundException e) { } catch (DataObjectNotFoundException e) {
// non existent category id specified in configuration. Output warning to // non existent category id specified in configuration. Output warning to
// logs and continue // logs and continue
s_log.warn("Category with id " + catArray[i] + s_log.warn("Category with id " + catArray[i]
" specified in configuration as a date ordered category, but the category" + + " specified in configuration as a date ordered category, but the category"
"does not exist"); + "does not exist");
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// non number specified in configuration. Output warning to // non number specified in configuration. Output warning to
// logs and continue // logs and continue
s_log.warn("Category with id " + catArray[i] + s_log.warn("Category with id " + catArray[i]
" specified in configuration as a date ordered category, "+ + " specified in configuration as a date ordered category, "
"but this is not a valid number"); + "but this is not a valid number");
} }
s_fixedDateOrderCats.add(catArray[i]); s_fixedDateOrderCats.add(catArray[i]);
} }
} }
public final TreeCatProvider getDefaultMenuCatProvider() { public final TreeCatProvider getDefaultMenuCatProvider() {
if (null == m_treeCatProvider) { if (null == m_treeCatProvider) {
try { try {
Class providerClass = (Class) get(m_defaultMenuCatProvider); Class providerClass = (Class) get(m_defaultMenuCatProvider);
if (providerClass == null) { if (providerClass == null) {
m_treeCatProvider = new Menu(); m_treeCatProvider = new Menu();
} else { } else {
m_treeCatProvider = (TreeCatProvider) providerClass.newInstance(); m_treeCatProvider = (TreeCatProvider) providerClass
} .newInstance();
} catch (Exception ex) { }
throw new UncheckedWrapperException(ex); } catch (Exception ex) {
} throw new UncheckedWrapperException(ex);
} }
return m_treeCatProvider; }
return m_treeCatProvider;
}
public Boolean getUseLanguageExtension() {
return (Boolean) get(m_useLanguageExtension);
} }
} }

View File

@ -82,3 +82,8 @@ com.arsdigita.navigation.default_menu_cat_provider.title=Default Menu Category P
com.arsdigita.navigation.default_menu_cat_provider.purpose=Class that provides categories included in menu for any categories that do not have an alternative provider registered com.arsdigita.navigation.default_menu_cat_provider.purpose=Class that provides categories included in menu for any categories that do not have an alternative provider registered
com.arsdigita.navigation.default_menu_cat_provider.example=com.arsdigita.navigation.ui.category.TreeCatProviderImpl com.arsdigita.navigation.default_menu_cat_provider.example=com.arsdigita.navigation.ui.category.TreeCatProviderImpl
com.arsdigita.navigation.default_menu_cat_provider.format=[class] com.arsdigita.navigation.default_menu_cat_provider.format=[class]
com.arsdigita.navigation.use_language_extension.title=Use language extension
com.arsdigita.navigation.use_language_extension.purpose=Use language extension to distiguish language version.
com.arsdigita.navigation.use_language_extension.example=true
com.arsdigita.navigation.use_language_extension.format=[Boolean]

View File

@ -43,16 +43,18 @@ import com.arsdigita.web.Application;
import com.arsdigita.web.DefaultApplicationFileResolver; import com.arsdigita.web.DefaultApplicationFileResolver;
import com.arsdigita.web.Web; import com.arsdigita.web.Web;
import com.arsdigita.globalization.GlobalizationHelper;
/** /**
* Manages the processing of URLs in the Navigation application. * Manages the processing of URLs in the Navigation application.
* *
*/ */
public class NavigationFileResolver extends DefaultApplicationFileResolver { public class NavigationFileResolver extends DefaultApplicationFileResolver {
private static final Logger s_log = private static final Logger s_log = Logger.getLogger(
Logger.getLogger(NavigationFileResolver.class); NavigationFileResolver.class);
private static final String CATEGORY_PATH_ATTR = private static final String CATEGORY_PATH_ATTR
NavigationFileResolver.class + ".categoryPath"; = NavigationFileResolver.class + ".categoryPath";
// path is set in a cookie, which navigation models may use if they wish // path is set in a cookie, which navigation models may use if they wish
public static final String PATH_COOKIE_NAME = "ad_path"; public static final String PATH_COOKIE_NAME = "ad_path";
public static final char PATH_COOKIE_SEPARATOR = '|'; public static final char PATH_COOKIE_SEPARATOR = '|';
@ -71,6 +73,14 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
s_log.debug("Resolving " + path); s_log.debug("Resolving " + path);
} }
if (Navigation.getConfig().getUseLanguageExtension()
&& path.matches("(.*)/index\\.[a-zA-Z]{2}")) {
final String lang = path.substring(path.length() - 2);
path = path.substring(0, path.length() - "index.$$".length());
GlobalizationHelper.setSelectedLocale(lang);
}
if (path.equals("/category.jsp")) { if (path.equals("/category.jsp")) {
Navigation nav = (Navigation) Web.getWebContext().getApplication(); Navigation nav = (Navigation) Web.getWebContext().getApplication();
@ -105,14 +115,16 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
// check that the category is in the tree of categories // check that the category is in the tree of categories
Category root = null; Category root = null;
DataCollection objs = SessionManager.getSession() DataCollection objs = SessionManager.getSession()
.retrieve(Domain.BASE_DATA_OBJECT_TYPE); .retrieve(Domain.BASE_DATA_OBJECT_TYPE);
objs.addEqualsFilter("model.ownerUseContext.categoryOwner.id", nav.getID()); objs.addEqualsFilter("model.ownerUseContext.categoryOwner.id", nav
.getID());
String dispatcherContext = null; String dispatcherContext = null;
TemplateContext tc = Navigation.getContext().getTemplateContext(); TemplateContext tc = Navigation.getContext().getTemplateContext();
if (tc != null) { if (tc != null) {
dispatcherContext = tc.getContext(); dispatcherContext = tc.getContext();
} }
objs.addEqualsFilter("model.ownerUseContext.useContext", dispatcherContext); objs.addEqualsFilter("model.ownerUseContext.useContext",
dispatcherContext);
DomainCollection domains = new DomainCollection(objs); DomainCollection domains = new DomainCollection(objs);
if (domains.next()) { if (domains.next()) {
root = ((Domain) domains.getDomainObject()).getModel(); root = ((Domain) domains.getDomainObject()).getModel();
@ -141,7 +153,8 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
cats.add(parents.getCategory()); cats.add(parents.getCategory());
} }
Category[] catsArray = (Category[]) cats.toArray(new Category[cats.size()]); Category[] catsArray = (Category[]) cats.toArray(new Category[cats
.size()]);
sreq.setAttribute(CATEGORY_PATH_ATTR, sreq.setAttribute(CATEGORY_PATH_ATTR,
catsArray); catsArray);
@ -206,9 +219,8 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
// be used if a navigation model retains the cookie. If we link to // be used if a navigation model retains the cookie. If we link to
// another application, it's navigation model may use this when // another application, it's navigation model may use this when
// deciding whether to trust the given path. // deciding whether to trust the given path.
path.append(PATH_COOKIE_SEPARATOR + Kernel.getContext().getResource()
path.append(PATH_COOKIE_SEPARATOR + .getID().toString());
Kernel.getContext().getResource().getID().toString());
for (int i = 0; i < catsArray.length; i++) { for (int i = 0; i < catsArray.length; i++) {
Category cat = catsArray[i]; Category cat = catsArray[i];
path.append(PATH_COOKIE_SEPARATOR + cat.getID().toString()); path.append(PATH_COOKIE_SEPARATOR + cat.getID().toString());
@ -223,7 +235,6 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
} }
resp.addCookie(cookie); resp.addCookie(cookie);
} }
public static Category[] getCategoryPath(HttpServletRequest req) { public static Category[] getCategoryPath(HttpServletRequest req) {
@ -240,10 +251,11 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
} }
/** /**
* *
* @param cat * @param cat
* @param useContext * @param useContext
* @return *
* @return
*/ */
private RequestDispatcher resolveTemplate(Category cat, String useContext) { private RequestDispatcher resolveTemplate(Category cat, String useContext) {
Template template = null; Template template = null;
@ -258,9 +270,9 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
} }
// If there's an explicit use context which doesn't exist, give a 404 // If there's an explicit use context which doesn't exist, give a 404
if (!Template.DEFAULT_USE_CONTEXT.equals(useContext) && null == template) { if (!Template.DEFAULT_USE_CONTEXT.equals(useContext) && null == template) {
s_log.debug("No template found in context " + getTemplateContext() + s_log.debug("No template found in context " + getTemplateContext()
" for category " + cat.getID() + " for category " + cat.getID()
+ " with use context " + useContext); + " with use context " + useContext);
return null; return null;
} }
@ -316,12 +328,13 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
/** /**
* *
* category resolution retained as an instance method to allow it to be * category resolution retained as an instance method to allow it to be
* overridden. Default functionality contained in static resolveCategory * overridden. Default functionality contained in static resolveCategory
* method. * method.
* *
* @param root * @param root
* @param path * @param path
*
* @return * @return
*/ */
protected Category[] resolvePath(Category root, String path) { protected Category[] resolvePath(Category root, String path) {
@ -329,13 +342,13 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
} }
/** /**
* Match a URL with the category tree and return the requested category * Match a URL with the category tree and return the requested category if
* if exists. * exists.
* *
* Quasimodo: Originally addEqualsFilter has been used to filter the * Quasimodo: Originally addEqualsFilter has been used to filter the
* appropriate category directly inside the SQL query. This isn't possible * appropriate category directly inside the SQL query. This isn't possible
* anymore due to the localised URLs of the new localised categories * anymore due to the localised URLs of the new localised categories (or at
* (or at least: not found it). Therefore we do the filtering in Java now. * least: not found it). Therefore we do the filtering in Java now.
* *
*/ */
public static Category[] resolveCategory(Category root, public static Category[] resolveCategory(Category root,
@ -382,4 +395,5 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
return (Category[]) cats.toArray(new Category[cats.size()]); return (Category[]) cats.toArray(new Category[cats.size()]);
} }
} }