Package org.apache.jackrabbit.jcr2spi.operation

Examples of org.apache.jackrabbit.jcr2spi.operation.Operation


    public void remove() throws VersionException, LockException, ConstraintViolationException, RepositoryException {
        checkSupportedOption(Repository.LEVEL_2_SUPPORTED);
        checkStatus();

        // validation checks are performed within remove operation
        Operation rm = Remove.create(getItemState());
        session.getSessionItemStateManager().execute(rm);
    }
View Full Code Here


        // build paths from the given JCR paths.
        Path srcPath = getQPath(srcAbsPath);
        Path destPath = getQPath(destAbsPath);

        // all validation is performed by Move Operation and state-manager
        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getPathResolver(), true);
        itemStateManager.execute(op);
    }
View Full Code Here

            // setting a property to null removes it automatically
            remove();
            return;
        }
        // modify the state of this property
        Operation op = SetPropertyValue.create(getPropertyState(), qValues, valueType);
        session.getSessionItemStateManager().execute(op);
    }
View Full Code Here

        }

        Path.Element srcName = getReorderPath(srcChildRelPath).getNameElement();
        Path.Element beforeName = (destChildRelPath == null) ? null : getReorderPath(destChildRelPath).getNameElement();

        Operation op = ReorderNodes.create(getNodeState(), srcName, beforeName);
        session.getSessionItemStateManager().execute(op);
    }
View Full Code Here

        if (nt.isMixin() || nt.isAbstract()) {
            throw new ConstraintViolationException("Cannot change the primary type: '" + nodeTypeName + "' is a mixin type or abstract.");
        }

        // perform the operation
        Operation op = SetPrimaryType.create(getNodeState(), ntName);
        session.getSessionItemStateManager().execute(op);
    }
View Full Code Here

                throw new ConstraintViolationException("Cannot add '" + mixinName + "' mixin type.");
            }

            mixinValue.add(mixinQName);
            // perform the operation
            Operation op = SetMixin.create(getNodeState(), mixinValue.toArray(new Name[mixinValue.size()]));
            session.getSessionItemStateManager().execute(op);
        }
    }
View Full Code Here

            }
        }

        // delegate to operation
        Name[] mixins = mixinValue.toArray(new Name[mixinValue.size()]);
        Operation op = SetMixin.create(getNodeState(), mixins);
        session.getSessionItemStateManager().execute(op);
    }
View Full Code Here

        } catch (ItemNotFoundException e) {
            // no corresponding node exists -> method has not effect
            return;
        }

        Operation op = Update.create(getNodeState(), srcWorkspaceName);
        ((WorkspaceImpl)session.getWorkspace()).getUpdatableItemStateManager().execute(op);
    }
View Full Code Here

            // use default node type
            nodeTypeName = definition.getDefaultPrimaryType();
        }
        // validation check are performed by item state manager
        // NOTE: uuid is generated while creating new state.
        Operation an = AddNode.create(getNodeState(), nodeName, nodeTypeName, null);
        session.getSessionItemStateManager().execute(an);

        // finally retrieve the new node
        List<ItemState> addedStates = ((AddNode) an).getAddedStates();
        ItemState nState = addedStates.get(0);
View Full Code Here

     * @throws RepositoryException
     */
    private Property createProperty(Name qName, int type, QPropertyDefinition def,
                                    QValue[] qvs)
        throws ConstraintViolationException, RepositoryException {
        Operation op = AddProperty.create(getNodeState(), qName, type, def, qvs);
        session.getSessionItemStateManager().execute(op);
        return getProperty(qName);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.operation.Operation

Copyright © 2018 www.massapicom. 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.