From: <ssk...@vh...> - 2005-12-05 15:52:34
|
Author: sskracic Date: 2005-12-05 16:50:17 +0100 (Mon, 05 Dec 2005) New Revision: 1028 Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java Log: Category filtering is now implemented in Lucene as well. Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java 2005-12-05 15:48:55 UTC (rev 1027) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java 2005-12-05 15:50:17 UTC (rev 1028) @@ -48,7 +48,7 @@ * filters supported by the current search query engine. */ public class ItemQueryComponent extends BaseQueryComponent { - + private String m_context; public ItemQueryComponent(String context) { @@ -57,12 +57,19 @@ if (Search.getConfig().isIntermediaEnabled()) { add(new PermissionFilterComponent( SecurityManager.CMS_READ_ITEM)); + add(new LaunchDateFilterWidget(new LaunchDateFilterType(), + LaunchDateFilterType.KEY)); + } + if (Search.getConfig().isIntermediaEnabled() || + Search.getConfig().isLuceneEnabled()) { + if (CMS.getContext().hasContentSection()) { ContentSection section = CMS.getContext().getContentSection(); add(new SimpleCategoryFilterWidget(section.getRootCategory())); + add(new ContentTypeFilterWidget(section)); } else { - ContentSectionCollection sections = + ContentSectionCollection sections = ContentSection.getAllSections(); List cats = new ArrayList(); @@ -72,33 +79,21 @@ } add(new SimpleCategoryFilterWidget( (Category[])cats.toArray(new Category[cats.size()]))); - } - add(new LaunchDateFilterWidget(new LaunchDateFilterType(), - LaunchDateFilterType.KEY)); - } - - if (Search.getConfig().isIntermediaEnabled() || - Search.getConfig().isLuceneEnabled()) { - - if (CMS.getContext().hasContentSection()) { - ContentSection section = CMS.getContext().getContentSection(); - add(new ContentTypeFilterWidget(section)); - } else { add(new ContentTypeFilterWidget()); } add(new VersionFilterComponent(context)); - add(new DateRangeFilterWidget(new LastModifiedDateFilterType(), + add(new DateRangeFilterWidget(new LastModifiedDateFilterType(), LastModifiedDateFilterType.KEY)); - add(new DateRangeFilterWidget(new CreationDateFilterType(), + add(new DateRangeFilterWidget(new CreationDateFilterType(), CreationDateFilterType.KEY)); add(new PartyFilterWidget(new CreationUserFilterType(), CreationUserFilterType.KEY)); add(new PartyFilterWidget(new LastModifiedUserFilterType(), LastModifiedUserFilterType.KEY)); } - - Submit submit = new Submit(m_context + "_search", + + Submit submit = new Submit(m_context + "_search", ContentSectionPage.globalize("cms.ui.search")); add(submit); } |