LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / reportbuilder / java / org / libreoffice / report / pentaho / PentahoReportEngineMetaData.java
blobef71cb3c18b4eb292e9dd63f3eb2b161332ec0da
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package org.libreoffice.report.pentaho;
20 import java.util.HashMap;
21 import java.util.List;
22 import java.util.Map;
24 import org.libreoffice.report.DataSourceFactory;
25 import org.libreoffice.report.ImageService;
26 import org.libreoffice.report.InputRepository;
27 import org.libreoffice.report.OutputRepository;
28 import org.libreoffice.report.ReportEngineMetaData;
29 import org.libreoffice.report.ReportEngineParameterNames;
30 import org.libreoffice.report.ReportJobFactory;
33 public class PentahoReportEngineMetaData
34 implements ReportEngineMetaData
37 public static final String OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
38 public static final String OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet";
39 public static final String OPENDOCUMENT_CHART = "application/vnd.oasis.opendocument.chart";
40 public static final String DEBUG = "raw/text+xml";
41 private final Map<String,Class<?>> parameterTypes;
43 public PentahoReportEngineMetaData()
45 parameterTypes = new HashMap<String,Class<?>>();
46 parameterTypes.put(ReportEngineParameterNames.CONTENT_TYPE, String.class);
47 parameterTypes.put(ReportEngineParameterNames.INPUT_NAME, String.class);
48 parameterTypes.put(ReportEngineParameterNames.OUTPUT_NAME, String.class);
49 parameterTypes.put(ReportEngineParameterNames.INPUT_REPOSITORY, InputRepository.class);
50 parameterTypes.put(ReportEngineParameterNames.OUTPUT_REPOSITORY, OutputRepository.class);
51 parameterTypes.put(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, DataSourceFactory.class);
52 parameterTypes.put(ReportEngineParameterNames.IMAGE_SERVICE, ImageService.class);
53 parameterTypes.put(ReportEngineParameterNames.INPUT_REPORTJOB_FACTORY, ReportJobFactory.class);
54 parameterTypes.put(ReportEngineParameterNames.INPUT_MASTER_COLUMNS, List.class);
55 parameterTypes.put(ReportEngineParameterNames.INPUT_MASTER_VALUES, List.class);
56 parameterTypes.put(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS, List.class);
57 parameterTypes.put(ReportEngineParameterNames.AUTHOR, String.class);
58 parameterTypes.put(ReportEngineParameterNames.TITLE, String.class);
59 parameterTypes.put(ReportEngineParameterNames.MAXROWS, Integer.class);
62 public Class getParameterType(final String parameter)
64 return parameterTypes.get(parameter);