Examples of UnsupportedFormatException


Examples of com.haulmont.yarg.exception.UnsupportedFormatException

            String htmlContent = new String(htmlOutputStream.toByteArray());
            renderPdfDocument(htmlContent, outputStream);

        } else {
            throw new UnsupportedFormatException();
        }
    }
View Full Code Here

Examples of com.haulmont.yarg.exception.UnsupportedFormatException

        FormatterCreator docCreator = new FormatterCreator() {
            @Override
            public ReportFormatter create(FormatterFactoryInput factoryInput) {
                if (officeIntegration == null) {
                    throw new UnsupportedFormatException("Could not use doc templates because Open Office connection params not set. Please check, that \"cuba.reporting.openoffice.path\" property is set in properties file.");
                }
                DocFormatter docFormatter = new DocFormatter(factoryInput, officeIntegration);
                docFormatter.setDefaultFormatProvider(defaultFormatProvider);
                return docFormatter;
            }
View Full Code Here

Examples of com.haulmont.yarg.exception.UnsupportedFormatException

        ReportTemplate reportTemplate = factoryInput.reportTemplate;
        OutputStream outputStream = factoryInput.outputStream;

        FormatterCreator formatterCreator = formattersMap.get(templateExtension);
        if (formatterCreator == null) {
            throw new UnsupportedFormatException(String.format("Unsupported template extension [%s]", templateExtension));
        }

        return formatterCreator.create(factoryInput);
    }
View Full Code Here

Examples of com.haulmont.yarg.exception.UnsupportedFormatException

                    pdfConverter.convertToPdf(PdfConverter.FileType.SPREADSHEET, stream.toByteArray(), outputStream);
                } catch (IOException e) {
                    throw wrapWithReportingException("An error occurred while converting xls to pdf.", e);
                }
            } else {
                throw new UnsupportedFormatException("Could not convert xls files to pdf because Open Office connection params not set. Please check, that \"cuba.reporting.openoffice.path\" property is set in properties file.");
            }
        }
    }
View Full Code Here

Examples of de.nava.informa.core.UnsupportedFormatException

        return RSS_2_0_Parser.getInstance().parse(cBuilder, root);
      } else if (rssVersion.indexOf("2.0") >= 0 || rssVersion.equals("2")) {
        LOGGER.info("Channel uses RSS root element (Version 2.0).");
        return RSS_2_0_Parser.getInstance().parse(cBuilder, root);
      } else {
        throw new UnsupportedFormatException("Unsupported RSS version [" +
                                             rssVersion + "].");
      }
    } else if (rootElement.indexOf("rdf") >= 0) {
      return RSS_1_0_Parser.getInstance().parse(cBuilder, root);
    } else if (rootElement.indexOf("feed") >= 0) {
      Attribute versionAttr = root.getAttribute("version");
      Namespace namespace = ParserUtils.getDefaultNS(root);
      if (versionAttr != null) {
          String feedVersion = versionAttr.getValue();
          if (feedVersion.indexOf("0.1") >= 0 || feedVersion.indexOf("0.2") >= 0) {
              LOGGER.info("Channel uses feed root element (Version " + feedVersion + ").");
              LOGGER.warn("This atom version is not really supported yet, assume Atom 0.3 format");
              return Atom_0_3_Parser.getInstance().parse(cBuilder, root);
          } else if (feedVersion.indexOf("0.3") >= 0) {
              LOGGER.info("Channel uses feed root element (Version 0.3).");
              return Atom_0_3_Parser.getInstance().parse(cBuilder, root);
          }
      } else if (namespace != null && namespace.getURI() != null) {
          if ( !namespace.getURI().equals("http://www.w3.org/2005/Atom")) {
              LOGGER.warn("Channel uses unknown namespace in feed root element, assume Atom 1.0 format.");
          } else {
              LOGGER.info("Channel uses feed root element (Atom 1.0 format).");
          }
          return Atom_1_0_Parser.getInstance().parse(cBuilder, root);
      }
    }

    // did not match anything
    throw new UnsupportedFormatException("Unsupported root element [" +
                                         rootElement + "].");
  }
View Full Code Here

Examples of de.nava.informa.core.UnsupportedFormatException

        return ChannelFormat.RSS_0_92;
      } else if (rootElement.indexOf("2.0") > 0) {
        logger.info("Channel uses RSS root element (Version 2.0).");
        return ChannelFormat.RSS_2_0;
      } else {
        throw new UnsupportedFormatException("Unsupported RSS version [" +
                                             rootElement + "].");
      }
    } else if (rootElement.indexOf("rdf") >= 0) {
      logger.info("Channel uses RDF root element.");
      return ChannelFormat.RSS_1_0;
    } else if (rootElement.indexOf("feed") >= 0) {
      if (rootElement.indexOf("0.1") >= 0) {
        return ChannelFormat.ATOM_0_1;
      } else if (rootElement.indexOf("0.2") >= 0) {
        return ChannelFormat.ATOM_0_2;
      } else if (rootElement.indexOf("0.3") >= 0) {
        return ChannelFormat.ATOM_0_3;
      } else {
        throw new UnsupportedFormatException("Unsupported ATOM version [" +rootElement + "].");
      }
    } else {
      throw new UnsupportedFormatException("Not able to parse document " +
                                         "with root element [" +
                                         rootElement + "].");
    }
  }
View Full Code Here

Examples of de.nava.informa.core.UnsupportedFormatException

        return OPML_1_1_Parser.parse(root);
      }
    }

    // did not match anything
    throw new UnsupportedFormatException("Unsupported OPML root element [" +
                                         rootElement + "].");
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.dataimport.importer.UnsupportedFormatException

   */
  public Integer getInt(int column) throws IOException, UnsupportedFormatException {
    checkPointer();
    Cell cell = sheet.getCell(column, pointer);
    if (cell.getType() != CellType.NUMBER) {
      throw new UnsupportedFormatException();
    }
    return (new Double(((NumberCell) cell).getValue())).intValue();
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.dataimport.importer.UnsupportedFormatException

   */
  public Date getDate(int column) throws IOException, UnsupportedFormatException {
    checkPointer();
    Cell cell = sheet.getCell(column, pointer);
    if (cell.getType() != CellType.DATE) {
      throw new UnsupportedFormatException();
    }
    return ((DateCell) cell).getDate();
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.dataimport.importer.UnsupportedFormatException

   */
  public Long getLong(int column) throws IOException, UnsupportedFormatException {
    checkPointer();
    Cell cell = sheet.getCell(column, pointer);
    if (cell.getType() != CellType.NUMBER) {
      throw new UnsupportedFormatException();
    }
    return (new Double(((NumberCell) cell).getValue())).longValue();
  }
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.