Examples of PropertyDelegate


Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

    public Property getProperty(final String relPath) throws RepositoryException {
        return perform(new ItemReadOperation<PropertyImpl>() {
            @Override
            public PropertyImpl perform() throws RepositoryException {
                String oakPath = getOakPathOrThrowNotFound(relPath);
                PropertyDelegate pd = dlg.getPropertyOrNull(oakPath);
                if (pd == null) {
                    throw new PathNotFoundException(relPath + " not found on " + getPath());
                } else {
                    return new PropertyImpl(pd, sessionContext);
                }
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

                Iterable<Property> properties = Iterables.transform(
                        propertyOakPaths,
                        new Function<String, Property>() {
                            @Override
                            public Property apply(String oakPath) {
                                PropertyDelegate pd = sessionDelegate.getProperty(oakPath);
                                return pd == null ? null : new PropertyImpl(pd, sessionContext);
                            }
                        }
                );
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

    @Override
    public void removeMixin(final String mixinName) throws RepositoryException {
        perform(new ItemWriteOperation<Void>() {
            @Override
            public Void perform() throws RepositoryException {
                PropertyDelegate propDlg = dlg.getPropertyOrNull(JcrConstants.JCR_MIXINTYPES);
                String oakName = getOakName(mixinName);
                if (propDlg == null || !ImmutableSet.copyOf(propDlg.getPropertyState().getValue(Type.NAMES)).contains(oakName)) {
                    throw new NoSuchNodeTypeException("Mixin " + mixinName +" not contained in " + this);
                }

                // TODO: implement #removeMixin (OAK-767)
                throw new ConstraintViolationException();
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

                }

                NodeDelegate parent = dlg.getParent();
                while (parent != null) {
                    if (parent.getPropertyOrNull(lockOwner) != null) {
                        PropertyDelegate isDeep =
                                parent.getPropertyOrNull(lockIsDeep);
                        if (isDeep != null) {
                            PropertyState state = isDeep.getPropertyState();
                            if (!state.isArray() && state.getValue(BOOLEAN)) {
                                return true;
                            }
                        }
                    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

                        dlg.getParent()), sessionContext);
    }

    @Override
    public Calendar getCreated() throws RepositoryException {
        PropertyDelegate dlg = getPropertyOrThrow(JcrConstants.JCR_CREATED);
        return ValueFactoryImpl.createValue(dlg.getSingleState(), sessionContext).getDate();
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

        return ValueFactoryImpl.createValues(p.getMultiState(), sessionContext);
    }

    @Override
    public Version[] getPredecessors() throws RepositoryException {
        PropertyDelegate p = getPropertyOrThrow(VersionConstants.JCR_PREDECESSORS);
        List<Version> predecessors = new ArrayList<Version>();
        VersionManagerDelegate vMgr = getVersionManagerDelegate();
        for (Value v : getValues(p)) {
            String id = v.getString();
            predecessors.add(new VersionImpl(vMgr.getVersionByIdentifier(id), sessionContext));
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

        return predecessors.toArray(new Version[predecessors.size()]);
    }

    @Override
    public Version[] getSuccessors() throws RepositoryException {
        PropertyDelegate p = getPropertyOrThrow(VersionConstants.JCR_SUCCESSORS);
        List<Version> successors = new ArrayList<Version>();
        VersionManagerDelegate vMgr = getVersionManagerDelegate();
        for (Value v : getValues(p)) {
            String id = v.getString();
            successors.add(new VersionImpl(vMgr.getVersionByIdentifier(id), sessionContext));
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

    }

    @Nonnull
    private PropertyDelegate getPropertyOrThrow(@Nonnull String name)
            throws RepositoryException {
        PropertyDelegate p = dlg.getPropertyOrNull(checkNotNull(name));
        if (p == null) {
            throw new RepositoryException("Inconsistent version storage. " +
                    "Version does not have a " + name + " property.");
        }
        return p;
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

    public NodeImpl createNodeOrNull(NodeDelegate nd) throws RepositoryException {
        if (nd == null) {
            return null;
        }
        PropertyDelegate pd = nd.getPropertyOrNull(JcrConstants.JCR_PRIMARYTYPE);
        String type = pd != null ? pd.getString() : null;
        if (JcrConstants.NT_VERSION.equals(type)) {
            VersionManagerDelegate delegate = VersionManagerDelegate.create(getSessionDelegate());
            return new VersionImpl(delegate.createVersion(nd), this);
        } else if (JcrConstants.NT_VERSIONHISTORY.equals(type)) {
            VersionManagerDelegate delegate = VersionManagerDelegate.create(getSessionDelegate());
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

    }

    public static NodeImpl<? extends NodeDelegate> createNode(
                NodeDelegate delegate, SessionContext context)
                throws RepositoryException {
        PropertyDelegate pd = delegate.getPropertyOrNull(JCR_PRIMARYTYPE);
        String type = pd != null ? pd.getString() : null;
        if (JcrConstants.NT_VERSION.equals(type)) {
            VersionManagerDelegate vmd =
                    VersionManagerDelegate.create(context.getSessionDelegate());
            return new VersionImpl(vmd.createVersion(delegate), context);
        } else if (JcrConstants.NT_VERSIONHISTORY.equals(type)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.