Package org.eobjects.analyzer.job.builder

Examples of org.eobjects.analyzer.job.builder.AnalysisJobBuilder


    LookAndFeelManager.getInstance().init();

    // run a small job
    AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(), "conf.xml"));
    AnalysisRunner runner = new AnalysisRunnerImpl(conf);
    AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);

    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    ajb.setDatastore(ds);

    DataContextProvider dcp = ds.getDataContextProvider();
    Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.ORDERS");

    ajb.addSourceColumn(table.getColumnByName("ORDERDATE"));
    ajb.addSourceColumn(table.getColumnByName("SHIPPEDDATE"));
    ajb.addSourceColumn(table.getColumnByName("CUSTOMERNUMBER"));

    @SuppressWarnings("unchecked")
    InputColumn<Date> orderDateColumn = (InputColumn<Date>) ajb.getSourceColumnByName("ORDERDATE");
    @SuppressWarnings("unchecked")
    InputColumn<Date> shippedDateColumn = (InputColumn<Date>) ajb.getSourceColumnByName("SHIPPEDDATE");
    @SuppressWarnings("unchecked")
    InputColumn<Integer> customerNumberColumn = (InputColumn<Integer>) ajb.getSourceColumnByName("CUSTOMERNUMBER");
    @SuppressWarnings("unchecked")
    MutableInputColumn<String> customerNumberAsStringColumn = (MutableInputColumn<String>) ajb
        .addTransformer(ConvertToStringTransformer.class).addInputColumn(customerNumberColumn).getOutputColumns()
        .get(0);

    DateGapAnalyzer dga = ajb.addRowProcessingAnalyzer(DateGapAnalyzer.class).getConfigurableBean();
    dga.setFromColumn(orderDateColumn);
    dga.setToColumn(shippedDateColumn);
    dga.setGroupColumn(customerNumberAsStringColumn);

    AnalysisResultFuture resultFuture = runner.run(ajb.toAnalysisJob());

    if (resultFuture.isErrornous()) {
      throw resultFuture.getErrors().get(0);
    }
View Full Code Here


public class PropertyWidgetFactoryTest extends TestCase {

  public void testCreateAllPropertyTypes() throws Exception {
    Injector injector = Guice.createInjector(new DCModule(DCConfiguration.get()));

    AnalysisJobBuilder ajb = injector.getInstance(AnalysisJobBuilder.class);

    AnalyzerBeanDescriptor<ManyPropertiesAnalyzer> descriptor = Descriptors.ofAnalyzer(ManyPropertiesAnalyzer.class);

    assertEquals(24, descriptor.getConfiguredProperties().size());

    AbstractBeanJobBuilder<?, ?, ?> beanJobBuilder = ajb.addRowProcessingAnalyzer(descriptor);

    PropertyWidgetFactory propertyWidgetFactory = injector.getInstance(InjectorBuilder.class)
        .with(PropertyWidgetFactory.TYPELITERAL_BEAN_JOB_BUILDER, beanJobBuilder).createInjector()
        .getInstance(PropertyWidgetFactory.class);
    assertNotNull(propertyWidgetFactory);
View Full Code Here

  public static void main(String[] args) {
    LookAndFeelManager.getInstance().init();

    // run a small job
    AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(), "conf.xml"));
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);
    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    DataContextProvider dcp = ds.getDataContextProvider();
    Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.CUSTOMERS");
    ajb.setDatastore(ds);
    ajb.addSourceColumns(table.getNumberColumns());
    ajb.addRowProcessingAnalyzer(NumberAnalyzer.class).addInputColumns(ajb.getSourceColumns());

    Injector injector = Guice.createInjector(new DCModule(conf) {
      @Override
      public AnalysisJobBuilder getAnalysisJobBuilder() {
        return ajb;
View Full Code Here

          Map<String, String> variableOverrides = new HashMap<String, String>();
          for (Entry<String, JXTextField> entry : _variableTextFields.entrySet()) {
            variableOverrides.put(entry.getKey(), entry.getValue().getText());
          }

          AnalysisJobBuilder ajb = reader.create(new BufferedInputStream(new FileInputStream(_file)),
              sourceColumnMapping, variableOverrides);
         
          OpenAnalysisJobActionListener openAnalysisJobActionListener = _openAnalysisJobActionListenerProvider.get();
          openAnalysisJobActionListener.openJob(_file, ajb);
         
View Full Code Here

    _runAnalysisActionProvider = runAnalysisActionProvider;
    _saveAnalysisJobActionListenerProvider = saveAnalysisJobActionListenerProvider;
    _userPreferences = userPreferences;

    if (analysisJobBuilder == null) {
      _analysisJobBuilder = new AnalysisJobBuilder(_configuration);
    } else {
      _analysisJobBuilder = analysisJobBuilder;
      DataContextProvider dcp = _analysisJobBuilder.getDataContextProvider();
      if (dcp != null) {
        _datastore = dcp.getDatastore();
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.job.builder.AnalysisJobBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.