Search in sources :

Example 1 with IgnoreOperation

use of org.apache.jackrabbit.jcr2spi.operation.IgnoreOperation in project jackrabbit by apache.

the class SessionItemStateManager method visit.

/**
 * @see OperationVisitor#visit(AddProperty)
 */
public void visit(AddProperty operation) throws ValueFormatException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
    NodeState parent = operation.getParentState();
    Name propertyName = operation.getPropertyName();
    QPropertyDefinition pDef = operation.getDefinition();
    int targetType = pDef.getRequiredType();
    if (targetType == PropertyType.UNDEFINED) {
        targetType = operation.getPropertyType();
        if (targetType == PropertyType.UNDEFINED) {
            targetType = PropertyType.STRING;
        }
    }
    addPropertyState(parent, propertyName, targetType, operation.getValues(), pDef, operation.getOptions());
    if (!(operation instanceof IgnoreOperation)) {
        transientStateMgr.addOperation(operation);
    }
}
Also used : QPropertyDefinition(org.apache.jackrabbit.spi.QPropertyDefinition) IgnoreOperation(org.apache.jackrabbit.jcr2spi.operation.IgnoreOperation) Name(org.apache.jackrabbit.spi.Name)

Example 2 with IgnoreOperation

use of org.apache.jackrabbit.jcr2spi.operation.IgnoreOperation in project jackrabbit by apache.

the class SessionItemStateManager method visit.

// ---------------------------------------------------< OperationVisitor >---
/**
 * @see OperationVisitor#visit(AddNode)
 */
public void visit(AddNode operation) throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
    NodeState parent = operation.getParentState();
    ItemDefinitionProvider defProvider = mgrProvider.getItemDefinitionProvider();
    QNodeDefinition def = defProvider.getQNodeDefinition(parent.getAllNodeTypeNames(), operation.getNodeName(), operation.getNodeTypeName());
    List<ItemState> newStates = addNodeState(parent, operation.getNodeName(), operation.getNodeTypeName(), operation.getUuid(), def, operation.getOptions());
    operation.addedState(newStates);
    if (!(operation instanceof IgnoreOperation)) {
        transientStateMgr.addOperation(operation);
    }
}
Also used : ItemDefinitionProvider(org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider) IgnoreOperation(org.apache.jackrabbit.jcr2spi.operation.IgnoreOperation) QNodeDefinition(org.apache.jackrabbit.spi.QNodeDefinition)

Aggregations

IgnoreOperation (org.apache.jackrabbit.jcr2spi.operation.IgnoreOperation)2 ItemDefinitionProvider (org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider)1 Name (org.apache.jackrabbit.spi.Name)1 QNodeDefinition (org.apache.jackrabbit.spi.QNodeDefinition)1 QPropertyDefinition (org.apache.jackrabbit.spi.QPropertyDefinition)1