Examples of XmlValue


Examples of org.apache.slide.util.XMLValue

    public XMLValue computeGroupMembership(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
        if (revisionDescriptor.getProperty(P_GROUP_MEMBERSHIP) != null) {
            Object v = revisionDescriptor.getProperty(P_GROUP_MEMBERSHIP).getValue();
            return (v instanceof XMLValue)
                ? (XMLValue)v
                : new XMLValue((String)v);
        }
        else {
            XMLValue xmlValue = new XMLValue();
            Uri principalUri = nsaToken.getUri(sToken, revisionDescriptors.getUri());
            SubjectNode principalNode = (SubjectNode)principalUri.getStore().retrieveObject(principalUri);
            Enumeration roles = ((ACLSecurityImpl)nsaToken.getSecurityHelper()).getGroupMembership(sToken, principalNode);     
            while (roles.hasMoreElements()) {
                String rolePath = (String)roles.nextElement();
    // FIXME wihtout servletPath??
                String roleHref = contextPath+rolePath;
                xmlValue.addHref(roleHref);
            }
            return xmlValue;
        }
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

        }
    }
   
    // FIXME wihtout servletPath??
    private XMLValue createUserPath(NodeProperty userProperty, String contextPath) throws IllegalArgumentException {
        XMLValue xmlValue = new XMLValue();
        String userHref = "";
        NamespaceConfig config = nsaToken.getNamespaceConfig();
        if ((userProperty != null) && (userProperty.getValue()!=null) &&
                (!"".equals(userProperty.getValue().toString()))) {
           
            userHref = contextPath + config.getUsersPath() + "/" + userProperty.getValue().toString();
            xmlValue.addHref(userHref);
        }
        else {
            xmlValue.add(new Element(E_UNAUTHENTICATED, DNSP));
        }
        return xmlValue;
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

       
        NodeProperty property = revisionDescriptor.getProperty(propertyName);
        if (property == null) {
            property = new NodeProperty(propertyName, null);
        }
        XMLValue xmlValue = new XMLValue((String)property.getValue());
        Iterator iterator = xmlValue.iterator();
        boolean alreadyContained = false;
        Element element = null;
        while (iterator.hasNext() && !alreadyContained) {
            element = (Element)iterator.next();
            if (element.getName().equals(elementName) && element.getText().equals(elementValue)) {
                alreadyContained = true;
            }
        }
        if (!alreadyContained) {
            element = new Element(elementName);
            element.setText(elementValue);
            xmlValue.add(element);
        }
        revisionDescriptor.setProperty(propertyName, xmlValue.toString());
        return !alreadyContained;
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

       
        NodeProperty property = revisionDescriptor.getProperty(propertyName);
        boolean found = false;
        if (property != null) {
           
            XMLValue xmlValue = new XMLValue((String)property.getValue());
            Iterator iterator = xmlValue.iterator();
            Element element = null;
            while (iterator.hasNext() && !found) {
                element = (Element)iterator.next();
                if (element.getName().equals(elementName) && element.getText().equals(elementValue)) {
                    found = true;
                    iterator.remove();
                }
            }
            if (found) {
                revisionDescriptor.setProperty(propertyName, xmlValue.toString());
            }
        }
        return found;
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

        try {
            lowerNrds = content.retrieve(stoken, lowerNode.getUri());
            lowerNrd = content.retrieve(stoken, lowerNrds);

            NodeProperty psProp = lowerNrd.getProperty(P_PARENT_SET);
            XMLValue xv = new XMLValue( String.valueOf(psProp.getValue()) );
            Iterator i = xv.getList().iterator();
            while (i.hasNext()) {
                // iterate over parent elements
                Element pElm = (Element)i.next();
                String hrPath = pElm.getChild( E_HREF, DNSP ).getText();
                ObjectNode hrNode = structure.retrieve( stoken, hrPath );
View Full Code Here

Examples of org.apache.slide.util.XMLValue

            String value = "";
            if (content.size() == 1 && content.get(0) instanceof Text) {
                value = ((Text)content.get(0)).getText();
            }
            else if (content.size() > 0) {
                XMLValue xmlVal = new XMLValue(content);
                if (P_GROUP_MEMBER_SET.equals(name) && S_DAV.equals(namespaceUri)) {
                    xmlVal.stripServletContext(req.getContextPath());
                }
                value = xmlVal.toString();
            }
            // register prefix/URI at NamespaceCache
            NamespaceCache.getNamespace(namespacePrefix, namespaceUri);
           
            return new PropPatchProperty(name, namespaceUri, value);
View Full Code Here

Examples of org.apache.slide.util.XMLValue

       
        boolean containsLabel = false;
        NodeProperty labelNameSetProperty = revisionDescriptor.getProperty(DeltavConstants.P_LABEL_NAME_SET);
        if ( (labelNameSetProperty != null) && (labelNameSetProperty.getValue() != null) ) {
            try {
                XMLValue xmlValue = new XMLValue(labelNameSetProperty.getValue().toString());
                Iterator iterator = xmlValue.iterator();
                while ( !containsLabel && iterator.hasNext()) {
                    containsLabel = label.equals(((Element)iterator.next()).getText());
                }
            }
            catch (JDOMException e) {}
View Full Code Here

Examples of org.apache.slide.util.XMLValue

            // collect the parent bindings of the destination node
            Map parentBindings = new HashMap();
            try {
                NodeRevisionDescriptor destinationNrd =
                    content.retrieve( slideToken, content.retrieve(slideToken, destinationUri) );
                XMLValue v = new XMLValue( (String)destinationNrd.getProperty( P_PARENT_SET ).getValue() );
                Iterator i = v.iterator();
                while (i.hasNext()) {
                    Namespace dnsp = Namespace.getNamespace(S_DAV);
                    Element parentElm = (Element)i.next();
                    String segment = parentElm.getChild(E_SEGMENT, dnsp).getTextTrim();
                    String href = parentElm.getChild(E_HREF, dnsp).getTextTrim();
View Full Code Here

Examples of org.apache.slide.util.XMLValue

       
        property = new Element(propertyName, namespace);
        if ( (propertyValue != null) && (propertyValue.toString().length() > 0)) {
            if( propertyValue.toString().indexOf('<') >= 0 ) {
                try {
                    XMLValue xmlValue = new XMLValue(propertyValue.toString(), valueDefaultNamespace);
//                    if (AbstractResourceKind.isLiveProperty(propertyName)) {
//                        convertHrefValueToAbsoluteURL (xmlValue, contextPath, servletPath, config);
//                    }
                    Iterator iterator = xmlValue.iterator();
                    while (iterator.hasNext()) {
                        Object o = iterator.next();
                        if( o instanceof Element )
                            property.addContent((Element)o);
                        else if( o instanceof Text )
View Full Code Here

Examples of org.apache.slide.util.XMLValue

        }
    }
   
    private AbstractReport getExternalReportWorker(Element reportElm) throws JDOMException, WebdavException {
        AbstractReport result = null;
        XMLValue xv = new XMLValue(config.getInitParameter("external-reports"));
        Iterator i = xv.iterator();
        while (i.hasNext()) {
            Object r = i.next();
            if (r instanceof Element
                && "report".equals(((Element)r).getName())
                && reportElm.getName().equals(((Element)r).getAttributeValue("name"))
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.