/** * Creates a repository configuration object based on an existing configuration. The factories * contained within the configuration will be newly initialized, but all other information * will be the same. * * @param config repository configuration to create the new instance from * @return repository configuration * @throws ConfigurationException on configuration errors */ public static RepositoryConfig create(RepositoryConfig config) throws ConfigurationException { RepositoryConfig copiedConfig = new RepositoryConfig(config.home, config.sec, config.fsf, config.workspaceDirectory, config.workspaceConfigDirectory, config.defaultWorkspace, config.workspaceMaxIdleTime, config.template, config.vc, config.qhf, config.cc, config.dsf, config.rlf, config.dsc, new ConnectionFactory(), config.parser); copiedConfig.init(); return copiedConfig; }
/** * Creates a repository configuration object based on an existing configuration. The factories * contained within the configuration will be newly initialized, but all other information * will be the same. * * @param config repository configuration to create the new instance from * @return repository configuration * @throws ConfigurationException on configuration errors */ public static RepositoryConfig create(RepositoryConfig config) throws ConfigurationException { RepositoryConfig copiedConfig = new RepositoryConfig(config.home, config.sec, config.fsf, config.workspaceDirectory, config.workspaceConfigDirectory, config.defaultWorkspace, config.workspaceMaxIdleTime, config.template, config.vc, config.qhf, config.cc, config.dsf, config.rlf, config.dsc, new ConnectionFactory(), config.parser); copiedConfig.init(); return copiedConfig; }
/** * Parses the given repository configuration document using the given * parser variables. Note that the ${rep.home} variable should be set * by the caller! * <p> * Note that in addition to parsing the repository configuration, this * method also initializes the configuration (creates the configured * directories, etc.). The {@link ConfigurationParser} class should be * used directly to just parse the configuration. * * @since Apache Jackrabbit 2.1 * @param xml repository configuration document * @param variables parser variables * @return repository configuration * @throws ConfigurationException on configuration errors */ public static RepositoryConfig create(InputSource xml, Properties variables) throws ConfigurationException { RepositoryConfigurationParser parser = new RepositoryConfigurationParser(variables, new ConnectionFactory()); RepositoryConfig config = parser.parseRepositoryConfig(xml); config.init(); return config; }
/** * Parses the given repository configuration document using the given * parser variables. Note that the ${rep.home} variable should be set * by the caller! * <p> * Note that in addition to parsing the repository configuration, this * method also initializes the configuration (creates the configured * directories, etc.). The {@link ConfigurationParser} class should be * used directly to just parse the configuration. * * @since Apache Jackrabbit 2.1 * @param xml repository configuration document * @param variables parser variables * @return repository configuration * @throws ConfigurationException on configuration errors */ public static RepositoryConfig create(InputSource xml, Properties variables) throws ConfigurationException { RepositoryConfigurationParser parser = new RepositoryConfigurationParser(variables, new ConnectionFactory()); RepositoryConfig config = parser.parseRepositoryConfig(xml); config.init(); return config; }
private void initDefaultRepository()throws Exception { SecurityConfig securityConfig=buildSecurityConfig(); FileSystemFactory fileSystemFactory=buildFileSystemFactory("repository"); String workspaceDirectory=""+repoHomeDir+"/workspaces"; String workspaceConfigDirectory=null; String defaultWorkspace="default"; int workspaceMaxIdleTime=0; VersioningConfig versioningConfig=buildVersioningConfig(); QueryHandlerFactory queryHandlerFactory=null; ClusterConfig clusterConfig=null; DataStoreFactory dataStoreFactory=buildDataStoreFactory(); RepositoryLockMechanismFactory repositoryLockMechanismFactory=buildRepositoryLockMechanismFactory(); DataSourceConfig dataSourceConfig=new DataSourceConfig(); ConnectionFactory connectionFactory=new ConnectionFactory(); RepositoryConfigurationParser repositoryConfigurationParser=new RepositoryConfigurationParser(new Properties()); initWorkspaceTemplate(); RepositoryConfig repositoryConfig = new RepositoryConfig(repoHomeDir, securityConfig, fileSystemFactory, workspaceDirectory, workspaceConfigDirectory, defaultWorkspace, workspaceMaxIdleTime, workspaceTemplate, versioningConfig, queryHandlerFactory, clusterConfig, dataStoreFactory, repositoryLockMechanismFactory, dataSourceConfig, connectionFactory, repositoryConfigurationParser); repositoryConfig.init(); repository=RepositoryImpl.create(repositoryConfig); }