Skip to main content
Skip table of contents

Integrate Midoris Archiving Plugin

The Archiving Plugin for Confluence is a Content Lifecycle Management solution which allows users to keep their Confluence content up-to-date. One feature the app offers is page view tracking of Confluence pages. This page describes how you can integrate this functionality with Scroll Viewport.

Implementation

To use the plugin with Scroll Viewport you need to do a Ajax Request from your theme – like the plugin does with the Confluence UI.

First, you need to have access to our $page.id placeholder result in our external javascript file. This can be achieved by creating a meta-tag like this:

CODE
<meta name="pageId" content="${page.id}">

This meta-tag then needs to be included inside the html-head, so it can be accessed on all pages.

After the page id is included in the html-head, you need to do the Ajax Request.

Ideally, this request should be placed somewhere where it gets executed every time someone views the page. The best place to include this would be immediately after the DOM is loaded in your document ready function.

JS
$(function() { 																	// Loads our javascript after them DOM is loaded
	var pageId  = $('meta[name="pageId"]').attr('content');						// we get the page id from our meta-tag
	var baseUrl = $('meta[name="ajs-base-url"]').attr('content');				// our confluence-base url
	var url 	= baseUrl + "/rest/archiving/1.0/content-status/" + pageId;		// we build the url for the request

	$.get( url );																// we execute the GET request to update the page status
}):

After implementing, you can check if the request is made by opening the developer console of your browser and checking the XHR request. This is an example of what the request should look like:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.