/** * @inheritDoc */ public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException { node.removeMixin(mixinName); }
public boolean removeMixin(Node node, String mixinTypeName) throws RepositoryException { try { node.removeMixin(mixinTypeName); return true; } catch (NoSuchNodeTypeException ignore) { // Mixin was not here return false; } }
@Override public void removeMixin(String type) throws RepositoryException { this.node.removeMixin(type); }
/** * Removes the cq:ReplicationStatus mixin from the node if it has it. * * @param node the node * @throws RepositoryException */ private void removeReplicationStatusMixin(final Node node) throws RepositoryException { if (this.hasMixin(node, ReplicationStatus.NODE_TYPE)) { node.removeMixin(ReplicationStatus.NODE_TYPE); } }
/** {@inheritDoc} */ public void removeMixin(String name) throws RepositoryException, RemoteException { try { node.removeMixin(name); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
/** * Removes the cq:ReplicationStatus mixin from the node if it has it. * * @param node the node * @throws RepositoryException */ private void removeReplicationStatusMixin(final Node node) throws RepositoryException { if (this.hasMixin(node, ReplicationStatus.NODE_TYPE)) { node.removeMixin(ReplicationStatus.NODE_TYPE); } }
private void removeMixin(final Node node, final String mixin) throws RepositoryException { for (NodeType mixinType : node.getMixinNodeTypes()) { if (mixinType.getName().equals(mixin)) { node.removeMixin(mixin); return; } } }
void checkout() throws RepositoryException { // copy nodetype if (draft == null) { if (current == null) { throw new ItemNotFoundException("Remodel node " + HippoNodeType.HIPPOSYSEDIT_NODETYPE + ", current version was not found for type " + subject.getPath()); } draft = ((HippoSession) current.getSession()).copy(current, current.getParent().getPath() + "/" + HippoNodeType.HIPPOSYSEDIT_NODETYPE); draft.removeMixin(HippoNodeType.NT_REMODEL); } }
private void removeHasVersionMixin(String destAbsPath) throws RepositoryException { Node node = getSession().getNode(destAbsPath); NodeUtil.visit(node, nodeToVisit -> { if (NodeUtil.hasMixin(nodeToVisit, NodeTypes.HasVersion.NAME)) { nodeToVisit.removeMixin(NodeTypes.HasVersion.NAME); nodeToVisit.getSession().save(); } }); } }
@Override public void move(String srcAbsPath, String destAbsPath) throws PathNotFoundException, VersionException, ConstraintViolationException, LockException, ItemExistsException, RepositoryException { Node node = getNode(srcAbsPath); // we want to remove mixin when copying node via NodeUtil if (node.isNew() && TEMPORARY_NODE.matcher(srcAbsPath).matches() && NodeUtil.hasMixin(node, NodeTypes.HasVersion.NAME)) { node.removeMixin(NodeTypes.HasVersion.NAME); } getWrappedSession().move(srcAbsPath, destAbsPath); } }
public void testRemoveMixVersionable() throws Exception { Node node = testRootNode.addNode(nodeName1); node.addMixin(mixVersionable); superuser.save(); node.removeMixin(mixVersionable); superuser.save(); }
public void testRemoveMixVersionable1() throws Exception { Node node = testRootNode.addNode(nodeName1); node.addMixin(mixReferenceable); node.addMixin(mixVersionable); superuser.save(); node.removeMixin(mixVersionable); superuser.save(); }
@Test public void testRemoveMixin() throws Exception { ((Node) superuser.getItem(childNode.getPath())).addMixin(mixinName); superuser.save(); testSession.refresh(false); modify(childNode.getPath(), Privilege.JCR_NODE_TYPE_MANAGEMENT, true); childNode.removeMixin(mixinName); testSession.save(); }
public void testRemoveAddMixVersionable() throws Exception { Node node = testRootNode.addNode(nodeName1); node.addMixin(mixVersionable); superuser.save(); String vhId = node.getVersionHistory().getUUID(); node.removeMixin(mixVersionable); node.addMixin(mixVersionable); superuser.save(); assertFalse(vhId.equals(node.getVersionHistory().getUUID())); }
@Test( expected = ConstraintViolationException.class ) public void shouldNotAllowRemovalIfExistingChildNodeWouldHaveNoDefinition() throws Exception { Node a = session.getRootNode().addNode("a", BASE_PRIMARY_TYPE); a.addMixin(MIXIN_TYPE_B); a.addNode(CHILD_NODE_B); session.save(); Node rootNode = session.getRootNode(); Node nodeA = rootNode.getNode("a"); nodeA.removeMixin(MIXIN_TYPE_B); }
@Test public void shouldAllowRemovalIfExistingChildNodeWouldHaveDefinition() throws Exception { Node a = session.getRootNode().addNode("a", "nt:unstructured"); a.addMixin(MIXIN_TYPE_B); a.addNode(CHILD_NODE_B); session.save(); Node rootNode = session.getRootNode(); Node nodeA = rootNode.getNode("a"); nodeA.removeMixin(MIXIN_TYPE_B); }
public void testRemoveAddMixVersionable1() throws Exception { Node node = testRootNode.addNode(nodeName1); node.addMixin(mixReferenceable); node.addMixin(mixVersionable); superuser.save(); String vhId = node.getVersionHistory().getUUID(); node.removeMixin(mixVersionable); node.addMixin(mixVersionable); superuser.save(); assertEquals(vhId, node.getVersionHistory().getUUID()); } }
@Test( expected = ConstraintViolationException.class ) public void shouldNotAllowRemovalIfExistingPropertyWouldHaveNoDefinition() throws Exception { Node a = session.getRootNode().addNode("a", BASE_PRIMARY_TYPE); a.addMixin(MIXIN_TYPE_B); a.setProperty(PROPERTY_B, "true"); session.save(); Node rootNode = session.getRootNode(); Node nodeA = rootNode.getNode("a"); nodeA.removeMixin(MIXIN_TYPE_B); session.save(); }
@Test public void testRemoveMixin() throws Exception { Node n = superuser.getNode(path); deny(path, readPrivileges); assertTrue(n.hasNode("rep:policy")); assertTrue(n.isNodeType("rep:AccessControllable")); n.removeMixin("rep:AccessControllable"); superuser.save(); assertFalse(n.hasNode("rep:policy")); assertFalse(n.isNodeType("rep:AccessControllable")); } }
public void testRemoveMixin() throws Exception { Node n = superuser.getNode(path); Privilege[] privileges = privilegesFromName(Privilege.JCR_READ); withdrawPrivileges(path, privileges, getRestrictions(superuser, path)); assertTrue(n.hasNode("rep:policy")); assertTrue(n.isNodeType("rep:AccessControllable")); n.removeMixin("rep:AccessControllable"); superuser.save(); assertFalse(n.hasNode("rep:policy")); assertFalse(n.isNodeType("rep:AccessControllable")); } }