Package org.apache.jackrabbit.oak.api

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


        case PropertyType.REFERENCE:
            return vf.createValue(v.getString(), PropertyType.REFERENCE);
        case PropertyType.WEAKREFERENCE:
            return vf.createValue(v.getString(), PropertyType.WEAKREFERENCE);
        case PropertyType.URI:
            return vf.createValue(v.getString(), PropertyType.URI);
        case PropertyType.BINARY:
            try {
                byte[] data = v.getString().getBytes("UTF-8");
                return vf.createValue(new ByteArrayInputStream(data));
            } catch (IOException e) {
View Full Code Here


        case PropertyType.URI:
            return vf.createValue(v.getString(), PropertyType.URI);
        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

                if (lowerBound == null && upperBound == null) {
                    // ignore
                } else {
                    CoreValueFactory vf = query.getValueFactory();
                    if (lowerBound != null) {
                        operand1.apply(f, Operator.GREATER_OR_EQUAL, vf.createValue(lowerBound));
                    }
                    if (upperBound != null) {
                        operand1.apply(f, Operator.LESS_OR_EQUAL, vf.createValue(upperBound));
                    }
                }
View Full Code Here

                    CoreValueFactory vf = query.getValueFactory();
                    if (lowerBound != null) {
                        operand1.apply(f, Operator.GREATER_OR_EQUAL, vf.createValue(lowerBound));
                    }
                    if (upperBound != null) {
                        operand1.apply(f, Operator.LESS_OR_EQUAL, vf.createValue(upperBound));
                    }
                }
            } else {
                operand1.apply(f, operator, v);
            }
View Full Code Here

            Root root = session.getLatestRoot();
            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

                if (lowerBound == null && upperBound == null) {
                    // ignore
                } else if (operand1.supportsRangeConditions()) {
                    CoreValueFactory vf = query.getValueFactory();
                    if (lowerBound != null) {
                        operand1.restrict(f, Operator.GREATER_OR_EQUAL, vf.createValue(lowerBound));
                    }
                    if (upperBound != null) {
                        operand1.restrict(f, Operator.LESS_OR_EQUAL, vf.createValue(upperBound));
                    }
                }
View Full Code Here

                    CoreValueFactory vf = query.getValueFactory();
                    if (lowerBound != null) {
                        operand1.restrict(f, Operator.GREATER_OR_EQUAL, vf.createValue(lowerBound));
                    }
                    if (upperBound != null) {
                        operand1.restrict(f, Operator.LESS_OR_EQUAL, vf.createValue(upperBound));
                    }
                }
            } else {
                operand1.restrict(f, operator, v);
            }
View Full Code Here

                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

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.