Package org.saiku.olap.query2

Examples of org.saiku.olap.query2.Parameter


                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here


            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
                buffer.append(parameter.getName());
                commaNeeded = true;
            }
        }
        return buffer.toString();
    }
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
View Full Code Here

            arguments,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    Parameter p = (Parameter)object;
                    return !p.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL) && !p.isException();
                }
            });
        return arguments;
    }
View Full Code Here

      @PathParam("queryname") String queryName,
      @FormParam("json") String jsonFormParam,
      @FormParam("file") String fileFormParam,
      MultivaluedMap<String, String> formParams) throws ServletException {
    try {
      ThinQuery tq = null;
      String file = fileFormParam;
      String json = jsonFormParam;
      if (formParams != null) {
        json = formParams.containsKey("json") ? formParams.getFirst("json") : jsonFormParam;
        file = formParams.containsKey("file") ? formParams.getFirst("file") : fileFormParam;
      }
      String filecontent = null;
      if (StringUtils.isNotBlank(json)) {
        filecontent = json;
      } else if (StringUtils.isNotBlank(file)) {
        Response f = repository.getResource(file);
        filecontent = new String((byte[]) f.getEntity());
      }
      if (StringUtils.isBlank(filecontent)) {
        throw new SaikuServiceException(
            "Cannot create new query. Empty file content " + StringUtils.isNotBlank(json) + " or read from file:"
            + file);
      }
      if (thinQueryService.isOldQuery(filecontent)) {
        tq = thinQueryService.convertQuery(filecontent);
      } else {
        ObjectMapper om = new ObjectMapper();
        tq = om.readValue(filecontent, ThinQuery.class);
      }

      if (LOG.isDebugEnabled()) {
        LOG.debug("TRACK\t" + "\t/query/" + queryName + "\tPOST\t tq:" + (tq == null) + " file:" + file);
      }

      if (tq == null) {
        throw new SaikuServiceException("Cannot create blank query (ThinQuery object = null)");
      }
      tq.setName(queryName);

      //SaikuCube cube = tq.getCube();
      //if (StringUtils.isNotBlank(xml)) {
      //String query = ServletUtil.replaceParameters(formParams, xml);
      //return thinQueryService.createNewOlapQuery(queryName, query);
View Full Code Here

        rsc.setRuntime(runtime.intValue());
        return rsc;
      }

      QueryResult qr = RestUtil.convert(thinQueryService.execute(tq));
      ThinQuery tqAfter = thinQueryService.getContext(tq.getName()).getOlapQuery();
      qr.setQuery(tqAfter);
      return qr;
    } catch (Exception e) {
      LOG.error("Cannot execute query (" + tq + ")", e);
      String error = ExceptionUtils.getRootCauseMessage(e);
View Full Code Here

  @POST
  @Consumes({ "application/json" })
  @Path("/enrich")
  public ThinQuery enrich(ThinQuery tq) {
    try {
      ThinQuery tqAfter = thinQueryService.updateQuery(tq);
      return tqAfter;
    } catch (Exception e) {
      LOG.error("Cannot enrich query (" + tq + ")", e);
      String error = ExceptionUtils.getRootCauseMessage(e);
      throw new WebApplicationException(Response.serverError().entity(error).build());
View Full Code Here

            }
            realPositions.add(cellPosition);
          }
        }
      }
      ThinQuery tq = thinQueryService.zoomIn(queryName, realPositions);
      return tq;

    } catch (Exception e) {
      LOG.error("Cannot zoom in on query (" + queryName + ")", e);
      throw new WebApplicationException(e);
View Full Code Here

      @PathParam("queryname") String queryname,
      @QueryParam("format") String format,
      @QueryParam("css") @DefaultValue("false") Boolean css,
      @QueryParam("tableonly") @DefaultValue("false") Boolean tableonly,
      @QueryParam("wrapcontent") @DefaultValue("true") Boolean wrapcontent) {
    ThinQuery tq = thinQueryService.getContext(queryname).getOlapQuery();
    return exportHtml(tq, format, css, tableonly, wrapcontent);
  }
View Full Code Here

TOP

Related Classes of org.saiku.olap.query2.Parameter

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.