@Override public String toString() { return getAllNodeTypes().toString(); }
@Override public String toString() { return getAllNodeTypes().toString(); }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { session.checkLive(); return new JcrNodeTypeIterator(nodeTypes().getAllNodeTypes()); }
@Override public NodeTypeIterator getAllNodeTypes() throws RepositoryException { session.checkLive(); return new JcrNodeTypeIterator(nodeTypes().getAllNodeTypes()); }
for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) {
for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) {
RepositoryNodeTypeManager with( JcrRepository.RunningState repository, boolean includeColumnsForInheritedProperties, boolean includePseudoColumnsInSelectStar ) { assert this.systemWorkspaceName.equals(repository.repositoryCache().getSystemWorkspaceName()); PathFactory pathFactory = repository.context().getValueFactories().getPathFactory(); Path nodeTypesPath = pathFactory.createAbsolutePath(JcrLexicon.SYSTEM, JcrLexicon.NODE_TYPES); assert this.nodeTypesPath.equals(nodeTypesPath); RepositoryNodeTypeManager result = new RepositoryNodeTypeManager(repository, includeColumnsForInheritedProperties, includePseudoColumnsInSelectStar); // Now copy the node types from this cache into the new manager's cache ... // (If we didn't do this, we'd have to refresh from the system storage) result.nodeTypesCache = result.nodeTypesCache.with(this.nodeTypesCache.getAllNodeTypes()); // Do not copy the listeners return result; }
RepositoryNodeTypeManager with( JcrRepository.RunningState repository, boolean includeColumnsForInheritedProperties, boolean includePseudoColumnsInSelectStar ) { assert this.systemWorkspaceName.equals(repository.repositoryCache().getSystemWorkspaceName()); PathFactory pathFactory = repository.context().getValueFactories().getPathFactory(); Path nodeTypesPath = pathFactory.createAbsolutePath(JcrLexicon.SYSTEM, JcrLexicon.NODE_TYPES); assert this.nodeTypesPath.equals(nodeTypesPath); RepositoryNodeTypeManager result = new RepositoryNodeTypeManager(repository, includeColumnsForInheritedProperties, includePseudoColumnsInSelectStar); // Now copy the node types from this cache into the new manager's cache ... // (If we didn't do this, we'd have to refresh from the system storage) result.nodeTypesCache = result.nodeTypesCache.with(this.nodeTypesCache.getAllNodeTypes()); // Do not copy the listeners return result; }
for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) { for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) { addView(builder, context, nodeType);
for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) { for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) { addView(builder, context, nodeType);
@Test public void shouldAllowUnregisteringUnusedType() throws Exception { ntTemplate.setName(TEST_TYPE_NAME); JcrNodeDefinitionTemplate childNode = new JcrNodeDefinitionTemplate(this.context); childNode.setDefaultPrimaryTypeName(JcrNtLexicon.FILE.getString(this.registry)); ntTemplate.getNodeDefinitionTemplates().add(childNode); try { repoTypeManager.registerNodeType(ntTemplate); } catch (Exception ex) { fail(ex.getMessage()); } Name typeNameAsName = nameFactory.create(TEST_TYPE_NAME); int nodeTypeCount = nodeTypes().getAllNodeTypes().size(); repoTypeManager.unregisterNodeType(Arrays.asList(new Name[] {typeNameAsName}), true); assertThat(nodeTypes().getAllNodeTypes().size(), is(nodeTypeCount - 1)); assertThat(nodeTypes().getNodeType(typeNameAsName), is(nullValue())); }
for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) {
for (JcrNodeType nodeType : nodeTypes.getAllNodeTypes()) {
@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)); } }
@SuppressWarnings( "unchecked" ) @Test public void shouldAllowUnregisteringUnusedTypesWithMutualDependencies() throws Exception { ntTemplate.setName(TEST_TYPE_NAME); JcrNodeDefinitionTemplate childNode = new JcrNodeDefinitionTemplate(this.context); childNode.setDefaultPrimaryTypeName(TEST_TYPE_NAME2); ntTemplate.getNodeDefinitionTemplates().add(childNode); NodeTypeTemplate ntTemplate2 = new JcrNodeTypeTemplate(this.context); ntTemplate2.setName(TEST_TYPE_NAME2); JcrNodeDefinitionTemplate childNode2 = new JcrNodeDefinitionTemplate(this.context); childNode2.setDefaultPrimaryTypeName(TEST_TYPE_NAME); ntTemplate2.getNodeDefinitionTemplates().add(childNode2); try { repoTypeManager.registerNodeTypes(Arrays.asList(new NodeTypeDefinition[] {ntTemplate, ntTemplate2})); } catch (Exception ex) { fail(ex.getMessage()); } Name typeNameAsName = nameFactory.create(TEST_TYPE_NAME); Name type2NameAsName = nameFactory.create(TEST_TYPE_NAME2); int nodeTypeCount = nodeTypes().getAllNodeTypes().size(); repoTypeManager.unregisterNodeType(Arrays.asList(new Name[] {typeNameAsName, type2NameAsName}), true); assertThat(nodeTypes().getAllNodeTypes().size(), is(nodeTypeCount - 2)); assertThat(nodeTypes().getNodeType(typeNameAsName), is(nullValue())); assertThat(nodeTypes().getNodeType(type2NameAsName), is(nullValue())); }