Document Changelog Server

Last modified by Admin on 2021/11/19 01:15

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

Thomas Mortagne

Active Installs1
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=2020-05-29T17%3A16%3A14%2B02%3A00&end=2020-08-30T17%3A16%3A14%2B02%3A00

  • 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 start/end input date and the dates found in the XML version of the response are following the standard JAXB format ("yyyy-MM-dd'T'HH:mm:ssXXX").

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>
        2020-05-29T17:16:14+02:00
   </start>
   <end>
        2020-08-30T17:16:14+02:00
   </end>
   <logs>
       <reference>
            xwiki:XWiki.Notifications.NotificationEmailHourlySender
       </reference>
       <locale>
       </locale>
       <realLocale>
       </realLocale>
       <date>
            2020-06-02T18:00:00+02:00
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            test:Scheduler.NotificationEmailHourlySender
       </reference>
       <locale>
       </locale>
       <realLocale>
       </realLocale>
       <date>
            2020-08-13T10:54:06+02:00
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            test:Scheduler.NotificationEmailDailySender
       </reference>
       <locale>
       </locale>
       <realLocale>
       </realLocale>
       <date>
            2020-08-13T10:54:08+02:00
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            test:Scheduler.NotificationEmailWeeklySender
       </reference>
       <locale>
       </locale>
       <realLocale>
       </realLocale>
       <date>
            2020-08-13T10:54:08+02:00
       </date>
       <type>
            UPDATE
       </type>
   </logs>
   <logs>
       <reference>
            test:XWiki.Notifications.NotificationEmailHourlySender
       </reference>
       <locale>
       </locale>
       <realLocale>
       </realLocale>
       <date>
            2020-08-13T11:00:00+02:00
       </date>
       <type>
            UPDATE
       </type>
   </logs>
</documentLogs>
{
 "start": 1590765374000,
 "end": 1598800574000,
 "logs": [
    {
     "reference": "xwiki:XWiki.Notifications.NotificationEmailHourlySender",
     "locale": "",
     "realLocale": "",
     "date": 1591113600000,
     "type": "UPDATE"
    },
    {
     "reference": "test:Scheduler.NotificationEmailHourlySender",
     "locale": "",
     "realLocale": "",
     "date": 1597308846000,
     "type": "UPDATE"
    },
    {
     "reference": "test:Scheduler.NotificationEmailDailySender",
     "locale": "",
     "realLocale": "",
     "date": 1597308848000,
     "type": "UPDATE"
    },
    {
     "reference": "test:Scheduler.NotificationEmailWeeklySender",
     "locale": "",
     "realLocale": "",
     "date": 1597308848000,
     "type": "UPDATE"
    },
    {
     "reference": "test:XWiki.Notifications.NotificationEmailHourlySender",
     "locale": "",
     "realLocale": "",
     "date": 1597309200000,
     "type": "UPDATE"
    }
  ]
}

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.1.1

v1.1

v1.0.1

v1.0

Dependencies

Dependencies for this extension (org.xwiki.contrib.docchangelog:docchangelog-server 1.1.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.1.1
Tags:
    

Get Connected