Examples of XmlValue


Examples of com.sleepycat.dbxml.XmlValue

            // not clear why this is needed.... but it is used in hashing the queries
            int resourceComponentCount = 0;
            Map<String, String> variables = getXpathVariables(attributeMap);
            for (String variable : variables.keySet()) {
                context.setVariableValue(variable, new XmlValue(variables.get(variable)));
                if (variable.equals(XACML_RESOURCE_ID)) {
                    resourceComponentCount++;
                }
            }


            qe =
                getQuery(attributeMap, context, resourceComponentCount);


        } catch (XmlException xe) {
            throw new PolicyIndexException("Error while constructing query", xe);
        } catch (URISyntaxException e) {
            throw new PolicyIndexException("Error while constructing query", e);
        }

        DbXmlManager.readLock.lock();
        try {
            b = System.nanoTime();
            total += b - a;
            if (log.isDebugEnabled()) {
                log.debug("Query prep. time: " + (b - a) + "ns");
            }

            // execute the query
            a = System.nanoTime();

            XmlResults results = qe.execute(context);

            b = System.nanoTime();
            total += b - a;
            if (log.isDebugEnabled()) {
                log.debug("Query exec. time: " + (b - a) + "ns");
            }

            // process results
            while (results.hasNext()) {

                XmlValue value = results.next();
                byte[] content = value.asDocument().getContent();
                if (content.length > 0) {
                    documents.put(value.asDocument().getName(),
                                  handleDocument(m_policyReader.readPolicy(content),policyFinder));
                } else {
                    throw new PolicyIndexException("Zero-length result found");
                }
            }
View Full Code Here

Examples of com.sun.xml.internal.txw2.annotation.XmlValue

                throw e.getTargetException();
            }
        }

        XmlAttribute xa = method.getAnnotation(XmlAttribute.class);
        XmlValue xv = method.getAnnotation(XmlValue.class);
        XmlElement xe = method.getAnnotation(XmlElement.class);


        if(xa!=null) {
            if(xv!=null || xe!=null)
View Full Code Here

Examples of com.sun.xml.txw2.annotation.XmlValue

                throw e.getTargetException();
            }
        }

        XmlAttribute xa = method.getAnnotation(XmlAttribute.class);
        XmlValue xv = method.getAnnotation(XmlValue.class);
        XmlElement xe = method.getAnnotation(XmlElement.class);


        if(xa!=null) {
            if(xv!=null || xe!=null)
View Full Code Here

Examples of javax.xml.bind.annotation.XmlValue

    }
   
    @Override
    public Boolean isOutputAsText(Annotated ann)
    {
      XmlValue attr = findAnnotation(XmlValue.class, ann, false, false, false);
        if (attr != null) {
            return Boolean.TRUE;
        }
        return null;
    }
View Full Code Here

