8.4.4. Service configuration

Hereunder is the default configuration of the Calendar Rest service:


<component>
    <type>org.exoplatform.calendar.ws.CalendarRestApi</type>
    <init-params>
        <value-param>
            <name>query_limit</name>
            <value>10</value>
        </value-param>
    </init-params>
</component>

The parameter query_limit is used to limit the number of items returned by a query. This applies on the methods that have query param limit. If limit is absent or it exceeds query_limit, query_limit will be the maximum number of items a query can return.

For example, this query GET /v1/calendar/calendars?limit=20 sends an exceeding limit, so only 10 or fewer items will be returned.

You can use a portal extension to override the service configuration. In your custom-extension.war!/WEB-INF/conf/configuration.xml, write this configuration:


<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
  xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
    <component>
        <type>org.exoplatform.calendar.ws.CalendarRestApi</type>
        <init-params>
            <value-param>
                <name>query_limit</name>
                <value>${exo.calendar.rest.query_limit:100}</value>
            </value-param>
        </init-params>
    </component>
</configuration>

This changes query_limit to 100, or to the value of exo.calendar.rest.query_limit property if that property is set in the exo.properties file.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus