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(),
                    node.getMixinTypeNames(),
                    node.getSession()
            ));
        }
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();
            if (p.getDefinition().isProtected()) {
                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();
            if (p.getDefinition().isProtected()) {
                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

                        case Event.PROPERTY_ADDED:
                        case Event.PROPERTY_CHANGED:
                            // test if the added/changed prop belongs to an ACe
                            // node and affects the permission of any of the
                            // principals listed in principalNames.
                            PropertyImpl p = (PropertyImpl) session.getProperty(path);
                            NodeImpl parent = (NodeImpl) p.getParent();
                            if (parent.isNodeType(NT_REP_ACE)) {
                                String principalName = null;
                                if (P_PRIVILEGES.equals(p.getQName())) {
                                    // test if principal-name sibling-prop matches
                                    principalName = parent.getProperty(P_PRINCIPAL_NAME).getString();
                                } else if (P_PRINCIPAL_NAME.equals(p.getQName())) {
                                    // a new ace or an ace change its principal-name.
                                    principalName = p.getString();
                                }
                                if (principalName != null &&
                                        principalNames.contains(principalName)) {
                                    clearCache = true;
                                }
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();
            if (p.getDefinition().isProtected()) {
                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();
            if (p.getDefinition().isProtected()) {
                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

    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();
            if (p.getDefinition().isProtected()) {
                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();
            if (p.getDefinition().isProtected()) {
                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

            // traverse the tree below groups-path and collect membership manually.
            log.info("Traversing groups tree to collect membership.");
            ItemVisitor visitor = new TraversingItemVisitor.Default() {
                @Override
                protected void entering(Property property, int level) throws RepositoryException {
                    PropertyImpl pImpl = (PropertyImpl) property;
                    NodeImpl n = (NodeImpl) pImpl.getParent();
                    if (P_MEMBERS.equals(pImpl.getQName()) && n.isNodeType(NT_REP_GROUP)) {
                        for (Value value : property.getValues()) {
                            if (value.getString().equals(node.getIdentifier())) {
                                Group gr = (Group) userManager.getAuthorizable(n);
                                groups.add(gr);
                            }
View Full Code Here

                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

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.