Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.CoreValueFactory.createValue()


                for (CoreValue value : property.getValues()) {
                    String name = value.getString();
                    if (!name.equals(source) && !added.contains(property)
                            && !name.startsWith(":")) {
                        if (name.equals(target)) {
                            order.add(factory.createValue(source));
                            added.add(source);
                        }
                        order.add(factory.createValue(name));
                        added.add(name);
                    }
View Full Code Here


                            && !name.startsWith(":")) {
                        if (name.equals(target)) {
                            order.add(factory.createValue(source));
                            added.add(source);
                        }
                        order.add(factory.createValue(name));
                        added.add(name);
                    }
                }
            }
View Full Code Here

                    }
                }
            }

            if (!added.contains(source)) {
                order.add(factory.createValue(source));
            }
            if (target != null && !added.contains(target)) {
                order.add(factory.createValue(source));
            }
View Full Code Here

            if (!added.contains(source)) {
                order.add(factory.createValue(source));
            }
            if (target != null && !added.contains(target)) {
                order.add(factory.createValue(source));
            }

            tree.setProperty(PropertyState.OAK_CHILD_ORDER, order);
        }
    }
View Full Code Here

            Root root = session.getCurrentRoot();
            Tree tree = root.getTree(dlg.getPath());
            if (tree == null) {
                throw new ItemNotFoundException();
            }
            tree.setProperty(lockOwner, factory.createValue(userID));
            tree.setProperty(lockIsDeep, factory.createValue(isDeep));
            root.commit(DefaultConflictHandler.OURS); // TODO: fail instead?
        } catch (CommitFailedException e) {
            throw new RepositoryException("Unable to lock " + this, e);
        }
View Full Code Here

            Tree tree = root.getTree(dlg.getPath());
            if (tree == null) {
                throw new ItemNotFoundException();
            }
            tree.setProperty(lockOwner, factory.createValue(userID));
            tree.setProperty(lockIsDeep, factory.createValue(isDeep));
            root.commit(DefaultConflictHandler.OURS); // TODO: fail instead?
        } catch (CommitFailedException e) {
            throw new RepositoryException("Unable to lock " + this, e);
        }
View Full Code Here

                    String key = generateKey(8);
                    String token = new StringBuilder(tokenTree.getPath()).append(DELIM).append(key).toString();

                    CoreValueFactory vf = contentSession.getCoreValueFactory();
                    tokenTree.setProperty(TOKEN_ATTRIBUTE_KEY, vf.createValue(PasswordUtility.buildPasswordHash(key)));
                    final long expirationTime = creationTime + tokenExpiration;
                    tokenTree.setProperty(TOKEN_ATTRIBUTE_EXPIRY, getExpirationValue(expirationTime));

                    Map<String, String> attributes;
                    for (String name : sc.getAttributeNames()) {
View Full Code Here

                    Map<String, String> attributes;
                    for (String name : sc.getAttributeNames()) {
                        if (!TOKEN_ATTRIBUTE.equals(name)) {
                            String attr = sc.getAttribute(name).toString();
                            tokenTree.setProperty(name, vf.createValue(attr));
                        }
                    }
                    root.commit(DefaultConflictHandler.OURS);

                    // also set the new token to the simple credentials.
View Full Code Here

        case PropertyType.STRING:
            switch(targetType) {
            case PropertyType.BINARY:
                try {
                    byte[] data = v.getString().getBytes("UTF-8");
                    return vf.createValue(new ByteArrayInputStream(data));
                } catch (IOException e) {
                    // I don't know in what case that could really occur
                    // except if UTF-8 isn't supported
                    throw new IllegalArgumentException(v.getString(), e);
                }
View Full Code Here

                    // I don't know in what case that could really occur
                    // except if UTF-8 isn't supported
                    throw new IllegalArgumentException(v.getString(), e);
                }
            }
            return vf.createValue(v.getString(), targetType);
        }
        switch (targetType) {
        case PropertyType.STRING:
            return vf.createValue(v.getString());
        case PropertyType.BOOLEAN:
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.