Examples of useWorkspace()


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

        assert this.connectionFactory != null;
        assert sessionContext != null;
        // The default workspace should be the system workspace ...
        Graph result = Graph.create(this.systemSourceName, this.connectionFactory, sessionContext);
        if (this.systemWorkspaceName != null) {
            result.useWorkspace(systemWorkspaceName);
        }
        return result;
    }

    QueryParsers queryParsers() {
View Full Code Here

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

                    }
                    // Per JCR 1.0 6.1.1, if the workspaceName is not recognized, a NoSuchWorkspaceException is thrown
                    throw new NoSuchWorkspaceException(JcrI18n.workspaceNameIsInvalid.text(sourceName, workspaceName));
                }

                graph.useWorkspace(workspaceName);
            } catch (InvalidWorkspaceException e) {
                throw new NoSuchWorkspaceException(JcrI18n.workspaceNameIsInvalid.text(sourceName, workspaceName), e);
            } catch (RepositorySourceException e) {
                String msg = JcrI18n.errorVerifyingWorkspaceName.text(sourceName, workspaceName, e.getMessage());
                throw new NoSuchWorkspaceException(msg, e);
View Full Code Here

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

        private Graph workspaceGraph( String workspaceName ) {
            Graph graph = Graph.create(this.sourceName, connectionFactory, context);

            if (workspaceName != null) {
                graph.useWorkspace(workspaceName);
            }

            return graph;
        }
View Full Code Here

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

                                    int maxRowCount,
                                    int offset ) {
            Graph graph = Graph.create(sourceName, connectionFactory, context);

            if (workspaceName != null) {
                graph.useWorkspace(workspaceName);
            }

            return graph.search(searchExpression, maxRowCount, offset);
        }
View Full Code Here

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

        mockJndi = mock(Context.class);
        stub(mockJndi.lookup(anyString())).toReturn(null);
        source.setContext(mockJndi);

        Graph graph = Graph.create(source, context);
        graph.useWorkspace("default");

        return source;
    }

    /**
 
View Full Code Here

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

                RepositorySource configSource = getConfigurationSource();
                if (configSource != null) {
                    Graph config = Graph.create(configSource, getExecutionContext());
                    String workspaceName = getConfigurationWorkspaceName();
                    if (workspaceName != null) {
                        config.useWorkspace(workspaceName);
                    }
                    Path configPath = getPathToConfigurationRoot();
                    Path sourcePath = getExecutionContext().getValueFactories().getPathFactory().create(configPath, sourceName);
                    result = config.getSubgraphOfDepth(depth).at(sourcePath);
                }
View Full Code Here

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

        CheckArg.isNotNull(sourceName, "sourceName");
        checkRunning();
        Graph graph = Graph.create(sourceName, getRepositoryService().getRepositoryLibrary(), context);
        if (configuration.getRepositorySource().getName().equals(sourceName) && configuration.getWorkspace() != null) {
            // set the workspace ...
            graph.useWorkspace(configuration.getWorkspace());
        }
        return graph;
    }

    /**
 
View Full Code Here

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

     * @return a graph to the configuration content
     */
    protected Graph getConfigurationGraph() {
        Graph result = Graph.create(configuration.getRepositorySource(), context);
        if (configuration.getWorkspace() != null) {
            result.useWorkspace(configuration.getWorkspace());
        }
        return result;
    }

    /**
 
View Full Code Here

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

                Problems problems = new SimpleProblems();
                // Now read the node and create the source ...
                Graph graph = Graph.create(getConfigurationSourceName(), getRepositoryLibrary(), getExecutionEnvironment());
                try {
                    String workspaceName = getConfigurationWorkspaceName();
                    if (workspaceName != null) graph.useWorkspace(workspaceName);
                    Map<Name, Property> properties = graph.getPropertiesByName().on(sourcePath);
                    RepositorySource source = createRepositorySource(sourcePath, properties, problems);
                    if (source != null) {
                        // It was the config for a source, so try to add or replace an existing source ...
                        getRepositoryLibrary().addSource(source, true);
View Full Code Here

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

        // Verify connectivity ...
        Graph graph = Graph.create(source, context);
        if (workspaceName != null) {
            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;
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.