How to change default PageSize

Out of the box, Nuxeo default to 20 items per display page. Users can change that to 50 maximum. I want to remove pagination at all. Or set items/page to very high number (eg 100000) by default

What need to be changed for that ?

0 votes

2 answers

3133 views

ANSWER



Override the default content view definitions to set the default size you want. Not sure of the limit here, but I tried 1250 (with a big test view) and it worked. The on-screen selector for the items/page should be modified or removed to reflect the new max value, otherwise the 1250 items will be displayed but the screen will show 5 (a little confusing). One thing to keep in mind is the potential for performance issues as the number of documents grows.

Items/page can be found in content_view_result_layout_selector.xhtml – to override you'll need to make a contribution.

Default content view can be overriden through an IDE contribution or directly by placing the override file in the nxserver/config directory and naming it

<component name="com.concena.ecm.webapp.contentview.contrib">

  <require>org.nuxeo.ecm.webapp.contentview.contrib</require>
  <extension target="org.nuxeo.ecm.platform.ui.web.ContentViewService"
    point="contentViews">

    <contentView name="document_content">

      <title>label.contentview.document_content</title>
      <translateTitle>true</translateTitle>
      <showTitle>false</showTitle>

      <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="dc:title" operator="FULLTEXT">
            <field schema="advanced_search" name="title" />
          </predicate>
          <predicate parameter="dc:modified" operator="BETWEEN">
            <field schema="advanced_search" name="modified_min" />
            <field schema="advanced_search" name="modified_max" />
          </predicate>
          <fixedPart>
            ecm:parentId = ? AND ecm:isCheckedInVersion = 0 AND
            ecm:mixinType !=
            'HiddenInNavigation' AND ecm:currentLifeCycleState
            != 'deleted'
          </fixedPart>
        </whereClause>
        <parameter>#{currentDocument.id}</parameter>
        <sort column="dc:title" ascending="true" />
        <pageSize>1250</pageSize>
      </coreQueryPageProvider>
1 votes



This is what scare me. Do I really have to override the whole PageProvider for a single property ?
04/21/2012

It's verbose, but I don't think it's all that scary :-) In this case I don't think you can get any more granular and, for example, only contribute a new page size. But it's really just a matter of copy the existing contribution, rename it, add a require, and change the parameter of interest.
04/21/2012

Just did that. But I have a feeling that this is somewhat brittle because now I'm responsible for those nxquery predicates (and other little stuffs). Also I'm still cannot be able to override the "content_view_result_layout_selector.xhtml" More hint is needed. Thanks.
04/21/2012


The default max page size can be controlled by a framework property on future version 5.6, backported on maintenance branches for versions 5.4.2 and 5.5, see https://jira.nuxeo.com/browse/NXP-9052

1 votes