Package org.apache.jackrabbit.webdav.xml

Examples of org.apache.jackrabbit.webdav.xml.ElementIterator


        if (!DomUtil.matches(root, XML_PROPERTYUPDATE, NAMESPACE)) {
            log.warn("PropPatch-Request has no <DAV:propertyupdate> tag.");
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "PropPatch-Request has no <propertyupdate> tag.");
        }

        ElementIterator it = DomUtil.getChildren(root);
        while (it.hasNext()) {
            Element el = it.nextElement();
            if (DomUtil.matches(el, XML_SET, NAMESPACE)) {
                Element propEl = DomUtil.getChildElement(el, XML_PROP, NAMESPACE);
                if (propEl != null) {
                    ElementIterator properties = DomUtil.getChildren(propEl);
                    while (properties.hasNext()) {
                        DavProperty davProp = DefaultDavProperty.createFromXml(properties.nextElement());
                        proppatchSet.add(davProp);
                        proppatchList.add(davProp);
                    }
                }
            } else if (DomUtil.matches(el, XML_REMOVE, NAMESPACE)) {
                Element propEl = DomUtil.getChildElement(el, XML_PROP, NAMESPACE);
                if (propEl != null) {
                    ElementIterator properties = DomUtil.getChildren(propEl);
                    while (properties.hasNext()) {
                        DavProperty davProp = DefaultDavProperty.createFromXml(properties.nextElement());
                        proppatchSet.add(davProp);
                        proppatchList.add(davProp.getName());
                    }
                }
            } else {
View Full Code Here


        if (!XML_PROPFIND.equals(root.getLocalName())) {
            log.info("PropFind-Request has no <profind> tag.");
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "PropFind-Request has no <profind> tag.");
        }

        ElementIterator it = DomUtil.getChildren(root);
        while (it.hasNext()) {
            Element child = it.nextElement();
            String nodeName = child.getLocalName();
            if (XML_PROP.equals(nodeName)) {
                propfindType = PROPFIND_BY_PROPERTY;
                propfindProps = new DavPropertyNameSet(child);
                break;
View Full Code Here

        if (!DomUtil.matches(root, XML_PROPERTYUPDATE, NAMESPACE)) {
            log.warn("PropPatch-Request has no <DAV:propertyupdate> tag.");
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "PropPatch-Request has no <propertyupdate> tag.");
        }

        ElementIterator it = DomUtil.getChildren(root);
        while (it.hasNext()) {
            Element el = it.nextElement();
            if (DomUtil.matches(el, XML_SET, NAMESPACE)) {
                Element propEl = DomUtil.getChildElement(el, XML_PROP, NAMESPACE);
                if (propEl != null) {
                    ElementIterator properties = DomUtil.getChildren(propEl);
                    while (properties.hasNext()) {
                        DavProperty davProp = DefaultDavProperty.createFromXml(properties.nextElement());
                        proppatchSet.add(davProp);
                        proppatchList.add(davProp);
                    }
                }
            } else if (DomUtil.matches(el, XML_REMOVE, NAMESPACE)) {
                Element propEl = DomUtil.getChildElement(el, XML_PROP, NAMESPACE);
                if (propEl != null) {
                    ElementIterator properties = DomUtil.getChildren(propEl);
                    while (properties.hasNext()) {
                        DavProperty davProp = DefaultDavProperty.createFromXml(properties.nextElement());
                        proppatchSet.add(davProp);
                        proppatchList.add(davProp.getName());
                    }
                }
            } else {
View Full Code Here

            DavPropertyName propName = DavPropertyName.create(nameAttr, namespace);
            DavProperty p = res.getProperty(propName);
            if (p != null) {
                if (p instanceof HrefProperty && res instanceof DeltaVResource) {
                    ElementIterator it = DomUtil.getChildren(propertyElem, XML_PROPERTY, NAMESPACE);
                    resp.add(new ExpandProperty((DeltaVResource)res, (HrefProperty)p, it));
                } else {
                    resp.add(p);
                }
            } else {
View Full Code Here

            throw new IllegalArgumentException("DAV:multistatus element expected.");
        }

        MultiStatus multistatus = new MultiStatus();

        ElementIterator it = DomUtil.getChildren(multistatusElement, XML_RESPONSE, NAMESPACE);
        while (it.hasNext()) {
            Element respElem = it.nextElement();
            MultiStatusResponse response = MultiStatusResponse.createFromXml(respElem);
            multistatus.addResponse(response);
        }

        // optional response description on the multistatus element
View Full Code Here

        if (!DomUtil.matches(sDiscoveryElement, ObservationConstants.SUBSCRIPTIONDISCOVERY.getName(), ObservationConstants.SUBSCRIPTIONDISCOVERY.getNamespace())) {
            throw new IllegalArgumentException("'subscriptiondiscovery' element expected.");
        }

        List subscriptions = new ArrayList();
        ElementIterator it = DomUtil.getChildren(sDiscoveryElement, ObservationConstants.XML_SUBSCRIPTION, ObservationConstants.NAMESPACE);
        while (it.hasNext()) {
            final Element sb = it.nextElement();
            // anonymous inner class: Subscription interface
            Subscription s = new Subscription() {
                /**
                 * @see Subscription#getSubscriptionId()
                 */
 
View Full Code Here

        if (!DomUtil.matches(lockDiscoveryElement, PROPERTY_LOCKDISCOVERY, NAMESPACE)) {
            throw new IllegalArgumentException("DAV:lockdiscovery element expected.");
        }

        List activeLocks = new ArrayList();
        ElementIterator it = DomUtil.getChildren(lockDiscoveryElement, XML_ACTIVELOCK, NAMESPACE);
        while (it.hasNext()) {
            Element al = it.nextElement();
            activeLocks.add(new ALockImpl(al));
        }

        return new LockDiscovery((ActiveLock[]) activeLocks.toArray(new ActiveLock[activeLocks.size()]));
    }
View Full Code Here

                method.checkSuccess();
                Document doc = method.getResponseBodyAsDocument();

                if (doc != null) {
                    Element rootElement = doc.getDocumentElement();
                    ElementIterator nsElems = DomUtil.getChildren(rootElement, JcrRemotingConstants.XML_DESCRIPTOR, ItemResourceConstants.NAMESPACE);
                    while (nsElems.hasNext()) {
                        Element elem = nsElems.nextElement();
                        String key = DomUtil.getChildText(elem, JcrRemotingConstants.XML_DESCRIPTORKEY, ItemResourceConstants.NAMESPACE);
                        ElementIterator it = DomUtil.getChildren(elem, JcrRemotingConstants.XML_DESCRIPTORVALUE, ItemResourceConstants.NAMESPACE);
                        List<QValue> vs = new ArrayList<QValue>();
                        while (it.hasNext()) {
                            Element dv = it.nextElement();
                            String descriptor = DomUtil.getText(dv);
                            if (key != null && descriptor != null) {
                                String typeStr = (DomUtil.getAttribute(dv, JcrRemotingConstants.ATTR_VALUE_TYPE, null));
                                int type = (typeStr == null) ? PropertyType.STRING : PropertyType.valueFromName(typeStr);
                                vs.add(getQValueFactory().create(descriptor, type));
View Full Code Here

                }
            }

            List<Event> events = new ArrayList<Event>();

            ElementIterator entries = DomUtil.getChildren(doc.getDocumentElement(), AtomFeedConstants.N_ENTRY);
            while (entries.hasNext()) {
                Element entryElem = entries.next();

                Element contentElem = DomUtil.getChildElement(entryElem, AtomFeedConstants.N_CONTENT);
                if (contentElem != null
                        && "application/vnd.apache.jackrabbit.event+xml".equals(contentElem.getAttribute("type"))) {
                    List<Event> el = buildEventList(contentElem, (SessionInfoImpl) sessionInfo, rootUri);
View Full Code Here

            EventBundle[] events;
            if (disc.isEmpty()) {
                events = new EventBundle[0];
            } else {
                Element discEl = disc.toXml(DomUtil.createDocument());
                ElementIterator it = DomUtil.getChildren(discEl,
                        ObservationConstants.N_EVENTBUNDLE);
                List<EventBundle> bundles = new ArrayList<EventBundle>();
                while (it.hasNext()) {
                    Element bundleElement = it.nextElement();
                    String value = DomUtil.getAttribute(bundleElement,
                            ObservationConstants.XML_EVENT_LOCAL, null);
                    // check if it matches a batch id recently submitted
                    boolean isLocal = false;
                    if (value != null) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.webdav.xml.ElementIterator

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.