Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package pt.webdetails.cda;
  
  
  import  org.apache.commons.logging.Log;
  import  org.apache.commons.logging.LogFactory;
  import  org.pentaho.platform.api.engine.IPentahoSession;
  import  org.pentaho.reporting.engine.classic.core.ClassicEngineBoot;
Main engine class that will answer to calls

Created by IntelliJ IDEA. User: pedro Date: Feb 2, 2010 Time: 2:24:16 PM

 
 public class CdaEngine
 {
 
 
   private static final Log logger = LogFactory.getLog(CdaEngine.class);
   private static CdaEngine _instance;
 
 
   protected CdaEngine()
   {
     .info("Initializing CdaEngine");
     init();
 
   }
 
 
   public void doQuery(final OutputStream out,
                       final CdaSettings cdaSettings,
                       final QueryOptions queryOptionsthrows UnknownDataAccessExceptionQueryExceptionUnsupportedExporterExceptionExporterException
   {
 
     .debug("Doing query on CdaSettings [ " + cdaSettings.getId() + " (" + queryOptions.getDataAccessId() + ")]");
 
     TableModel tableModel = cdaSettings.getDataAccess(queryOptions.getDataAccessId()).doQuery(queryOptions);
 
     // Handle the exports
 
     ExporterEngine.getInstance().getExporter(queryOptions.getOutputType(), queryOptions.getExtraSettings()).export(outtableModel);
 
   }
 
 
   public void listQueries(final OutputStream out,
                           final CdaSettings cdaSettings,
                           final DiscoveryOptions discoveryOptionsthrows UnsupportedExporterExceptionExporterException
   {
 
     .debug("Getting list of queries on CdaSettings [ " + cdaSettings.getId() + ")]");
 
 
     final TableModel tableModel = cdaSettings.listQueries(discoveryOptions);
 
     // Handle the exports
 
     ExporterEngine.getInstance().getExporter(discoveryOptions.getOutputType()).export(outtableModel);
 
   }
 
 
   public void listParameters(final OutputStream out,
                              final CdaSettings cdaSettings,
                              final DiscoveryOptions discoveryOptionsthrows UnknownDataAccessExceptionUnsupportedExporterExceptionExporterException
   {
 
     .debug("Getting list of queries on CdaSettings [ " + cdaSettings.getId() + ")]");
 
 
     final TableModel tableModel = cdaSettings.getDataAccess(discoveryOptions.getDataAccessId()).listParameters(discoveryOptions);
 
     // Handle the exports
 
     ExporterEngine.getInstance().getExporter(discoveryOptions.getOutputType()).export(outtableModel);
 
 
   }
 
   public void getCdaList(final OutputStream outfinal DiscoveryOptions discoveryOptionsfinal IPentahoSession userSessionthrows UnsupportedExporterExceptionExporterException
   {
 
     final TableModel tableModel = SolutionRepositoryUtils.getInstance().getCdaList(userSession);
 
     ExporterEngine.getInstance().getExporter(discoveryOptions.getOutputType()).export(outtableModel);
  }
  public boolean isStandalone()
  {
    return "true".equals(CdaBoot.getInstance().getGlobalConfig().getConfigProperty("pt.webdetails.cda.Standalone"));
  }
  private void init()
  {
    // Start ClassicEngineBoot
    CdaBoot.getInstance().start();
    ClassicEngineBoot.getInstance().start();
  }
  public static synchronized CdaEngine getInstance()
  {
    if ( == null)
    {
       = new CdaEngine();
    }
    return ;
  }
New to GrepCode? Check out our FAQ X