org.xwiki.extension.handler
Interface ExtensionValidator


@Role
public interface ExtensionValidator

Check if executing a given action on a passed extension is allowed.

Mostly used for default behavior when ExtensionHandler does not have any special check for its type. The goal is to make easy for any environment using commons-extension module to have a default restriction on all extensions types (for example in XWiki unless the type has special checking you need programming right to install an extension).

Since:
4.2M2
Version:
$Id: b80dde20b644b416a37a40f2e57cb1eb5738ade2 $

Method Summary
 void checkInstall(Extension extension, String namespace, Request request)
          Check if installing the passed extension is allowed.
 void checkUninstall(InstalledExtension extension, String namespace, Request request)
          Check if uninstalling the passed extension is allowed.
 

Method Detail

checkInstall

void checkInstall(Extension extension,
                  String namespace,
                  Request request)
                  throws InstallException
Check if installing the passed extension is allowed.

It is generally used to do some non generic checking of whether or not it is possible to install the passed extension (not the right environment, not enough rights, etc.).

Parameters:
extension - the extension to install
namespace - the namespace from where to install
request - extra parameters
Throws:
InstallException - installing the extension will fail

checkUninstall

void checkUninstall(InstalledExtension extension,
                    String namespace,
                    Request request)
                    throws UninstallException
Check if uninstalling the passed extension is allowed.

It is generally used to do some non generic checking of whether or not it is possible to uninstall the passed extension (not the right environment, not enough rights, etc.).

Parameters:
extension - the extension to uninstall
namespace - the namespace from where to uninstall
request - extra parameters
Throws:
UninstallException - uninstalling the extension will fail


Copyright © 2004-2013 XWiki. All Rights Reserved.