@Override public List<ParameterContributor> getContributors(ParameterContributorContext context) throws JRException { List<ParameterContributor> contributors = new ArrayList<ParameterContributor>(); String dataAdapterUri = JRPropertiesUtil.getInstance(context.getJasperReportsContext()).getProperty(context.getDataset(), PROPERTY_DATA_ADAPTER_LOCATION); if (dataAdapterUri != null) { DataAdapterResource dataAdapterResource = RepositoryUtil.getInstance(context.getJasperReportsContext()).getResourceFromLocation(dataAdapterUri, DataAdapterResource.class); ParameterContributor dataAdapterService = DataAdapterServiceUtil.getInstance(context).getService(dataAdapterResource.getDataAdapter()); return Collections.singletonList(dataAdapterService); } return contributors; }
/** * */ private List<ParameterContributor> getParameterContributors(ParameterContributorContext context) throws JRException { List<ParameterContributor> allContributors = null; List<?> factories = getJasperReportsContext().getExtensions(ParameterContributorFactory.class); if (factories != null && factories.size() > 0) { allContributors = new ArrayList<ParameterContributor>(); for (Iterator<?> it = factories.iterator(); it.hasNext();) { ParameterContributorFactory factory = (ParameterContributorFactory)it.next(); List<ParameterContributor> contributors = factory.getContributors(context); if (contributors != null) { allContributors.addAll(contributors); } } } return allContributors; }
@Override public DataFileService createService(ParameterContributorContext context, DataFile dataFile) { if (dataFile instanceof RepositoryDataLocation) { return new RepositoryDataLocationService(context, (RepositoryDataLocation) dataFile); } if (dataFile instanceof HttpDataLocation) { return new HttpDataService(context, (HttpDataLocation) dataFile); } return null; }
/** * */ public XmlDataAdapterService( ParameterContributorContext paramContribContext, XmlDataAdapter xmlDataAdapter ) { super(paramContribContext, xmlDataAdapter); }
/** * */ public DataSourceProviderDataAdapterService( ParameterContributorContext paramContribContext, DataSourceProviderDataAdapter dsDataAdapter ) { super(paramContribContext, dsDataAdapter); }
/** * */ public void contributeParameters(Map<String,Object> parameterValues) throws JRException { parameterContributors = getParameterContributors(new ParameterContributorContext(getJasperReportsContext(), this, parameterValues)); if (parameterContributors != null) { for(ParameterContributor contributor : parameterContributors) { contributor.contributeParameters(parameterValues); } } }
protected String dataAdapterQualification(JRDataset dataset, DataAdapter dataAdapter) { ParameterContributorContext contributorContext = new ParameterContributorContext(context, dataset, Collections.<String, Object>emptyMap()); DataAdapterServiceUtil serviceUtil = DataAdapterServiceUtil.getInstance(contributorContext); DataAdapterService service = serviceUtil.getService(dataAdapter); return service instanceof Designated ? ((Designated) service).getDesignation() : null; }
public static DataFileResolver instance(ParameterContributorContext context) { // not caching for now return new DataFileResolver(context); }
protected DataFileResolver(ParameterContributorContext context) { this.context = context; }
/** * */ public JndiDataAdapterService(ParameterContributorContext paramContribContext, JndiDataAdapter jndiDataAdapter) { super(paramContribContext, jndiDataAdapter); }
/** * */ public ExcelDataAdapterService(ParameterContributorContext paramContribContext, ExcelDataAdapter excelDataAdapter) { super(paramContribContext, excelDataAdapter); }
/** * */ public QueryExecuterDataAdapterService(ParameterContributorContext paramContribContext, QueryExecuterDataAdapter qeDataAdapter) { super(paramContribContext, qeDataAdapter); }
/** * */ public AbstractClasspathAwareDataAdapterService(ParameterContributorContext paramContribContext, ClasspathAwareDataAdapter dataAdapter) { super(paramContribContext, dataAdapter); }
/** * */ public XmlaDataAdapterService(ParameterContributorContext paramContribContext, XmlaDataAdapter dataAdapter) { super(paramContribContext, dataAdapter); }
/** * */ public XlsxDataAdapterService(ParameterContributorContext paramContribContext, XlsxDataAdapter xlsxDataAdapter) { super(paramContribContext, xlsxDataAdapter); }
public static DataFileUtils instance(ParameterContributorContext paramContribContext) { return new DataFileUtils(paramContribContext); }
protected DataFileUtils(ParameterContributorContext paramContribContext) { super(); this.paramContribContext = paramContribContext; }
/** * @deprecated Replaced by {@link #DataFileUtils(ParameterContributorContext)}. */ protected DataFileUtils(JasperReportsContext jasperReportsContext) { this(new ParameterContributorContext(jasperReportsContext, null, null)); }
/** * */ public JdbcDataAdapterService(ParameterContributorContext paramContribContext, JdbcDataAdapter jdbcDataAdapter) { super(paramContribContext, jdbcDataAdapter); }
/** * */ public AbstractXlsDataAdapterService(ParameterContributorContext paramContribContext, XlsDataAdapter xlsDataAdapter) { super(paramContribContext, xlsDataAdapter); }
/** * */ public XlsDataAdapterService(ParameterContributorContext paramContribContext, XlsDataAdapter xlsDataAdapter) { super(paramContribContext, xlsDataAdapter); }
/** * */ public JsonDataAdapterService(ParameterContributorContext paramContribContext, JsonDataAdapter jsonDataAdapter) { super(paramContribContext, jsonDataAdapter); }
public HttpDataService(ParameterContributorContext context, HttpDataLocation dataLocation) { this.context = context; this.dataLocation = dataLocation; }
/** * @deprecated Replaced by {@link #getDataAdapterService(ParameterContributorContext, DataAdapter)}. */ @Override public DataAdapterService getDataAdapterService(JasperReportsContext jasperReportsContext, DataAdapter dataAdapter) { return getDataAdapterService(new ParameterContributorContext(jasperReportsContext, null, null), dataAdapter); }
/** * */ public SpringHibernateDataAdapterService(ParameterContributorContext paramContribContext, SpringHibernateDataAdapter jsonDataAdapter) { super(paramContribContext, jsonDataAdapter); }
/** * */ public HibernateDataAdapterService(ParameterContributorContext paramContribContext, HibernateDataAdapter jsonDataAdapter) { super(paramContribContext, jsonDataAdapter); }
/** * */ private DataAdapterServiceUtil(ParameterContributorContext paramContribContext) { this.paramContribContext = paramContribContext; }
/** * */ public static DataAdapterServiceUtil getInstance(ParameterContributorContext paramContribContext) { return new DataAdapterServiceUtil(paramContribContext); }
/** * @deprecated Replaced by {@link #getInstance(ParameterContributorContext)}. */ public static DataAdapterServiceUtil getInstance(JasperReportsContext jasperReportsContext) { return getInstance(new ParameterContributorContext(jasperReportsContext, null, null)); }
/** * */ public EjbqlDataAdapterService(ParameterContributorContext paramContribContext, EjbqlDataAdapter jsonDataAdapter) { super(paramContribContext, jsonDataAdapter); }
/** * */ public DataSourceDataAdapterService(ParameterContributorContext paramContribContext, DataSourceDataAdapter dsDataAdapter) { super(paramContribContext, dsDataAdapter); }
/** * */ public BeanDataAdapterService(ParameterContributorContext paramContribContext, BeanDataAdapter beanDataAdapter) { super(paramContribContext, beanDataAdapter); }
public RepositoryDataLocationService(ParameterContributorContext context, RepositoryDataLocation dataLocation) { this.repository = RepositoryUtil.getInstance(context.getJasperReportsContext()); this.dataLocation = dataLocation; }
/** * */ public AbstractDataAdapterService(ParameterContributorContext paramContribContext, DataAdapter dataAdapter) { this.dataAdapter = dataAdapter; this.paramContribContext = paramContribContext; }
/** * @deprecated Replaced by {@link #AbstractDataAdapterService(ParameterContributorContext, DataAdapter)}. */ public AbstractDataAdapterService(JasperReportsContext jasperReportsContext, DataAdapter dataAdapter) { this(new ParameterContributorContext(jasperReportsContext, null, null), dataAdapter); }
/** * */ public ParameterContributorContext getParameterContributorContext() { return paramContribContext; }
/** * */ public EmptyDataAdapterService(ParameterContributorContext paramContribContext, EmptyDataAdapter emptyDataAdapter) { super(paramContribContext, emptyDataAdapter); }
/** * */ public MondrianDataAdapterService( ParameterContributorContext paramContribContext, MondrianDataAdapter jdbcDataAdapter) { super(paramContribContext, jdbcDataAdapter); }
/** * */ public CsvDataAdapterService(ParameterContributorContext paramContribContext, CsvDataAdapter csvDataAdapter) { super(paramContribContext, csvDataAdapter); }
public HeaderToolbarParameterContributor (ParameterContributorContext context) { this.context = context; }