Examples of AnyURIValue


Examples of org.exist.xquery.value.AnyURIValue

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

    try {
      final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
      final Resource res = collection.getResource(new AnyURIValue(args[1].getStringValue()).toXmldbURI().toString());
      if (res != null) {
        final String lockUser = ums.hasUserLock(res);
        if (lockUser != null && isCalledAs("clear-lock")) {
          ums.unlockResource(res);
        }
View Full Code Here

Examples of org.exist.xquery.value.AnyURIValue

    this.errorIfAbsent = errorIfAbsent;
  }
 
  protected LocalCollection createLocalCollection(String name) throws XMLDBException {
    try {
      return new LocalCollection(context.getSubject(), context.getBroker().getBrokerPool(), new AnyURIValue(name).toXmldbURI(), context.getAccessContext());
    } catch(final XPathException e) {
      throw new XMLDBException(ErrorCodes.INVALID_URI,e);
    }
  }
View Full Code Here

Examples of org.exist.xquery.value.AnyURIValue

        return child;
    }
   
    static public final Collection createCollectionPath(Collection parentColl, String relPath) throws XMLDBException, XPathException {
        Collection current = parentColl;
        final StringTokenizer tok = new StringTokenizer(new AnyURIValue(relPath).toXmldbURI().toString(), "/");
        while (tok.hasMoreTokens()) {
            final String token = tok.nextToken();
            current = createCollection(current, token);
        }
        return current;
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

    }

    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

Examples of org.exist.xquery.value.AnyURIValue

    }
   
    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

Examples of org.exist.xquery.value.AnyURIValue

    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

Examples of org.exist.xquery.value.AnyURIValue

    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

Examples of org.exist.xquery.value.AnyURIValue

    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

Examples of org.exist.xquery.value.AnyURIValue

    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
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.