Platform Explorer / CMF 1.8

Component org.nuxeo.cm.contentview.search.contrib

Contributions

XML Source

<?xml version="1.0"?>

<component name="org.nuxeo.cm.contentview.search.contrib">
  <require>org.nuxeo.ecm.webapp.contentview.search.contrib</require>

  <extension target="org.nuxeo.ecm.platform.ui.web.ContentViewService"
    point="contentViews">

    <contentView name="simple_search">

      <coreQueryPageProvider>
        <property name="coreSession">#{documentManager}</property>
        <pattern>
          SELECT * FROM Document WHERE ecm:fulltext LIKE ? AND ecm:mixinType !=
          'HiddenInNavigation' AND (ecm:mixinType IN ('Distributable' ,
          'CaseGroupable')) AND ecm:isCheckedInVersion = 0 AND
          ecm:currentLifeCycleState != 'deleted'
        </pattern>
        <parameter>#{documentSearchActions.simpleSearchKeywords}</parameter>
        <sort column="dc:title" ascending="true" />
        <pageSize>20</pageSize>
      </coreQueryPageProvider>

      <useGlobalPageSize>true</useGlobalPageSize>
      <refresh>
        <event>documentChanged</event>
        <event>documentChildrenChanged</event>
      </refresh>
      <cacheKey>only_one_cache</cacheKey>
      <cacheSize>1</cacheSize>

      <resultLayouts>
        <layout name="search_listing_ajax" title="document_listing"
          translateTitle="true" iconPath="/icons/document_listing_icon.png" />
        <layout
          name="document_virtual_navigation_listing_ajax_compact_2_columns"
          title="document_listing_compact_2_columns" translateTitle="true"
          iconPath="/icons/document_listing_compact_2_columns_icon.png" />
        <layout name="document_virtual_navigation_listing_ajax_icon_2_columns"
          title="document_listing_icon_2_columns" translateTitle="true"
          iconPath="/icons/document_listing_icon_2_columns_icon.png" />
      </resultLayouts>

      <selectionList>CURRENT_SELECTION</selectionList>
      <actions category="CURRENT_SELECTION_LIST" />

    </contentView>



    <contentView name="advanced_search">

      <coreQueryPageProvider>
        <property name="coreSession">#{documentManager}</property>
        <whereClause docType="AdvancedSearch">
          <predicate parameter="ecm:fulltext" operator="FULLTEXT">
            <field schema="advanced_search" name="fulltext_all" />
          </predicate>

          <predicate parameter="ecm:isCheckedInVersion" operator="=">
            <field schema="advanced_search" name="isCheckedInVersion" />
          </predicate>

          <predicate parameter="ecm:path" operator="STARTSWITH">
            <field schema="advanced_search" name="searchpath" />
          </predicate>

          <predicate parameter="dc:title" operator="FULLTEXT">
            <field schema="advanced_search" name="title" />
          </predicate>

          <predicate parameter="dc:description" operator="FULLTEXT">
            <field schema="advanced_search" name="description" />
          </predicate>

          <predicate parameter="dc:rights" operator="LIKE">
            <field schema="advanced_search" name="rights" />
          </predicate>

          <predicate parameter="dc:source" operator="LIKE">
            <field schema="advanced_search" name="source" />
          </predicate>

          <predicate parameter="dc:nature" operator="IN">
            <field schema="advanced_search" name="nature" />
          </predicate>

          <predicate parameter="dc:coverage" operator="IN">
            <field schema="advanced_search" name="coverage" />
          </predicate>

          <predicate parameter="dc:subjects" operator="IN">
            <field schema="advanced_search" name="subjects" />
          </predicate>

          <predicate parameter="dc:created" operator="BETWEEN">
            <field schema="advanced_search" name="created_min" />
            <field schema="advanced_search" name="created_max" />
          </predicate>

          <predicate parameter="dc:modified" operator="BETWEEN">
            <field schema="advanced_search" name="modified_min" />
            <field schema="advanced_search" name="modified_max" />
          </predicate>

          <predicate parameter="dc:issued" operator="BETWEEN">
            <field schema="advanced_search" name="issued_min" />
            <field schema="advanced_search" name="issued_max" />
          </predicate>

          <predicate parameter="dc:valid" operator="BETWEEN">
            <field schema="advanced_search" name="valid_min" />
            <field schema="advanced_search" name="valid_max" />
          </predicate>

          <predicate parameter="dc:expired" operator="BETWEEN">
            <field schema="advanced_search" name="expired_min" />
            <field schema="advanced_search" name="expired_max" />
          </predicate>

          <predicate parameter="dc:format" operator="LIKE">
            <field schema="advanced_search" name="format" />
          </predicate>

          <predicate parameter="dc:language" operator="LIKE">
            <field schema="advanced_search" name="language" />
          </predicate>

          <predicate parameter="ecm:currentLifeCycleState" operator="IN">
            <field schema="advanced_search" name="currentLifeCycleStates" />
          </predicate>
          <fixedPart>
            ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0
            AND (ecm:mixinType IN ('CaseGroupable' , 'Distributable'))
          </fixedPart>
        </whereClause>
        <sort column="dc:title" ascending="true" />
        <pageSize>20</pageSize>
      </coreQueryPageProvider>

      <searchLayout name="advanced_search" />

      <useGlobalPageSize>true</useGlobalPageSize>
      <refresh>
        <event>documentChanged</event>
        <event>documentChildrenChanged</event>
      </refresh>
      <cacheKey>only_one_cache</cacheKey>
      <cacheSize>1</cacheSize>

      <!-- TODO: add bindings here instead of search results templates -->

      <resultLayouts>
        <layout name="search_listing_ajax" title="document_listing"
          translateTitle="true" iconPath="/icons/document_listing_icon.png" />
        <layout
          name="document_virtual_navigation_listing_ajax_compact_2_columns"
          title="document_listing_compact_2_columns" translateTitle="true"
          iconPath="/icons/document_listing_compact_2_columns_icon.png" />
        <layout name="document_virtual_navigation_listing_ajax_icon_2_columns"
          title="document_listing_icon_2_columns" translateTitle="true"
          iconPath="/icons/document_listing_icon_2_columns_icon.png" />
      </resultLayouts>

      <selectionList>CURRENT_SELECTION</selectionList>
      <actions category="CURRENT_SELECTION_LIST" />

    </contentView>

  </extension>

</component>