1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 package com.sun.star.report.pentaho; 24 25 import com.sun.star.report.JobDefinitionException; 26 import com.sun.star.report.ReportEngine; 27 import com.sun.star.report.ReportEngineMetaData; 28 import com.sun.star.report.ReportJob; 29 import com.sun.star.report.ReportJobDefinition; 30 import com.sun.star.report.util.DefaultReportJobDefinition; 31 32 import org.jfree.report.JFreeReportBoot; 33 34 public class PentahoReportEngine implements ReportEngine 35 { 36 37 private final ReportEngineMetaData metaData; 38 PentahoReportEngine()39 public PentahoReportEngine() 40 { 41 JFreeReportBoot.getInstance().start(); 42 this.metaData = new PentahoReportEngineMetaData(); 43 } 44 getMetaData()45 public ReportEngineMetaData getMetaData() 46 { 47 return metaData; 48 } 49 createJobDefinition()50 public ReportJobDefinition createJobDefinition() 51 { 52 return new DefaultReportJobDefinition(metaData); 53 } 54 55 /** 56 * Open points: How to define scheduling? 57 * 58 * @return the report job definition for the job description. 59 * 60 * @throws com.sun.star.report.JobDefinitionException 61 * 62 */ createJob(final ReportJobDefinition definition)63 public ReportJob createJob(final ReportJobDefinition definition) 64 throws JobDefinitionException 65 { 66 return new PentahoReportJob(definition); 67 } 68 } 69