Package org.mapfish.print.output

Examples of org.mapfish.print.output.OutputFormat


        PJsonObject specJson = MapPrinter.parseSpec(jsonConfig);
        if (Log.isDebugEnabled(LOGGER_NAME)) {
            Log.debug(LOGGER_NAME, "Generating thumbnail from config: " +
                jsonConfig);
        }
        final OutputFormat outputFormat =
                getMapPrinter().getOutputFormat(specJson);

        File tempFile = File.createTempFile("thumbnail",
                "." + outputFormat.getFileSuffix());
        FileOutputStream out = null;
        try {
            out = new FileOutputStream(tempFile);
            PrintParams params = new PrintParams(
                    getMapPrinter().getConfig(),
                    configFile.getParentFile(),
                    specJson,
                    out,
                    new HashMap<String, String>());
            outputFormat.print(params);
        } catch (IOException e) {
            throw e;
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            if (out != null) {
                out.close();
            }
        }

        if (rotationAngle != null) {
            rotate(tempFile, outputFormat.getFileSuffix(), rotationAngle);
        }
        return tempFile;
    }
View Full Code Here


            this.metricRegistry.counter(getClass().getName() + "success").inc();
            LOGGER.debug("Successfully completed print job" + this.referenceId + "\n" + this.requestData);
            String fileName = getFileName(mapPrinter, spec);

            final OutputFormat outputFormat = mapPrinter.getOutputFormat(spec);
            String mimeType = outputFormat.getContentType();
            String fileExtension = outputFormat.getFileSuffix();

            return new SuccessfulPrintJob(this.referenceId, reportURI, getAppId(), new Date(), fileName, mimeType,
                    fileExtension, this.access);
        } catch (Throwable e) {
            String canceledText = "";
View Full Code Here

     @param specJson the client json request.
     * @param out the stream to write to.
     */
    public final void print(final PJsonObject specJson, final OutputStream out)
            throws Exception {
        final OutputFormat format = getOutputFormat(specJson);
        final File taskDirectory = this.workingDirectories.getTaskDirectory();
       
        try {
            format.print(specJson, getConfiguration(), this.configFile.getParentFile(), taskDirectory, out);
        } finally {
            this.workingDirectories.removeDirectory(taskDirectory);
        }
    }
View Full Code Here

TOP

Related Classes of org.mapfish.print.output.OutputFormat

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.