KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > plugin > jfreereport > ReportWizardSpecComponent


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  */

13 package org.pentaho.plugin.jfreereport;
14
15 import org.apache.commons.logging.Log;
16 import org.apache.commons.logging.LogFactory;
17 import org.pentaho.core.runtime.IRuntimeContext;
18 import org.pentaho.plugin.jfreereport.components.JFreeReportGenerateDefinitionComponent;
19
20 /**
21  * The report-wizard component generates a report definition from a report-spec
22  * file. Use this component, if want to use the standard-report process only or
23  * if you have no need to tweak the processing.
24  * <p/>
25  * This class calls the {@link JFreeReportGenerateDefinitionComponent} to do
26  * the real work.
27  *
28  * @created May 15, 2006
29  * @author Michael D'Amour
30  */

31 public class ReportWizardSpecComponent extends JFreeReportComponent
32 {
33   private static final long serialVersionUID = 3435921119638344882L;
34
35   private JFreeReportGenerateDefinitionComponent generateDefinitionComponent;
36
37   public ReportWizardSpecComponent()
38   {
39   }
40
41   public Log getLogger()
42   {
43     return LogFactory.getLog(ReportWizardSpecComponent.class);
44   }
45
46   public boolean validateAction()
47   {
48     generateDefinitionComponent = new JFreeReportGenerateDefinitionComponent();
49     if (initAndValidate(generateDefinitionComponent) == false)
50     {
51       return false;
52     }
53     return super.validateAction();
54   }
55
56   protected boolean executeReportAction()
57   {
58     if (generateDefinitionComponent.init() == false)
59     {
60       return false;
61     }
62     if (generateDefinitionComponent.execute() !=
63           IRuntimeContext.RUNTIME_STATUS_SUCCESS)
64     {
65       return false;
66     }
67     generateDefinitionComponent.done();
68     return super.executeReportAction();
69
70   }
71 }
72
Popular Tags