Adding or Updating an Exclusion Calendar

This method creates a named exclusion calendar that you can use when scheduling reports. If the calendar already exists, you have the option of replacing it and updating all the jobs that used it.

Method

URL

PUT

http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs/calendars/<calendarName>?<arguments>

Argument

Type/Value

Description

replace?

true / false

If true, any calendar existing in the JobStore with the same name is overwritten. When this argument is omitted, it is false by default.

update
Triggers?

true / false

Whether or not to update existing triggers that referenced the already existing calendar so that they are based on the new trigger.

Content-Type

Content

application/xml

A well-formed XML calendar descriptor (see examples below).

Return Value on Success

Typical Return Values on Failure

200 OK –

404 Not Found – When the specified calendar name does not exist.

The following examples show the types of exclusion calendars that you can add to the scheduler:

Base calendar.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>base</calendarType>
  <description>Base calendar description</description>
  <timeZone>GMT+03:00</timeZone>
</reportJobCalendar>
Annual calendar – A list of days that you want to exclude every year.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>annual</calendarType>
  <description>Annual calendar description</description>
  <timeZone>GMT+03:00</timeZone>
  <excludeDays>
    <excludeDay>2012-03-20</excludeDay>
    <excludeDay>2012-03-21</excludeDay>
    <excludeDay>2012-03-22</excludeDay>
  </excludeDays>
</reportJobCalendar>
Cron calendar – Defines the days and times to exclude as a cron expression.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>cron</calendarType>
  <description>Cron format description</description>
  <cronExpression>0 30 10-13 ? * WED,FRI</cronExpression>
  <timeZone>GMT+03:00</timeZone>
</reportJobCalendar>
Daily calendar – Defines a time range to exclude every day.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>daily</calendarType>
  <description>Daily calendar description</description>
  <invertTimeRange>false</invertTimeRange>
  <rangeEndingCalendar>2012-03-20T14:44:37.353+03:00</rangeEndingCalendar>
  <rangeStartingCalendar>2012-03-20T14:43:37.353+03:00</rangeStartingCalendar>
  <timeZone>GMT+03:00</timeZone>
</reportJobCalendar>
Holiday calendar – Defines a set of days to exclude that can be updated every year.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>holiday</calendarType>
  <description>Holiday calendar description</description>
  <excludeDays>
    <excludeDay>2012-03-20</excludeDay>
    <excludeDay>2012-03-21</excludeDay>
    <excludeDay>2012-03-22</excludeDay>
  </excludeDays>
  <timeZone>GMT+03:00</timeZone>
</reportJobCalendar>
Weekly calendar – Defines a set of days to be excluded each week.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>weekly</calendarType>
  <description>test description</description>
  <excludeDaysFlags>
    <excludeDayFlag>false</excludeDayFlag> <!--SUNDAY--->
    <excludeDayFlag>true</excludeDayFlag>  <!--MONDAY--->
    <excludeDayFlag>false</excludeDayFlag>  <!--TUESDAY--->
    <excludeDayFlag>true</excludeDayFlag>  <!--WEDNESDAY--->
    <excludeDayFlag>false</excludeDayFlag>  <!--THURSDAY--->
    <excludeDayFlag>true</excludeDayFlag>  <!--FRIDAY--->
    <excludeDayFlag>false</excludeDayFlag>  <!--SATURDAY--->
  </excludeDaysFlags>
  <timeZone>GMT+03:00</timeZone>
</reportJobCalendar>
Monthly calendar – Defines the dates to exclude every month.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
  <calendarType>monthly</calendarType>
  <description>Monthly calendar description</description>
  <excludeDaysFlags>
    <excludeDayFlag>true</excludeDayFlag> <!--01--->
    <excludeDayFlag>false</excludeDayFlag> <!--02--->
    <excludeDayFlag>true</excludeDayFlag> <!--03--->
    <excludeDayFlag>false</excludeDayFlag> <!--04--->
    <excludeDayFlag>true</excludeDayFlag> <!--05--->
    <excludeDayFlag>false</excludeDayFlag> <!--06--->
    <excludeDayFlag>true</excludeDayFlag> <!--07--->
    <excludeDayFlag>false</excludeDayFlag> <!--08--->
    <excludeDayFlag>true</excludeDayFlag> <!--09--->
    <excludeDayFlag>false</excludeDayFlag> <!--10--->
    <excludeDayFlag>true</excludeDayFlag> <!--11--->
    <excludeDayFlag>false</excludeDayFlag> <!--12--->
    <excludeDayFlag>false</excludeDayFlag> <!--13--->
    <excludeDayFlag>true</excludeDayFlag> <!--14--->
    <excludeDayFlag>false</excludeDayFlag> <!--15--->
    <excludeDayFlag>false</excludeDayFlag> <!--16--->
    <excludeDayFlag>false</excludeDayFlag> <!--17--->
    <excludeDayFlag>false</excludeDayFlag> <!--18--->
    <excludeDayFlag>false</excludeDayFlag> <!--19--->
    <excludeDayFlag>false</excludeDayFlag> <!--20--->
    <excludeDayFlag>false</excludeDayFlag> <!--21--->
    <excludeDayFlag>false</excludeDayFlag> <!--22--->
    <excludeDayFlag>false</excludeDayFlag> <!--23--->
    <excludeDayFlag>false</excludeDayFlag> <!--24--->
    <excludeDayFlag>false</excludeDayFlag> <!--25--->
    <excludeDayFlag>false</excludeDayFlag> <!--26--->
    <excludeDayFlag>false</excludeDayFlag> <!--27--->
    <excludeDayFlag>false</excludeDayFlag> <!--28--->
    <excludeDayFlag>false</excludeDayFlag> <!--29--->
    <excludeDayFlag>false</excludeDayFlag> <!--30--->
    <excludeDayFlag>false</excludeDayFlag> <!--31--->
</excludeDaysFlags>
<timeZone>GMT+03:00</timeZone>
</reportJobCalendar>
Version: 
Feedback
randomness