Package org.exist.xquery.value

Examples of org.exist.xquery.value.AnyURIValue


     * @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[], org.exist.xquery.value.Sequence)
     */
    public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
        throws XPathException {

        final XmldbURI destination = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI();
        if (getSignature().getArgumentCount() == 3) {
            final XmldbURI doc = new AnyURIValue(args[2].itemAt(0).getStringValue()).toXmldbURI();
            try {
                final Resource resource = collection.getResource(doc.toString());
                if (resource == null) {
                    logger.error( "Resource " + doc + " not found");
                    throw new XPathException(this, "Resource " + doc + " not found");
View Full Code Here


    }

    private Sequence getAllAccountMetadataKeys() throws XPathException {
        final ValueSequence result = new ValueSequence();
        for(final AXSchemaType axSchemaType : AXSchemaType.values()) {
            result.add(new AnyURIValue(axSchemaType.getNamespace()));
        }
        for(final EXistSchemaType exSchemaType : EXistSchemaType.values()) {
            result.add(new AnyURIValue(exSchemaType.getNamespace()));
        }
        return result;
    }
View Full Code Here

    }
   
    private Sequence getAllGroupMetadataKeys() throws XPathException {
        final ValueSequence result = new ValueSequence();  
        for(final SchemaType GROUP_METADATA_KEY : GROUP_METADATA_KEYS) {
            result.add(new AnyURIValue(GROUP_METADATA_KEY.getNamespace()));
        }
        return result;
    }
View Full Code Here

    private Sequence getPrincipalMetadataKeys(final Principal principal) throws XPathException {
       
        final Set<SchemaType> metadataKeys = principal.getMetadataKeys();
        final Sequence seq = new ValueSequence(metadataKeys.size());
        for(final SchemaType schemaType : metadataKeys) {
            seq.add(new AnyURIValue(schemaType.getNamespace()));
        }
        return seq;
    }
View Full Code Here

    try {
      if(isCalledAs("encode")) {
        return new StringValue(URIUtils.urlEncodePartsUtf8(args[0].getStringValue()));
      } else if(isCalledAs("encode-uri")) {
        return new AnyURIValue(URIUtils.encodeXmldbUriFor(args[0].getStringValue()));
      } else {
        return new StringValue(URIUtils.urlDecodeUtf8(args[0].getStringValue()));
      }
    } catch(final URISyntaxException e) {
            logger.error(e.getMessage(), e);
View Full Code Here

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
            final RequestWrapper wrapper = (RequestWrapper) value.getObject();
            final Object attr = wrapper.getAttribute(XQueryURLRewrite.RQ_ATTR_REQUEST_URI);
            if (attr == null || isCalledAs("get-effective-uri"))
          {return new AnyURIValue(wrapper.getRequestURI());}
            else
                {return new AnyURIValue(attr.toString());}
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  } 
View Full Code Here

    throws XPathException {
    String docName = args[1].isEmpty() ? null : args[1].getStringValue();
    if(docName != null && docName.length() == 0)
      {docName = null;}
    else if(docName != null)
      {docName = new AnyURIValue(docName).toXmldbURI().toString();}
   
    final Item item = args[2].itemAt(0);
        String mimeType = MimeType.XML_TYPE.getName();
    boolean binary = !Type.subTypeOf(item.getType(), Type.NODE);
   
View Full Code Here

  }
 
  public Sequence eval(Sequence args[], Sequence contextSequence)
        throws XPathException {

    final String path = new AnyURIValue(args[0].itemAt(0).getStringValue()).toString();
   
    if(path.matches("^[a-z]+://.*")) {
      //external
      final MimeTable mimeTable = MimeTable.getInstance();
      final MimeType mimeType = mimeTable.getContentTypeFor(path);
View Full Code Here

                }
                return groups;
                // get-user-home
            } else {
                final XmldbURI home = XmldbURI.DB;
                return null == home ? Sequence.EMPTY_SEQUENCE : new AnyURIValue(home);
            }
        } catch(final XMLDBException e) {
            logger.error(e.getMessage());
            throw new XPathException(this, "Failed to query user " + userName, e);
        } finally {
View Full Code Here

        else {
                // fn:namespace-uri-from-QName
          String uri = qname.getNamespaceURI();
          if (uri == null)
            {uri = "";}         
                result = new AnyURIValue(uri);
        }
        }
       
        if (context.getProfiler().isEnabled())
            {context.getProfiler().end(this, "", result);}       
View Full Code Here

TOP

Related Classes of org.exist.xquery.value.AnyURIValue

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.