Package org.mapfish.print.config

Examples of org.mapfish.print.config.Configuration


                            return error404(uri, httpMethod);
                        }
                    }
                }
        );
        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("."));
        this.forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        @SuppressWarnings("unchecked")
View Full Code Here


    public TemporaryFolder folder = new TemporaryFolder();
    private Template template;

    @Before
    public void setUp() throws Exception {
        Configuration configuration = new Configuration();
        this.template = new Template();
        this.template.setConfiguration(configuration);

    }
View Full Code Here

    @Test
    public void testCreateMapDependency() throws Exception {

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

        ProcessorDependencyGraph graph = template.getProcessorGraph();
        List<ProcessorGraphNode> roots = graph.getRoots();

        assertEquals(1, roots.size());
View Full Code Here

    }

    @Test
    public void testConvertTableInConfigNotInRequest() throws IOException, JSONException, NoSuchAppException, URISyntaxException {
        setUpConfigFiles();
        Configuration configuration = printerFactory.create("default").getConfiguration();
        final PJsonObject v2ApiRequest = loadRequestDataAsJson("requestData-old-api-no-table-data.json");
        JSONObject request = OldAPIRequestConverter.convert(v2ApiRequest, configuration).getInternalObj();

        assertTrue(request.has("attributes"));
        JSONObject attributes = request.getJSONObject("attributes");
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void testConvertInvalidTemplate() throws IOException, JSONException, NoSuchAppException, URISyntaxException {
        setUpConfigFiles();
        Configuration configuration = printerFactory.create("wrong-layout").getConfiguration();
        // will trigger an exception, because the configuration uses a
        // different layout than specified in the request
        OldAPIRequestConverter.convert(loadRequestDataAsJson("requestData-old-api-all.json"), configuration);
    }
View Full Code Here

    protected abstract ConfigFileLoaderPlugin getLoader();

    @Test
    public void testAccessibleChildResource_InWorkingDir() throws Exception {

        final Configuration configuration = getConfiguration();

        assertAccessible(this.workingDirectories.getReports());
        assertAccessible(this.workingDirectories.getWorking(configuration));
        assertAccessible(this.workingDirectories.getJasperCompilation(configuration));
        assertAccessible(this.workingDirectories.getReportsOldApi());
View Full Code Here

        assertAccessible(this.workingDirectories.getReportsOldApi());
        assertAccessible(this.workingDirectories.getTaskDirectory());
    }

    private Configuration getConfiguration() {
        final Configuration configuration = new Configuration();
        configuration.setConfigurationFile(CONFIG_FILE);
        return configuration;
    }
View Full Code Here

        return configuration;
    }

    @Test
    public void testLoadFileChildResource_InWorkingDir() throws Exception {
        final Configuration configuration = getConfiguration();

        final String resourceFileName = "resourceFile.txt";
        final byte[] bytes = Files.toByteArray(getFile(FileConfigFileLoader.class, resourceFileName));

        assertLoadable(bytes, this.workingDirectories.getReports());
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("."));
        this.forkJoinPool.invoke(template.getProcessorGraph().createTask(values));

        URI northArrowGraphic = (URI) values.getObject("graphic", URI.class);
View Full Code Here

        doTest(requestData);
    }


    private void doTest(PJsonObject requestData) throws IOException, JSONException {
        final Configuration config = configurationFactory.getConfig(getFile(BASE_DIR + "config.yaml"));
        final Template template = config.getTemplate("main");
        Values values = new Values(requestData, template, parser, getTaskDirectory(), this.httpRequestFactory, new File("."));
        template.getProcessorGraph().createTask(values).invoke();

        @SuppressWarnings("unchecked")
        List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class);
View Full Code Here

TOP

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

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.