Package org.apache.jackrabbit.value

Examples of org.apache.jackrabbit.value.ValueFactoryImpl


                Value[] values = new Value[groupUsers.size()];
                for (ListIterator it = groupUsers.listIterator(); it.hasNext(); ) {
                    int index = it.nextIndex();
                    User groupUser = (User) it.next();
                    String currentUsername = groupUser.getUsername();
                    ValueFactory valueFactory = new ValueFactoryImpl();
                    values[index] = valueFactory.createValue(currentUsername);
                }
                groupNode.setProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME, values);
            }
           
           
View Full Code Here


                Value[] values = new Value[groupUsers.size()];
                for (ListIterator it = groupUsers.listIterator(); it.hasNext(); ) {
                    int index = it.nextIndex();
                    User currentGroupUser = (User) it.next();
                    String currentUsername = currentGroupUser.getUsername();
                    ValueFactory valueFactory = new ValueFactoryImpl();
                    values[index] = valueFactory.createValue(currentUsername);
                }
                groupNode.setProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME, values);
            }
           
            ContentDao contentDao = ContentDao.createInstance();
View Full Code Here

            node.setProperty(NodesTypes.PREFIX + READ_GROUPS_PROPERTY, new Value[0]);
        } catch (AccessDeniedException e) {
            return;
        }
       
        ValueFactory valueFactory = new ValueFactoryImpl();
        addMandatoryPermissions(content);
           
        {
            node.setProperty(NodesTypes.PREFIX + READ_GROUPS_PROPERTY, new Value[0]);
          List readGroups = content.getReadGroups();
          if (readGroups != null && !readGroups.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[readGroups.size()];
            for (ListIterator it = readGroups.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                Group currentGroup = (Group) it.next();
                Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
                values[index] = valueFactory.createValue(groupNode);
            }
            node.setProperty(NodesTypes.PREFIX + READ_GROUPS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + READ_USERS_PROPERTY, new Value[0]);
          List readUsers = content.getReadUsers();
          if (readUsers != null && !readUsers.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[readUsers.size()];
            for (ListIterator it = readUsers.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                User currentUser = (User) it.next();
                values[index] = valueFactory.createValue(currentUser.getUsername());
            }
 
            node.setProperty(NodesTypes.PREFIX + READ_USERS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + WRITE_GROUPS_PROPERTY, new Value[0]);
          List writeGroups = content.getWriteGroups();
          if (writeGroups != null && !writeGroups.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[writeGroups.size()];
            for (ListIterator it = writeGroups.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                Group currentGroup = (Group) it.next();
                Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
                values[index] = valueFactory.createValue(groupNode);
            }
            node.setProperty(NodesTypes.PREFIX + WRITE_GROUPS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + WRITE_USERS_PROPERTY, new Value[0]);
          List writeUsers = content.getWriteUsers();
          if (writeUsers != null && !writeUsers.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[writeUsers.size()];
            for (ListIterator it = writeUsers.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                    User currentUser = (User) it.next();
                values[index] = valueFactory.createValue(currentUser.getUsername());
            }
            node.setProperty(NodesTypes.PREFIX + WRITE_USERS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + REMOVE_GROUPS_PROPERTY, new Value[0]);
          List removeGroups = content.getRemoveGroups();
          if (removeGroups != null && !removeGroups.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[removeGroups.size()];
            for (ListIterator it = removeGroups.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                Group currentGroup = (Group) it.next();
                Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
                values[index] = valueFactory.createValue(groupNode);
            }
            node.setProperty(NodesTypes.PREFIX + REMOVE_GROUPS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + REMOVE_USERS_PROPERTY, new Value[0]);
          List removeUsers = content.getRemoveUsers();
          if (removeUsers != null && !removeUsers.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[removeUsers.size()];
            for (ListIterator it = removeUsers.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                    User currentUser = (User) it.next();
                values[index] = valueFactory.createValue(currentUser.getUsername());
            }
            node.setProperty(NodesTypes.PREFIX + REMOVE_USERS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + OWNER_GROUPS_PROPERTY, new Value[0]);
          List ownerGroups = content.getOwnerGroups();
          if (ownerGroups != null && !ownerGroups.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[ownerGroups.size()];
            for (ListIterator it = ownerGroups.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                Group currentGroup = (Group) it.next();
                Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
                values[index] = valueFactory.createValue(groupNode);
            }
            node.setProperty(NodesTypes.PREFIX + OWNER_GROUPS_PROPERTY, values);
          }
        }
       
        {
            node.setProperty(NodesTypes.PREFIX + OWNER_USERS_PROPERTY, new Value[0]);
          List ownerUsers = content.getOwnerUsers();
          if (ownerUsers != null && !ownerUsers.isEmpty()) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
            Value[] values = new Value[ownerUsers.size()];
            for (ListIterator it = ownerUsers.listIterator(); it.hasNext(); ) {
                int index = it.nextIndex();
                    User currentUser = (User) it.next();
                values[index] = valueFactory.createValue(currentUser.getUsername());
            }
            node.setProperty(NodesTypes.PREFIX + OWNER_USERS_PROPERTY, values);
          }
        }
       
        {
            if (content.isRestrictChildren() != null) {
                if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                    this.addContentMixin(node);
                }
                Value restrictChildrenValue = valueFactory.createValue(content.isRestrictChildren().booleanValue());
                node.setProperty(NodesTypes.PREFIX + RESTRICT_CHILDREN_PROPERTY, restrictChildrenValue);
            }
        }
    }
View Full Code Here

     * {@inheritDoc}
     */
    public ValueFactory getValueFactory()
            throws UnsupportedRepositoryOperationException, RepositoryException {
        if (valueFactory == null) {
            valueFactory = new ValueFactoryImpl();
        }
        return valueFactory;
    }
View Full Code Here

     * {@inheritDoc}
     */
    public ValueFactory getValueFactory()
            throws UnsupportedRepositoryOperationException, RepositoryException {
        if (valueFactory == null) {
            valueFactory = new ValueFactoryImpl();
        }
        return valueFactory;
    }
View Full Code Here

     * {@inheritDoc}
     */
    public ValueFactory getValueFactory()
            throws UnsupportedRepositoryOperationException, RepositoryException {
        if (valueFactory == null) {
            valueFactory = new ValueFactoryImpl();
        }
        return valueFactory;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.value.ValueFactoryImpl

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.