/** {@inheritDoc} */ public boolean isMixin() throws RemoteException { return type.isMixin(); }
public MixinTypeInfo(NodeType nodeType) { super(nodeType); // if (!nodeType.isMixin()) { throw new IllegalArgumentException(); } } }
private void unRegisterNodeTypeAt(String nodeType) throws RepositoryException { // Non JCR custom method NodeType tempNT = getNodeType(nodeType); if (tempNT.isMixin()) { mixinNodetypes.remove(tempNT); } else { primaryNodetypes.remove(tempNT); } nodeTypesList.remove(tempNT); RegistryNodeTypeUtil.unregisterNodeTypeFromRegistry(registrySession,this,nodeType); } }
private Term getTerm(NodeType nt, InternalHippoSession session, NamespaceMappings nsMappings) throws IllegalNameException, NamespaceException { String ntName = getNtName(nt.getName(), session, nsMappings); if (nt.isMixin()) { return new Term(ServicingFieldNames.HIPPO_MIXINTYPE, ntName); } else { return new Term(ServicingFieldNames.HIPPO_PRIMARYTYPE, ntName); } }
/** * {@inheritDoc} */ public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException { Name[] ntNames = ntReg.getRegisteredNodeTypes(); ArrayList<NodeType> list = new ArrayList<NodeType>(ntNames.length); for (Name ntName : ntNames) { NodeType nt = getNodeType(ntName); if (!nt.isMixin()) { list.add(nt); } } return new NodeTypeIteratorAdapter(list); }
/** * {@inheritDoc} */ public NodeTypeIterator getMixinNodeTypes() throws RepositoryException { Name[] ntNames = ntReg.getRegisteredNodeTypes(); ArrayList<NodeType> list = new ArrayList<NodeType>(ntNames.length); for (Name ntName : ntNames) { NodeType nt = getNodeType(ntName); if (nt.isMixin()) { list.add(nt); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getMixinNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); NodeTypeIterator iterator = getAllNodeTypes(); while (iterator.hasNext()) { NodeType type = iterator.nextNodeType(); if (type.isMixin()) { list.add(type); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getMixinNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); NodeTypeIterator iterator = getAllNodeTypes(); while (iterator.hasNext()) { NodeType type = iterator.nextNodeType(); if (type.isMixin()) { list.add(type); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); NodeTypeIterator iterator = getAllNodeTypes(); while (iterator.hasNext()) { NodeType type = iterator.nextNodeType(); if (!type.isMixin()) { list.add(type); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); NodeTypeIterator iterator = getAllNodeTypes(); while (iterator.hasNext()) { NodeType type = iterator.nextNodeType(); if (!type.isMixin()) { list.add(type); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getMixinNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); NodeTypeIterator iterator = getAllNodeTypes(); while (iterator.hasNext()) { NodeType type = iterator.nextNodeType(); if (type.isMixin()) { list.add(type); } } return new NodeTypeIteratorAdapter(list); }
@Override public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException { List<NodeType> list = Lists.newArrayList(); NodeTypeIterator iterator = getAllNodeTypes(); while (iterator.hasNext()) { NodeType type = iterator.nextNodeType(); if (!type.isMixin()) { list.add(type); } } return new NodeTypeIteratorAdapter(list); }
protected Term createNodeTypeTerm(NodeType type) throws RepositoryException { String field; if (type.isMixin()) { // search for nodes where jcr:mixinTypes is set to this mixin field = mixinTypesField; } else { // search for nodes where jcr:primaryType is set to this type field = primaryTypeField; } String name = nsMappings.translateName(session.getQName(type.getName())); return new Term(PROPERTIES, FieldNames.createNamedValue(field, name)); }
protected Term createNodeTypeTerm(NodeType type) throws RepositoryException { String field; if (type.isMixin()) { // search for nodes where jcr:mixinTypes is set to this mixin field = mixinTypesField; } else { // search for nodes where jcr:primaryType is set to this type field = primaryTypeField; } String name = nsMappings.translateName(session.getQName(type.getName())); return new Term(PROPERTIES, FieldNames.createNamedValue(field, name)); }
/** * Test if getPrimaryNodeTypes does not return any mixin node types */ public void testGetPrimaryNodeTypes() throws RepositoryException { NodeTypeIterator types = manager.getPrimaryNodeTypes(); while (types.hasNext()) { assertFalse("getPrimaryNodeTypes() must not return mixin " + "node types", types.nextNodeType().isMixin()); } }
/** * Test if getMixinNodeTypes does return exclusively mixin node types */ public void testGetMixinNodeTypes() throws RepositoryException { NodeTypeIterator types = manager.getMixinNodeTypes(); while (types.hasNext()) { assertTrue("getMixinNodeTypes() must return exclusively mixin " + "node types", types.nextNodeType().isMixin()); } }
private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException { // TODO: figure out the right place for this check NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found if (nt.isAbstract() || nt.isMixin()) { throw new ConstraintViolationException(getNodePath()); } // TODO: END PropertyState state = PropertyStates.createProperty( JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME); dlg.setProperty(state, true, true); dlg.setOrderableChildren(nt.hasOrderableChildNodes()); }
private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException { // TODO: figure out the right place for this check NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found if (nt.isAbstract() || nt.isMixin()) { throw new ConstraintViolationException(getNodePath()); } // TODO: END PropertyState state = PropertyStates.createProperty( JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME); dlg.setProperty(state, true, true); dlg.setOrderableChildren(nt.hasOrderableChildNodes()); }
private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException { // TODO: figure out the right place for this check NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found if (nt.isAbstract() || nt.isMixin()) { throw new ConstraintViolationException(getNodePath()); } // TODO: END PropertyState state = PropertyStates.createProperty( JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME); dlg.setProperty(state, true, true); dlg.setOrderableChildren(nt.hasOrderableChildNodes()); }