final JcrNodeTypeManager nodeTypeManager() { if (nodeTypeManager == null) { try { lock.lock(); if (nodeTypeManager == null) { nodeTypeManager = new JcrNodeTypeManager(session, repository().nodeTypeManager()); } } finally { lock.unlock(); } } return nodeTypeManager; }
final JcrNodeTypeManager nodeTypeManager() { if (nodeTypeManager == null) { try { lock.lock(); if (nodeTypeManager == null) { nodeTypeManager = new JcrNodeTypeManager(session, repository().nodeTypeManager()); } } finally { lock.unlock(); } } return nodeTypeManager; }
private Set<NodeType> nodeTypes( Set<Name> names ) { NodeTypes nodeTypes = session.repository().nodeTypeManager().getNodeTypes(); Set<NodeType> result = new HashSet<>(names.size()); for (Name name : names) { result.add(nodeTypes.getNodeType(name)); } return result; }
private Set<NodeType> nodeTypes( Set<Name> names ) { NodeTypes nodeTypes = session.repository().nodeTypeManager().getNodeTypes(); Set<NodeType> result = new HashSet<>(names.size()); for (Name name : names) { result.add(nodeTypes.getNodeType(name)); } return result; }
final NodeTypes nodeTypes() { return this.repository().nodeTypeManager().getNodeTypes(); }
final NodeTypes nodeTypes() { return this.repository().nodeTypeManager().getNodeTypes(); }
final void signalNamespaceChanges( boolean global ) { nodeTypeManager().signalNamespaceChanges(); if (global) repository.nodeTypeManager().signalNamespaceChanges(); }
final void signalNamespaceChanges( boolean global ) { nodeTypeManager().signalNamespaceChanges(); if (global) repository.nodeTypeManager().signalNamespaceChanges(); }
private NodeType nodeType( Name name ) { return session.repository().nodeTypeManager().getNodeTypes().getNodeType(name); }
private NodeType nodeType( Name name ) { return session.repository().nodeTypeManager().getNodeTypes().getNodeType(name); }
protected JcrPreSave( SystemContent content, Map<NodeKey, NodeKey> baseVersionKeys, Map<NodeKey, NodeKey> originalVersionKeys, long aclChangesCount ) { assert content != null; this.cache = cache(); this.systemContent = content; this.systemCache = content.cache(); this.baseVersionKeys = baseVersionKeys; this.originalVersionKeys = originalVersionKeys; // Get the capabilities cache. This is immutable, so we'll use it for the entire pre-save operation ... this.nodeTypeMgr = repository().nodeTypeManager(); this.nodeTypeCapabilities = nodeTypeMgr.getNodeTypes(); if (aclChangesCount != 0) { aclMetadataRefresh(aclChangesCount); } }
protected JcrPreSave( SystemContent content, Map<NodeKey, NodeKey> baseVersionKeys, Map<NodeKey, NodeKey> originalVersionKeys, long aclChangesCount ) { assert content != null; this.cache = cache(); this.systemContent = content; this.systemCache = content.cache(); this.baseVersionKeys = baseVersionKeys; this.originalVersionKeys = originalVersionKeys; // Get the capabilities cache. This is immutable, so we'll use it for the entire pre-save operation ... this.nodeTypeMgr = repository().nodeTypeManager(); this.nodeTypeCapabilities = nodeTypeMgr.getNodeTypes(); if (aclChangesCount != 0) { aclMetadataRefresh(aclChangesCount); } }
@Test public void shouldStoreNodeTypeDefinitionsInSystemCatalog() { Collection<JcrNodeType> nodeTypes = repository.nodeTypeManager().getNodeTypes().getAllNodeTypes(); for (int i = 0; i != 3; ++i) { system.store(nodeTypes, true); assertThat(repository.nodeTypeManager().refreshFromSystem(), is(true)); } }
private NodeType nodeType(Name name) { return session.repository().nodeTypeManager().getNodeTypes().getNodeType(name); }
@Override public CancellableQuery createExecutableQuery( QueryCommand query, PlanHints hints, Map<String, Object> variables ) throws RepositoryException { session.checkLive(); // Submit immediately to the workspace graph ... Schemata schemata = session.workspace().nodeTypeManager().schemata(); NodeTypes nodeTypes = session.repository().nodeTypeManager().getNodeTypes(); RepositoryIndexes indexDefns = session.repository().queryManager().getIndexes(); String workspaceName = session.workspaceName(); JcrRepository.RunningState state = session.repository().runningState(); RepositoryQueryManager queryManager = state.queryManager(); RepositoryCache repoCache = state.repositoryCache(); NodeCache nodeCache = hints.useSessionContent ? session.cache() : session.cache().getWorkspace(); Map<String, NodeCache> overriddenNodeCaches = new HashMap<String, NodeCache>(); overriddenNodeCaches.put(workspaceName, nodeCache); Set<String> workspaceNames = null; if (hints.includeSystemContent) { workspaceNames = new LinkedHashSet<String>(); workspaceNames.add(workspaceName); workspaceNames.add(repoCache.getSystemWorkspaceName()); } else { workspaceNames = Collections.singleton(workspaceName); } return queryManager.query(executionContext, repoCache, workspaceNames, overriddenNodeCaches, query, schemata, indexDefns, nodeTypes, hints, variables); }
@Override public CancellableQuery createExecutableQuery( QueryCommand query, PlanHints hints, Map<String, Object> variables ) throws RepositoryException { session.checkLive(); // Submit immediately to the workspace graph ... Schemata schemata = session.workspace().nodeTypeManager().schemata(); NodeTypes nodeTypes = session.repository().nodeTypeManager().getNodeTypes(); RepositoryIndexes indexDefns = session.repository().queryManager().getIndexes(); String workspaceName = session.workspaceName(); JcrRepository.RunningState state = session.repository().runningState(); RepositoryQueryManager queryManager = state.queryManager(); RepositoryCache repoCache = state.repositoryCache(); NodeCache nodeCache = hints.useSessionContent ? session.cache() : session.cache().getWorkspace(); Map<String, NodeCache> overriddenNodeCaches = new HashMap<String, NodeCache>(); overriddenNodeCaches.put(workspaceName, nodeCache); Set<String> workspaceNames = null; if (hints.includeSystemContent) { workspaceNames = new LinkedHashSet<String>(); workspaceNames.add(workspaceName); workspaceNames.add(repoCache.getSystemWorkspaceName()); } else { workspaceNames = Collections.singleton(workspaceName); } return queryManager.query(executionContext, repoCache, workspaceNames, overriddenNodeCaches, query, schemata, indexDefns, nodeTypes, hints, variables); }
@Test public void shouldReadNodeTypeDefinitionsFromSystemCatalog() { NodeTypes nodeTypes = repository.nodeTypeManager().getNodeTypes(); Set<Name> builtInNodeTypes = new HashSet<Name>(nodeTypes.getAllNodeTypeNames()); for (NodeTypeDefinition type : system.readAllNodeTypes()) { Name name = name(type.getName()); JcrNodeType actual = nodeTypes.getNodeType(name); assertThat("Did not find actual node type for name \"" + type.getName() + "\"", actual, is(notNullValue())); assertThat(builtInNodeTypes.remove(name), is(true)); } assertThat(builtInNodeTypes.isEmpty(), is(true)); }
@Override @Before public void beforeEach() throws Exception { super.beforeEach(); context = session.context(); ntTemplate = new JcrNodeTypeTemplate(context); registry = session.namespaces(); nameFactory = session.nameFactory(); repoTypeManager = session.repository().nodeTypeManager(); }
@Override @Before public void beforeEach() throws Exception { super.beforeEach(); nameFactory = session.nameFactory(); repoTypeManager = session.repository().nodeTypeManager(); session.getWorkspace().getNodeTypeManager().registerNodeTypes(getTestTypes(), true); }
@Before public void beforeEach() throws Exception { config = new RepositoryConfiguration("repoName").with(new TestingEnvironment()); repository = new JcrRepository(config); repository.start(); context = repository.runningState().context(); repoTypeManager = repository.nodeTypeManager(); session = repository.login(); }