Examples of AnyURIValue


Examples of org.exist.xquery.value.AnyURIValue

  }
 
  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

Examples of org.exist.xquery.value.AnyURIValue

                }
                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

Examples of org.exist.xquery.value.AnyURIValue

        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

Examples of org.exist.xquery.value.AnyURIValue

                }
                if (relativeURI != null) {
                    if (!(("".equals(relativeURI.toString()) ||
                            (type == Node.ATTRIBUTE_NODE && "/db".equals(relativeURI.toString()))))) {
                        if (relativeURI.isAbsolute()) {
                            result = new AnyURIValue(relativeURI);
                        } else {
                            result = new AnyURIValue(baseURI.resolve(relativeURI));
                        }
                    } else {
                        result = new AnyURIValue(baseURI);
                    }
                }
            }
        }
        if (context.getProfiler().isEnabled())
View Full Code Here

Examples of org.exist.xquery.value.AnyURIValue

    @Override
    public Sequence evalWithCollection(final Collection collection, final Sequence[] args, final Sequence contextSequence)
    throws XPathException {

        try {
            final Resource res = collection.getResource(new AnyURIValue(args[1].getStringValue()).toXmldbURI().toString());
            if (res != null) {
                final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
                final String user = args[2].getStringValue();
                final String group = args[3].getStringValue();
                final int mode = ((IntegerValue) args[4].convertTo(Type.INTEGER)).getInt();
View Full Code Here

Examples of org.exist.xquery.value.AnyURIValue

      } else {
                MutableDocumentSet mdocs = new DefaultDocumentSet();
    for(int i = 0; i < args.size(); i++) {
        try {
      final String next = (String)args.get(i);
      XmldbURI nextUri = new AnyURIValue(next).toXmldbURI();
      if(nextUri.getCollectionPath().length() == 0) {
          throw new XPathException(this, "Invalid argument to " + XMLDBModule.PREFIX + ":document() function: empty string is not allowed here.");
      }
      if(nextUri.numSegments()==1) {                    
          nextUri = context.getBaseURI().toXmldbURI().resolveCollectionPath(nextUri);
View Full Code Here

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

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 {
    if(getSignature().getArgumentCount() == 2) {
      final String doc = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI().toString();
      try {
        final Resource resource = collection.getResource(doc);
        if (resource == null) {
                    logger.error("Resource " + doc + " not found");
                    throw new XPathException(this, "Resource " + doc + " not found");
View Full Code Here

Examples of org.exist.xquery.value.AnyURIValue

   */
  public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
        throws XPathException {

    if(getSignature().getArgumentCount() == 3) {
      final XmldbURI doc = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI();
      try {
        final Resource resource = collection.getResource(doc.toString());
        if (resource == null) {
                    logger.error("Resource " + doc + " not found");

View Full Code Here

Examples of org.exist.xquery.value.AnyURIValue

    final String url = args[0].getStringValue();
   
    final JavaObjectValue value = (JavaObjectValue)
      var.getValue().itemAt(0);
    if(value.getObject() instanceof ResponseWrapper) {
      return new AnyURIValue(((ResponseWrapper)value.getObject()).encodeURL(url));
    } else {
      throw new XPathException(this, "Variable $response is not bound to a Response object.");
    }
  }
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.