Navigation tree size

How do I change the left-hand navigation tree to display more than 50 children for a folder?

1 votes

1 answers

1376 views

ANSWER



In Nuxeo 5.4.2 and beyond this can be done by overriding the tree_children PageProvider and changing the pageSize:

 <require>org.nuxeo.ecm.webapp.pageproviders.contrib</require>

 <extension target="org.nuxeo.ecm.platform.query.api.PageProviderService"
    point="providers">
    <coreQueryPageProvider name="tree_children">
      <pattern>
        SELECT * FROM Document WHERE ecm:parentId = ? AND ecm:isProxy = 0 AND
        ecm:mixinType = 'Folderish' AND ecm:mixinType != 'HiddenInNavigation'
        AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState !=
        'deleted'
      </pattern>
      <sort column="dc:title" ascending="true" />
      <pageSize>50</pageSize>
    </coreQueryPageProvider>
  </extension>

In Nuxeo 5.4.1 and earlier you had to override the TREE_CHILDREN QueryModel and provide a new max:

  <require>org.nuxeo.ecm.webapp.querymodel.DefaultQueryModels</require>

  <extension target="org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService"
    point="model">
    <queryModel name="TREE_CHILDREN">
      <pattern>
        SELECT * FROM Document WHERE ecm:parentId = ? AND ecm:isProxy = 0 AND
        ecm:mixinType = 'Folderish' AND ecm:mixinType != 'HiddenInNavigation'
        AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState !=
        'deleted'
      </pattern>
      <sortable defaultSortAscending="true"
        defaultSortColumn="dc:title" value="true" />
      <max>50</max>
    </queryModel>
  </extension>
2 votes



Moreover, note that since Nuxeo 5.4.2 you can also contribute a maxPageSize in a coreQueryPageProvider. The effective page size you get is the min between pageSize and maxPageSize. Default value for maxPageSize is 100.
11/15/2011