Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.PropertyInfo


     */
    public PropertyState createPropertyState(PropertyId propertyId,
                                             PropertyEntry entry)
            throws ItemNotFoundException, RepositoryException {
        try {
            PropertyInfo info = service.getPropertyInfo(sessionInfo, propertyId);
            assertMatchingPath(info, entry);
            return createPropertyState(info, entry);
        } catch (PathNotFoundException e) {
            throw new ItemNotFoundException(e.getMessage());
        }
View Full Code Here


     * @inheritDoc
     * @see ItemStateFactory#createDeepPropertyState(PropertyId,NodeEntry)
     */
    public PropertyState createDeepPropertyState(PropertyId propertyId, NodeEntry anyParent) throws ItemNotFoundException, RepositoryException {
        try {
            PropertyInfo info = service.getPropertyInfo(sessionInfo, propertyId);
            PropertyState propState = createDeepPropertyState(info, anyParent, null);
            assertValidState(propState, info);
            return propState;
        } catch (PathNotFoundException e) {
            throw new ItemNotFoundException(e.getMessage());
View Full Code Here

        QValue v = rs.getQValueFactory().create(resolver.getQPath(testPath));
        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
        assertEquals(PropertyType.PATH, pi.getType());

        pi = getPropertyInfo(nid, propName);
        assertEquals(v.getPath(), pi.getValues()[0].getPath());
        assertEquals(v, pi.getValues()[0]);
        assertEquals(PropertyType.PATH, pi.getType());
    }
View Full Code Here

        QValue v = rs.getQValueFactory().create(false);
        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertFalse(pi.getValues()[0].getBoolean());
        assertEquals(PropertyType.BOOLEAN, pi.getType());

        pi = getPropertyInfo(nid, propName);
        assertFalse(pi.getValues()[0].getBoolean());
        assertEquals(PropertyType.BOOLEAN, pi.getType());
    }
View Full Code Here

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
        assertEquals(PropertyType.REFERENCE, pi.getType());

        pi = getPropertyInfo(nid, propName);
        assertEquals(v, pi.getValues()[0]);
        assertEquals(PropertyType.REFERENCE, pi.getType());
    }
View Full Code Here

        b.addProperty(nid, propName, v);
        b.setValue(pid, v2);
        b.setValue(pid, v3);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(1, pi.getValues().length);
        assertEquals(v3, pi.getValues()[0]);
        assertEquals(PropertyType.NAME, pi.getType());

        pi = getPropertyInfo(nid, propName);
        assertFalse(pi.isMultiValued());
        assertEquals(1, pi.getValues().length);
        assertEquals(v3, pi.getValues()[0]);
        assertEquals(PropertyType.NAME, pi.getType());
    }
View Full Code Here

    private PropertyInfo getPropertyInfo(NodeId parentId, Name propName) throws RepositoryException {
        Iterator it = rs.getItemInfos(si, parentId);
        while (it.hasNext()) {
            ItemInfo info = (ItemInfo) it.next();
            if (!info.denotesNode()) {
                PropertyInfo pInfo = (PropertyInfo) info;
                if (propName.equals((pInfo.getId().getName()))) {
                    return pInfo;
                }
            }
        }
        throw new ItemNotFoundException();
View Full Code Here

                                return object instanceof PropertyInfo;
                            }
                        }),
                        new Transformer() {
                            public Object transform(Object input) {
                                PropertyInfo info = (PropertyInfo) input;
                                return info.getId();
                            }});

                Iterator<ItemInfo> childInfos = new TransformIterator(itemInfos.iterator(), new Transformer(){
                    public Object transform(Object input) {
                        ItemInfo info = (ItemInfo) input;
                        Name name = info.getPath().getNameElement().getName();
                        return new ChildInfoImpl(name, null, Path.INDEX_DEFAULT);
                    }});

                nodeInfo = new NodeInfoImpl(path, id, Path.INDEX_DEFAULT, NameConstants.NT_UNSTRUCTURED,
                        Name.EMPTY_ARRAY, EmptyIterator.INSTANCE, propertyIds, childInfos);
View Full Code Here

    private PropertyInfo getPropertyInfo(NodeId parentId, Name propName) throws RepositoryException {
        Iterator it = rs.getItemInfos(si, parentId);
        while (it.hasNext()) {
            ItemInfo info = (ItemInfo) it.next();
            if (!info.denotesNode()) {
                PropertyInfo pInfo = (PropertyInfo) info;
                if (propName.equals((pInfo.getId().getName()))) {
                    return pInfo;
                }
            }
        }
        throw new ItemNotFoundException();
View Full Code Here

     */
    public PropertyState createPropertyState(PropertyId propertyId,
                                             PropertyEntry entry)
            throws ItemNotFoundException, RepositoryException {
        try {
            PropertyInfo info = service.getPropertyInfo(sessionInfo, propertyId);
            assertMatchingPath(info, entry);
            return createPropertyState(info, entry);
        } catch (PathNotFoundException e) {
            throw new ItemNotFoundException(e.getMessage());
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.PropertyInfo

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.