Platform Explorer / CMF 1.8

Component com.nuxeo.casemanagement.querymodel

Contributions

XML Source

<?xml version="1.0"?>

<component name="com.nuxeo.casemanagement.querymodel">
  <require>org.nuxeo.ecm.platform.routing.querymodel</require>
  <extension
    target="org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService"
    point="model">

    <!-- Case Management Default Service -->

    <queryModel name="GET_MAILBOX_FROM_ID">
      <pattern>
        SELECT * FROM Document WHERE mlbx:mailbox_id=? AND
        ecm:currentLifeCycleState != 'deleted' AND ecm:mixinType = 'Mailbox'
      </pattern>
    </queryModel>

    <queryModel name="GET_ALL_MAILBOX">
      <pattern>
        SELECT * FROM Document WHERE ecm:currentLifeCycleState != 'deleted' AND
        ecm:mixinType = 'Mailbox'
      </pattern>
    </queryModel>

    <queryModel name="byType">
      <max>10</max>
      <whereClause>
        <predicate parameter="cmdoc:type" operator="STARTSWITH">
          <field schema="case_item" name="type" />
        </predicate>
        <fixedPart>
          ecm:mixinType != 'HiddenInNavigation' AND ecm:currentLifeCycleState
          !='deleted' AND ecm:mixinType = 'CaseGroupable' AND ecm:mixinType =
          'Distributable'
        </fixedPart>
      </whereClause>
      <sortColumn>
        <field schema="advanced_search" name="sortColumn" />
      </sortColumn>
      <sortAscending>
        <field schema="advanced_search" name="sortAscending" />
      </sortAscending>
    </queryModel>

    <queryModel name="CURRENT_CASE_ITEM_RELATION_SEARCH">
      <pattern>
        SELECT * FROM Document WHERE ecm:mixinType = 'CaseGroupable' AND
        ecm:mixinType = 'Distributable' AND ecm:currentLifeCycleState !=
        'deleted' AND ecm:uuid != ? AND ecm:fulltext LIKE ?
      </pattern>
      <sortable value="true" defaultSortColumn="dc:title"
        defaultSortAscending="true" />
      <max>20</max>
    </queryModel>

    <queryModel name="SIMPLE_SEARCH">
      <pattern>
        SELECT * FROM Document WHERE ecm:fulltext LIKE ? AND ecm:mixinType !=
        'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND
        ecm:currentLifeCycleState != 'deleted' AND ecm:mixinType =
        'CaseGroupable' AND ecm:mixinType = 'Distributable'
      </pattern>
      <max>10</max>
      <sortable value="true" />
    </queryModel>

    <!-- we override the contribution to start route on case only -->
    <queryModel name="CURRENT_DOC_ROUTING_SEARCH_ATTACHED_DOC">
      <pattern>
        SELECT * FROM Document WHERE ecm:currentLifeCycleState != 'deleted'
        AND dc:title LIKE ? AND ecm:mixinType != 'CaseGroupable' AND
        ecm:mixinType = 'Distributable'
      </pattern>
      <sortable value="true" defaultSortColumn="dc:title"
        defaultSortAscending="true" />
      <max>20</max>
    </queryModel>
  </extension>

</component>