Interface MarketplaceServiceInternal
- All Known Implementing Classes:
MarketplaceServiceInternalImpl
public interface MarketplaceServiceInternal
Provides access to all available Marketplace operations
- Since:
- 3.1.2
- Author:
- joseross
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy a plugin in a sitevoidcreateSite(CreateSiteRequest request) Creates a site using the given blueprintgetInstalledPlugins(String siteId) Returns a list of the plugins currently installed in the given siteorg.apache.commons.configuration2.HierarchicalConfiguration<?> getPluginConfiguration(String siteId, String pluginId) Load the configuration for a given plugin as an objectgetPluginConfigurationAsString(String siteId, String pluginId) Load the configuration for a given plugin as a stringgetPluginUsage(String siteId, String pluginId) List dependant items for a pluginvoidinstallPlugin(String siteId, String pluginId, org.craftercms.commons.plugin.model.Version pluginVersion, Map<String, String> parameters) Install a plugin in a sitevoidremovePlugin(String siteId, String pluginId, boolean force) Removes a plugin from a sitesearchPlugins(String type, String keywords, boolean showIncompatible, long offset, long limit) Performs a search for all available plugins that match the given filtersvoidwritePluginConfiguration(String siteId, String pluginId, String content) Writes the configuration for a given plugin
-
Field Details
-
HEADER_STUDIO_ID
- See Also:
-
HEADER_STUDIO_BUILD
- See Also:
-
HEADER_STUDIO_VERSION
- See Also:
-
HEADER_JAVA_VERSION
- See Also:
-
HEADER_OS_NAME
- See Also:
-
HEADER_OS_VERSION
- See Also:
-
HEADER_OS_ARCH
- See Also:
-
-
Method Details
-
searchPlugins
Map<String,Object> searchPlugins(String type, String keywords, boolean showIncompatible, long offset, long limit) throws MarketplaceException Performs a search for all available plugins that match the given filters- Parameters:
type- the type of plugins to searchkeywords- the keywords to filter pluginsshowIncompatible- indicates if incompatible plugins should be returnedoffset- the offset for paginationlimit- the limit for pagination- Returns:
- the result from the Marketplace
- Throws:
MarketplaceException- if there is any error performing the search
-
createSite
void createSite(CreateSiteRequest request) throws RemoteRepositoryNotFoundException, InvalidRemoteRepositoryException, InvalidRemoteUrlException, ServiceLayerException, InvalidRemoteRepositoryCredentialsException Creates a site using the given blueprint- Parameters:
request- the site information- Throws:
RemoteRepositoryNotFoundException- if there is an error with the remote repositoryInvalidRemoteRepositoryException- if there is an error with the remote repositoryInvalidRemoteUrlException- if there is an error with the remote repositoryServiceLayerException- if there is any unexpected errorInvalidRemoteRepositoryCredentialsException- if there is any error with the credentials
-
getInstalledPlugins
Returns a list of the plugins currently installed in the given site- Parameters:
siteId- the id of the site- Returns:
- the list of plugins
- Throws:
MarketplaceException- if there is any error reading the plugin registry
-
installPlugin
void installPlugin(String siteId, String pluginId, org.craftercms.commons.plugin.model.Version pluginVersion, Map<String, String> parameters) throws MarketplaceExceptionInstall a plugin in a site- Parameters:
siteId- the id of the sitepluginId- the id of the pluginpluginVersion- the version of the pluginparameters- the parameters for the plugin- Throws:
MarketplaceException- if there is any error installing the plugin
-
copyPlugin
void copyPlugin(String siteId, String path, Map<String, String> parameters) throws MarketplaceExceptionCopy a plugin in a site- Parameters:
siteId- the id of the sitepath- the path of the plugin folderparameters- the parameters for the plugin- Throws:
MarketplaceException- if there is any error copying the plugin
-
removePlugin
Removes a plugin from a site- Parameters:
siteId- the id of the sitepluginId- the id of the pluginforce- indicates if the plugin should be removed even if there are dependant items- Throws:
MarketplaceException- if there is any error removing the pluginServiceLayerException
-
getPluginUsage
List dependant items for a plugin- Parameters:
siteId- the id of the sitepluginId- the id of the plugin- Throws:
ServiceLayerException- if there is any error getting the dependant items
-
getPluginConfiguration
org.apache.commons.configuration2.HierarchicalConfiguration<?> getPluginConfiguration(String siteId, String pluginId) throws ConfigurationException Load the configuration for a given plugin as an object- Parameters:
siteId- the id of the sitepluginId- the id of the plugin- Returns:
- the configuration object
- Throws:
ConfigurationException- if there is any error loading the configuration
-
getPluginConfigurationAsString
String getPluginConfigurationAsString(String siteId, String pluginId) throws ContentNotFoundException Load the configuration for a given plugin as a string- Parameters:
siteId- the id of the sitepluginId- the id of the plugin- Returns:
- the configuration string
- Throws:
ContentNotFoundException- if there is any issue reading the file from the repository
-
writePluginConfiguration
void writePluginConfiguration(String siteId, String pluginId, String content) throws UserNotFoundException, ServiceLayerException Writes the configuration for a given plugin- Parameters:
siteId- the id of the sitepluginId- the id of the plugincontent- the new configuration- Throws:
UserNotFoundException- if there is any error authenticating the userServiceLayerException- if there is any error writing the configuration
-