001/* 002 * Copyright 2018 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.plugins.odfpilotage.report; 017 018import java.util.Map; 019 020import org.ametys.core.user.UserIdentity; 021import org.ametys.plugins.odfpilotage.schedulable.AbstractReportSchedulable; 022import org.ametys.runtime.i18n.I18nizableText; 023 024/** 025 * Interface for pilotage reports. 026 */ 027public interface PilotageReport 028{ 029 /** The key for the output format */ 030 public static final String PARAMETER_OUTPUT_FORMAT = "outputFormat"; 031 /** The key for the program */ 032 public static final String PARAMETER_PROGRAM = "program"; 033 /** The key for the orgunit */ 034 public static final String PARAMETER_ORGUNIT = "orgunit"; 035 /** The key for the catalog */ 036 public static final String PARAMETER_CATALOG = "catalog"; 037 /** The key for the lang */ 038 public static final String PARAMETER_LANG = "lang"; 039 040 /** The XLS output format */ 041 public static final String OUTPUT_FORMAT_XLS = "xls"; 042 /** The DOC output format */ 043 public static final String OUTPUT_FORMAT_DOC = "doc"; 044 045 /** 046 * The pilotage report target. 047 */ 048 public enum PilotageReportTarget 049 { 050 /** To execute a report on a program */ 051 PROGRAM, 052 /** To execute a report on an orgunit */ 053 ORGUNIT; 054 } 055 056 /** 057 * Retrieves the id of the report. 058 * @return the id. 059 */ 060 public String getId(); 061 062 /** 063 * Retrieves the label of the report. 064 * @return the label. 065 */ 066 public I18nizableText getLabel(); 067 068 /** 069 * Check if the report supports the given schedulable. 070 * @param schedulable The schedulable to check 071 * @return <code>true</code> if the schedulable is supported, <code>false</code> otherwise 072 */ 073 public boolean supports(AbstractReportSchedulable schedulable); 074 075 /** 076 * Launch a report on the given target with the given parameters. 077 * @param target The target of the report 078 * @param reportParameters The report parameters 079 * @param user The current user 080 */ 081 public void launch(PilotageReportTarget target, Map<String, String> reportParameters, UserIdentity user); 082}