Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.PropertyImpl


            log.debug(message);
            return false;
        }

        Value toRemove = getSession().getValueFactory().createValue(group.getNode());
        PropertyImpl property = node.getProperty(P_GROUPS);
        List valList = new ArrayList(Arrays.asList(property.getValues()));
        if (valList.remove(toRemove)) {
            try {
                if (valList.isEmpty()) {
                    userManager.removeProtectedItem(property, node);
                } else {
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();
            }

            if (opv == OnParentVersionAction.ABORT) {
                parent.reload();
                throw new VersionException("Checkin aborted due to OPV in " + prop);
            } else if (opv == OnParentVersionAction.VERSION
                    || opv == OnParentVersionAction.COPY) {
                // ignore frozen properties
                if (!prop.getQName().equals(NameConstants.JCR_PRIMARYTYPE)
                        && !prop.getQName().equals(NameConstants.JCR_MIXINTYPES)
                        && !prop.getQName().equals(NameConstants.JCR_UUID)) {
                    node.copyFrom(prop);
                }
            }
        }
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 (getNodeImpl().hasProperty(properties[i])) {
                        PropertyImpl prop = getNodeImpl().getProperty(properties[i]);
                        if (!prop.getDefinition().isMultiple()) {
                            if (prop.getDefinition().getRequiredType() == PropertyType.UNDEFINED) {
                                tmp[i] = valueFactory.createValue(prop.getString());
                            } else {
                                tmp[i] = prop.getValue();
                            }
                        } else {
                            // mvp values cannot be returned
                            tmp[i] = null;
                        }
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

        if (hold instanceof HoldImpl
                && n.getNodeId().equals(((HoldImpl) hold).getNodeId())
                && n.isNodeType(REP_RETENTION_MANAGEABLE)
                && n.hasProperty(REP_HOLD)) {

            PropertyImpl p = n.getProperty(REP_HOLD);
            Value[] vls = p.getValues();

            List newValues = new ArrayList(vls.length - 1);
            for (int i = 0; i < vls.length; i++) {
                if (!hold.equals(HoldImpl.createFromValue(vls[i], n.getNodeId(), session))) {
                    newValues.add(vls[i]);
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)) {
                                    readAllowed = isReadAllowed(principalNames);
                                    clearCache = true;
View Full Code Here

    public synchronized boolean removeReferee(Principal principal) throws RepositoryException {
        Value princValue = getSession().getValueFactory().createValue(principal.getName());
        List<Value> existingValues = getRefereeValues();

        if (existingValues.remove(princValue))  {
            PropertyImpl prop = node.getProperty(P_REFEREES);
            if (existingValues.isEmpty()) {
                userManager.removeProtectedItem(prop, node);
            } else {
                userManager.setProtectedProperty(node, P_REFEREES, existingValues.toArray(new Value[existingValues.size()]));
            }
View Full Code Here

            log.debug(message);
            return false;
        }

        Value toRemove = getSession().getValueFactory().createValue(group.getNode(), true);
        PropertyImpl property = node.getProperty(P_GROUPS);
        List<Value> valList = new ArrayList<Value>(Arrays.asList(property.getValues()));
        if (valList.remove(toRemove)) {
            try {
                if (valList.isEmpty()) {
                    userManager.removeProtectedItem(property, node);
                } else {
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

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.