Package org.mapfish.print.output

Examples of org.mapfish.print.output.Values


        final DataSourceAttributeValue value = new DataSourceAttributeValue();
        value.attributesValues = new Map[pValue.size()];
        for (int i = 0; i < pValue.size(); i++) {
            PObject rowData = pValue.getObject(i);
            final Values valuesForParsing = new Values();
            valuesForParsing.populateFromAttributes(template, parser, this.attributes, rowData);
            value.attributesValues[i] = valuesForParsing.asMap();
        }

        return value;
    }
View Full Code Here


            this.execContext = execContext;
        }

        @Override
        protected Values compute() {
            final Values values = this.execContext.getValues();

            final Processor<In, Out> process = this.node.processor;
            final MetricRegistry registry = this.node.metricRegistry;
            final String name = ProcessorGraphNode.class.getName() + "_compute():" + process.getClass();
            Timer.Context timerContext = registry.timer(name).time();
View Full Code Here

    }

    @Nullable
    @Override
    public Values createInputParameter() {
        return new Values();
    }
View Full Code Here

    private JRDataSource processInput(@Nonnull final Input input)
            throws JSONException, JRException {
        //CSON:RedundantThrows
        List<Values> dataSourceValues = Lists.newArrayList();
        for (Map<String, Object> o : input.datasource.attributesValues) {
            Values rowValues = new Values(input.values);
            for (Map.Entry<String, Object> entry : o.entrySet()) {
                rowValues.put(entry.getKey(), entry.getValue());
            }

            dataSourceValues.add(rowValues);
        }

        List<ForkJoinTask<Values>> futures = Lists.newArrayList();
        if (!dataSourceValues.isEmpty()) {
            for (Values dataSourceValue : dataSourceValues) {
                addAttributes(input.template, dataSourceValue);
                final ForkJoinTask<Values> taskFuture = this.processorGraph.createTask(dataSourceValue).fork();
                futures.add(taskFuture);
            }
            final File reportFile;
            if (this.reportTemplate != null) {
                final Configuration configuration = input.template.getConfiguration();
                final File file = new File(configuration.getDirectory(), this.reportTemplate);
                reportFile = this.jasperReportBuilder.compileJasperReport(configuration, file);
            } else {
                reportFile = null;
            }
            List<Map<String, ?>> rows = new ArrayList<Map<String, ?>>();

            for (ForkJoinTask<Values> future : futures) {
                final Values rowData = future.join();
                if (reportFile != null) {
                        rowData.put(this.reportKey, reportFile.getAbsolutePath());
                }
                rows.add(rowData.asMap());
            }

            return new JRMapCollectionDataSource(rows);
        }
        return null;
View Full Code Here

        final File configFile = getFile(OverviewMapAttributeTest.class, "overviewmap_attributes/config-json.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
        final PJsonObject pJsonObject = parseJSONObjectFromFile(OverviewMapAttributeTest.class, "overviewmap_attributes/requestData-json.json");
       
        final Values values = new Values(pJsonObject, template, new MapfishParser(), getTaskDirectory(), this.httpRequestFactory,
                new File("."));
        final MapAttribute.MapAttributeValues mapValue = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);
        final OverviewMapAttribute.OverviewMapAttributeValues overviewMapValue =
                values.getObject("overviewMapDef", OverviewMapAttribute.OverviewMapAttributeValues.class);
        final MapAttribute.OverriddenMapAttributeValues value = mapValue.getWithOverrides(overviewMapValue);
       
        assertEquals(300.0, value.getDpi(), 0.1);
        assertNotNull(value.getLayers());
        assertEquals(2, value.getLayers().size());
View Full Code Here

        final File configFile = getFile(OverviewMapAttributeTest.class, "overviewmap_attributes/config-yaml.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
        final PJsonObject pJsonObject = parseJSONObjectFromFile(OverviewMapAttributeTest.class, "overviewmap_attributes/requestData-yaml.json");
       
        final Values values = new Values(pJsonObject, template, new MapfishParser(), getTaskDirectory(), this.httpRequestFactory, new File("."));
        final MapAttribute.MapAttributeValues mapValue = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);
        final OverviewMapAttribute.OverviewMapAttributeValues overviewMapValue =
                values.getObject("overviewMapDef", OverviewMapAttribute.OverviewMapAttributeValues.class);
        final MapAttribute.OverriddenMapAttributeValues value = mapValue.getWithOverrides(overviewMapValue);

        assertEquals(80.0, value.getDpi(), 0.1);
        assertNotNull(value.getLayers());
View Full Code Here

        final File configFile = getFile(OverviewMapAttributeTest.class, "overviewmap_attributes/config-yaml.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
        final PJsonObject pJsonObject = parseJSONObjectFromFile(OverviewMapAttributeTest.class, "overviewmap_attributes/requestData-json.json");
       
        final Values values = new Values(pJsonObject, template, new MapfishParser(), getTaskDirectory(), this.httpRequestFactory, new File("."));
        final MapAttribute.MapAttributeValues mapValue = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);
        final OverviewMapAttribute.OverviewMapAttributeValues overviewMapValue =
                values.getObject("overviewMapDef", OverviewMapAttribute.OverviewMapAttributeValues.class);
        final MapAttribute.OverriddenMapAttributeValues value = mapValue.getWithOverrides(overviewMapValue);

        assertEquals(300.0, value.getDpi(), 0.1);
        assertNotNull(value.getLayers());
View Full Code Here

                }
        );
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        final Template template = config.getTemplate("main");
        PJsonObject requestData = loadJsonRequestData();
        Values values = new Values(requestData, template, this.parser, getTaskDirectory(), this.requestFactory, new File("."));
        template.getProcessorGraph().createTask(values).invoke();

        @SuppressWarnings("unchecked")
        List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class);
        assertEquals(2, layerGraphics.size());

        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 2625, 1225);

//        ImageIO.write(referenceImage, "png", new File("e:/tmp/expectedSimpleImage.png"));
View Full Code Here

        final String baseDir = BASIC_BASE_DIR;

        final Configuration config = configurationFactory.getConfig(getFile(baseDir + "config.yaml"));
        final Template template = config.getTemplate("main");
        PJsonObject requestData = loadJsonRequestData(baseDir);
        Values values = new Values(requestData, template, parser, getTaskDirectory(), this.httpRequestFactory, new File("."));
        forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        final JRMapCollectionDataSource tableDataSource = values.getObject("table", JRMapCollectionDataSource.class);

        int count = 0;
        while (tableDataSource.next()) {
            count++;
        }
View Full Code Here

                }
        );
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        final Template template = config.getTemplate("A4 landscape");
        PJsonObject requestData = loadJsonRequestData();
        Values values = new Values(requestData, template, this.parser, getTaskDirectory(), this.requestFactory, new File("."));
        template.getProcessorGraph().createTask(values).invoke();

        @SuppressWarnings("unchecked")
        List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class);
        assertEquals(2, layerGraphics.size());
        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 780, 330);

//      ImageIO.write(referenceImage, "png", new File("e:/tmp/expectedSimpleImage.png"));
//      Files.copy(new File(layerGraphics.get(0)), new File("e:/tmp/0_"+getClass().getSimpleName()+".tiff"));
View Full Code Here

TOP

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

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.