Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.PropertyImpl


                node.getSession()
        ));

        PropertyIterator iter = node.getProperties();
        while (iter.hasNext()) {
            PropertyImpl prop = (PropertyImpl) iter.nextProperty();
            events.add(EventState.propertyAdded(
                    (NodeId) node.getId(),
                    node.getPrimaryPath(),
                    prop.getPrimaryPath().getNameElement(),
                    ((NodeTypeImpl) node.getPrimaryNodeType()).getQName(),
                    node.getMixinTypeNames(),
                    node.getSession()
            ));
        }
View Full Code Here


        }

        // add the properties
        PropertyIterator piter = src.getProperties();
        while (piter.hasNext()) {
            PropertyImpl prop = (PropertyImpl) piter.nextProperty();
            int opv;
            if ((mode & MODE_COPY) > 0) {
                opv = OnParentVersionAction.COPY;
            } else {
                opv = prop.getDefinition().getOnParentVersion();
            }
            switch (opv) {
                case OnParentVersionAction.ABORT:
                    parent.reload();
                    throw new VersionException("Checkin aborted due to OPV in " + prop.safeGetJCRPath());
                case OnParentVersionAction.COMPUTE:
                case OnParentVersionAction.IGNORE:
                case OnParentVersionAction.INITIALIZE:
                    break;
                case OnParentVersionAction.VERSION:
                case OnParentVersionAction.COPY:
                    // ignore frozen properties
                    if (!prop.getQName().equals(QName.JCR_PRIMARYTYPE)
                            && !prop.getQName().equals(QName.JCR_MIXINTYPES)
                            && !prop.getQName().equals(QName.JCR_UUID)) {
                        node.copyFrom(prop);
                    }
                    break;
            }
        }
View Full Code Here

        public Value[] getValues() throws RepositoryException {
            if (values == null) {
                Value[] tmp = new Value[properties.length];
                for (int i = 0; i < properties.length; i++) {
                    if (node.hasProperty(properties[i])) {
                        PropertyImpl prop = node.getProperty(properties[i]);
                        if (!prop.getDefinition().isMultiple()) {
                            if (prop.getDefinition().getRequiredType() == PropertyType.UNDEFINED) {
                                tmp[i] = new StringValue(prop.getString());
                            } else {
                                tmp[i] = prop.getValue();
                            }
                        } else {
                            // mvp values cannot be returned
                            tmp[i] = null;
                        }
View Full Code Here

    public void testUserGetProperties() throws RepositoryException, NotExecutableException {
        AuthorizableImpl user = (AuthorizableImpl) getTestUser(superuser);
        NodeImpl n = user.getNode();

        for (PropertyIterator it = n.getProperties(); it.hasNext();) {
            PropertyImpl p = (PropertyImpl) it.nextProperty();
            NodeType declaringNt = p.getDefinition().getDeclaringNodeType();
            if (!declaringNt.isNodeType("rep:Authorizable") ||
                    protectedUserProps.contains(p.getName())) {
                assertFalse(user.hasProperty(p.getName()));
                assertNull(user.getProperty(p.getName()));
            } else {
                // authorizable defined property
                assertTrue(user.hasProperty(p.getName()));
                assertNotNull(user.getProperty(p.getName()));
            }
        }
    }
View Full Code Here

    public void testGroupGetProperties() throws RepositoryException, NotExecutableException {
        AuthorizableImpl group = (AuthorizableImpl) getTestGroup(superuser);
        NodeImpl n = group.getNode();

        for (PropertyIterator it = n.getProperties(); it.hasNext();) {
            PropertyImpl p = (PropertyImpl) it.nextProperty();
            NodeType declaringNt = p.getDefinition().getDeclaringNodeType();
            if (!declaringNt.isNodeType("rep:Authorizable") ||
                    protectedGroupProps.contains(p.getName())) {
                assertFalse(group.hasProperty(p.getName()));
                assertNull(group.getProperty(p.getName()));
            } else {
                // authorizable defined property
                assertTrue(group.hasProperty(p.getName()));
                assertNotNull(group.getProperty(p.getName()));
            }
        }
    }
View Full Code Here

                    try {
                        NodeImpl node = (NodeImpl) session.getItemManager().getItem(nodeId);
                        Path nodePath = node.getPrimaryPath();

                        if (node.hasProperty(RetentionManagerImpl.REP_HOLD)) {
                            PropertyImpl prop = node.getProperty(RetentionManagerImpl.REP_HOLD);
                            addHolds(nodePath, prop);
                        }
                        if (node.hasProperty(RetentionManagerImpl.REP_RETENTION_POLICY)) {
                            PropertyImpl prop = node.getProperty(RetentionManagerImpl.REP_RETENTION_POLICY);
                            addRetentionPolicy(nodePath, prop);
                        }
                    } catch (RepositoryException e) {
                        // node doesn't exist any more or hold/retention has been removed.
                        // ignore. upon close() the file will not contain the given nodeId
View Full Code Here

                    switch (ev.getType()) {
                        case Event.PROPERTY_ADDED:
                        case Event.PROPERTY_CHANGED:
                            // build the Hold objects from the rep:hold property
                            // and put them into the hold map.
                            PropertyImpl p = (PropertyImpl) session.getProperty(ev.getPath());
                            addHolds(nodePath, p);
                            break;
                        case Event.PROPERTY_REMOVED:
                            // all holds present on this node were remove
                            // -> remove the corresponding entry in the holdMap.
                            removeHolds(nodePath);
                            break;
                    }
                } else if (RetentionManagerImpl.REP_RETENTION_POLICY.equals(propName)) {
                    // retention policy changes
                    switch (ev.getType()) {
                        case Event.PROPERTY_ADDED:
                        case Event.PROPERTY_CHANGED:
                            // build the RetentionPolicy objects from the rep:retentionPolicy property
                            // and put it into the retentionMap.
                            PropertyImpl p = (PropertyImpl) session.getProperty(ev.getPath());
                            addRetentionPolicy(nodePath, p);
                            break;
                        case Event.PROPERTY_REMOVED:
                            // retention policy present on this node was remove
                            // -> remove the corresponding entry in the retentionMap.
View Full Code Here

                return false;
            }

            Value toRemove = getSession().getValueFactory().createValue((authorizable).getNode(), true);

            PropertyImpl property = node.getProperty(P_MEMBERS);
            List<Value> valList = new ArrayList<Value>(Arrays.asList(property.getValues()));

            if (valList.remove(toRemove)) {
                try {
                    if (valList.isEmpty()) {
                        userManager.removeProtectedItem(property, node);
View Full Code Here

            throw new RepositoryException("The administrator user cannot be disabled.");
        }
        if (reason == null) {
            if (isDisabled()) {
                // enable the user again.
                PropertyImpl disableProp = getNode().getProperty(P_DISABLED);
                userManager.removeProtectedItem(disableProp, getNode());
            } // else: nothing to do.
        } else {
            Value v = getSession().getValueFactory().createValue(reason);
            userManager.setProtectedProperty(getNode(), P_DISABLED, v);
View Full Code Here

            return null;
        }

        while (refs.hasNext()) {
            try {
                PropertyImpl pMember = (PropertyImpl) refs.nextProperty();
                NodeImpl nGroup = (NodeImpl) pMember.getParent();

                Set<String> groupNodeIdentifiers;
                if (P_MEMBERS.equals(pMember.getQName())) {
                    // Found membership information in members property
                    groupNodeIdentifiers = pIds;
                } else {
                    // Found membership information in members node
                    groupNodeIdentifiers = nIds;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.PropertyImpl

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.