Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

API for Plugin Vendors To Hook When Space Gets Backed Up/Restored

Gregory Sudderth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2012

or...

"Need Atlassian-provided API For Plugin Vendors To Use For Serialization of a Page/Space-related Plugin Data"

When a space gets backed up, and restored, it can lose external plugin vendor data, like "this gliffy image goes here". It would be cool if there was an interface that would allow plugin vendors to store that data and retrieve it for the backup/restore process.

The goal is the space/page is restored 100% like it was before backup.

Lemme try my lame agile skills in story lingo:

"As a 3rd party plugin-developer, I'd like to expose a hook that will get called when a Space is being backed up, to allow me to serialize out my plugin-specific context data for the Space being backed up. I'd also like that data to get used to call me to restore it when the Space gets restored."

G.

1 answer

0 votes
Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 13, 2013

Yes. There are 2 kind of exports: Global backup and Space export. The same classes are used by both, so the following method should work for space too.

First, you need to download the source of Confluence, because you'll need it. You can do so at http://my.atlassian.com if you've bought at least a starter license ($10).

Then have a look at FileXmlExporter#backupPluginData(). Any plugin which declares <backup-restore key="..." class="... something implementing BackupRestoreProvider"/> will be run during the back-ups.

A good example is ActiveObjects (source available on BitBucket). It saves data during export:

&lt;backup-restore key="activeObjectsBackupRestoreProvider" class="com.atlassian.activeobjects.confluence.backup.ActiveObjectsBackupRestoreProvider" public="true"/&gt;

Don't forget the public=true, so Confluence can see it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events