Interface InstalledExtensionRepository
-
- All Superinterfaces:
AdvancedSearchable
,ExtensionRepository
,Searchable
@Role public interface InstalledExtensionRepository extends ExtensionRepository, AdvancedSearchable
A repository containing installed extension.It's generally a virtual repository since the actual extension are generally stored in the local repository.
- Since:
- 4.0M2
- Version:
- $Id: b2cfff6e4efbab83e398c214e33f82f983809b48 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
countExtensions()
Collection<InstalledExtension>
getBackwardDependencies(String feature, String namespace)
Get provided installed extension backward dependencies in the provided namespace.default Collection<InstalledExtension>
getBackwardDependencies(String feature, String namespace, boolean withOptionals)
Get provided installed extension backward dependencies in the provided namespace.Map<String,Collection<InstalledExtension>>
getBackwardDependencies(ExtensionId extensionId)
Get all backward dependencies by namespace for the provided installed extension.default Map<String,Collection<InstalledExtension>>
getBackwardDependencies(ExtensionId extensionId, boolean withOptionals)
Get all backward dependencies by namespace for the provided installed extension.InstalledExtension
getInstalledExtension(String feature, String namespace)
Return the installed extension associated to the provided feature for the provided namespace (or root namespace since namespaces inherit from root).InstalledExtension
getInstalledExtension(ExtensionId extensionId)
Return extension descriptor from the repository.Collection<InstalledExtension>
getInstalledExtensions()
Collection<InstalledExtension>
getInstalledExtensions(String namespace)
Return all the extensions available for the provided namespace.default ExtensionNode<InstalledExtension>
getOrphanedDependencies(InstalledExtension extension, Namespace namespace)
Create a dependency tree containing the dependencies which are not shared with other extensions.InstalledExtension
installExtension(LocalExtension extension, String namespace, boolean dependency)
Indicate that the provided extension is installed in the provided namespace.InstalledExtension
installExtension(LocalExtension extension, String namespace, boolean dependency, Map<String,Object> properties)
Indicate that the provided extension is installed in the specified namespace with the given properties.InstalledExtension
resolve(ExtensionDependency extensionDependency)
Return extension descriptor from the repository.InstalledExtension
resolve(ExtensionId extensionId)
Return extension descriptor from the repository.IterableResult<InstalledExtension>
searchInstalledExtensions(String pattern, String namespace, int offset, int nb)
Search installed extensions based of the provided pattern and only in the passed namespace.IterableResult<InstalledExtension>
searchInstalledExtensions(String namespace, ExtensionQuery query)
Search installed extensions based of the provided query and only in the passed namespace.default IterableResult<InstalledExtension>
searchInstalledExtensions(Collection<String> namespaces, ExtensionQuery query)
Search installed extensions based of the provided query and only in the passed namespaces.default IterableResult<InstalledExtension>
searchInstalledExtensions(ExtensionQuery query)
Search installed extensions based of the provided query.void
uninstallExtension(InstalledExtension extension, String namespace)
Indicate that the provided extension is uninstalled from provided namespace.-
Methods inherited from interface org.xwiki.extension.repository.search.AdvancedSearchable
isFilterable, isSortable, search
-
Methods inherited from interface org.xwiki.extension.repository.ExtensionRepository
exists, getDescriptor, getId, resolveVersions
-
Methods inherited from interface org.xwiki.extension.repository.search.Searchable
search
-
-
-
-
Method Detail
-
countExtensions
int countExtensions()
- Returns:
- the number of local extensions
-
getInstalledExtension
InstalledExtension getInstalledExtension(String feature, String namespace)
Return the installed extension associated to the provided feature for the provided namespace (or root namespace since namespaces inherit from root).- Parameters:
feature
- the extension id or provided feature (virtual extension)namespace
- the namespace where the extension is installed, null mean installed in all namespaces (root namespace)- Returns:
- the extension, null if none could be found
-
getInstalledExtensions
Collection<InstalledExtension> getInstalledExtensions()
- Returns:
- all installed local extensions, an empty collection if none could be found
-
getInstalledExtensions
Collection<InstalledExtension> getInstalledExtensions(String namespace)
Return all the extensions available for the provided namespace. This also include root extension since namespaces inherit from root.Note that
getInstalledExtensions()
return all the extensions installed in all namespaces whilegetInstalledExtensions(String)
withnull
return only those that are globally available.- Parameters:
namespace
- the namespace where to search for installed extensions, null mean installed in all namespaces (root namespace)- Returns:
- all the local extensions installed in the provided namespace, an empty collection if none could be found
-
installExtension
InstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency) throws InstallException
Indicate that the provided extension is installed in the provided namespace.- Parameters:
extension
- the extension to installnamespace
- the namespace in which the extension is installeddependency
- indicate if the extension is stored as a dependency of another one- Returns:
- the new
InstalledExtension
- Throws:
InstallException
- error when trying to install provided extension
-
installExtension
InstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency, Map<String,Object> properties) throws InstallException
Indicate that the provided extension is installed in the specified namespace with the given properties.- Parameters:
extension
- the extension to installnamespace
- the namespace in which the extension is installeddependency
- indicate if the installed extension is stored as a dependency of another extensionproperties
- the custom properties to set on the installed extension for the specified namespace- Returns:
- the new
InstalledExtension
- Throws:
InstallException
- error when trying to install provided extension- Since:
- 7.0M2
-
getInstalledExtension
InstalledExtension getInstalledExtension(ExtensionId extensionId)
Return extension descriptor from the repository. If the extension can't be foundnull
is returned.- Parameters:
extensionId
- the extension identifier- Returns:
- the found extension descriptor or null if none could be found
- Since:
- 4.2RC1
-
uninstallExtension
void uninstallExtension(InstalledExtension extension, String namespace) throws UninstallException
Indicate that the provided extension is uninstalled from provided namespace.Extension is never removed form the local repository. It's just namespace related informations.
- Parameters:
extension
- the extension to uninstallnamespace
- the namespace from which the extension is uninstalled- Throws:
UninstallException
- error when trying to uninstall provided extension
-
getBackwardDependencies
Collection<InstalledExtension> getBackwardDependencies(String feature, String namespace) throws ResolveException
Get provided installed extension backward dependencies in the provided namespace.Only look at the backward dependencies in the provided namespace. To get all the dependencies of a root extension (namespace=null) across namespaces use
getBackwardDependencies(ExtensionId)
instead.This does not follow optional dependencies.
- Parameters:
feature
- the extension unique identifiernamespace
- the namespace where to search for backward dependencies- Returns:
- the backward dependencies, an empty collection of none could be found
- Throws:
ResolveException
- error when searching for backward dependencies
-
getBackwardDependencies
default Collection<InstalledExtension> getBackwardDependencies(String feature, String namespace, boolean withOptionals) throws ResolveException
Get provided installed extension backward dependencies in the provided namespace.Only look at the backward dependencies in the provided namespace. To get all the dependencies of a root extension (namespace=null) across namespaces use
getBackwardDependencies(ExtensionId)
instead.- Parameters:
feature
- the extension unique identifierwithOptionals
- include optional dependencies in the searchnamespace
- the namespace where to search for backward dependencies- Returns:
- the backward dependencies, an empty collection of none could be found
- Throws:
ResolveException
- error when searching for backward dependencies- Since:
- 11.10
-
getBackwardDependencies
Map<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId) throws ResolveException
Get all backward dependencies by namespace for the provided installed extension.This does not follow optional dependencies.
- Parameters:
extensionId
- the extension identifier- Returns:
- the extension backward dependencies in all namespaces
- Throws:
ResolveException
- error when searching for extension backward dependencies
-
getBackwardDependencies
default Map<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId, boolean withOptionals) throws ResolveException
Get all backward dependencies by namespace for the provided installed extension.- Parameters:
extensionId
- the extension identifierwithOptionals
- include optional dependencies in the search- Returns:
- the extension backward dependencies in all namespaces
- Throws:
ResolveException
- error when searching for extension backward dependencies- Since:
- 11.10
-
getOrphanedDependencies
default ExtensionNode<InstalledExtension> getOrphanedDependencies(InstalledExtension extension, Namespace namespace)
Create a dependency tree containing the dependencies which are not shared with other extensions.- Parameters:
extension
- the extension for which to resolve the exclusive dependenciesnamespace
- the namespace where to search for orphan extension dependencies- Returns:
- the extensions installed as dependency in the passed namespace and which no longer have backward dependencies if the extension is uninstalled
- Since:
- 11.10
-
resolve
InstalledExtension resolve(ExtensionDependency extensionDependency) throws ResolveException
Description copied from interface:ExtensionRepository
Return extension descriptor from the repository. If the extension can't be found aResolveException
is thrown.- Specified by:
resolve
in interfaceExtensionRepository
- Parameters:
extensionDependency
- the target extension as a dependency- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException
- when the dependency does not match any extension in the repositoryResolveException
- failed to find extension in the repository
-
resolve
InstalledExtension resolve(ExtensionId extensionId) throws ResolveException
Description copied from interface:ExtensionRepository
Return extension descriptor from the repository. If the extension can't be found aResolveException
is thrown.- Specified by:
resolve
in interfaceExtensionRepository
- Parameters:
extensionId
- the extension identifier- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException
- when the extension does not exist in the repositoryResolveException
- failed to find extension in the repository
-
searchInstalledExtensions
IterableResult<InstalledExtension> searchInstalledExtensions(String pattern, String namespace, int offset, int nb) throws SearchException
Search installed extensions based of the provided pattern and only in the passed namespace.The pattern is a simple character chain.
- Parameters:
pattern
- the pattern to searchnamespace
- the namespace where to searchoffset
- the offset from where to start returning search resultsnb
- the maximum number of search results to return- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided pattern- Since:
- 5.3M1
-
searchInstalledExtensions
IterableResult<InstalledExtension> searchInstalledExtensions(String namespace, ExtensionQuery query) throws SearchException
Search installed extensions based of the provided query and only in the passed namespace.- Parameters:
namespace
- the namespace where to searchquery
- the extension query used to filter and order the result- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided pattern- Since:
- 7.0M2
-
searchInstalledExtensions
default IterableResult<InstalledExtension> searchInstalledExtensions(ExtensionQuery query) throws SearchException
Search installed extensions based of the provided query.- Parameters:
query
- the extension query used to filter and order the result- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided pattern- Since:
- 8.1RC1
-
searchInstalledExtensions
default IterableResult<InstalledExtension> searchInstalledExtensions(Collection<String> namespaces, ExtensionQuery query) throws SearchException
Search installed extensions based of the provided query and only in the passed namespaces.- Parameters:
namespaces
- the namespaces where to searchquery
- the extension query used to filter and order the result- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided pattern- Since:
- 8.1RC1
-
-