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

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

762 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you