Package org.apache.jackrabbit.jcr2spi.hierarchy

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry


        if (getNodeState().getStatus() == Status.EXISTING) {
            // jcr:mixinTypes must correspond to the mixins present on the nodestate.
            mixinValue = getNodeState().getMixinTypeNames();
        } else {
            try {
                PropertyEntry pe = getNodeEntry().getPropertyEntry(NameConstants.JCR_MIXINTYPES);
                if (pe != null) {
                    // prop entry exists (and ev. has been transiently mod.)
                    // -> retrieve mixin types from prop
                    mixinValue = StateUtility.getMixinNames(pe.getPropertyState());
                } else {
                    // prop entry has not been loaded yet -> not modified
                    mixinValue = getNodeState().getMixinTypeNames();
                }
            } catch (RepositoryException e) {
View Full Code Here


     */
    // TODO: protected due to usage within VersionImpl, VersionHistoryImpl (check for alternatives)
    protected Property getProperty(Name qName) throws PathNotFoundException, RepositoryException {
        checkStatus();
        try {
            PropertyEntry pEntry = getNodeEntry().getPropertyEntry(qName, true);
            if (pEntry == null) {
                throw new PathNotFoundException(qName.toString());
            }
            return (Property) itemMgr.getItem(pEntry);
        } catch (AccessDeniedException e) {
View Full Code Here

            } else {
                // TODO: check if correct (and only used for creating new)
                Name primaryType = nodeState.getNodeTypeName();
                allNtNames = new Name[] { primaryType }; // default
                try {
                    PropertyEntry pe = nodeState.getNodeEntry().getPropertyEntry(NameConstants.JCR_MIXINTYPES, true);
                    if (pe != null) {
                        PropertyState mixins = pe.getPropertyState();
                        QValue[] values = mixins.getValues();
                        allNtNames = new Name[values.length + 1];
                        for (int i = 0; i < values.length; i++) {
                            allNtNames[i] = values[i].getName();
                        }
View Full Code Here

        PropertyState propState = null;
        QPropertyDefinition def = null;

        NodeEntry parentEntry = (NodeEntry) parentState.getHierarchyEntry();
        PropertyEntry pEntry = parentEntry.getPropertyEntry(propName);
        if (pEntry != null) {
            // a property with that name already exists...
            try {
                PropertyState existing = pEntry.getPropertyState();
                def = existing.getDefinition();
                if (def.isProtected()) {
                    // skip protected property
                    log.debug("skipping protected property " + LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                    return;
View Full Code Here

        }
        // non-recursive invalidation (but including all properties)
        NodeEntry nodeEntry = (NodeEntry) nodeState.getHierarchyEntry();
        Iterator entries = nodeEntry.getPropertyEntries();
        while (entries.hasNext()) {
            PropertyEntry pe = (PropertyEntry) entries.next();
            pe.invalidate(false);
        }
        nodeEntry.invalidate(false);
    }
View Full Code Here

                entry = createIntermediateNodeEntry(entry, name, index);
                i++;
            }
            // create PropertyEntry for the last element if not existing yet
            Name propName = missingElems[i].getName();
            PropertyEntry propEntry = entry.getPropertyEntry(propName);
            if (propEntry == null) {
                propEntry = entry.addPropertyEntry(propName);
            }
            return createPropertyState(info, propEntry);
        } catch (PathNotFoundException e) {
View Full Code Here

        session.checkIsAlive();

        Iterator iter = parentEntry.getPropertyEntries();
        while (iter.hasNext()) {
            try {
                PropertyEntry entry = (PropertyEntry) iter.next();
                // check read access by accessing the propState (also implicit validation).
                entry.getPropertyState();
                return true;
            } catch (ItemNotFoundException e) {
                // should not occur. ignore
                log.debug("Failed to access node state.", e);
            }
View Full Code Here

     */
    private Name[] getQLabels() throws RepositoryException {
        refreshEntry(labelNodeEntry);
        List labelNames = new ArrayList();
        for (Iterator it = labelNodeEntry.getPropertyEntries(); it.hasNext(); ) {
            PropertyEntry pe = (PropertyEntry) it.next();
            if (! NameConstants.JCR_PRIMARYTYPE.equals(pe.getName()) &&
                ! NameConstants.JCR_MIXINTYPES.equals(pe.getName())) {
                labelNames.add(pe.getName());
            }
        }
        return (Name[]) labelNames.toArray(new Name[labelNames.size()]);
    }
View Full Code Here

     * @throws RepositoryException
     */
    private Version getVersionByLabel(Name qLabel) throws VersionException, RepositoryException {
         refreshEntry(labelNodeEntry);
        // retrieve reference property value -> and retrieve referenced node
        PropertyEntry pEntry = labelNodeEntry.getPropertyEntry(qLabel, true);
        if (pEntry == null) {
            throw new VersionException("Version with label '" + qLabel + "' does not exist.");
        }
        Node version = ((Property) itemMgr.getItem(pEntry)).getNode();
        return (Version) version;
View Full Code Here

    /**
     * @see ItemManager#getProperty(Path)
     */
    public synchronized Property getProperty(Path path) throws PathNotFoundException, RepositoryException {
        PropertyEntry propertyEntry = hierMgr.getPropertyEntry(path);
        try {
            return (Property) getItem(propertyEntry);
        } catch (ItemNotFoundException infe) {
            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getPathResolver()));
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry

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.