public class CmsRepositoryManager
extends java.lang.Object
I_CmsRepository
and can be used to get a repository by its name.
The configuration of the repositories is done in the configuration file
opencms-importexport.xml.
| 构造器和说明 |
|---|
CmsRepositoryManager()
Creates a new instance for the resource manager,
will be called by the vfs configuration manager.
|
CmsRepositoryManager(boolean configured)
Creates a new unconfigured instance of the repository manager.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRepositoryClass(I_CmsRepository repository)
Adds a new configured repository.
|
static java.util.List<I_CmsResourceWrapper> |
createResourceWrappersFromConfiguration(CmsParameterConfiguration config,
java.lang.String paramName,
org.apache.commons.logging.Log log)
Creates a list of resource wrappers from a collection of configuration parameters, for use in configuring repositories.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAdditionalInfoForLogin(java.lang.String userName,
java.lang.String password)
Gets the additional infos for the user who just logged in which is required for the repositories to work.
|
java.util.List<I_CmsRepository> |
getRepositories()
Returns the repositories.
|
<REPO extends I_CmsRepository> |
getRepositories(java.lang.Class<REPO> cls)
Gets a list of the repositories for the given superclass.
|
I_CmsRepository |
getRepository(java.lang.String name)
Returns the repository with the given name.
|
<REPO extends I_CmsRepository> |
getRepository(java.lang.String name,
java.lang.Class<REPO> cls)
Gets a repository by name, but only if its class is a subclass of the class passed as a parameter.
|
void |
initConfiguration()
Initializes a configuration after all parameters have been added.
|
void |
initializeCms(CmsObject cms)
Initializes repositories using an admin CMS object.
|
boolean |
isConfigured()
Returns the configured.
|
void |
shutDown()
Shuts down the repository manager.
|
public CmsRepositoryManager()
public CmsRepositoryManager(boolean configured)
Is used if there are no repositories configured.
configured - determines if the repository manager was configuredpublic static java.util.List<I_CmsResourceWrapper> createResourceWrappersFromConfiguration(CmsParameterConfiguration config, java.lang.String paramName, org.apache.commons.logging.Log log) throws CmsConfigurationException
config - the configurationparamName - the parameter namelog - the logger to use for error messagesCmsConfigurationException - if something goes wrong with reading the configurationpublic void addRepositoryClass(I_CmsRepository repository) throws CmsConfigurationException
repository - the repository to addCmsConfigurationException - in case the resource manager configuration is already initializedpublic java.util.Map<java.lang.String,java.lang.Object> getAdditionalInfoForLogin(java.lang.String userName,
java.lang.String password)
userName - the name of the logged in userpassword - the password of the logged in userpublic java.util.List<I_CmsRepository> getRepositories()
public <REPO extends I_CmsRepository> java.util.List<REPO> getRepositories(java.lang.Class<REPO> cls)
cls - the superclasspublic I_CmsRepository getRepository(java.lang.String name)
name - the name of the repositorypublic <REPO extends I_CmsRepository> REPO getRepository(java.lang.String name, java.lang.Class<REPO> cls)
Otherwise, null will be returned.
name - the repository namecls - the class used to filter repositoriespublic void initConfiguration()
throws CmsConfigurationException
CmsConfigurationException - if something goes wrongpublic void initializeCms(CmsObject cms)
cms - the CMS object with admin privilegespublic boolean isConfigured()
public void shutDown()