Package org.eobjects.analyzer.configuration

Examples of org.eobjects.analyzer.configuration.AnalyzerBeansConfiguration


  private static final Logger logger = LoggerFactory.getLogger(DatastoreCreationDelegateImpl.class);

  @Override
  public void createDatastore(Datastore datastore) {
    final AnalyzerBeansConfiguration configuration = DCConfiguration.get();
    final MutableDatastoreCatalog datastoreCatalog = (MutableDatastoreCatalog) configuration.getDatastoreCatalog();
    final String name = datastore.getName();
    synchronized (datastoreCatalog) {
      if (datastoreCatalog.containsDatastore(name)) {
        logger.warn("Datastore '{}' already exists. No new datastore will be created!", name);
      } else {
View Full Code Here


    _injectorBuilder = injectorBuilder;
  }

  @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
View Full Code Here

    return _table;
  }

  @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<?>>();
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

   */
  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());
View Full Code Here

   */
  public static void main(String[] args) {
    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())
View Full Code Here

   */
  public static void main(String[] args) throws Throwable {
    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);
    }

    List<AnalyzerResult> list = Collections.emptyList();
    RendererFactory rendererFactory = new RendererFactory(conf.getDescriptorProvider(), null);
    DetailsResultWindow window = new DetailsResultWindow("Example", list, new DCWindowContext(conf,
        UserPreferences.getInstance()), rendererFactory);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    List<AnalyzerResult> results = resultFuture.getResults();
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());
View Full Code Here

        return;
      }
    }

    // configuration loading can be multithreaded, so begin early
    final AnalyzerBeansConfiguration configuration = loadConfiguration();

    if (!cliMode) {
      // set up error handling that displays an error dialog
      final DCUncaughtExceptionHandler exceptionHandler = new DCUncaughtExceptionHandler();
      Thread.setDefaultUncaughtExceptionHandler(exceptionHandler);

      // init the look and feel
      LookAndFeelManager.getInstance().init();
    }

    // log usage
    UsageLogger.getInstance().logApplicationStartup();

    if (cliMode) {

      final PrintWriter out = new PrintWriter(System.out);
      // run in CLI mode

      CliArguments arguments = _options.getCommandLineArguments();

      final CliRunner runner = new CliRunner(arguments, out);
      runner.run(configuration);
      out.flush();

      exitCommandLine(configuration, 0);
      return;
    } else {
      // run in GUI mode

      final Injector injector = Guice.createInjector(new DCModule(configuration));

      final AnalysisJobBuilderWindow analysisJobBuilderWindow = injector.getInstance(AnalysisJobBuilderWindow.class);

      if (_options.isSingleDatastoreMode()) {
        DatastoreCatalog datastoreCatalog = configuration.getDatastoreCatalog();
        Datastore singleDatastore = _options.getSingleDatastore(datastoreCatalog);
        if (singleDatastore == null) {
          logger.info("Single datastore mode was enabled, but datastore was null!");
        } else {
          logger.info("Initializing single datastore mode with {}", singleDatastore);
        }
        analysisJobBuilderWindow.setDatastoreSelectionEnabled(false);
        analysisJobBuilderWindow.setDatastore(singleDatastore, true);
      }
      analysisJobBuilderWindow.open();

      final UserPreferences userPreferences = injector.getInstance(UserPreferences.class);
      final WindowContext windowContext = injector.getInstance(WindowContext.class);

      // set up HTTP service for ExtensionSwap installation
      loadExtensionSwapService(userPreferences, windowContext);

      // load regex swap regexes if logged in
      final RegexSwapUserPreferencesHandler regexSwapHandler = new RegexSwapUserPreferencesHandler(
          (MutableReferenceDataCatalog) configuration.getReferenceDataCatalog());
      userPreferences.addLoginChangeListener(regexSwapHandler);

      final ExitActionListener exitActionListener = _options.getExitActionListener();
      if (exitActionListener != null) {
        windowContext.addExitActionListener(exitActionListener);
View Full Code Here

      });
    }
  }

  private AnalyzerBeansConfiguration loadConfiguration() {
    AnalyzerBeansConfiguration configuration = DCConfiguration.get();
    return configuration;
  }
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.configuration.AnalyzerBeansConfiguration

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.