Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.PropertyInfo


        if (nid.getPath() == null) {
            PropertyId id = getIdFactory().createPropertyId(nid, NameConstants.JCR_UUID);
            QValue[] vs = new QValue[] {getQValueFactory().create(nid.getUniqueID(), PropertyType.STRING)};
            Path p = getPathFactory().create(nPath, NameConstants.JCR_UUID, true);
            PropertyInfo pi = new PropertyInfoImpl(id, p, PropertyType.STRING, false, vs);
            l.add(pi);
        }

        Name pName = NameConstants.JCR_PRIMARYTYPE;
        QValue[] vs = new QValue[] {getQValueFactory().create(nInfo.getNodetype())};
        PropertyInfo pi = new PropertyInfoImpl(getIdFactory().createPropertyId(nid, pName),
                getPathFactory().create(nPath, pName, true), PropertyType.NAME, false, vs);
        l.add(pi);

        Name[] mixins = nInfo.getMixins();
        if (mixins.length > 0) {
View Full Code Here


     * @see RepositoryService#getItemInfos(SessionInfo, ItemId)
     */
    @Override
    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws ItemNotFoundException, RepositoryException {
        if (!itemId.denotesNode()) {
            PropertyInfo propertyInfo = getPropertyInfo(sessionInfo, (PropertyId) itemId);
            return Iterators.singleton(propertyInfo);
        } else {
            NodeId nodeId = (NodeId) itemId;
            Path path = getPath(itemId, sessionInfo);
            String uri = getURI(path, sessionInfo);
View Full Code Here

    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId)
            throws ItemNotFoundException, RepositoryException {

        if (!itemId.denotesNode()) {
            PropertyId propertyId = (PropertyId) itemId;
            PropertyInfo propertyInfo = getPropertyInfo(sessionInfo, propertyId);
            return Iterators.singleton(propertyInfo);
        }
        else {
            NodeId nodeId = (NodeId) itemId;
            final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
View Full Code Here

            // nodeInfo.
            l.addAll(buildPropertyInfos(nInfo));
            return l.iterator();
        }
        else {
            PropertyInfo pInfo = getPropertyInfo(sessionInfo, (PropertyId) itemId);
            return Iterators.singleton(pInfo);
        }
    }
View Full Code Here

        if (nid.getPath() == null) {
            PropertyId id = getIdFactory().createPropertyId(nid, NameConstants.JCR_UUID);
            QValue[] vs = new QValue[] {getQValueFactory().create(nid.getUniqueID(), PropertyType.STRING)};
            Path p = getPathFactory().create(nPath, NameConstants.JCR_UUID, true);
            PropertyInfo pi = new PropertyInfoImpl(id, p, PropertyType.STRING, false, vs);
            l.add(pi);
        }

        Name pName = NameConstants.JCR_PRIMARYTYPE;
        QValue[] vs = new QValue[] {getQValueFactory().create(nInfo.getNodetype())};
        PropertyInfo pi = new PropertyInfoImpl(getIdFactory().createPropertyId(nid, pName),
                getPathFactory().create(nPath, pName, true), PropertyType.NAME, false, vs);
        l.add(pi);

        Name[] mixins = nInfo.getMixins();
        if (mixins.length > 0) {
View Full Code Here

        Name fileName = resolver.getQName("\u0633\u0634.txt");
        createFile(fileName);

        NodeId nid = getNodeId(testPath + "/\u0633\u0634.txt/jcr:content");

        PropertyInfo pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_LASTMODIFIED));
        assertEquals(lastModified, pi.getValues()[0]);

        pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_MIMETYPE));
        assertEquals(mimeType, pi.getValues()[0]);

        pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_ENCODING));
        assertEquals(enc, pi.getValues()[0]);

        pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_DATA));
        assertEquals("\u0633\u0634", pi.getValues()[0].getString());
    }
View Full Code Here

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, new QValue[0]);
        rs.submit(b);

        PropertyId pid = getPropertyId(nid, propName);
        PropertyInfo pi = rs.getPropertyInfo(si, pid);
        assertTrue(pi.isMultiValued());
        assertEquals(Arrays.asList(new QValue[0]), Arrays.asList(pi.getValues()));
        assertFalse(pi.getType() == PropertyType.UNDEFINED);

        Iterator<? extends ItemInfo> it = rs.getItemInfos(si, nid);
        while (it.hasNext()) {
            ItemInfo info = it.next();
            if (!info.denotesNode()) {
                PropertyInfo pInfo = (PropertyInfo) info;
                if (propName.equals((pInfo.getId().getName()))) {
                    assertTrue(pi.isMultiValued());
                    assertEquals(Arrays.asList(new QValue[0]), Arrays.asList(pi.getValues()));
                    assertFalse(pi.getType() == PropertyType.UNDEFINED);
                    break;
                }
View Full Code Here

        PropertyId pid = getPropertyId(nid, propName);
        b = rs.createBatch(si, pid);
        b.setValue(pid, new QValue[0]);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, pid);
        assertTrue(pi.isMultiValued());
        assertEquals(Arrays.asList(new QValue[0]), Arrays.asList(pi.getValues()));
    }
View Full Code Here

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

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertTrue(pi.isMultiValued());
        assertEquals(Arrays.asList(vs), Arrays.asList(pi.getValues()));
        assertEquals(PropertyType.LONG, pi.getType());
    }
View Full Code Here

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, rs.getQValueFactory().create(new byte[] {'a', 'b', 'c'}));
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals("abc", pi.getValues()[0].getString());
        assertEquals(PropertyType.BINARY, pi.getType());
    }
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.