Examples of unparse()


Examples of org.apache.tapestry.util.ContentType.unparse()

        _entities = entities;
        _safe = safe;
       
        ContentType contentTypeObject = new ContentType(contentType);
        contentTypeObject.setParameter("charset", encoding);
        _contentType = contentTypeObject.unparse();

        setOutputStream(stream, encoding);
    }

    /**
 
View Full Code Here

Examples of org.apache.tapestry.util.ContentType.unparse()

    private String generateFullContentType(String contentType, String encoding)
    {
        ContentType contentTypeObject = new ContentType(contentType);
        if (contentTypeObject.getParameter("charset") == null)
            contentTypeObject.setParameter("charset", encoding);
        return contentTypeObject.unparse();
    }

    protected void setWriter(PrintWriter writer)
    {
        _writer = writer;
View Full Code Here

Examples of org.apache.tapestry.util.ContentType.unparse()

    private String generateFullContentType(String contentType, String encoding)
    {
        ContentType contentTypeObject = new ContentType(contentType);
        if (contentTypeObject.getParameter("charset") == null)
            contentTypeObject.setParameter("charset", encoding);
        return contentTypeObject.unparse();
    }

    protected void setWriter(PrintWriter writer)
    {
        _writer = writer;
View Full Code Here

Examples of org.apache.tapestry5.ContentType.unparse()

        contentType.setBaseType("text");
        contentType.setSubType("html");
        contentType.setParameter("charset", "utf-8");

        assertEquals(contentType.unparse(), "text/html;charset=utf-8");
    }

    @Test
    public void unparse_no_parameters() throws Exception
    {
View Full Code Here

Examples of org.apache.tapestry5.ContentType.unparse()

        ContentType contentType = new ContentType();

        contentType.setBaseType("text");
        contentType.setSubType("html");

        assertEquals(contentType.unparse(), "text/html");
    }

    @Test
    public void to_string_is_unparse()
    {
View Full Code Here

Examples of org.apache.tapestry5.ContentType.unparse()

        contentType.setBaseType("text");
        contentType.setSubType("html");
        contentType.setParameter("charset", "utf-8");

        assertEquals(contentType.toString(), contentType.unparse());
    }
}
View Full Code Here

Examples of org.olap4j.mdx.SelectNode.unparse()

  public String getMdx() {
    final Writer writer = new StringWriter();
    if (SaikuProperties.OLAPCONVERTQUERY) {
      try {
        SelectNode s = QueryConverter.convert(query);
        s.unparse(new ParseTreeWriter(new PrintWriter(writer)));
      } catch (SaikuIncompatibleException se) {
        LOG.debug("Cannot convert to new query model mdx, falling back to old version", se);
        this.query.getSelect().unparse(new ParseTreeWriter(new PrintWriter(writer)));
      } catch (Exception e) {
        throw new SaikuServiceException("Cannot convert to new query model", e);
View Full Code Here

Examples of org.saiku.olap.query.QueryDeserializer.unparse()

  public SaikuQuery createNewOlapQuery(@Nullable String name, @NotNull String xml) {
    try {
      QueryDeserializer qd = new QueryDeserializer();
      SaikuCube scube = qd.getFakeCube(xml);
      OlapConnection con = olapDiscoverService.getNativeConnection(scube.getConnection());
      IQuery query = qd.unparse(xml, con);
      // TODO - this is not good! could lead to duplicate queries
      if (name == null) {
        name = UUID.randomUUID().toString();
        putIQuery(name, query);
      } else {
View Full Code Here

Examples of org.saiku.olap.query.QueryDeserializer.unparse()

  @NotNull
  private IQuery applyTag(@NotNull IQuery query, OlapConnection con, @NotNull SaikuTag t) throws Exception {
    String xml = query.toXml();
    QueryDeserializer qd = new QueryDeserializer();
    query = qd.unparse(xml, con);

    List<SimpleCubeElement> doneDimension = new ArrayList<SimpleCubeElement>();
    Map<String, QueryDimension> dimensionMap = new HashMap<String, QueryDimension>();
    if (t.getSaikuTupleDimensions() != null) {
      for (SimpleCubeElement st : t.getSaikuTupleDimensions()) {
View Full Code Here

Examples of org.saiku.olap.query.QueryDeserializer.unparse()

  public ThinQuery convertQuery(@NotNull String xml) throws Exception {
    if (StringUtils.isNotBlank(xml) && xml.trim().startsWith("<?xml")) {
      QueryDeserializer qd = new QueryDeserializer();
      SaikuCube scube = qd.getFakeCube(xml);
      OlapConnection con = olapDiscoverService.getNativeConnection(scube.getConnection());
      IQuery query = qd.unparse(xml, con);

      if (QueryType.QM.equals(query.getType())) {
        OlapQuery qr = (OlapQuery) query;
        Query sQ = QueryConverter.convertQuery(qr.getQuery());
        SaikuCube converted = ObjectUtil.convert(scube.getConnection(), sQ.getCube());
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.