ItemSearchWidget
Dieverse Änderungen am ItemSearchWidget * Übersetzung vom Browse-Pane * Such-Fomular erweitert, so daß die Liste der Contenttypen jetzt durch den Basis-CT eingeschränkt wird. * viele andere Kleinigkeiten - hauptsächlich Formatierung git-svn-id: https://svn.libreccm.org/ccm/trunk@636 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e3d3b435ac
commit
b57e0d9474
|
|
@ -28,7 +28,6 @@ package com.arsdigita.cms;
|
|||
* // URL resource: protocol handler removal: START
|
||||
* Will be removed as soon as a stable release 6.6 is created.
|
||||
*/
|
||||
|
||||
import com.arsdigita.bebop.SimpleComponent;
|
||||
import com.arsdigita.bebop.form.DHTMLEditor;
|
||||
import com.arsdigita.categorization.Category;
|
||||
|
|
@ -117,51 +116,37 @@ 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);
|
||||
|
||||
/**
|
||||
* 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",
|
||||
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",
|
||||
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",
|
||||
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 {
|
||||
|
|
@ -177,29 +162,21 @@ 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
|
||||
|
||||
/**
|
||||
* 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",
|
||||
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",
|
||||
private final Parameter m_dhtmlEditorConfig = new DHTMLEditorConfigParameter("com.arsdigita.cms.dhtml_editor_config",
|
||||
Parameter.REQUIRED,
|
||||
new DHTMLEditor.Config("XinhaConfig",
|
||||
"/assets/xinha/CCMcmsXinhaConfig.js"));
|
||||
|
|
@ -213,222 +190,149 @@ public final class CMSConfig extends AbstractConfig {
|
|||
// content items for links and internal image assets, which may not
|
||||
// be accessable by other modules which use DHTMLeditor.
|
||||
// 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]
|
||||
*/
|
||||
private final Parameter
|
||||
m_dhtmlEditorPlugins = new StringArrayParameter
|
||||
("com.arsdigita.cms.dhtml_editor_plugins",
|
||||
private final Parameter m_dhtmlEditorPlugins = new StringArrayParameter("com.arsdigita.cms.dhtml_editor_plugins",
|
||||
Parameter.OPTIONAL,
|
||||
null);
|
||||
|
||||
/**
|
||||
* 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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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));
|
||||
|
||||
/**
|
||||
* 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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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."+
|
||||
"RelatedLinkPropertyForm.hideAdditionalResourceFields",
|
||||
private final Parameter m_hideAdditionalResourceFields = new BooleanParameter("com.arsdigita.cms.contentassets.ui."
|
||||
+ "RelatedLinkPropertyForm.hideAdditionalResourceFields",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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);
|
||||
|
||||
/**
|
||||
* 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",
|
||||
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));
|
||||
|
||||
/**
|
||||
* Keyword Weight, the relative weight given to the dcKeywords element
|
||||
* 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));
|
||||
|
||||
/**
|
||||
* Asset steps to skip, specify asset steps that are not relevant for
|
||||
* specific content types.
|
||||
|
|
@ -438,101 +342,69 @@ 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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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));
|
||||
|
||||
|
||||
// ///////////////////////////////////////////
|
||||
// Notification related parameters
|
||||
// ///////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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
|
||||
// ////////////////////////////////////////////////////
|
||||
|
|
@ -540,21 +412,15 @@ public final class CMSConfig extends AbstractConfig {
|
|||
* 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",
|
||||
Parameter.REQUIRED,
|
||||
"/WEB-INF/resources/content-center-map.xml");
|
||||
|
||||
|
||||
// ///////////////////////////////////////////
|
||||
// Content Section config related parameters
|
||||
// ///////////////////////////////////////////
|
||||
private final Parameter
|
||||
m_defaultSection = new StringParameter
|
||||
("com.arsdigita.cms.default_content_section",
|
||||
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
|
||||
|
|
@ -562,30 +428,26 @@ 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",
|
||||
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_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",
|
||||
Parameter.REQUIRED, "browse");
|
||||
|
||||
// ///////////////////////////////////////////
|
||||
// publishToFile package related parameter
|
||||
// ///////////////////////////////////////////
|
||||
|
||||
// Moved to publishToFile.PublishToFileConfig as of version 6.0.2
|
||||
// private final Parameter m_disableItemPfs;
|
||||
// private final Parameter m_publishToFileClass;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor, but do NOT instantiate this class directly.
|
||||
*
|
||||
|
|
@ -652,6 +514,8 @@ public final class CMSConfig extends AbstractConfig {
|
|||
register(m_defaultItemResolverClass);
|
||||
register(m_defaultTemplateResolverClass);
|
||||
|
||||
register(m_itemSearchDefaultTab);
|
||||
|
||||
// publishToFile package related parameter
|
||||
// Moved to publishToFile.PublishToFileConfig as of version 6.0.2
|
||||
// register(m_disableItemPfs);
|
||||
|
|
@ -795,7 +659,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
// ///////////////////////////////////////////
|
||||
// publishToFile package related configuration
|
||||
// ///////////////////////////////////////////
|
||||
|
||||
// Moved to publishToFile.PublishToFileConfig! Temporarily retained here
|
||||
// for backwards compatibility
|
||||
public final boolean getDisableItemPfs() {
|
||||
|
|
@ -808,7 +671,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
return PublishToFileConfig.getConfig().getPublishListenerClass();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch the file name contaning XML Mapping of the content center tabs
|
||||
* to URLs
|
||||
|
|
@ -818,7 +680,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
return (String) get(m_contentCenterMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Internal class representing a DHTMLEditor configuration parameter. It
|
||||
* creates a new DHMTLEditor Config object (internal class in DHTMLEditor).
|
||||
|
|
@ -833,6 +694,7 @@ public final class CMSConfig extends AbstractConfig {
|
|||
* (pboy, 2010-09-02)
|
||||
*/
|
||||
private class DHTMLEditorConfigParameter extends StringParameter {
|
||||
|
||||
public DHTMLEditorConfigParameter(final String name,
|
||||
final int multiplicity,
|
||||
final Object defaultObj) {
|
||||
|
|
@ -850,8 +712,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
return DHTMLEditor.Config.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected static HashMap extraXMLGenerators = new HashMap();
|
||||
|
||||
/** Add one ExtraXMLGenerator to the list. */
|
||||
|
|
@ -871,6 +731,7 @@ public final class CMSConfig extends AbstractConfig {
|
|||
public static Iterator getExtraXMLGeneratorsIterator() {
|
||||
return extraXMLGenerators.entrySet().iterator();
|
||||
}
|
||||
|
||||
public final boolean hideResetLifecycleLink() {
|
||||
return ((Boolean) get(m_hideResetLifecycleLink)).booleanValue();
|
||||
}
|
||||
|
|
@ -905,7 +766,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
return ((Boolean) get(m_scoreTitleAndKeywords)).booleanValue();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* for the given content type, returns a collection of
|
||||
* steps that are deemed irrelevant for the type.
|
||||
|
|
@ -1024,4 +884,8 @@ public final class CMSConfig extends AbstractConfig {
|
|||
public final boolean getAllowContentCreateInSectionListing() {
|
||||
return ((Boolean) get(m_allowContentCreateInSectionListing)).booleanValue();
|
||||
}
|
||||
|
||||
public String getItemSearchDefaultTab() {
|
||||
return (String) get(m_itemSearchDefaultTab);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,3 +227,14 @@ com.arsdigita.cms.allow_content_create_in_section_listing.title=Allow content cr
|
|||
com.arsdigita.cms.allow_content_create_in_section_listing.purpose=Allows you to turn off the ability to create content in the section listing
|
||||
com.arsdigita.cms.allow_content_create_in_section_listing.example=true
|
||||
com.arsdigita.cms.allow_content_create_in_section_listing.format=[boolean]
|
||||
|
||||
com.arsdigita.cms.item_search.default_tab.title=Set the default tabe for ItemSearchWidget
|
||||
com.arsdigita.cms.item_search.default_tab.purpose=Select either "browse" or "search" for default tab
|
||||
com.arsdigita.cms.item_search.default_tab.example=browse
|
||||
com.arsdigita.cms.item_search.default_tab.format=[string]
|
||||
|
||||
com.arsdigita.cms.item_search.xx.title=
|
||||
com.arsdigita.cms.item_search.xx.purpose=
|
||||
com.arsdigita.cms.item_search.xx.example=
|
||||
com.arsdigita.cms.item_search.xx.format=[string]
|
||||
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ cms.ui.search_prompt=Search to add new members
|
|||
cms.ui.search_to_add_new_members=Search to Add New Members
|
||||
cms.ui.search_errors.empty_terms=Please enter some search terms
|
||||
cms.ui.search_errors.bad_terms=Your search terms contain illegal words or characters
|
||||
cms.ui.search_no_results=Sorry. Your search returned 0 results.
|
||||
cms.ui.select_one=--select one--
|
||||
cms.ui.sign_out=Sign out
|
||||
cms.ui.submission_cancelled=Submission Cancelled
|
||||
|
|
@ -346,6 +347,10 @@ cms.ui.workflow_profile_exists_on_selected_folder=Workflow Profile exists on sel
|
|||
cms.ui.yes=Yes
|
||||
cms.ui.you_do_not_have_sufficient_privileges_to_access_this_page=You do not have sufficient privileges to access this page.
|
||||
|
||||
cms.ui.item_search.page_title=Item Search
|
||||
cms.ui.item_search.browse=Browse
|
||||
cms.ui.item_search.search=Search
|
||||
|
||||
|
||||
# Package com.arsdigita.cms.ui.authoring
|
||||
# ======================================
|
||||
|
|
|
|||
|
|
@ -314,6 +314,7 @@ cms.ui.search_prompt=Suche um neue Mitglieder zu erg\u00e4nzen
|
|||
cms.ui.search_to_add_new_members=Suche um neue Mitglieder zu erg\u00e4nzen
|
||||
cms.ui.search_errors.empty_terms=Bitte Suchbegriffe eingeben
|
||||
cms.ui.search_errors.bad_terms=Your search terms contain illegal words or characters
|
||||
cms.ui.search_no_results=Ihre Suche ergab leider keine Treffer.
|
||||
cms.ui.select_one=--ausw\u00e4hlen--
|
||||
cms.ui.sign_out=Abmelden
|
||||
cms.ui.submission_cancelled=Prozess abgebrochen
|
||||
|
|
@ -345,7 +346,9 @@ cms.ui.workflow_profile_exists_on_selected_folder=Ablaufprofil existiert f\u00fc
|
|||
cms.ui.yes=Ja
|
||||
cms.ui.you_do_not_have_sufficient_privileges_to_access_this_page=Unzureichende Zugriffsrechte f\u00fcr diese Seite.
|
||||
|
||||
|
||||
cms.ui.item_search.page_title=Dokumentensuche
|
||||
cms.ui.item_search.browse=Bl\u00e4ttern
|
||||
cms.ui.item_search.search=Suchen
|
||||
|
||||
# Package com.arsdigita.cms.ui.authoring
|
||||
# ======================================
|
||||
|
|
|
|||
|
|
@ -35,11 +35,13 @@ import com.arsdigita.globalization.Locale;
|
|||
import com.arsdigita.kernel.Group;
|
||||
import com.arsdigita.kernel.SiteNode;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.persistence.CompoundFilter;
|
||||
import com.arsdigita.persistence.DataAssociation;
|
||||
import com.arsdigita.persistence.DataAssociationCursor;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.DataQuery;
|
||||
import com.arsdigita.persistence.FilterFactory;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
|
@ -53,6 +55,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* <p>A content section represents a collection of content that is
|
||||
|
|
@ -776,6 +779,32 @@ public class ContentSection extends Application {
|
|||
return types;
|
||||
}
|
||||
|
||||
public ContentTypeCollection getSiblingsOfContentType(ContentType ct) {
|
||||
ContentTypeCollection ctc = getContentTypes();
|
||||
|
||||
// The Filter Factory
|
||||
FilterFactory ff = ctc.getFilterFactory();
|
||||
|
||||
// Create an or-filter
|
||||
CompoundFilter or = ff.or();
|
||||
|
||||
// The content type must be either of the requested type
|
||||
or.addFilter(ff.equals(ContentType.ID, ct.ID));
|
||||
|
||||
// Or must be a sibling of the requested type
|
||||
try {
|
||||
StringTokenizer strTok = new StringTokenizer(ct.getSiblings(), "/");
|
||||
while (strTok.hasMoreElements()) {
|
||||
or.addFilter(ff.equals(ContentType.ID, (String) strTok.nextElement()));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// WTF? The selected content type does not exist in the table???
|
||||
}
|
||||
|
||||
ctc.addFilter(or);
|
||||
return ctc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all user-defined content types registered to the content section
|
||||
* that can be created.
|
||||
|
|
|
|||
|
|
@ -583,6 +583,7 @@ public class ContentType extends ACSObject {
|
|||
ctc.addFilter(or);
|
||||
return ctc;
|
||||
}
|
||||
|
||||
private static List s_xsl = new ArrayList();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.ui;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Resettable;
|
||||
|
|
@ -34,15 +33,11 @@ import com.arsdigita.search.ui.QueryGenerator;
|
|||
* @author Stanislav Freidin (sfreidin@arsdigita.com)
|
||||
* @version $Id: ItemSearch.java 1940 2009-05-29 07:15:05Z terry $
|
||||
*/
|
||||
public class ItemSearch extends Form
|
||||
implements Resettable, QueryGenerator {
|
||||
public class ItemSearch extends Form implements Resettable, QueryGenerator {
|
||||
|
||||
private static final org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(ItemSearch.class);
|
||||
|
||||
public static final String SINGLE_TYPE_PARAM
|
||||
= ItemSearchSection.SINGLE_TYPE_PARAM;
|
||||
|
||||
public static final String SINGLE_TYPE_PARAM = ItemSearchSection.SINGLE_TYPE_PARAM;
|
||||
private ItemSearchSection m_section;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(ItemSearchBrowsePane.class);
|
||||
|
||||
private FolderSelectionModel m_folderSel;
|
||||
private Tree m_tree;
|
||||
private ItemSearchFolderBrowser m_browser;
|
||||
|
|
@ -74,7 +73,7 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
|
||||
public ItemSearchBrowsePane() {
|
||||
setClassAttr("sidebarNavPanel");
|
||||
setAttribute("navbar-title", "Folders");
|
||||
setAttribute("navbar-title", GlobalizationUtil.globalize("cms.ui.folder_browser").localize().toString());
|
||||
|
||||
Label l = new Label(GlobalizationUtil.globalize("cms.ui.folder_browser"));
|
||||
l.setClassAttr("heading");
|
||||
|
|
@ -87,10 +86,14 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
s_log.debug("linksOnlyInSameSubsite value is " + linksOnlyInSameSubsite);
|
||||
|
||||
m_tree = new Tree(new FolderTreeModelBuilder() {
|
||||
|
||||
@Override
|
||||
protected Folder getRoot(PageState ps) {
|
||||
Folder root = getRootFolder(ps);
|
||||
|
||||
if( null == root ) return super.getRoot( ps );
|
||||
if (null == root) {
|
||||
return super.getRoot(ps);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
});
|
||||
|
|
@ -133,6 +136,7 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
}
|
||||
|
||||
sectionForm.addInitListener(new FormInitListener() {
|
||||
|
||||
public void init(FormSectionEvent ev) {
|
||||
PageState ps = ev.getPageState();
|
||||
|
||||
|
|
@ -155,16 +159,18 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
// We have more than one subsite to choose between
|
||||
OID sectionOID = (OID) m_section.getValue(ps);
|
||||
if (s_log.isDebugEnabled()) {
|
||||
if( null != sectionOID )
|
||||
if (null != sectionOID) {
|
||||
s_log.debug("Using section " + sectionOID.toString());
|
||||
else
|
||||
} else {
|
||||
s_log.debug("Using default section");
|
||||
}
|
||||
}
|
||||
|
||||
if( null == sectionOID ) return null;
|
||||
if (null == sectionOID) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ContentSection section = (ContentSection)
|
||||
DomainObjectFactory.newInstance( sectionOID );
|
||||
ContentSection section = (ContentSection) DomainObjectFactory.newInstance(sectionOID);
|
||||
|
||||
return section.getRootFolder();
|
||||
} else {
|
||||
|
|
@ -214,7 +220,6 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
}
|
||||
|
||||
// Implement TreeExpansionListener
|
||||
|
||||
public void treeCollapsed(TreeExpansionEvent e) {
|
||||
PageState s = e.getPageState();
|
||||
m_folderSel.setSelectedKey(s, e.getNodeKey());
|
||||
|
|
@ -262,13 +267,15 @@ public class ItemSearchBrowsePane extends CMSContainer
|
|||
|
||||
private FolderSelectionModel createFolderSelectionModel() {
|
||||
return new FolderSelectionModel("folder") {
|
||||
|
||||
protected BigDecimal getRootFolderID(PageState ps) {
|
||||
Folder root = getRootFolder(ps);
|
||||
|
||||
if( null == root ) return super.getRootFolderID( ps );
|
||||
if (null == root) {
|
||||
return super.getRootFolderID(ps);
|
||||
}
|
||||
return root.getID();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ public class ItemSearchFolderBrowser extends Table {
|
|||
return new Integer((int) itemColl.size());
|
||||
}
|
||||
};
|
||||
|
||||
private RequestLocal m_itemColl = new RequestLocal() {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -23,10 +23,12 @@ import com.arsdigita.bebop.SimpleContainer;
|
|||
import com.arsdigita.bebop.TabbedPane;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.CMSConfig;
|
||||
import com.arsdigita.cms.CMSExcursion;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.dispatcher.CMSPage;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.dispatcher.RequestContext;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.templating.PresentationManager;
|
||||
|
|
@ -48,26 +50,24 @@ import javax.servlet.http.HttpServletResponse;
|
|||
* @version $Revision: #12 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
*/
|
||||
public class ItemSearchPage extends CMSPage {
|
||||
|
||||
private final static String XSL_CLASS = "CMS Admin";
|
||||
|
||||
private TabbedPane m_tabbedPane;
|
||||
|
||||
private ItemSearchBrowsePane m_browse;
|
||||
private ItemSearchPopup m_search;
|
||||
private BigDecimalParameter m_sectionId;
|
||||
|
||||
private static final CMSConfig s_conf = CMSConfig.getInstance();
|
||||
public static final String CONTENT_SECTION = "section_id";
|
||||
|
||||
/**
|
||||
* Construct a new ItemSearchPage
|
||||
*/
|
||||
public ItemSearchPage() {
|
||||
super("Item Search", new SimpleContainer());
|
||||
super(GlobalizationUtil.globalize("cms.ui.item_search.page_title").localize().toString(), new SimpleContainer());
|
||||
|
||||
setClassAttr("cms-admin");
|
||||
|
||||
addGlobalStateParam
|
||||
(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM));
|
||||
addGlobalStateParam(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM));
|
||||
addGlobalStateParam(new StringParameter(ItemSearchPopup.WIDGET_PARAM));
|
||||
|
||||
m_sectionId = new BigDecimalParameter(CONTENT_SECTION);
|
||||
|
|
@ -81,7 +81,6 @@ public class ItemSearchPage extends CMSPage {
|
|||
add(m_tabbedPane);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the Browse pane. Overriding this
|
||||
* method to return null will prevent this tab from appearing.
|
||||
|
|
@ -107,7 +106,6 @@ public class ItemSearchPage extends CMSPage {
|
|||
return m_search;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Created the TabbedPane to use for this page. Sets the class
|
||||
* attribute for this tabbed pane. The default implementation uses a
|
||||
|
|
@ -122,13 +120,21 @@ public class ItemSearchPage extends CMSPage {
|
|||
protected TabbedPane createTabbedPane() {
|
||||
TabbedPane pane = new TabbedPane();
|
||||
pane.setClassAttr(XSL_CLASS);
|
||||
addToPane(pane, "Browse", getBrowsePane());
|
||||
addToPane(pane, "Search", getSearchPane());
|
||||
|
||||
addToPane(pane, "browse", getBrowsePane());
|
||||
addToPane(pane, "search", getSearchPane());
|
||||
|
||||
if(s_conf.getItemSearchDefaultTab().equals("browse")) {
|
||||
pane.setDefaultPane(m_browse);
|
||||
//pane.addActionListener(this);
|
||||
return pane;
|
||||
}
|
||||
if(s_conf.getItemSearchDefaultTab().equals("search")) {
|
||||
pane.setDefaultPane(m_search);
|
||||
}
|
||||
|
||||
//pane.addActionListener(this);
|
||||
// pane.setTabVisible(null, pane, true);
|
||||
return pane;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the specified component, with the specified tab name, to the
|
||||
|
|
@ -140,11 +146,10 @@ public class ItemSearchPage extends CMSPage {
|
|||
*/
|
||||
protected void addToPane(TabbedPane pane, String tabName, Component comp) {
|
||||
if (comp != null) {
|
||||
pane.addTab(tabName, comp);
|
||||
pane.addTab(GlobalizationUtil.globalize("cms.ui.item_search." + tabName).localize().toString(), comp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* When a new tab is selected, reset the state of the
|
||||
* formerly-selected pane.
|
||||
|
|
@ -154,22 +159,22 @@ public class ItemSearchPage extends CMSPage {
|
|||
//public void actionPerformed(ActionEvent event) {
|
||||
//PageState state = event.getPageState();
|
||||
//Component pane = m_tabbedPane.getCurrentPane(state);
|
||||
|
||||
//if ( pane == m_browse ) {
|
||||
// MP: reset tasks pane
|
||||
//} else if ( pane == m_search ) {
|
||||
//m_search.reset(state);
|
||||
//}
|
||||
//}
|
||||
|
||||
/**
|
||||
* This strange voodoo from Dan. No idea what it does.
|
||||
*/
|
||||
@Override
|
||||
public void dispatch(final HttpServletRequest request,
|
||||
final HttpServletResponse response,
|
||||
RequestContext actx)
|
||||
throws IOException, ServletException {
|
||||
new CMSExcursion() {
|
||||
|
||||
public void excurse()
|
||||
throws IOException, ServletException {
|
||||
ContentSection section = null;
|
||||
|
|
@ -178,15 +183,13 @@ public class ItemSearchPage extends CMSPage {
|
|||
section = (ContentSection) app;
|
||||
} else {
|
||||
try {
|
||||
section = new ContentSection
|
||||
((BigDecimal) m_sectionId.transformValue(request));
|
||||
section = new ContentSection((BigDecimal) m_sectionId.transformValue(request));
|
||||
} catch (DataObjectNotFoundException ex) {
|
||||
throw new UncheckedWrapperException(ex);
|
||||
}
|
||||
}
|
||||
setContentSection(section);
|
||||
|
||||
|
||||
final Document doc = buildDocument(request, response);
|
||||
final PresentationManager pm =
|
||||
Templating.getPresentationManager();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.ui;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
|
|
@ -45,10 +44,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||
*/
|
||||
public class ItemSearchPopup extends ItemSearch {
|
||||
|
||||
|
||||
private static final org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(ItemSearchPopup.class);
|
||||
|
||||
public static final String WIDGET_PARAM = "widget";
|
||||
public static final String URL_PARAM = "useURL";
|
||||
|
||||
|
|
@ -63,12 +60,14 @@ public class ItemSearchPopup extends ItemSearch {
|
|||
}
|
||||
|
||||
// Hide results by default
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
p.addGlobalStateParam(new StringParameter(WIDGET_PARAM));
|
||||
p.addGlobalStateParam(new StringParameter(URL_PARAM));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemSearchSection createSearchSection(String context) {
|
||||
return new ItemSearchSectionPopup(context);
|
||||
}
|
||||
|
|
@ -79,6 +78,7 @@ public class ItemSearchPopup extends ItemSearch {
|
|||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component createResultsPane(QueryGenerator generator) {
|
||||
return new PopupResultsPane(generator);
|
||||
}
|
||||
|
|
@ -97,13 +97,14 @@ public class ItemSearchPopup extends ItemSearch {
|
|||
}
|
||||
|
||||
private static class PopupResultsPane extends ResultsPane {
|
||||
|
||||
public PopupResultsPane(QueryGenerator generator) {
|
||||
super(generator);
|
||||
setRelativeURLs(true);
|
||||
}
|
||||
|
||||
protected Element generateDocumentXML(PageState state,
|
||||
Document doc) {
|
||||
@Override
|
||||
protected Element generateDocumentXML(PageState state, Document doc) {
|
||||
Element element = super.generateDocumentXML(state, doc);
|
||||
|
||||
element.addAttribute("class", "jsButton");
|
||||
|
|
@ -114,14 +115,14 @@ public class ItemSearchPopup extends ItemSearch {
|
|||
boolean useURL = "true".equals(
|
||||
state.getValue(new StringParameter(URL_PARAM)));
|
||||
|
||||
String fillString = useURL ?
|
||||
getItemURL(state.getRequest(), doc.getOID()) :
|
||||
doc.getOID().get("id").toString() +
|
||||
" (" + doc.getTitle() + ")";
|
||||
String fillString = useURL
|
||||
? getItemURL(state.getRequest(), doc.getOID())
|
||||
: doc.getOID().get("id").toString()
|
||||
+ " (" + doc.getTitle() + ")";
|
||||
|
||||
Element jsLabel = Search.newElement("jsAction");
|
||||
jsLabel.addAttribute("name", "fillItem" +
|
||||
doc.getOID().get("id") + "()");
|
||||
jsLabel.addAttribute("name", "fillItem"
|
||||
+ doc.getOID().get("id") + "()");
|
||||
jsLabel.setText(generateJSLabel((BigDecimal) doc.getOID().get("id"),
|
||||
widget, fillString));
|
||||
element.addContent(jsLabel);
|
||||
|
|
@ -130,18 +131,18 @@ public class ItemSearchPopup extends ItemSearch {
|
|||
}
|
||||
|
||||
private String generateJSLabel(BigDecimal id, String widget, String fill) {
|
||||
return " <script language=javascript> " +
|
||||
" <!-- \n" +
|
||||
" function fillItem" +
|
||||
id +
|
||||
"() { \n" +
|
||||
" window.opener.document." +
|
||||
widget + ".value=\"" + fill + "\";\n" +
|
||||
" self.close(); \n" +
|
||||
" return false; \n" +
|
||||
" } \n" +
|
||||
" --> \n" +
|
||||
" </script> ";
|
||||
return " <script language=javascript> "
|
||||
+ " <!-- \n"
|
||||
+ " function fillItem"
|
||||
+ id
|
||||
+ "() { \n"
|
||||
+ " window.opener.document."
|
||||
+ widget + ".value=\"" + fill + "\";\n"
|
||||
+ " self.close(); \n"
|
||||
+ " return false; \n"
|
||||
+ " } \n"
|
||||
+ " --> \n"
|
||||
+ " </script> ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ public class ItemSearchSection extends FormSection
|
|||
m_query = createQueryGenerator(context);
|
||||
m_results = createResultsPane(m_query);
|
||||
|
||||
addResultsPane(this);
|
||||
addQueryGenerator(this);
|
||||
addResultsPane(this);
|
||||
addFormListener();
|
||||
|
||||
setClassAttr("itemSearch");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.ui;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Container;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
|
|
@ -47,11 +46,8 @@ public class ItemSearchSectionInline extends ItemSearchSection {
|
|||
|
||||
private static final org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(ItemSearchSectionInline.class);
|
||||
|
||||
|
||||
private Submit m_selectItem;
|
||||
private String m_name;
|
||||
|
||||
private OIDParameter m_item;
|
||||
|
||||
/**
|
||||
|
|
@ -66,15 +62,18 @@ public class ItemSearchSectionInline extends ItemSearchSection {
|
|||
m_item = new OIDParameter(name + "_itemOID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
p.addGlobalStateParam(m_item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component createResultsPane(QueryGenerator generator) {
|
||||
return new InlineResultsPane(generator);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addResultsPane(Container container) {
|
||||
super.addResultsPane(container);
|
||||
|
||||
|
|
@ -83,10 +82,12 @@ public class ItemSearchSectionInline extends ItemSearchSection {
|
|||
container.add(m_selectItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addFormListener() {
|
||||
// do nothing (ItemSearchWidget's submission listener does this.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processQuery(PageState state) {
|
||||
super.processQuery(state);
|
||||
m_selectItem.setVisible(state, hasQuery(state));
|
||||
|
|
@ -107,25 +108,29 @@ public class ItemSearchSectionInline extends ItemSearchSection {
|
|||
}
|
||||
|
||||
private class ItemSelectSubmit extends Submit {
|
||||
|
||||
public ItemSelectSubmit(String name, String label) {
|
||||
super(name, label);
|
||||
}
|
||||
|
||||
public ItemSelectSubmit(String name, GlobalizedMessage label) {
|
||||
super(name, label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible(PageState ps) {
|
||||
return hasQuery(ps) && super.isVisible(ps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class InlineResultsPane extends ResultsPane {
|
||||
|
||||
public InlineResultsPane(QueryGenerator query) {
|
||||
super(query);
|
||||
setRelativeURLs(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element generateDocumentXML(PageState state,
|
||||
Document doc) {
|
||||
Element element = super.generateDocumentXML(state, doc);
|
||||
|
|
|
|||
|
|
@ -165,8 +165,7 @@ public class ItemSearchWidget extends FormSection
|
|||
/**
|
||||
* Construct a new ItemSearchWidget. The model must be an ItemSearchParameter
|
||||
*/
|
||||
public ItemSearchWidget(ParameterModel model,
|
||||
ContentType contentType) {
|
||||
public ItemSearchWidget(ParameterModel model, ContentType contentType) {
|
||||
super(new BoxPanel(BoxPanel.VERTICAL));
|
||||
|
||||
if (!(model instanceof ItemSearchParameter)) {
|
||||
|
|
@ -267,8 +266,7 @@ public class ItemSearchWidget extends FormSection
|
|||
: ContentType.findByAssociatedObjectType(objectType)));
|
||||
}
|
||||
|
||||
public ItemSearchWidget(String name,
|
||||
ContentType contentType) {
|
||||
public ItemSearchWidget(String name, ContentType contentType) {
|
||||
this(new ItemSearchParameter(name, contentType), contentType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import java.util.Collections;
|
|||
import java.util.Iterator;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* A {@link com.arsdigita.bebop.tree.TreeModelBuilder} that produces trees
|
||||
* containing the folder structure underneath a root folder. The root
|
||||
|
|
@ -56,14 +55,13 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @version $Id: FolderTreeModelBuilder.java 1940 2009-05-29 07:15:05Z terry $
|
||||
*/
|
||||
|
||||
public class FolderTreeModelBuilder extends LockableImpl
|
||||
implements TreeModelBuilder {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(FolderTreeModelBuilder.class);
|
||||
|
||||
private PrivilegeDescriptor TREE_DESCRIPTOR =
|
||||
SecurityManager.CMS_PREVIEW_ITEM_DESCRIPTOR;
|
||||
|
||||
/**
|
||||
* Make a tree model that lists the hierarchy of folders underneath the
|
||||
* folder returnedby {@link #getRoot getRoot}.
|
||||
|
|
@ -78,8 +76,15 @@ public class FolderTreeModelBuilder extends LockableImpl
|
|||
"com.arsdigita.cms.getRootFolder",
|
||||
"com.arsdigita.cms.getSubFolders") {
|
||||
|
||||
@Override
|
||||
public Iterator getChildren(TreeNode node, PageState data) {
|
||||
String nodeKey = node.getKey().toString();
|
||||
|
||||
// Always expand root node
|
||||
if (nodeKey.equals(getRoot(data).getKey().toString())/* && t.isCollapsed(nodeKey, data)*/) {
|
||||
t.expand(nodeKey, data);
|
||||
}
|
||||
|
||||
if (t.isCollapsed(nodeKey, data)) {
|
||||
return Collections.EMPTY_LIST.iterator();
|
||||
}
|
||||
|
|
@ -92,10 +97,8 @@ public class FolderTreeModelBuilder extends LockableImpl
|
|||
partyOID = party.getOID();
|
||||
}
|
||||
UniversalPermissionDescriptor universalPermission =
|
||||
new UniversalPermissionDescriptor
|
||||
(SecurityManager.CMS_PREVIEW_ITEM_DESCRIPTOR, partyOID);
|
||||
if (PermissionService.checkPermission
|
||||
(universalPermission)) {
|
||||
new UniversalPermissionDescriptor(SecurityManager.CMS_PREVIEW_ITEM_DESCRIPTOR, partyOID);
|
||||
if (PermissionService.checkPermission(universalPermission)) {
|
||||
// the person is an admin so we just pass in the
|
||||
// standard, non filtered query
|
||||
return getDataQueryTreeIterator(
|
||||
|
|
@ -124,7 +127,6 @@ public class FolderTreeModelBuilder extends LockableImpl
|
|||
return sec.getRootFolder();
|
||||
}
|
||||
|
||||
|
||||
private class NewFolderBrowserIterator implements Iterator {
|
||||
|
||||
private DataQuery m_nodes;
|
||||
|
|
@ -182,8 +184,7 @@ public class FolderTreeModelBuilder extends LockableImpl
|
|||
m_nodes = new GenericDataQuery(
|
||||
SessionManager.getSession(),
|
||||
sql,
|
||||
new String[] {"id", "name", "nchild"}
|
||||
);
|
||||
new String[]{"id", "name", "nchild"});
|
||||
}
|
||||
|
||||
public Object next() {
|
||||
|
|
@ -192,25 +193,24 @@ public class FolderTreeModelBuilder extends LockableImpl
|
|||
// this appears to be the only portable way to dig numbers out
|
||||
// of the result set
|
||||
id = new BigDecimal(m_nodes.get("id").toString());
|
||||
} catch (NumberFormatException nfe) {}
|
||||
} catch (NumberFormatException nfe) {
|
||||
}
|
||||
String name = m_nodes.get("name").toString();
|
||||
BigDecimal count = new BigDecimal(0);
|
||||
try {
|
||||
count = new BigDecimal(m_nodes.get("nchild").toString());
|
||||
} catch (NumberFormatException nfe) {}
|
||||
} catch (NumberFormatException nfe) {
|
||||
}
|
||||
|
||||
return new DataQueryTreeNode(id, name, count.intValue() > 0);
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException
|
||||
("cannot remove nodes via iterator");
|
||||
throw new UnsupportedOperationException("cannot remove nodes via iterator");
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return m_nodes.next();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.ui.search;
|
||||
|
||||
|
||||
import com.arsdigita.search.ui.FilterWidget;
|
||||
import com.arsdigita.search.Search;
|
||||
import com.arsdigita.search.FilterSpecification;
|
||||
|
|
@ -28,34 +27,101 @@ import com.arsdigita.cms.ContentSection;
|
|||
import com.arsdigita.xml.Element;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.parameters.ArrayParameter;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.search.ContentTypeFilterType;
|
||||
import com.arsdigita.cms.search.ContentTypeFilterSpecification;
|
||||
import com.arsdigita.cms.ui.ItemSearch;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ContentTypeFilterWidget extends FilterWidget {
|
||||
|
||||
private ContentType[] m_types;
|
||||
private ContentType m_parentType = null;
|
||||
private ContentSection m_section = null;
|
||||
private ContentTypeCollection m_types = null;
|
||||
|
||||
public ContentTypeFilterWidget(ContentTypeCollection types) {
|
||||
super(new ContentTypeFilterType(),
|
||||
new ArrayParameter(new StringParameter(ContentTypeFilterType.KEY)));
|
||||
super(new ContentTypeFilterType(), new ArrayParameter(new StringParameter(ContentTypeFilterType.KEY)));
|
||||
m_types = types;
|
||||
}
|
||||
|
||||
m_types = new ContentType[(int)types.size()];
|
||||
int i = 0;
|
||||
while (types.next()) {
|
||||
m_types[i++] = types.getContentType();
|
||||
}
|
||||
}
|
||||
public ContentTypeFilterWidget(ContentSection section) {
|
||||
this(section.getContentTypes());
|
||||
}
|
||||
|
||||
public ContentTypeFilterWidget(ContentSection section, ContentType parentType) {
|
||||
this(section.getSiblingsOfContentType(parentType));
|
||||
m_section = section;
|
||||
m_parentType = parentType;
|
||||
}
|
||||
|
||||
public ContentTypeFilterWidget(ContentType parentType) {
|
||||
this(ContentType.getSiblingsOf(parentType));
|
||||
m_parentType = parentType;
|
||||
}
|
||||
|
||||
public ContentTypeFilterWidget() {
|
||||
this(ContentType.getRegisteredContentTypes());
|
||||
}
|
||||
|
||||
protected ContentSection getContentSection() {
|
||||
return m_section;
|
||||
}
|
||||
|
||||
private ContentType getParentType(PageState state) {
|
||||
|
||||
ContentType ct = m_parentType;
|
||||
|
||||
BigDecimal singleTypeID =
|
||||
(BigDecimal) state.getValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM));
|
||||
|
||||
if (singleTypeID != null) {
|
||||
try {
|
||||
ct = new ContentType(singleTypeID);
|
||||
} catch (DataObjectNotFoundException ex) {
|
||||
ct = null;
|
||||
}
|
||||
}
|
||||
|
||||
return ct;
|
||||
}
|
||||
|
||||
protected ContentType[] getContentTypes(PageState state) {
|
||||
return m_types;
|
||||
|
||||
ContentType parentType = getParentType(state);
|
||||
ContentTypeCollection typesCollection = m_types;
|
||||
|
||||
// If the section and parent type both equals the preset from initializer
|
||||
// there is no need to get a new ContentTypeCollection
|
||||
if (getContentSection() != m_section && parentType != m_parentType) {
|
||||
|
||||
if (getContentSection() != null) {
|
||||
ContentSection section = getContentSection();
|
||||
|
||||
if (parentType == null) {
|
||||
typesCollection = section.getContentTypes();
|
||||
} else {
|
||||
typesCollection = section.getSiblingsOfContentType(parentType);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (parentType == null) {
|
||||
typesCollection = ContentType.getRegisteredContentTypes();
|
||||
} else {
|
||||
typesCollection = ContentType.getSiblingsOf(parentType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContentType[] typesArray = new ContentType[(int) typesCollection.size()];
|
||||
|
||||
for (int i = 0; typesCollection.next();) {
|
||||
typesArray[i++] = typesCollection.getContentType();
|
||||
}
|
||||
|
||||
return typesArray;
|
||||
}
|
||||
|
||||
public FilterSpecification getFilter(PageState state) {
|
||||
|
|
@ -68,8 +134,8 @@ public class ContentTypeFilterWidget extends FilterWidget {
|
|||
return new ContentTypeFilterSpecification(types);
|
||||
}
|
||||
|
||||
public void generateBodyXML(PageState state,
|
||||
Element parent) {
|
||||
@Override
|
||||
public void generateBodyXML(PageState state, Element parent) {
|
||||
super.generateBodyXML(state, parent);
|
||||
|
||||
String[] types = (String[]) getValue(state);
|
||||
|
|
@ -83,15 +149,15 @@ public class ContentTypeFilterWidget extends FilterWidget {
|
|||
Element type = Search.newElement("contentType");
|
||||
type.addAttribute("name", widgetTypes[i].getAssociatedObjectType());
|
||||
type.addAttribute("title", widgetTypes[i].getLabel());
|
||||
|
||||
for (int j = 0; j < types.length; j++) {
|
||||
if (types[j].equals(widgetTypes[i].getAssociatedObjectType())) {
|
||||
type.addAttribute("isSelected", "1");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
parent.addContent(type);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,13 +60,15 @@ public class ItemQueryComponent extends BaseQueryComponent {
|
|||
LaunchDateFilterType.KEY));
|
||||
}
|
||||
|
||||
if (Search.getConfig().isIntermediaEnabled() ||
|
||||
Search.getConfig().isLuceneEnabled()) {
|
||||
if (Search.getConfig().isIntermediaEnabled()
|
||||
|| Search.getConfig().isLuceneEnabled()) {
|
||||
|
||||
add(new PermissionFilterComponent(
|
||||
SecurityManager.CMS_PREVIEW_ITEM));
|
||||
|
||||
add(new SimpleCategoryFilterWidget() {
|
||||
|
||||
@Override
|
||||
protected Category[] getRoots(PageState state) {
|
||||
Category[] roots;
|
||||
if (CMS.getContext().hasContentSection()) {
|
||||
|
|
@ -87,19 +89,13 @@ public class ItemQueryComponent extends BaseQueryComponent {
|
|||
});
|
||||
|
||||
add(new ContentTypeFilterWidget() {
|
||||
protected ContentType[] getContentTypes(PageState state) {
|
||||
// override only if there's content section context
|
||||
|
||||
@Override
|
||||
protected ContentSection getContentSection() {
|
||||
if (CMS.getContext().hasContentSection()) {
|
||||
ContentSection section = CMS.getContext().getContentSection();
|
||||
ContentTypeCollection typesCollection = section.getContentTypes();
|
||||
ContentType[] typesArray = new ContentType[(int)typesCollection.size()];
|
||||
int i = 0;
|
||||
while (typesCollection.next()) {
|
||||
typesArray[i++] = typesCollection.getContentType();
|
||||
}
|
||||
return typesArray;
|
||||
return CMS.getContext().getContentSection();
|
||||
} else {
|
||||
return super.getContentTypes(state);
|
||||
return super.getContentSection();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -122,14 +118,15 @@ public class ItemQueryComponent extends BaseQueryComponent {
|
|||
}
|
||||
|
||||
private class LaunchDateFilterWidget extends DateRangeFilterWidget {
|
||||
|
||||
public LaunchDateFilterWidget(FilterType type, String name) {
|
||||
super(type, name);
|
||||
|
||||
}
|
||||
public boolean isVisible(PageState state) {
|
||||
return !ContentSection.getConfig().getHideLaunchDate() &&
|
||||
super.isVisible(state);
|
||||
}
|
||||
|
||||
public boolean isVisible(PageState state) {
|
||||
return !ContentSection.getConfig().getHideLaunchDate()
|
||||
&& super.isVisible(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.search.ui;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.SimpleComponent;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
|
|
@ -41,15 +40,11 @@ import java.util.Iterator;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
public class ResultsPane extends SimpleComponent {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(ResultsPane.class);
|
||||
|
||||
public static final int PAGE_SIZE = 10;
|
||||
|
||||
private int m_pageSize = PAGE_SIZE;
|
||||
|
||||
private String m_engine;
|
||||
private QueryGenerator m_query;
|
||||
private IntegerParameter m_pageNumber;
|
||||
|
|
@ -75,8 +70,7 @@ public class ResultsPane extends SimpleComponent {
|
|||
m_relative = false;
|
||||
}
|
||||
|
||||
public void generateXML(PageState state,
|
||||
Element parent) {
|
||||
public void generateXML(PageState state, Element parent) {
|
||||
if (!m_query.hasQuery(state)) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("No query available, skipping XMl generation");
|
||||
|
|
@ -87,17 +81,17 @@ public class ResultsPane extends SimpleComponent {
|
|||
QuerySpecification spec = m_query.getQuerySpecification(state);
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
resultSet = m_engine == null ?
|
||||
Search.process(spec) :
|
||||
Search.process(spec,
|
||||
Search.DEFAULT_RESULT_CACHE,
|
||||
m_engine);
|
||||
resultSet = m_engine == null
|
||||
? Search.process(spec)
|
||||
: Search.process(spec, Search.DEFAULT_RESULT_CACHE, m_engine);
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Got result set " + resultSet.getClass() +
|
||||
" count: " + resultSet.getCount());
|
||||
s_log.debug("Got result set " + resultSet.getClass()
|
||||
+ " count: " + resultSet.getCount());
|
||||
}
|
||||
|
||||
if (resultSet.getCount() > 0) {
|
||||
|
||||
Integer page = (Integer) m_pageNumber.transformValue(state.getRequest());
|
||||
int pageNumber = (page == null ? 1 : page.intValue());
|
||||
long objectCount = resultSet.getCount();
|
||||
|
|
@ -121,10 +115,10 @@ public class ResultsPane extends SimpleComponent {
|
|||
exportAttributes(content);
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Paginator stats\n page number:" + pageNumber +
|
||||
"\n page count: "+ pageCount + "\n page size: " +
|
||||
m_pageSize + "\n start " + begin + "\n end: " +
|
||||
end + "\n count: "+ objectCount);
|
||||
s_log.debug("Paginator stats\n page number:" + pageNumber
|
||||
+ "\n page count: " + pageCount + "\n page size: "
|
||||
+ m_pageSize + "\n start " + begin + "\n end: "
|
||||
+ end + "\n count: " + objectCount);
|
||||
}
|
||||
|
||||
content.addContent(generatePaginatorXML(state,
|
||||
|
|
@ -135,6 +129,16 @@ public class ResultsPane extends SimpleComponent {
|
|||
content.addContent(generateDocumentsXML(state, results));
|
||||
|
||||
parent.addContent(content);
|
||||
} else {
|
||||
// No search result, so we don't need a paginator, but we want
|
||||
// to inform the user, that there are no results for this search
|
||||
Element content = Search.newElement("results");
|
||||
Element info = content.newChildElement("info");
|
||||
// info.setText(GlobalizationUtil.globalize("cms.ui.search_no_results").localize().toString());
|
||||
info.setText("Sorry. Your search returned 0 results.");
|
||||
parent.addContent(content);
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (resultSet != null) {
|
||||
try {
|
||||
|
|
@ -174,8 +178,7 @@ public class ResultsPane extends SimpleComponent {
|
|||
}
|
||||
|
||||
paginator.addAttribute("pageParam", m_pageNumber.getName());
|
||||
paginator.addAttribute("baseURL", URL.there(url.getPathInfo(), map)
|
||||
.toString());
|
||||
paginator.addAttribute("baseURL", URL.there(url.getPathInfo(), map).toString());
|
||||
paginator.addAttribute("pageNumber", XML.format(new Integer(pageNumber)));
|
||||
paginator.addAttribute("pageCount", XML.format(new Integer(pageCount)));
|
||||
paginator.addAttribute("pageSize", XML.format(new Integer(pageSize)));
|
||||
|
|
@ -247,6 +250,4 @@ public class ResultsPane extends SimpleComponent {
|
|||
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue