cogExpose a REST API to get a log of document modifications
TypeJAR
Category
Developed by

Thomas Mortagne

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

This extension store in the database a log of document created/deleted/updated and expose it trough a REST API.

The endpoint of the REST API is:

https://myhost/xwiki/rest/docchangelog?start=Tue,%2020%20Oct%202020%2017:11:43%20CEST&end=Tue,%2020%20Oct%202020%2020:11:43%20CEST

  • start: the returned log must be more recent than the start date (inclusive)
  • end: the returned log must be older than the end date (exclusive)

The format of all the dates both as parameter and in the result is following RFC1123 ("EEE, dd MMM yyyy HH:mm:ss zzz").

Both XML (default) and JSON are supported as results (controlled by the HTTP accept).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<documentLogs xmlns="http://www.xwiki.org/docchangelog">
   <start>
        Tue, 18 Aug 2020 10:23:39 CEST
   </start>
   <logs>
       <reference>
            xwiki:Scheduler.NotificationEmailDailySender
       </reference>
       <locale>
       </locale>
       <date>
            Tue, 18 Aug 2020 10:23:39 CEST
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            xwiki:Scheduler.NotificationEmailHourlySender
       </reference>
       <locale>
       </locale>
       <date>
            Tue, 18 Aug 2020 10:23:39 CEST
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            xwiki:Scheduler.NotificationEmailWeeklySender
       </reference>
       <locale>
       </locale>
       <date>
            Tue, 18 Aug 2020 10:23:39 CEST
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            xwiki:XWiki.Notifications.NotificationEmailHourlySender
       </reference>
       <locale>
       </locale>
       <date>
            Wed, 21 Oct 2020 12:00:00 CEST
       </date>
       <type>
            CREATE
       </type>
   </logs>
</documentLogs>
{
 "start": "Tue, 18 Aug 2020 10:23:39 CEST",
 "end": null,
 "logs": [
    {
     "reference": "xwiki:Scheduler.NotificationEmailDailySender",
     "locale": "",
     "date": "Tue, 18 Aug 2020 10:23:39 CEST",
     "type": "UPDATE"
    },
    {
     "reference": "xwiki:Scheduler.NotificationEmailHourlySender",
     "locale": "",
     "date": "Tue, 18 Aug 2020 10:23:39 CEST",
     "type": "UPDATE"
    },
    {
     "reference": "xwiki:Scheduler.NotificationEmailWeeklySender",
     "locale": "",
     "date": "Tue, 18 Aug 2020 10:23:39 CEST",
     "type": "UPDATE"
    },
    {
     "reference": "xwiki:XWiki.Notifications.NotificationEmailHourlySender",
     "locale": "",
     "date": "Wed, 21 Oct 2020 12:00:00 CEST",
     "type": "CREATE"
    }
  ]
}

A JAX-RS model that you can reused in a Java client is provided as part of the module org.xwiki.contrib.docchangelog:docchangelog-model.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.


You will need to restart XWiki after the first installation of this extension.

Release Notes

v1.0.1

v1.0

Dependencies

Dependencies for this extension (org.xwiki.contrib.docchangelog:docchangelog-server 1.0.1):

  • org.xwiki.platform:xwiki-platform-oldcore 11.10
  • org.xwiki.platform:xwiki-platform-rest-server 11.10
  • org.xwiki.contrib.docchangelog:docchangelog-model 1.0.1
Tags:
    

Get Connected