Package org.eobjects.analyzer.connection

Examples of org.eobjects.analyzer.connection.DataContextProvider


          if (datastorePanel.isSelected()) {
            Datastore datastore = datastorePanel.getDatastore();

            // open the connection here, to make any connection
            // issues apparent early
            DataContextProvider dataContextProvider = datastore.getDataContextProvider();
            dataContextProvider.getDataContext().getSchemaNames();
            _analysisJobBuilderWindow.setDatastore(datastore);
            dataContextProvider.close();
            return;
          }
          i++;
        }
      }
View Full Code Here


    // 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) {
View Full Code Here

          imageManager.getImageIcon("images/actions/preview_data.png"));
      previewButton.setMargin(buttonMargin);
      previewButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          final DataContextProvider dcp = datastore.getDataContextProvider();
          final Table previewTable = result.getPreviewTable(datastore);
          if (previewTable == null) {
            throw new IllegalStateException("Result did not return any preview table: " + result);
          } else {
            final PreviewSourceDataActionListener actionListener = new PreviewSourceDataActionListener(
View Full Code Here

      _nameTextField.setText(synonymCatalog.getName());
      _datastoreComboBox.setSelectedItem(datastoreName);

      Datastore datastore = _datastoreCatalog.getDatastore(datastoreName);
      if (datastore != null) {
        DataContextProvider dataContextProvider = datastore.getDataContextProvider();
        try {
          SchemaNavigator sn = dataContextProvider.getSchemaNavigator();

          Column masterTermColumn = sn.convertToColumn(synonymCatalog.getMasterTermColumnPath());
          _masterTermColumnComboBox.setSelectedItem(masterTermColumn);

          String[] synonymColumnPaths = synonymCatalog.getSynonymColumnPaths();
          Column[] synonymColumns = sn.convertToColumns(synonymColumnPaths);
          _synonymColumnsPanel.setColumns(Arrays.asList(synonymColumns));
        } finally {
          dataContextProvider.close();
        }
      }

    }
  }
View Full Code Here

    if (!isPreviewDataAvailable()) {
      logger.info("Not displaying preview table because isPreviewDataAvailable() returned false");
      return null;
    }
    D datastore = getPreviewDatastore(filename);
    DataContextProvider dcp = datastore.getDataContextProvider();
    DataContext dc = dcp.getDataContext();
    Table table = getPreviewTable(dc);
    Column[] columns = table.getColumns();
    if (columns.length > getPreviewColumns()) {
      // include max 10 columns
      columns = Arrays.copyOf(columns, getPreviewColumns());
    }
    Query q = dc.query().from(table).select(columns).toQuery();
    q.setMaxRows(7);

    DataSet dataSet = dc.executeQuery(q);

    dcp.close();

    return dataSet;
  }
View Full Code Here

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

    _datastoreSelectionEnabled = true;
    _componentJobBuilderPresenterRendererFactory = new RendererFactory(_configuration.getDescriptorProvider(),
View Full Code Here

   * @param expandTree
   *            true if the datastore tree should be initially expanded.
   */
  @Override
  public void setDatastore(final Datastore datastore, boolean expandTree) {
    final DataContextProvider dcp;
    if (datastore == null) {
      dcp = null;
    } else {
      dcp = datastore.getDataContextProvider();
    }
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.connection.DataContextProvider

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.