本文整理汇总了Java中org.pentaho.metastore.persist.MetaStoreFactory类的典型用法代码示例。如果您正苦于以下问题:Java MetaStoreFactory类的具体用法?Java MetaStoreFactory怎么用?Java MetaStoreFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetaStoreFactory类属于org.pentaho.metastore.persist包,在下文中一共展示了MetaStoreFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: addRepo
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
public void addRepo() throws MetaStoreException, XulException {
MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
GitRepository repo = new GitRepository();
EditRepositoryDialog dialog = new EditRepositoryDialog( getShell(), repo );
if ( dialog.open() == Window.OK ) {
repoFactory.saveElement( repo );
XulConfirmBox confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );
confirmBox.setTitle( "Success" );
confirmBox.setMessage( "Open now?" );
confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );
confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) );
confirmBox.addDialogCallback( (XulDialogLambdaCallback<Object>) ( sender, returnCode, retVal ) -> {
if ( returnCode == Status.ACCEPT ) {
gitController.openGit( repo );
}
} );
confirmBox.open();
}
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:21,代码来源:GitSpoonMenuController.java
示例3: 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
示例4: removeService
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
protected boolean removeService( Shell shell, IMetaStore metaStore, String elementName ) {
MessageDialog dialog = new MessageDialog( shell, "Confirm removal", shell.getDisplay().getSystemImage( SWT.ICON_QUESTION ),
"Are you sure you want to remove streaming service '" + elementName + "'?", SWT.NONE, new String[] { "Yes", "No" }, 1 );
int answerIndex = dialog.open();
if ( answerIndex == 0 ) {
try {
MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
rtFactory.deleteElement( elementName );
return true;
} catch ( MetaStoreException e ) {
new ErrorDialog( shell, "Error", "Error deleting streaming service with name '" + elementName + "'", e );
return false;
}
}
return false;
}
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:19,代码来源:StreamingTransDialogTab.java
示例5: createNewService
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
protected String createNewService( Shell shell, IMetaStore metaStore ) {
EnterStringDialog dialog = new EnterStringDialog( shell, "table1", "Enter service name", "Enter the name of the new streaming service" );
String name = dialog.open();
if ( name != null ) {
try {
MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
if ( rtFactory.loadElement( name ) != null ) {
throw new MetaStoreException( "The streaming service with name '" + name + "' already exists" );
}
} catch ( MetaStoreException e ) {
new ErrorDialog( shell, "Error", "Error creating new streaming service", e );
return null;
}
return name;
} else {
return null;
}
}
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:21,代码来源:StreamingTransDialogTab.java
示例6: 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
示例7: editConnection
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
public static void editConnection(Shell shell, MetaStoreFactory<HCPConnection> factory, String connectionName) {
if (StringUtils.isEmpty(connectionName)) {
return;
}
try {
HCPConnection hcpConnection = factory.loadElement(connectionName);
if (hcpConnection==null) {
newConnection(shell, factory);
} else {
HCPConnectionDialog hcpConnectionDialog = new HCPConnectionDialog(shell, hcpConnection);
if (hcpConnectionDialog.open()) {
factory.saveElement(hcpConnection);
}
}
} catch(Exception exception) {
new ErrorDialog(shell,
BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorEditingConnection.Title"),
BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorEditingConnection.Message"),
exception);
}
}
开发者ID:mattcasters,项目名称:pdi-hcp-plugin,代码行数:22,代码来源:HCPConnectionUtils.java
示例8: deleteConnection
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
public static void deleteConnection(Shell shell, MetaStoreFactory<HCPConnection> factory, String connectionName) {
if (StringUtils.isEmpty(connectionName)) {
return;
}
MessageBox box = new MessageBox(shell, SWT.YES | SWT.NO | SWT.ICON_ERROR);
box.setText(BaseMessages.getString(PKG, "HCPConnectionUtils.DeleteConnectionConfirmation.Title"));
box.setMessage(BaseMessages.getString(PKG, "HCPConnectionUtils.DeleteConnectionConfirmation.Message", connectionName));
int answer = box.open();
if ((answer&SWT.YES)!=0) {
try {
factory.deleteElement(connectionName);
} catch(Exception exception) {
new ErrorDialog(shell,
BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorDeletingConnection.Title"),
BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorDeletingConnection.Message", connectionName),
exception);
}
}
}
开发者ID:mattcasters,项目名称:pdi-hcp-plugin,代码行数:22,代码来源:HCPConnectionUtils.java
示例9: editUnitTest
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
protected void editUnitTest(String unitTestName, TransMeta transMeta) {
try {
Spoon spoon = Spoon.getInstance();
MetaStoreFactory<TransUnitTest> setFactory = new MetaStoreFactory<TransUnitTest>(
TransUnitTest.class, spoon.getMetaStore(), PentahoDefaults.NAMESPACE);
TransUnitTest unitTest = setFactory.loadElement(unitTestName);
if (unitTest==null) {
throw new KettleException(BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorEditingUnitTest.Message", unitTestName));
}
TransUnitTestDialog dialog = new TransUnitTestDialog(spoon.getShell(), transMeta, spoon.getMetaStore(), unitTest);
if (dialog.open()) {
setFactory.saveElement(unitTest);
}
} catch(Exception exception) {
new ErrorDialog(Spoon.getInstance().getShell(),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorEditingUnitTest.Title"),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorEditingUnitTest.Message", unitTestName),
exception);
}
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:21,代码来源:ShowUnitTestMenuExtensionPoint.java
示例10: deleteUnitTest
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
protected void deleteUnitTest(String unitTestName) {
MessageBox box = new MessageBox(Spoon.getInstance().getShell(), SWT.YES | SWT.NO);
box.setText(BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.YouSureToDelete.Title"));
box.setMessage(BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.YouSureToDelete.Message", unitTestName));
int answer = box.open();
if ((answer&SWT.YES)!=0) {
try {
MetaStoreFactory<TransUnitTest> factory = new MetaStoreFactory<TransUnitTest>(TransUnitTest.class, Spoon.getInstance().getMetaStore(), PentahoDefaults.NAMESPACE);
factory.deleteElement(unitTestName);
DataSetHelper.getInstance().detachUnitTest();
} catch(Exception exception) {
new ErrorDialog(Spoon.getInstance().getShell(),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorDeletingUnitTest.Title"),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorDeletingUnitTest.Message", unitTestName),
exception);
}
}
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:20,代码来源:ShowUnitTestMenuExtensionPoint.java
示例11: 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
示例12: addDataSet
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
public void addDataSet() {
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 );
DataSet dataSet = new DataSet();
editDataSet( spoon, dataSet, groups, setFactory, null );
} catch ( Exception e ) {
new ErrorDialog( spoon.getShell(), "Error", "Error creating a new data set", e );
}
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:24,代码来源:DataSetHelper.java
示例13: editDataSet
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
private void editDataSet( Spoon spoon, DataSet dataSet, List<DataSetGroup> groups, MetaStoreFactory<DataSet> setFactory, String setName ) throws MetaStoreException {
try {
DataSetDialog setDialog = new DataSetDialog( spoon.getShell(), setFactory.getMetaStore(), dataSet, groups, getAvailableDatabases(spoon.getRepository()) );
while ( setDialog.open() ) {
String message = validateDataSet( dataSet, setName, setFactory.getElementNames() );
// Save the data set...
//
if ( message == null ) {
setFactory.saveElement( dataSet );
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", "Unable to edit data set", e);
}
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:25,代码来源:DataSetHelper.java
示例14: FactoriesHierarchy
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
public FactoriesHierarchy( IMetaStore metaStore, List<DatabaseMeta> databases ) throws MetaStoreException {
this.metaStore = metaStore;
this.databases = databases;
groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
List<DataSetGroup> groups = groupFactory.getElements();
setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );
List<DataSet> sets = setFactory.getElements();
setFactory.addNameFactory( DataSetConst.GROUP_LIST_KEY, groupFactory );
testFactory = new MetaStoreFactory<TransUnitTest>( TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE );
testFactory.addNameList( DataSetConst.SET_LIST_KEY, sets );
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:18,代码来源:FactoriesHierarchy.java
示例15: testSerialisation
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
public void testSerialisation() throws Exception {
DataSetGroup group = new DataSetGroup( NAME, DESC, databaseMeta, SCHEMA );
MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, NAMESPACE );
// save the group
//
groupFactory.saveElement( group );
// Load the element
//
groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, Arrays.asList( databaseMeta ) );
DataSetGroup verify = groupFactory.loadElement( NAME );
// Verify loading...
//
assertNotNull( verify );
assertEquals( group.getName(), verify.getName() );
assertEquals( group.getDescription(), verify.getDescription() );
assertNotNull( verify.getDatabaseMeta() );
assertEquals( group.getDatabaseMeta(), verify.getDatabaseMeta() );
assertEquals( group.getSchemaName(), verify.getSchemaName() );
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:24,代码来源:DataSetGroupTest.java
示例16: setUp
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
@Before
public void setUp() {
mockLog = mock( LogChannelInterface.class );
mockMeta = mock( AbstractMeta.class );
mockMetaStoreFactory = mock( MetaStoreFactory.class );
NamedClusterEmbedManager.testMetaStoreFactory = mockMetaStoreFactory;
IMetaStore mockMetaStore = mock( IMetaStore.class );
mockNamedCluster1 = mock( NamedClusterOsgi.class );
mockNamedCluster2 = mock( NamedClusterOsgi.class );
when( mockNamedCluster1.getName() ).thenReturn( CLUSTER1_NAME );
when( mockNamedCluster2.getName() ).thenReturn( CLUSTER2_NAME );
mockNamedClusterService = mock( NamedClusterServiceOsgi.class );
when( mockMeta.getNamedClusterServiceOsgi() ).thenReturn( mockNamedClusterService );
when( mockMeta.getMetaStore() ).thenReturn( mockMetaStore );
when( mockNamedClusterService.getClusterTemplate() ).thenReturn( mock( NamedClusterOsgi.class ) );
when( mockNamedClusterService.getNamedClusterByName( eq( CLUSTER1_NAME ), any() ) ).thenReturn( mockNamedCluster1 );
when( mockNamedClusterService.getNamedClusterByName( eq( CLUSTER2_NAME ), any() ) ).thenReturn( mockNamedCluster2 );
namedClusterEmbedManager = new NamedClusterEmbedManager( mockMeta, mockLog );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:21,代码来源:NamedClusterEmbedManagerTest.java
示例17: 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
示例18: saveRepository
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
@VisibleForTesting
void saveRepository( GitRepository repo ) {
MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
try {
repoFactory.saveElement( repo );
} catch ( MetaStoreException e ) {
e.printStackTrace();
}
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:10,代码来源:GitSpoonMenuController.java
示例19: testSerialisation
import org.pentaho.metastore.persist.MetaStoreFactory; //导入依赖的package包/类
@Test
public void testSerialisation() throws MetaStoreException {
MetaStoreFactory<GitRepository> repoFactory = new MetaStoreFactory<GitRepository>( GitRepository.class, metaStore, NAMESPACE );
repoFactory.saveElement( repo );
GitRepository verify = repoFactory.loadElement( NAME );
assertEquals( NAME, verify.getName() );
assertEquals( DESCRIPTION, verify.getDescription() );
assertEquals( DIRECTORY, verify.getDirectory() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitRepositoryTest.java
示例20: 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
注:本文中的org.pentaho.metastore.persist.MetaStoreFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论