当前位置: 首页>>代码示例>>Java>>正文


Java MetaStoreFactory.getElementNames方法代码示例

本文整理汇总了Java中org.pentaho.metastore.persist.MetaStoreFactory.getElementNames方法的典型用法代码示例。如果您正苦于以下问题:Java MetaStoreFactory.getElementNames方法的具体用法?Java MetaStoreFactory.getElementNames怎么用?Java MetaStoreFactory.getElementNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.metastore.persist.MetaStoreFactory的用法示例。


在下文中一共展示了MetaStoreFactory.getElementNames方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openRepo

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void openRepo() {
  MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();

  try {
    List<String> names = repoFactory.getElementNames();
    Collections.sort( names );
    EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to open..." );
    String name = esd.open();

    if ( name == null ) {
      return;
    }
    GitRepository repo = repoFactory.loadElement( name );
    gitController.openGit( repo );
  } catch ( Exception e ) {
    e.printStackTrace();
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:19,代码来源:GitSpoonMenuController.java

示例2: editRepo

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void editRepo() throws MetaStoreException {
  MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();

  List<String> names = repoFactory.getElementNames();
  Collections.sort( names );
  EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to edit..." );
  String name = esd.open();

  if ( name == null ) {
    return;
  }
  GitRepository repo = repoFactory.loadElement( name );
  EditRepositoryDialog dialog = new EditRepositoryDialog( getShell(), repo );
  if ( dialog.open() == Window.OK ) {
    repoFactory.saveElement( repo );
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:18,代码来源:GitSpoonMenuController.java

示例3: getData

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
private void getData() {
  
  try {
    MetaStoreFactory<StreamingService> factory = new MetaStoreFactory<StreamingService>(StreamingService.class, metaStore, PentahoDefaults.NAMESPACE);
    List<String> names = factory.getElementNames();
    Collections.sort(names);
    wServiceName.setItems(names.toArray(new String[names.size()]));
  } catch(MetaStoreException e) {
    LogChannel.GENERAL.logError("Error reading streaming service names from the metastore", e);
  }
  
  wServiceName.setText( Const.NVL(input.getServiceName(), ""));
  wIdField.setText(Const.NVL(input.getIdField(), ""));
  wTimeStampField.setText(Const.NVL(input.getTimestampField(), ""));
  
  String[] slaves = transMeta.getSlaveServerNames();
  Arrays.sort(slaves);
  wSlaveServer.setItems(slaves);
  wSlaveServer.setText(Const.NVL(input.getSlaveServer(), ""));
  
  wStepname.selectAll();
  wStepname.setFocus();
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:24,代码来源:GetStreamingCacheDialog.java

示例4: removeDataSetGroup

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void removeDataSetGroup() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
    
    try {

      List<String> groupNames = groupFactory.getElementNames();
      Collections.sort( groupNames );
      EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), groupNames.toArray( new String[groupNames.size()] ), "Select the group", "Select the group to edit..." );
      String groupName = esd.open();
      if ( groupName != null ) {
        
        // TODO: Find the unit tests for this group, if there are any, we can't remove the group
        //
        groupFactory.deleteElement(groupName);
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups or deleting a group", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:24,代码来源:DataSetHelper.java

示例5: removeRepo

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void removeRepo() throws MetaStoreException {
  MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();

  List<String> names = repoFactory.getElementNames();
  Collections.sort( names );
  EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to remove..." );
  String name = esd.open();

  if ( name != null ) {
    repoFactory.deleteElement( name );
    showMessageBox( "Success", "Success" );
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:14,代码来源:GitSpoonMenuController.java

示例6: getServiceElementNames

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
private String[] getServiceElementNames( Shell shell, IMetaStore metaStore ) {
  try {
    MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
    List<String> list = rtFactory.getElementNames();
    String[] names = list.toArray( new String[list.size()] );
    Arrays.sort( names );
    return names;
  } catch ( Exception e ) {
    e.printStackTrace();
    new ErrorDialog( shell, "Error", "Error getting list of streaming services", e );
    return new String[] {};
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:14,代码来源:StreamingTransDialogTab.java

示例7: editDataSetGroup

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void editDataSetGroup() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
    try {

      List<String> groupNames = groupFactory.getElementNames();
      Collections.sort( groupNames );
      EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), groupNames.toArray( new String[groupNames.size()] ), "Select the group", "Select the group to edit..." );
      String groupName = esd.open();
      if ( groupName != null ) {
        List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
        groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
        DataSetGroup dataSetGroup = groupFactory.loadElement( groupName );

        DataSetGroupDialog groupDialog = new DataSetGroupDialog( spoon.getShell(), dataSetGroup, databases );
        while ( groupDialog.open() ) {
          String message = validateDataSetGroup( dataSetGroup, groupName, groupFactory.getElementNames() );

          // Save the group ...
          //
          if ( message == null ) {
            groupFactory.saveElement( dataSetGroup );
            break;
          } else {
            MessageBox box = new MessageBox( spoon.getShell(), SWT.OK );
            box.setText( "Error" );
            box.setMessage( message );
            box.open();
          }
        }
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:39,代码来源:DataSetHelper.java

示例8: editDataSet

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void editDataSet() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
    IMetaStore metaStore = spoon.getMetaStore();

    try {
      MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
      List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
      groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
      List<DataSetGroup> groups = groupFactory.getElements();

      MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
      setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );

      List<String> setNames = setFactory.getElementNames();
      Collections.sort( setNames );
      EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), setNames.toArray( new String[setNames.size()] ), "Select the set", "Select the data set to edit..." );
      String setName = esd.open();
      if ( setName != null ) {
        DataSet dataSet = setFactory.loadElement( setName );

        editDataSet( spoon, dataSet, groups, setFactory, setName );
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:28,代码来源:DataSetHelper.java

示例9: selectUnitTest

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
public void selectUnitTest() {
  
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  try {
    TransGraph transGraph = spoon.getActiveTransGraph();
    IMetaStore metaStore = spoon.getMetaStore();
    if ( transGraph == null ) {
      return;
    }
    TransMeta transMeta = spoon.getActiveTransformation();
    if ( transMeta == null ) {
      return;
    }

    MetaStoreFactory<TransUnitTest> testFactory = new MetaStoreFactory<TransUnitTest>( TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE);
    List<String> testNames = testFactory.getElementNames();
    String[] names = testNames.toArray( new String[testNames.size()] );
    Arrays.sort( names );
    EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), names, "Select a unit test", "Select the unit test to use" );
    String testName = esd.open();
    if ( testName != null ) {
      
      TransUnitTest unitTest = testFactory.loadElement( testName );
      if (unitTest==null) {
        throw new KettleException( "Unit test '"+testName+"' could not be found (deleted)?" );
      }

      selectUnitTest(transMeta, unitTest);
      Spoon.getInstance().refreshGraph();
    }
  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error selecting a new transformation unit test", e );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:35,代码来源:DataSetHelper.java

示例10: refreshGroups

import org.pentaho.metastore.persist.MetaStoreFactory; //导入方法依赖的package包/类
private void refreshGroups(IMetaStore metaStore) throws MetaStoreException {
  
  MetaStoreFactory<DataSetGroup> factory = new MetaStoreFactory<DataSetGroup>(DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE);
  factory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
  
  groups = factory.getElements();
  
  List<String> names = factory.getElementNames();
  Collections.sort(names);
  wDataSetGroup.setItems(names.toArray(new String[names.size()]));      

}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:13,代码来源:DataSetDialog.java


注:本文中的org.pentaho.metastore.persist.MetaStoreFactory.getElementNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。