Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.Graph.createWorkspace()


                Path destinationPath = executionContext.getValueFactories().getPathFactory().createRootPath();

                InputStream xmlStream = getClass().getResourceAsStream("/tck/repositoryForTckTests.xml");
                graph.importXmlFrom(xmlStream).into(destinationPath);

                graph.createWorkspace().named("otherWorkspace");
            }
        } catch (Exception ex) {
            // The TCK tries to quash this exception. Print it out to be more obvious.
            ex.printStackTrace();
            throw new IllegalStateException("Failed to initialize the repository with text content.", ex);
View Full Code Here


                Path destinationPath = executionContext.getValueFactories().getPathFactory().createRootPath();

                InputStream xmlStream = getClass().getResourceAsStream("/tck/repositoryForTckTests.xml");
                graph.importXmlFrom(xmlStream).into(destinationPath);

                graph.createWorkspace().named("otherWorkspace");
            }
        } catch (Exception ex) {
            // The TCK tries to quash this exception. Print it out to be more obvious.
            ex.printStackTrace();
            throw new IllegalStateException("Failed to initialize the repository with text content.", ex);
View Full Code Here

            Workspace workspace = null;
            try {
                workspace = graph.useWorkspace(workspaceName); // should throw exception if not connectable
            } catch (InvalidWorkspaceException e) {
                // Try creating the workspace ...
                workspace = graph.createWorkspace().named(workspaceName);
            }
            assert workspace.getRoot() != null;
        }

        // Verify the path ...
View Full Code Here

    public void shouldEstimateTimeToIndexContent() {
        // Prime the reading of the files ...
        InMemoryRepositorySource prime = new InMemoryRepositorySource();
        prime.setName(sourceName);
        Graph primeGraph = Graph.create(prime, context);
        primeGraph.createWorkspace().named(workspaceName1);
        primeGraph.createWorkspace().named(workspaceName2);

        // Prime the search engine ...
        sw.reset();
        sw.start();
View Full Code Here

        // Prime the reading of the files ...
        InMemoryRepositorySource prime = new InMemoryRepositorySource();
        prime.setName(sourceName);
        Graph primeGraph = Graph.create(prime, context);
        primeGraph.createWorkspace().named(workspaceName1);
        primeGraph.createWorkspace().named(workspaceName2);

        // Prime the search engine ...
        sw.reset();
        sw.start();
        SearchEngineIndexer indexer = new SearchEngineIndexer(context, searchEngine, connectionFactory);
View Full Code Here

        // Make sure there's a workspace for it ...
        Graph sourceGraph = Graph.create(sourceName, connectionFactory, context);
        if (sourceGraph.getWorkspaces().contains(workspaceName)) {
            sourceGraph.useWorkspace(workspaceName);
        } else {
            sourceGraph.createWorkspace().named(workspaceName);
        }
        return sourceGraph;
    }

    /**
 
View Full Code Here

        sourceName = "federated source";
        source.setName(sourceName);
        source.initialize(repositoryContext);

        Graph configRepository = Graph.create(configRepositorySource, context);
        configRepository.createWorkspace().named("configSpace");
        Graph.Batch batch = configRepository.batch();
        batch.create("/a").and();
        batch.create("/a/b").and();
        batch.create("/a/b/Test Repository").with(DnaLexicon.DEFAULT_WORKSPACE_NAME, "fedSpace").and();
        batch.create("/a/b/Test Repository/dna:workspaces").and();
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.