Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package pt.webdetails.cda.connections.kettle;
  
  
  import  org.apache.commons.logging.Log;
  import  org.apache.commons.logging.LogFactory;
 import  org.dom4j.Element;
 import  org.pentaho.reporting.engine.classic.core.ParameterMapping;
 import  org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleTransFromFileProducer;
 import  org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleTransformationProducer;
 import  org.pentaho.reporting.platform.plugin.connection.PentahoKettleTransFromFileProducer;
Todo: Document me!

Date: 08.05.2010 Time: 14:02:09

Author(s):
Thomas Morgner.
 
 public class TransFromFileConnection extends AbstractConnection implements KettleConnection
 {
 
   private static final Log logger = LogFactory.getLog(TransFromFileConnection.class);
 
 
   {
   }
 
 
   public TransFromFileConnection(final Element connection)
           throws InvalidConnectionException
   {
     super(connection);
   }


  

Parameters:
query the name of the transformation step that should be polled.
Returns:
the initialized transformation producer.
 
   public KettleTransformationProducer createTransformationProducer(final String query)
   {
     if (CdaEngine.getInstance().isStandalone())
     {
       return new KettleTransFromFileProducer("",
               .getTransformationFile(),
               querynullnull.getDefinedArgumentNames(),
               .getDefinedVariableNames());
     }
 
 
 
 
     try {
       Constructor c = PentahoKettleTransFromFileProducer.class.getConstructornew Class[]{String.classString.class,
               String.classString.classString.classString[].class, ParameterMapping[].class} );
       Object obj = c.newInstance"".getTransformationFile(), querynullnull.getDefinedArgumentNames(),
               .getDefinedVariableNames() );
       return (PentahoKettleTransFromFileProducer) obj;
     } catch ( Exception  e ) {
 
       try {
         Class formulaArgument =
                 Class.forName"org.pentaho.reporting.engine.classic.extensions.datasources.kettle.FormulaArgument" );
         Class formulaParameter =
                 Class.forName"org.pentaho.reporting.engine.classic.extensions.datasources.kettle.FormulaParameter" );
         Method convertFormulaArgument = formulaArgument.getMethod"convert"new Class[] {String[].class} );
         Method convertParameterArgument = formulaParameter.getMethod"convert"new Class[] {ParameterMapping[].class} );
         Constructor c = PentahoKettleTransFromFileProducer.class.getConstructors()[0];
         Object obj = c.newInstance"",
                 .getTransformationFile(),
                 querynullnull,
                 formulaArgument.castconvertFormulaArgument.invokenull,
                         new Object[]{ .getDefinedArgumentNames() } ) ),
                 formulaParameter.castconvertParameterArgument.invokenull,
                         new Object[]{ .getDefinedVariableNames() } ) ) );
         return (PentahoKettleTransFromFileProducer) obj;
       } catch ( InstantiationException ie ) {
         .error( "Error while creating PentahoKettleTransFromFileProducer"ie );
       } catch ( InvocationTargetException ite ) {
         .error( "Error while creating PentahoKettleTransFromFileProducer"ite );
       } catch ( IllegalAccessException iae) {
         .error( "Error while creating PentahoKettleTransFromFileProducer"iae );
       } catch ( ClassNotFoundException cnfe ) {
         .error( "Error while creating PentahoKettleTransFromFileProducer"cnfe );
       } catch ( NoSuchMethodException nsme ) {
         .error( "Error while creating PentahoKettleTransFromFileProducer"nsme );
       }
      return null;
    }
  }
  {
  }
  protected void initializeConnection(final Element connectionthrows InvalidConnectionException
  {
     = new TransFromFileConnectionInfo(connection);
  }
  public String getType()
  {
    return "kettleTransFromFile";
  }
  public boolean equals(final Object o)
  {
    if (this == o)
    {
      return true;
    }
    if (o == null || getClass() != o.getClass())
    {
      return false;
    }
    if ( != null ? !.equals(that.connectionInfo) : that.connectionInfo != null)
    {
      return false;
    }
    return true;
  }
  public int hashCode()
  {
    return  != null ? .hashCode() : 0;
  }
  {
    final ArrayList<PropertyDescriptorproperties = new ArrayList<PropertyDescriptor>();
    return properties;
  }
  public String getTypeForFile()
  {
    return "kettle.TransFromFile";
  }
	  return ;
  }
New to GrepCode? Check out our FAQ X