Examples of ElementIterator


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

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

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

        List<Subscription> subscriptions = new ArrayList<Subscription>();
        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

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

     */
    public static Position createFromXml(Element positionElement) {
        if (!DomUtil.matches(positionElement, XML_POSITION, NAMESPACE)) {
            throw new IllegalArgumentException("The 'DAV:position' element required.");
        }
        ElementIterator it = DomUtil.getChildren(positionElement);
        while (it.hasNext()) {
            Element el = it.nextElement();
            String type = el.getLocalName();
            // read the text of DAV:segment child element inside the type
            String segmentText = DomUtil.getChildText(el, XML_SEGMENT, NAMESPACE);
            // stop after the first iteration
            new Position(type, segmentText);
View Full Code Here

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

    private void parseNamespacesEntry(Element parent) {
        Element namespaces = DomUtil.getChildElement(parent, "namespaces", null);
        if (namespaces != null) {
            List l = new ArrayList();
            // retrieve prefix child elements
            ElementIterator it = DomUtil.getChildren(namespaces, "prefix", null);
            while (it.hasNext()) {
                Element e = it.nextElement();
                l.add(DomUtil.getText(e));
            }
            String[] prefixes = (String[])l.toArray(new String[l.size()]);
            l.clear();
            // retrieve uri child elements
            it = DomUtil.getChildren(namespaces, "uri", null);
            while (it.hasNext()) {
                Element e = it.nextElement();
                l.add(DomUtil.getText(e));
            }
            String[] uris = (String[])l.toArray(new String[l.size()]);
            itemFilter.setFilteredPrefixes(prefixes);
            itemFilter.setFilteredURIs(uris);
View Full Code Here

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

    private String[] parseNodeTypesEntry(Element parent) {
        String[] ntNames;
        Element nodetypes = DomUtil.getChildElement(parent, "nodetypes", null);
        if (nodetypes != null) {
            List l = new ArrayList();
            ElementIterator it = DomUtil.getChildren(nodetypes, "nodetype", null);
            while (it.hasNext()) {
                Element e = it.nextElement();
                l.add(DomUtil.getText(e));
        }
            ntNames = (String[])l.toArray(new String[l.size()]);
        } else {
            ntNames = new String[0];
View Full Code Here

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

        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

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

            // we should also check for correct namespace
            log.warn("PropPatch-Request has no <propertyupdate> tag.");
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "PropPatch-Request has no <propertyupdate> tag.");
        }

        ElementIterator it = DomUtil.getChildren(root, XML_SET, NAMESPACE);
        while (it.hasNext()) {
            Element propEl = DomUtil.getChildElement(it.nextElement(), XML_PROP, NAMESPACE);
            if (propEl != null) {
                ElementIterator properties = DomUtil.getChildren(propEl);
                while (properties.hasNext()) {
                   proppatchSet.add(DefaultDavProperty.createFromXml(properties.nextElement()));
                }
            }
        }

        // get <remove> properties
        it = DomUtil.getChildren(root, XML_REMOVE, NAMESPACE);
        while (it.hasNext()) {
            Element propEl = DomUtil.getChildElement(it.nextElement(), XML_PROP, NAMESPACE);
            if (propEl != null) {
                ElementIterator names = DomUtil.getChildren(propEl);
                while (names.hasNext()) {
                    proppatchRemove.add(DavPropertyName.createFromXml(names.nextElement()));
                }
            }
        }
    }
View Full Code Here

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

            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

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

        if (!DomUtil.matches(propElement, XML_PROP, NAMESPACE)) {
            throw new IllegalArgumentException("'DAV:prop' element expected.");
        }

        // fill the set
        ElementIterator it = DomUtil.getChildren(propElement);
        while (it.hasNext()) {
            add(DavPropertyName.createFromXml(it.nextElement()));
        }
    }
View Full Code Here

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

            Status status = Status.parse(statusLine);
            response = new MultiStatusResponse(href, status, responseDescription);
        } else {
            response = new MultiStatusResponse(href, responseDescription, TYPE_PROPSTAT);
        // read propstat elements
            ElementIterator it = DomUtil.getChildren(responseElement, XML_PROPSTAT, NAMESPACE);
        while (it.hasNext()) {
                Element propstat = it.nextElement();
                String propstatus = DomUtil.getChildText(propstat, XML_STATUS, NAMESPACE);
                Element prop = DomUtil.getChildElement(propstat, XML_PROP, NAMESPACE);
                if (propstatus != null && prop != null) {
                    int statusCode = Status.parse(propstatus).getStatusCode();
                    ElementIterator propIt = DomUtil.getChildren(prop);
                    while (propIt.hasNext()) {
                        Element el = propIt.nextElement();
                        // current elem is now either a dav property xml representation
                        // or the xml representation of a davpropertyname
                        if (DomUtil.hasContent(el)) {
                            // property
                            DavProperty property = DefaultDavProperty.createFromXml(el);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.