Package org.mapfish.print.config

Examples of org.mapfish.print.config.Template


                    }
                }
        );

        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());
View Full Code Here


            }
        });

        configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(baseDir() + "/config-forward-all.yaml"));
        final Template template = config.getTemplate("main");

        ProcessorDependencyGraph graph = template.getProcessorGraph();

        Values values = new Values();
        values.put(Values.CLIENT_HTTP_REQUEST_FACTORY_KEY, this.httpClientFactory);
        addExtraValues(values);
        forkJoinPool.invoke(graph.createTask(values));
View Full Code Here

    @Test
    public void testParsableByValues() throws Exception {
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        PJsonObject requestData = loadJsonRequestData();

        Template template = config.getTemplate("main");
        Values values = new Values(requestData, template, this.parser, config.getDirectory(), httpClientFactory, config.getDirectory());

        String[] array = (String[]) values.getObject("stringarray", Object.class);

        assertArrayEquals(new String[]{"s1", "s2"}, array);
View Full Code Here

        intArray.add(1);
        intArray.add(2);
        intArray.add(3);
        requestData.getJSONObject("attributes").getInternalObj().put("stringarray", intArray);

        Template template = config.getTemplate("main");
        Values values = new Values(requestData, template, this.parser, config.getDirectory(), httpClientFactory, config.getDirectory());

        String[] array = (String[]) values.getObject("stringarray", Object.class);

        assertArrayEquals(new String[]{"1", "2", "3"}, array);
View Full Code Here

        att.setZoomLevels(new ZoomLevels(1000, 2000, 3000, 4000));

        StringWriter stringWriter = new StringWriter();
        JSONWriter jsonWriter = new JSONWriter(stringWriter);
        jsonWriter.object();
        att.printClientConfig(jsonWriter, new Template());
        jsonWriter.endObject();
        JSONObject json = new JSONObject(stringWriter.toString());

        assertEquals(mapAttName, json.getString(ReflectiveAttribute.JSON_NAME));
        assertTrue(json.has(JSON_CLIENT_PARAMS));
View Full Code Here

        att.setDefault(defaultValue);

        StringWriter stringWriter = new StringWriter();
        JSONWriter jsonWriter = new JSONWriter(stringWriter);
        jsonWriter.object();
        att.printClientConfig(jsonWriter, new Template());
        jsonWriter.endObject();
        JSONObject json = new JSONObject(stringWriter.toString());

        final JSONObject required = json.getJSONObject(JSON_CLIENT_PARAMS);
        assertEquals(13, required.length());
View Full Code Here

    @Test
    public void testAssignStyleBasic() throws Exception {
        this.configurationFactory.setDoValidation(false);
        final Configuration config = this.configurationFactory.getConfig(getFile(BASE_DIR + "basic/config.yaml"));
        final Template template = config.getTemplate("main");
        PJsonObject requestData = parseJSONObjectFromFile(SetStyleProcessorTest.class, BASE_DIR + "basic/request.json");
        Values values = new Values(requestData, template, parser, this.folder.getRoot(), this.httpClientFactory, new File("."));
        forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        final MapAttribute.MapAttributeValues map = values.getObject("mapDef", MapAttribute.MapAttributeValues.class);
        final AbstractFeatureSourceLayer layer = (AbstractFeatureSourceLayer) map.getLayers().get(0);
        final MapfishMapContext mapContext = AbstractMapfishSpringTest.createTestMapContext();
        assertEquals("Default Line",
View Full Code Here

    @Test
    public void testAssignStyleMap() throws Exception {
        this.configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "map/config.yaml"));
        final Template template = config.getTemplate("main");
       
        ProcessorDependencyGraph graph = template.getProcessorGraph();
        List<ProcessorGraphNode> roots = graph.getRoots();

        assertEquals(1, roots.size());
        ProcessorGraphNode<Object, Object> rootNode = roots.get(0);
        assertEquals(SetStyleProcessor.class, rootNode.getProcessor().getClass());
View Full Code Here

    @Test
    public void testAssignStyleTwoMaps() throws Exception {
        this.configurationFactory.setDoValidation(false);
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "two_maps/config.yaml"));
        final Template template = config.getTemplate("main");
       
        ProcessorDependencyGraph graph = template.getProcessorGraph();
        List<ProcessorGraphNode> roots = graph.getRoots();
       
        assertEquals(2, roots.size());
        ProcessorGraphNode<Object, Object> rootNode1 = roots.get(0);
        assertEquals(SetStyleProcessor.class, rootNode1.getProcessor().getClass());
View Full Code Here

        layerData.origin = new double[]{10, 20};
        layerData.pointsInLine = 10;


        Configuration config = new Configuration();
        Template template = new Template();
        template.setConfiguration(config);

        final GridLayerPlugin plugin = new GridLayerPlugin();
        StyleParser styleParser = new StyleParser();
        plugin.setParser(styleParser);
        final GridLayer layer = plugin.parse(template, layerData);
View Full Code Here

TOP

Related Classes of org.mapfish.print.config.Template

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.