Examples of RepositoryConfig


Examples of org.apache.jackrabbit.core.config.RepositoryConfig

   * @param home
   * @return
   * @throws RepositoryException
   */
  protected Repository initRepository(File config, File home) throws RepositoryException {
    RepositoryConfig rconfig = RepositoryConfig.create(config.getPath(), home.getPath());
    try {
      return new TransientRepository(rconfig);
    } catch (IOException e) {
      throw new RepositoryException(e);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

    private void copyWorkspaces(NodeBuilder root)
            throws RepositoryException, IOException {
        logger.info("Copying default workspace");

        // Copy all the default workspace content
        RepositoryConfig config = source.getRepositoryConfig();
        String name = config.getDefaultWorkspaceName();
        PersistenceCopier copier = new PersistenceCopier(
                source.getWorkspaceInfo(name).getPersistenceManager(),
                source.getNamespaceRegistry(), target);
        copier.excludeNode(RepositoryImpl.SYSTEM_ROOT_NODE_ID);
        copier.copy(RepositoryImpl.ROOT_NODE_ID, root);
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

     * @return repository instance
     * @throws RepositoryException if the repository could not be created
     */
    protected JackrabbitRepository getRepository(Reference reference)
            throws RepositoryException {
        RepositoryConfig config = RepositoryConfig.create(
                reference.get(CONFIGFILEPATH_ADDRTYPE).getContent().toString(),
                reference.get(REPHOMEDIR_ADDRTYPE).getContent().toString());
        return RepositoryImpl.create(config);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

            NodeBuilder root, Map<Integer, String> idxToPrefix)
            throws RepositoryException, IOException {
        logger.info("Copying default workspace");

        // Copy all the default workspace content
        RepositoryConfig config = source.getRepositoryConfig();
        String name = config.getDefaultWorkspaceName();

        PersistenceManager pm =
                source.getWorkspaceInfo(name).getPersistenceManager();
        NamespaceRegistryImpl nr = source.getNamespaceRegistry();
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

        super(reference);
    }

    @Override
    protected JackrabbitRepository createRepository() throws RepositoryException {
        RepositoryConfig config = RepositoryConfig.create(
                resolvePath(getReference().get(CONFIGFILEPATH_ADDRTYPE).getContent().toString()),
                resolvePath(getReference().get(REPHOMEDIR_ADDRTYPE).getContent().toString()));
        return JahiaRepositoryImpl.create(config);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

     * @return repository instance
     * @throws RepositoryException if the repository could not be created
     */
    protected JackrabbitRepository createRepository()
            throws RepositoryException, IOException {
        RepositoryConfig config = RepositoryConfig.create(configFile.getFile().toString(), homeDir.getFile().toString());
        return JahiaRepositoryImpl.create(new JahiaRepositoryConfig(config));
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

                    + RepositoryImpl.class + " got: " + rep.getClass());
            return;
        }

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
        Collection<WorkspaceConfig> coll = conf.getWorkspaceConfigs();
        String[] names = new String[coll.size()];
        Iterator<WorkspaceConfig> wspIt = coll.iterator();
        for (int i = 0; wspIt.hasNext(); i++) {
            WorkspaceConfig wsc = (WorkspaceConfig) wspIt.next();
            names[i] = wsc.getName();
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

            } finally {
                input.close();
            }
        }

        RepositoryConfig config = RepositoryConfig.create(xml, dir);
        return RepositoryImpl.create(config);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

            }
        }
    }

    private void backup(File sourceDir) throws Exception {
        RepositoryConfig source;
        if (command.hasOption("conf")) {
            source = RepositoryConfig.create(
                    new File(command.getOptionValue("conf")), sourceDir);
        } else {
            source = RepositoryConfig.create(sourceDir);
        }

        File targetDir;
        if (command.hasOption("backup-repo")) {
            targetDir = new File(command.getOptionValue("backup-repo"));
        } else {
            int i = 1;
            do {
                targetDir = new File("jackrabbit-backup" + i++);
            } while (targetDir.exists());
        }

        RepositoryConfig target;
        if (command.hasOption("backup-conf")) {
            target = RepositoryConfig.install(
                    new File(command.getOptionValue("backup-conf")), targetDir);
        } else {
            target = RepositoryConfig.install(targetDir);
View Full Code Here

Examples of org.apache.jackrabbit.core.config.RepositoryConfig

                } catch (Exception e) {
                    // Not running within the main test suite
                    InputStream xml =
                        TestRepository.class.getResourceAsStream(CONF_RESOURCE);
                    String home = System.getProperty(HOME_PROPERTY, HOME_DEFAULT);
                    RepositoryConfig config = RepositoryConfig.create(xml, home);
                    instance = new TransientRepository(config);
                }
            }
            return instance;
        } catch (ConfigurationException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.