Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.PropertyId


     * @param propName   property name
     * @param parentId parent Id
     * @return new property state instance
     */
    private PropertyState createInstance(QName propName, NodeId parentId) {
        PropertyState state = persistMgr.createNew(new PropertyId(parentId, propName));
        state.setStatus(ItemState.STATUS_NEW);
        state.setContainer(this);

        return state;
    }
View Full Code Here


                         * where an element can have the same name as one of the attributes
                         * of its parent element) we have to rename the onflicting property;
                         *
                         * see http://issues.apache.org/jira/browse/JCR-61
                         */
                        PropertyId propId = new PropertyId(parent.getNodeId(), nodeName);
                        PropertyState conflicting = itemOps.getPropertyState(propId);
                        if (conflicting.getStatus() == ItemState.STATUS_NEW) {
                            // assume this property has been imported as well;
                            // rename conflicting property
                            // @todo use better reversible escaping scheme to create unique name
View Full Code Here

                writer.write("<" + NODEREFERENCES_ELEMENT + " "
                        + TARGETID_ATTRIBUTE + "=\"" + refs.getId() + "\">\n");
                // write references (i.e. the id's of the REFERENCE properties)
                Iterator iter = refs.getReferences().iterator();
                while (iter.hasNext()) {
                    PropertyId propId = (PropertyId) iter.next();
                    writer.write("\t<" + NODEREFERENCE_ELEMENT + " "
                            + PROPERTYID_ATTRIBUTE + "=\"" + propId + "\"/>\n");
                }
                writer.write("</" + NODEREFERENCES_ELEMENT + ">\n");
            } finally {
View Full Code Here

        PropertyState prop = null;
        PropDef def = null;

        if (node.hasPropertyName(name)) {
            // a property with that name already exists...
            PropertyId idExisting = new PropertyId(node.getNodeId(), name);
            prop = (PropertyState) itemOps.getItemState(idExisting);
            def = ntReg.getPropDef(prop.getDefinitionId());
            if (def.isProtected()) {
                // skip protected property
                log.debug("skipping protected property "
View Full Code Here

        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

     *
     * @param name
     * @return <code>true</code> if the given property exists.
     */
    public boolean hasProperty(QName name) {
        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        return stateMgr.hasItemState(propId);
    }
View Full Code Here

     *
     * @param name
     * @return the values of the given property.
     */
    public InternalValue[] getPropertyValues(QName name) {
        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        try {
            PropertyState ps = (PropertyState) stateMgr.getItemState(propId);
            return ps.getValues();
        } catch (ItemStateException e) {
            return null;
View Full Code Here

     *
     * @param name
     * @return the value of the given property.
     */
    public InternalValue getPropertyValue(QName name) {
        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        try {
            PropertyState ps = (PropertyState) stateMgr.getItemState(propId);
            return ps.getValues()[0];
        } catch (ItemStateException e) {
            return null;
View Full Code Here

     * @throws RepositoryException
     */
    private PropertyState getOrCreatePropertyState(QName name, int type, boolean multiValued)
            throws RepositoryException {

        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        if (stateMgr.hasItemState(propId)) {
            try {
                PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
                // someone calling this method will always alter the property state, so set status to modified
                if (propState.getStatus() == ItemState.STATUS_EXISTING) {
View Full Code Here

        // 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

TOP

Related Classes of org.apache.jackrabbit.core.PropertyId

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.