org.pentaho.di.repository.Repository.renameRepositoryDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中org.pentaho.di.repository.Repository.renameRepositoryDirectory方法的一些代码示例,展示了Repository.renameRepositoryDirectory的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.renameRepositoryDirectory方法的具体详情如下:
包路径:org.pentaho.di.repository.Repository
类名称:Repository
方法名:renameRepositoryDirectory

Repository.renameRepositoryDirectory介绍

[英]Move / rename a repository directory
[中]

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public ObjectId renameRepositoryDirectory( ObjectId objectId, RepositoryDirectoryInterface repositoryDirectoryInterface, String s ) throws KettleException {
 return getDelegate().renameRepositoryDirectory( objectId, repositoryDirectoryInterface, s );
}

代码示例来源:origin: pentaho/pentaho-kettle

public void setName( String name ) throws Exception {
 if ( getDirectory().getName().equalsIgnoreCase( name ) ) {
  return;
 }
 rep.renameRepositoryDirectory( getDirectory().getObjectId(), null, name );
 // Update the object reference so the new name is displayed
 obj = rep.findDirectory( getObjectId() );
 getParent().refresh();
}

代码示例来源:origin: pentaho/pentaho-kettle

public void setName( String name, boolean renameHomeDirectories ) throws Exception {
 if ( getDirectory().getName().equalsIgnoreCase( name ) ) {
  return;
 }
 if ( rep instanceof RepositoryExtended ) {
  ( (RepositoryExtended) rep ).renameRepositoryDirectory( getDirectory().getObjectId(), null, name,
    renameHomeDirectories );
 } else {
  rep.renameRepositoryDirectory( getDirectory().getObjectId(), null, name );
 }
 // Update the object reference so the new name is displayed
 obj = rep.getObjectInformation( getObjectId(), getRepositoryElementType() );
 refresh();
}

代码示例来源:origin: pentaho/pentaho-kettle

public boolean renameDirectory( RepositoryDirectoryInterface repdir, String name, String newname ) {
 boolean retval = false;
 try {
  if ( Utils.isEmpty( newname ) ) {
   throw new KettleException( BaseMessages.getString(
    PKG, "RepositoryExplorerDialog.Exception.NameCanNotBeEmpty" ) );
  }
  if ( !name.equals( newname ) ) {
   repdir.setName( newname );
   try {
    rep.renameRepositoryDirectory( repdir.getObjectId(), repdir, newname );
    retval = true;
   } catch ( Exception exception ) {
    retval = false;
    new ErrorDialog(
     shell,
     BaseMessages.getString( PKG, "RepositoryExplorerDialog.Directory.Rename.UnexpectedError.Message1" )
      + name + "]" + Const.CR
      + BaseMessages.getString( PKG, "RepositoryExplorerDialog.Directory.Rename.UnexpectedError.Message2" ),
     BaseMessages.getString( PKG, "RepositoryExplorerDialog.Directory.Rename.UnexpectedError.Title" ),
     exception );
   }
  }
 } catch ( KettleException e ) {
  new ErrorDialog( shell,
   BaseMessages.getString( PKG, "RepositoryExplorerDialog.Directory.Rename.UnexpectedError.Title" ),
   BaseMessages.getString( PKG, "RepositoryExplorerDialog.Directory.Rename.UnexpectedError.Message" ), e );
 }
 return retval;
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void move( UIRepositoryDirectory newParentDir ) throws Exception {
 if ( newParentDir != null ) {
  rep.renameRepositoryDirectory( obj.getObjectId(), newParentDir.getDirectory(), null );
  // Try to make sure the directories are updated properly
  if ( !newParentDir.equals( getParent() ) ) {
   getParent().getChildren().remove( this );
   newParentDir.getChildren().add( this );
   getParent().refresh();
   newParentDir.refresh();
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

dir.setName( newName );
try {
 rep.renameRepositoryDirectory( dir.getObjectId(), dir.getParent(), newName );
 ti.setText( newName );
 wTree.setSelection( ti );

代码示例来源:origin: pentaho/pentaho-kettle

( (RepositoryExtended) getRepository() ).renameRepositoryDirectory( () -> id, null, newName, true );
} else {
 objectId = getRepository().renameRepositoryDirectory( () -> id, null, newName );

相关文章

Repository类方法