Examples of org.apache.slide.projector.value.XMLValue

    public void deleteUser(URI user, Credentials credentials) throws IOException {
      removeResource(user, credentials);
    }
   
    public void addRole(URI user, URI role, Credentials credentials) throws IOException {
      XMLValue roleElement = getPropertyAsXMLValue(role, DAV_NAMESPACE, "group-member-set", credentials);
        Element newUserElement = new Element("href", "DAV:");
        newUserElement.addContent(user.toString());
        roleElement.getRootElement().addContent(newUserElement);
        XMLOutputter xout = new XMLOutputter(Format.getCompactFormat());
        String groupMemberSet = xout.outputString(roleElement.getRootElement().getContent());
    setProperty(role, DAV_NAMESPACE, "group-member-set", groupMemberSet, credentials);   
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

            }
            result = srsv.toString();
        }
        else if( P_AUTO_VERSION.equals(propName) ) {
           
            XMLValue xmlValue = new XMLValue();
           
            if (DEFAULT_AUTO_VERSION.length() > 0) {
                xmlValue.add(new Element(DEFAULT_AUTO_VERSION, DNSP));
            }
           
            if( ! resourceKind.isSupportedPropertyValue(P_AUTO_VERSION, xmlValue) ) {
                Domain.warn( "Auto-version not configured properly; using "
                                +E_CHECKOUT_CHECKIN );
                xmlValue = new XMLValue(new Element(E_CHECKOUT_CHECKIN, DNSP));
            }
           
            result = xmlValue.toString();
        }
        else if( P_CHECKOUT_FORK.equals(propName) ) {
           
            XMLValue xmlValue = new XMLValue();
           
            if (DEFAULT_CHECKOUT_FORK.length() > 0) {
                xmlValue.add(new Element(DEFAULT_CHECKOUT_FORK, DNSP));
            }
           
            if( ! resourceKind.isSupportedPropertyValue(P_CHECKOUT_FORK, xmlValue) ) {
                Domain.warn( "Checkout-fork not configured properly; using "
                                +E_FORBIDDEN );
                xmlValue = new XMLValue(new Element(E_FORBIDDEN, DNSP));
            }
           
            result = xmlValue.toString();
        }
        else if( P_CHECKIN_FORK.equals(propName) ) {
           
            XMLValue xmlValue = new XMLValue();
           
            if (DEFAULT_CHECKIN_FORK.length() > 0) {
                xmlValue.add(new Element(DEFAULT_CHECKIN_FORK, DNSP));
            }
           
            if( ! resourceKind.isSupportedPropertyValue(P_CHECKIN_FORK, xmlValue) ) {
                Domain.warn( "Checkin-fork not configured properly; using "
                                +E_FORBIDDEN );
                xmlValue = new XMLValue(new Element(E_FORBIDDEN, DNSP));
            }
           
            result = xmlValue.toString();
        }
        else if( P_GETCONTENTLANGUAGE.equals(propName) ) {
            result = "en";
        }
        else if( P_CREATOR_DISPLAYNAME.equals(propName) ) {
View Full Code Here

Examples of org.apache.slide.util.XMLValue

        }
        else if (P_WORKSPACE_CHECKOUT_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeWorkspaceCheckoutSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_WORKSPACE.equals(propertyName)) {
            XMLValue ws = null;
            if (Configuration.useBinding(nsaToken.getUri(sToken, revisionDescriptors.getUri()).getStore())) {
                ws = computeWorkspace(revisionDescriptors, revisionDescriptor, contextPath, servletPath);
            }
            else {
                ws = computeWorkspaceNoBinding(revisionDescriptors, revisionDescriptor, contextPath, servletPath);
View Full Code Here

Examples of org.apache.slide.util.XMLValue

     * @throws   AccessDeniedException
     * @throws   ObjectNotFoundException
     */
    public XMLValue computeSuccessorSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException {
       
        XMLValue xmlValue = new XMLValue();
        Element hrefElement = new Element(E_HREF, DNSP);
        NodeRevisionDescriptor successorRevisionDescriptor = null;
        NodeRevisionNumber successorRevisionNumber = null;
        Enumeration successorEnum = revisionDescriptors.getSuccessors(revisionDescriptor.getRevisionNumber());
       
        if (successorEnum != null) {
            while (successorEnum.hasMoreElements()) {
                successorRevisionNumber = (NodeRevisionNumber)successorEnum.nextElement();
                hrefElement = (Element)hrefElement.clone();
                StringBuffer buffer = new StringBuffer(revisionDescriptors.getUri());
                if ( ! revisionDescriptors.getUri().endsWith("/") ) {
                    buffer.append("/");
                }
                buffer.append(successorRevisionNumber.toString());
               
                hrefElement.setText(WebdavUtils.getAbsolutePath (
                                        buffer.toString(), contextPath,
                                        servletPath, sConf));
               
                xmlValue.add(hrefElement);
            }
        }
        return xmlValue;
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

     * @throws   ObjectNotFoundException
     * @throws   JDOMException
     */
    public XMLValue computeVersionHistory(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, JDOMException {
       
        XMLValue xmlValue = new XMLValue();
        ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(nsaToken, revisionDescriptors, revisionDescriptor);
        if (resourceKind instanceof Version) {
            Element element = new Element(E_HREF, DNSP);
           
            element.setText(WebdavUtils.getAbsolutePath (
                                revisionDescriptors.getUri(), contextPath,
                                servletPath, sConf));
           
            xmlValue.add(element);
        }
        else if (resourceKind instanceof CheckedInVersionControlled) {
            Element element = new Element(E_HREF, DNSP);
            String checkedInHref = revisionDescriptor.getProperty(P_CHECKED_IN).getValue().toString();
            String checkedInUri = ((Element)new XMLValue(checkedInHref).iterator().next()).getText();
            UriHandler uriHandler = UriHandler.getUriHandler(checkedInUri);
           
            element.setText (WebdavUtils.getAbsolutePath (
                                 uriHandler.getAssociatedHistoryUri(),
                                 contextPath, servletPath, sConf));
           
            xmlValue.add(element);
        }
        else if (resourceKind instanceof CheckedOutVersionControlled) {
            Element element = new Element(E_HREF, DNSP);
            String checkedOutHref = revisionDescriptor.getProperty(P_CHECKED_OUT).getValue().toString();
            String checkedOutUri = ((Element)new XMLValue(checkedOutHref).iterator().next()).getText();
            UriHandler uriHandler = UriHandler.getUriHandler(checkedOutUri);
           
            element.setText(WebdavUtils.getAbsolutePath (
                                uriHandler.getAssociatedHistoryUri(),
                                contextPath, servletPath, sConf));
           
            xmlValue.add(element);
        }
       
        return xmlValue;
    }
View Full Code Here

Examples of org.apache.slide.util.XMLValue

     * @throws   AccessDeniedException
     * @throws   ObjectNotFoundException
     */
    public XMLValue computeRootVersion(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException {
       
        XMLValue xmlValue = new XMLValue();
       
        ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(nsaToken, revisionDescriptors, revisionDescriptor);
        if (resourceKind instanceof VersionHistory) {
            Element element = new Element(E_HREF, DNSP);
            StringBuffer buffer = new StringBuffer(revisionDescriptors.getUri());
            if ( ! revisionDescriptors.getUri().endsWith("/") ) {
                buffer.append("/");
            }
            buffer.append(revisionDescriptors.getInitialRevision().toString());
           
            element.setText(WebdavUtils.getAbsolutePath (
                                buffer.toString(),
                                contextPath, servletPath, sConf));
           
            xmlValue.add(element);
        }
       
        return xmlValue;
    }
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.