Search code examples
xwiki

Is there any API to automate extension installation in XWiki?


I use xwiki Enterprise 7.4. The official way to install extensions is to use either Import feature or Extension Manager. Both ways require user interaction. I would like to automate extension installation process, so no user interactions for extension installation. Is it possible? I've automated spaces/pages creation via REST API. Maybe it's possible to use REST API to do it, I can't find it in documentation.

Why do I need it? It's simple: I've automated all the steps of deployment/migration process for my application and I would like to automate xwiki extension installation too.


Solution

  • All you need is to put the Thomas' script in a page. You can use the REST API for that. See: http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HPageresources

    Then you call the URL from your application.

    Ex: you put the code in XWiki/AutoInstall with a REST call and then you can call this page with the following url:

    http://localhost:8080/xwiki/bin/get/XWiki/AutoInstall
    

    I suggest to use the "get" action from the URL to avoid unnecessary informations.