Package org.eobjects.analyzer.job.builder

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


   * @param configuration
   */
  public void openFile(File file) {
    JaxbJobReader reader = new JaxbJobReader(_configuration);
    try {
      AnalysisJobBuilder ajb = reader.create(file);

      openJob(file, ajb);
    } catch (NoSuchDatastoreException e) {
      AnalysisJobMetadata metadata = reader.readMetadata(file);
      int result = JOptionPane.showConfirmDialog(null, e.getMessage()
View Full Code Here


    _injectorBuilder = injectorBuilder;
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(_configuration);
    ajb.setDatastore(_datastore);
    ajb.addSourceColumns(_table.getColumns());

    final RowProcessingAnalyzerJobBuilder<ExcelOutputAnalyzer> excelOutputAnalyzerBuilder = ajb
        .addRowProcessingAnalyzer(ExcelOutputAnalyzer.class);
    excelOutputAnalyzerBuilder.addInputColumns(ajb.getSourceColumns());
    File directory = _userPreferences.getConfiguredFileDirectory();
    excelOutputAnalyzerBuilder.getConfigurableBean().setFile(new File(directory, _datastore.getName() + ".xlsx"));
    excelOutputAnalyzerBuilder.getConfigurableBean().setSheetName(_table.getName());

    final PropertyWidgetFactory propertyWidgetFactory = _injectorBuilder.with(
View Full Code Here

  }

  @Override
  public void actionPerformed(ActionEvent e) {
    final AnalyzerBeansConfiguration configuration = DCConfiguration.get();
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(configuration);
    ajb.setDatastore(_datastore);
    ajb.addSourceColumns(_table.getColumns());

    final RowProcessingAnalyzerJobBuilder<CsvOutputAnalyzer> csvOutputAnalyzerBuilder = ajb
        .addRowProcessingAnalyzer(CsvOutputAnalyzer.class);
    csvOutputAnalyzerBuilder.addInputColumns(ajb.getSourceColumns());
    File directory = _userPreferences.getConfiguredFileDirectory();
    csvOutputAnalyzerBuilder.getConfigurableBean().setFile(new File(directory, _table.getName() + ".csv"));

    final PropertyWidgetFactory propertyWidgetFactory = _injectorBuilder.with(
        PropertyWidgetFactory.TYPELITERAL_BEAN_JOB_BUILDER, csvOutputAnalyzerBuilder).getInstance(
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent event) {
    final AnalyzerBeansConfiguration configuration = DCConfiguration.get();

    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(configuration);
    ajb.setDatastore(_datastore);

    final List<InputColumn<?>> booleanColumns = new ArrayList<InputColumn<?>>();
    final List<InputColumn<?>> stringColumns = new ArrayList<InputColumn<?>>();
    final List<InputColumn<?>> numberColumns = new ArrayList<InputColumn<?>>();
    final List<InputColumn<?>> dateTimeColumns = new ArrayList<InputColumn<?>>();

    for (Column column : getColumns()) {
      ajb.addSourceColumn(column);
      InputColumn<?> inputColumn = ajb.getSourceColumnByName(column.getName());
      DataTypeFamily dataTypeFamily = inputColumn.getDataTypeFamily();
      switch (dataTypeFamily) {
      case BOOLEAN:
        booleanColumns.add(inputColumn);
        break;
      case NUMBER:
        numberColumns.add(inputColumn);
        break;
      case DATE:
        dateTimeColumns.add(inputColumn);
        break;
      case STRING:
        stringColumns.add(inputColumn);
        break;
      }
    }

    if (!booleanColumns.isEmpty()) {
      // boolean analyzer contains combination matrices, so all columns
      // are added to a single analyzer job.
      ajb.addRowProcessingAnalyzer(BooleanAnalyzer.class).addInputColumns(booleanColumns);
    }
    if (!numberColumns.isEmpty()) {
      createAnalyzers(ajb, NumberAnalyzer.class, numberColumns);
    }
    if (!dateTimeColumns.isEmpty()) {
      createAnalyzers(ajb, DateAndTimeAnalyzer.class, dateTimeColumns);
    }
    if (!stringColumns.isEmpty()) {
      createAnalyzers(ajb, StringAnalyzer.class, stringColumns);
    }

    try {
      if (!ajb.isConfigured(true)) {
        throw new IllegalStateException("Unknown job configuration issue!");
      }

      Injector injector = Guice.createInjector(new DCModule(_parentModule, ajb));
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();

    AnalyzerBeansConfiguration configuration = DCConfiguration.get();
    analysisJobBuilder = new AnalysisJobBuilder(configuration);
    analysisJobBuilder.setDatastore("orderdb");
    analysisJobBuilder.addSourceColumns("PUBLIC.EMPLOYEES.EMAIL");
    emailTransformerBuilder = analysisJobBuilder.addTransformer(EmailStandardizerTransformer.class);
    emailTransformerBuilder.addInputColumn(analysisJobBuilder.getSourceColumnByName("EMAIL"));
  }
View Full Code Here

   *            new AnalysisJobBuilder should be created.
   */
  public DCModule(DCModule parent, AnalysisJobBuilder analysisJobBuilder) {
    _configuration = parent._configuration;
    if (analysisJobBuilder == null) {
      _analysisJobBuilder = new AnalysisJobBuilder(_configuration);
    } else {
      _analysisJobBuilder = analysisJobBuilder;
    }
    _windowContext = parent._windowContext;
    _userPreferences = parent._userPreferences;
View Full Code Here

    } else {
      _windowContext = ImmutableRef.of(windowContext);
    }

    if (analysisJobBuilder == null) {
      _analysisJobBuilder = new AnalysisJobBuilder(_configuration);
    } else {
      _analysisJobBuilder = analysisJobBuilder;
    }
  }
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();
    SchemaNavigator sn = dcp.getSchemaNavigator();
    ajb.setDatastore(ds);
    ajb.addSourceColumns(sn.convertToTable("PUBLIC.TRIAL_BALANCE").getColumns());
    ajb.addRowProcessingAnalyzer(ValueDistributionAnalyzer.class).addInputColumns(ajb.getSourceColumns());

    ajb.addSourceColumns(sn.convertToTable("PUBLIC.CUSTOMERS").getColumns());
    RowProcessingAnalyzerJobBuilder<ValueDistributionAnalyzer> groupedValueDist = ajb
        .addRowProcessingAnalyzer(ValueDistributionAnalyzer.class);
    groupedValueDist.addInputColumn(ajb.getSourceColumnByName("PUBLIC.CUSTOMERS.CITY"));
    groupedValueDist.setConfiguredProperty("Group column", ajb.getSourceColumnByName("PUBLIC.CUSTOMERS.COUNTRY"));

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

    final Set<String> categoryNames = _descriptor.getOutcomeCategoryNames();
    for (final String categoryName : categoryNames) {
      final JButton outcomeButton = new JButton(categoryName, imageManager.getImageIcon(
          "images/component-types/filter-outcome.png", IconUtils.ICON_SIZE_SMALL));
      AnalysisJobBuilder analysisJobBuilder = _filterJobBuilder.getAnalysisJobBuilder();
      outcomeButton.addActionListener(new DisplayOutputWritersForFilterOutcomeActionListener(_filterJobBuilder
          .getAnalysisJobBuilder().getConfiguration(), analysisJobBuilder, _filterJobBuilder, categoryName));
      outcomePanel.add(outcomeButton);
    }
View Full Code Here

    LookAndFeelManager.getInstance().init();

    // run a small job
    final 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.getLiteralColumns());
    ajb.addRowProcessingAnalyzer(PatternFinderAnalyzer.class).addInputColumns(ajb.getSourceColumns())
        .setName("Ungrouped pattern finders");

    final RowProcessingAnalyzerJobBuilder<PatternFinderAnalyzer> groupedPatternFinder = ajb.addRowProcessingAnalyzer(
        PatternFinderAnalyzer.class).setName("Grouped PF");
    ajb.addSourceColumns("PUBLIC.OFFICES.CITY", "PUBLIC.OFFICES.TERRITORY");
    groupedPatternFinder.addInputColumn(ajb.getSourceColumnByName("PUBLIC.OFFICES.CITY"));
    groupedPatternFinder.addInputColumn(ajb.getSourceColumnByName("PUBLIC.OFFICES.TERRITORY"), groupedPatternFinder
        .getDescriptor().getConfiguredProperty("Group column"));

    Injector injector = Guice.createInjector(new DCModule(conf) {
      @Override
      public AnalysisJobBuilder getAnalysisJobBuilder() {
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.