Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.TransientRepository$RepositoryFactory


        private static Repository getRepository(Map parameters)
                throws RepositoryException {
            Repository repo = null;
            Iterator factories = ServiceRegistry.lookupProviders(RepositoryFactory.class);
            while (factories.hasNext()) {
                RepositoryFactory factory = (RepositoryFactory) factories.next();
                repo = factory.getRepository(parameters);
                if (repo != null) {
                    break;
                }
            }
            return repo;
View Full Code Here


    private void doPropertyChangeTest(Object initialPropertyValues, Object newPropertyValues)
            throws RepositoryException, org.apache.sling.ide.transport.RepositoryException {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);
        try {
            Node contentNode = session.getRootNode().addNode("content");
            if (initialPropertyValues instanceof String) {
                contentNode.setProperty(PROP_NAME, (String) initialPropertyValues);
            } else if (initialPropertyValues instanceof String[]) {
View Full Code Here

    @Test
    public void changeNtFolderToSlingFolderWithAddedProperty() throws Exception {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);

        InputStream cndInput = getClass().getResourceAsStream("folder.cnd");
        CndImporter.registerNodeTypes(new InputStreamReader(cndInput), session);

        try {
View Full Code Here

    @Test
    public void changeSlingFolderToNtFolderWithExistingProperty() throws Exception {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);

        InputStream cndInput = getClass().getResourceAsStream("folder.cnd");
        CndImporter.registerNodeTypes(new InputStreamReader(cndInput), session);

        try {
View Full Code Here

    @Test
    @Ignore("SLING-4036")
    public void updateNtUnstructuredToNodeWithRequiredProperty() throws Exception {

        File out = new File(new File("target"), "jackrabbit");
        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);

        InputStream cndInput = getClass().getResourceAsStream("mandatory.cnd"); // TODO - should be test-definitions.cnd
        CndImporter.registerNodeTypes(new InputStreamReader(cndInput), session);

        try {
View Full Code Here

            expected = resourceNames;
        }

        File out = new File(new File("target"), "jackrabbit");

        TransientRepository repo = new TransientRepository(new File(out, "repository.xml"), new File(out, "repository"));
        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
        Session session = repo.login(credentials);
        List<String> finalOrder;
        try {
            Node content = session.getRootNode().addNode("content");

            for (String nodeName : nodeNames) {
View Full Code Here

* @since 0.5
*/
public class TransientRepositoryFactoryBean extends RepositoryFactoryBean {

  protected Repository createRepository() throws Exception {
    return new TransientRepository(getRepositoryConfig());
  }
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

        File config = new File(CONFIG_FILE);
        if (!config.exists()) {
            throw new Exception("missing config file: " + config.getPath());
        }
        repository = new TransientRepository(CONFIG_FILE,
                "target/repository_with_auth");

        // set up a user to authenticate
        SessionImpl session = (SessionImpl) repository
                .login(new SimpleCredentials("admin", "admin".toCharArray()));
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.TransientRepository$RepositoryFactory

Copyright © 2018 www.massapicom. 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.