Package org.apache.jackrabbit.name

Examples of org.apache.jackrabbit.name.QName


            // init label cache
            PropertyState[] labels = labelNode.getProperties();
            for (int i = 0; i < labels.length; i++) {
                PropertyState pState = labels[i];
                if (pState.getType() == PropertyType.REFERENCE) {
                    QName name = pState.getName();
                    UUID ref = (UUID) pState.getValues()[0].internalValue();
                    InternalVersionImpl v = (InternalVersionImpl) getVersion(new NodeId(ref));
                    if (v != null) {
                        labelCache.put(name, v);
                        v.internalAddLabel(name);
View Full Code Here


    public PropertyState[] getProperties() throws ItemStateException {
        Set set = nodeState.getPropertyNames();
        PropertyState[] props = new PropertyState[set.size()];
        int i = 0;
        for (Iterator iter = set.iterator(); iter.hasNext();) {
            QName propName = (QName) iter.next();
            PropertyId propId = new PropertyId(nodeState.getNodeId(), propName);
            props[i++] = (PropertyState) stateMgr.getItemState(propId);
        }
        return props;
    }
View Full Code Here

        NodeState state = (NodeState) stateMgr.getItemState(id);

        // remove properties
        Iterator iter = state.getPropertyNames().iterator();
        while (iter.hasNext()) {
            QName name = (QName) iter.next();
            PropertyId propId = new PropertyId(id, name);
            PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
            stateMgr.destroy(propState);
        }
        state.removeAllPropertyNames();
View Full Code Here

        if (state.getStatus() != ItemState.STATUS_EXISTING) {
            // first store all transient properties
            Set props = state.getPropertyNames();
            for (Iterator iter = props.iterator(); iter.hasNext();) {
                QName propName = (QName) iter.next();
                PropertyState pstate = (PropertyState) stateMgr.getItemState(
                        new PropertyId(state.getNodeId(), propName));
                if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
                    stateMgr.store(pstate);
                }
View Full Code Here

    private void reload(NodeState state) throws ItemStateException {
        if (state.getStatus() != ItemState.STATUS_EXISTING) {
            // first discard all all transient properties
            Set props = state.getPropertyNames();
            for (Iterator iter = props.iterator(); iter.hasNext();) {
                QName propName = (QName) iter.next();
                PropertyState pstate = (PropertyState) stateMgr.getItemState(
                        new PropertyId(state.getNodeId(), propName));
                if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
                    pstate.discard();
                }
View Full Code Here

     * @see javax.jcr.version.VersionHistory#getVersion(String)
     */
    public Version getVersion(String versionName)
            throws VersionException, RepositoryException {
        try {
            QName name = NameFormat.parse(versionName, session.getNamespaceResolver());
            InternalVersion v = getInternalVersionHistory().getVersion(name);
            if (v == null) {
                throw new VersionException("No version with name '" + versionName + "' exists in this version history.");
            }
            return (Version) session.getNodeById(v.getId());
View Full Code Here

    /**
     * @see javax.jcr.version.VersionHistory#getVersionByLabel(String)
     */
    public Version getVersionByLabel(String label) throws RepositoryException {
        try {
            QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
            InternalVersion v = getInternalVersionHistory().getVersionByLabel(qLabel);
            if (v == null) {
                throw new VersionException("No version with label '" + label + "' exists in this version history.");
            }
            return (Version) session.getNodeById(v.getId());
View Full Code Here

    /**
     * @see javax.jcr.version.VersionHistory#hasVersionLabel(String)
     */
    public boolean hasVersionLabel(String label) throws RepositoryException {
        try {
            QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
            return getInternalVersionHistory().getVersionByLabel(qLabel) != null;
        } catch (IllegalNameException e) {
            throw new IllegalArgumentException("Unable to resolve label: " + e);
        } catch (UnknownPrefixException e) {
            throw new IllegalArgumentException("Unable to resolve label: " + e);
View Full Code Here

     */
    public boolean hasVersionLabel(Version version, String label)
            throws VersionException, RepositoryException {
        checkOwnVersion(version);
        try {
            QName qLabel = NameFormat.parse(label, session.getNamespaceResolver());
            return ((VersionImpl) version).getInternalVersion().hasLabel(qLabel);
        } catch (IllegalNameException e) {
            throw new VersionException(e);
        } catch (UnknownPrefixException e) {
            throw new VersionException(e);
View Full Code Here

                    BufferedStringValue val =
                            (BufferedStringValue) currentPropValues.get(i);
                    String s = null;
                    try {
                        s = val.retrieve();
                        QName mixin = NameFormat.parse(s, nsContext);
                        state.mixinNames.add(mixin);
                    } catch (IOException ioe) {
                        throw new SAXException("error while retrieving value", ioe);
                    } catch (IllegalNameException ine) {
                        throw new SAXException(new InvalidSerializedDataException("illegal mixin type name: " + s, ine));
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.name.QName

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.