Examples of JavaObjectValue


Examples of org.exist.xquery.value.JavaObjectValue

    if( var.getValue().getItemType() != Type.JAVA_OBJECT ) {
      throw( new XPathException( this, "Variable $request is not bound to a Java object." ) );
    }

    JavaObjectValue request = (JavaObjectValue)var.getValue().itemAt( 0 );
   
    // get attribute name parameter
    String attribName     = getArgument( 0 ).eval( contextSequence, contextItem ).getStringValue();
    Sequence attribValue   = getArgument( 1 ).eval( contextSequence, contextItem );
   
    if( request.getObject() instanceof RequestWrapper ) {
      ((RequestWrapper)request.getObject()).setAttribute( attribName, attribValue );
    } else {
      thrownew XPathException( this, "Type error: variable $request is not bound to a request object" ) );
    }

    return( Sequence.EMPTY_SEQUENCE );
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    final Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR);
    if (var == null || var.getValue() == null || var.getValue().getItemType() != Type.JAVA_OBJECT) {
      return Sequence.EMPTY_SEQUENCE;
    }

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper)
    {
      final Cookie[] cookies = ((RequestWrapper)value.getObject()).getCookies();
      if(cookies != null)
      {
        if(cookies.length != 0)
        {
          final ValueSequence names = new ValueSequence();
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    // request object is read from global variable $request
    final Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR);
    if (var == null || var.getValue() == null || var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);

    if (value.getObject() instanceof RequestWrapper)
    {
      final String queryString = ((RequestWrapper) value.getObject()).getQueryString();
      if(queryString != null)
      {
        return new StringValue(queryString);
      }
      else
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getServerName());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
   
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getRequestURL().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.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    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());}
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      return new IntegerValue(((RequestWrapper) value.getObject()).getRemotePort());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

        }

        // get parameters
        final String uploadParamName = args[0].getStringValue();

        final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);

        if (value.getObject() instanceof RequestWrapper) {

            final RequestWrapper request = (RequestWrapper) value.getObject();

            final List<File> files = request.getFileUploadParam(uploadParamName);
            if (files == null) {
                logger.debug("File param not found: " + uploadParamName);
                return Sequence.EMPTY_SEQUENCE;
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
   
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getRemoteAddr());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    // get parameters
    final String uploadParamName = args[0].getStringValue();

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      final RequestWrapper request = (RequestWrapper)value.getObject();
      final List<File> files = request.getFileUploadParam(uploadParamName);
      if(files == null) {
        return Sequence.EMPTY_SEQUENCE;
      }
      final ValueSequence result = new ValueSequence();
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.