| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.ui.api.report; |
| |
| import java.io.InputStream; |
| import java.util.Map; |
| |
| import org.eclipse.e4.core.contexts.IEclipseContext; |
| import org.eclipse.osbp.ui.api.customfields.IBlobService; |
| import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService; |
| import org.eclipse.osbp.ui.api.themes.IThemeResourceService; |
| import org.eclipse.osbp.ui.api.user.IUser; |
| |
| public interface IReportProvider { |
| public final static String APPCONTEXT_REPORT = "AppContext_Report"; |
| public final static String APPCONTEXT_ECLIPSECONTEXT = "EclipseContext_Report"; |
| public final static String APPCONTEXT_DATAMARTINSTANCE = "DatamartInstance_Report"; |
| public final static String APPCONTEXT_FILTERMAP = "FilterMap_Report"; |
| public final static String APPCONTEXT_PROPERTYLOOKUP = "PropertyLookup_Report"; |
| |
| public enum Rendering { |
| PDF_FILE(false, true, true, false, false), PDF_STREAM(false, true, false, true, false), |
| /** @see {@link http://www.eclipse.org/forums/index.php/t/204085/} */ |
| PDF_PRINT_STREAM(false, true, false, true, true), HTML_FILE(true, false, true, false, false), HTML_STREAM(true, false, false, true, false); |
| |
| public boolean asHtml() { |
| return fAsHtml; |
| } |
| |
| public boolean asPdf() { |
| return fAsPdf; |
| } |
| |
| public boolean asFile() { |
| return fAsFile; |
| } |
| |
| public boolean asStream() { |
| return fAsStream; |
| } |
| |
| public boolean forPrinting() { |
| return fForPrinting; |
| } |
| |
| private final boolean fAsHtml; |
| private final boolean fAsPdf; |
| private final boolean fAsFile; |
| private final boolean fAsStream; |
| private final boolean fForPrinting; |
| |
| Rendering(boolean asHtml, boolean asPdf, boolean asFile, boolean asStream, boolean forPrinting) { |
| fAsHtml = asHtml; |
| fAsPdf = asPdf; |
| fAsFile = asFile; |
| fAsStream = asStream; |
| fForPrinting = forPrinting; |
| } |
| } |
| |
| void printReportAsPdf(String reportId, IEclipseContext eclipseContext, Map<String, String> filterMap); |
| |
| InputStream get(String reportId, IEclipseContext eclipseContext, Map<String, String> filterMap); |
| |
| InputStream get(String reportId, IEclipseContext eclipseContext, Map<String, String> filterMap, Rendering renderer, String outputPath); |
| |
| } |