本文整理汇总了Java中org.pentaho.di.repository.RepositoryElementMetaInterface类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryElementMetaInterface类的具体用法?Java RepositoryElementMetaInterface怎么用?Java RepositoryElementMetaInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryElementMetaInterface类属于org.pentaho.di.repository包,在下文中一共展示了RepositoryElementMetaInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RepositoryExplorerDialog
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
private RepositoryExplorerDialog(Shell par, int style, Repository rep, VariableSpace variableSpace)
{
super(par, style);
this.props=PropsUI.getInstance();
this.rep=rep;
this.log=rep.getLog();
this.variableSpace = variableSpace;
sortColumn = 0;
ascending = false;
objectMap = new HashMap<String, RepositoryElementMetaInterface>();
repositoryMeta = rep.getRepositoryMeta();
capabilities = repositoryMeta.getRepositoryCapabilities();
securityProvider = rep.getSecurityProvider();
securityManager = rep.getSecurityManager();
readonly = securityProvider.isReadOnly();
includeDeleted = false;
}
示例2: restoreSelectedObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public boolean restoreSelectedObjects()
{
TreeItem items[] = wTree.getSelection();
boolean error = false;
for (int i=0;i<items.length;i++)
{
final RepositoryElementMetaInterface repositoryObject = objectMap.get(ConstUI.getTreePath(items[i], 0));
if (repositoryObject!=null) {
try {
rep.undeleteObject(repositoryObject);
} catch(Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRestoring.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRestoring.Message"), e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
error=true;
}
}
}
refreshTree();
return !error;
}
示例3: fillRepositoryDirectoryFromTree
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
private void fillRepositoryDirectoryFromTree( final RepositoryDirectoryInterface parentDir,
final RepositoryFileTree treeNode ) throws KettleException {
try {
List<RepositoryElementMetaInterface> fileChildren = new ArrayList<RepositoryElementMetaInterface>();
List<RepositoryFileTree> children = treeNode.getChildren();
if ( children != null ) {
for ( RepositoryFileTree child : children ) {
if ( child.getFile().isFolder() ) {
RepositoryDirectory dir = new RepositoryDirectory( parentDir, child.getFile().getName() );
dir.setObjectId( new StringObjectId( child.getFile().getId().toString() ) );
parentDir.addSubdirectory( dir );
fillRepositoryDirectoryFromTree( dir, child );
} else {
// a real file, like a Transformation or Job
RepositoryLock lock = unifiedRepositoryLockService.getLock( child.getFile() );
RepositoryObjectType objectType = getObjectType( child.getFile().getName() );
fileChildren.add( new EERepositoryObject( child, parentDir, null, objectType, null, lock, false ) );
}
}
parentDir.setRepositoryObjects( fileChildren );
}
} catch ( Exception e ) {
throw new KettleException( "Unable to load directory structure from repository", e );
}
}
示例4: UIEETransformation
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public UIEETransformation( RepositoryElementMetaInterface rc, UIRepositoryDirectory parent, Repository rep ) {
super( rc, parent, rep );
if ( !( rc instanceof EERepositoryObject ) ) {
throw new IllegalArgumentException();
}
repObj = (EERepositoryObject) rc;
try {
if ( rep.hasService( ILockService.class ) ) {
lockService = (ILockService) rep.getService( ILockService.class );
} else {
throw new IllegalStateException();
}
if ( rep.hasService( IRevisionService.class ) ) {
revisionService = (IRevisionService) rep.getService( IRevisionService.class );
} else {
throw new IllegalStateException();
}
if ( rep.hasService( IAclService.class ) ) {
aclService = (IAclService) rep.getService( IAclService.class );
} else {
throw new IllegalStateException();
}
} catch ( KettleException e ) {
throw new RuntimeException( e );
}
}
示例5: loadFiles
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public List<RepositoryFile> loadFiles( String id ) {
try {
List<RepositoryElementMetaInterface> repositoryElementMetaInterfaces =
getRepository().getJobAndTransformationObjects( () -> id, false );
List<RepositoryFile> repositoryFiles = new ArrayList<>();
for ( RepositoryObjectInterface repositoryObject : repositoryElementMetaInterfaces ) {
org.pentaho.di.repository.RepositoryObject ro = (org.pentaho.di.repository.RepositoryObject) repositoryObject;
RepositoryFile repositoryFile = new RepositoryFile();
repositoryFile.setObjectId( repositoryObject.getObjectId() );
repositoryFile.setName( repositoryObject.getName() );
repositoryFile.setType( ro.getObjectType().getTypeDescription() );
repositoryFile.setExtension( ro.getObjectType().getExtension() );
repositoryFile.setDate( ro.getModifiedDate() );
repositoryFile.setObjectId( ro.getObjectId() );
repositoryFile.setPath( ro.getRepositoryDirectory().getPath() );
repositoryFiles.add( repositoryFile );
}
return repositoryFiles;
} catch ( KettleException ke ) {
return Collections.emptyList();
}
}
示例6: testGetRepositoryObjectsFilled
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
@Test
public void testGetRepositoryObjectsFilled() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
root.setObjectId( new LongObjectId( 0L ) );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );
root.setRepositoryObjects( Collections.emptyList() );
dir.setRepositoryObjects( Collections.singletonList( meta ) );
Repository repo = mock( Repository.class );
UIRepositoryDirectory uiDir = new UIRepositoryDirectory( root, null, repo );
UIRepositoryObjects objects = uiDir.getRepositoryObjects();
assertNotNull( objects );
uiDir = new UIRepositoryDirectory( dir, uiDir, repo );
objects = uiDir.getRepositoryObjects();
assertEquals( 1, objects.size() );
verifyZeroInteractions( repo );
}
示例7: testLoadRepositoryObjectsFilled
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
@Test
public void testLoadRepositoryObjectsFilled() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
root.setObjectId( new LongObjectId( 0L ) );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );
root.setRepositoryObjects( Collections.emptyList() );
dir.setRepositoryObjects( Collections.singletonList( meta ) );
Repository repo = mock( Repository.class );
assertTrue( RepositoryDirectoryUI.loadRepositoryObjects( root, true, true, repo ).isEmpty() );
assertEquals( 1, RepositoryDirectoryUI.loadRepositoryObjects( dir, true, true, repo ).size() );
verifyZeroInteractions( repo );
}
示例8: getRepositoryObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
private List<RepositoryElementMetaInterface> getRepositoryObjects( RepositoryDirectoryInterface directory,
String nameMask, String excludeNameMask ) throws KettleException {
List<RepositoryElementMetaInterface> list = new ArrayList<RepositoryElementMetaInterface>();
if ( directory.getRepositoryObjects() != null ) {
for ( RepositoryElementMetaInterface object : directory.getRepositoryObjects() ) {
boolean add = false;
if ( Utils.isEmpty( nameMask ) || object.getName().matches( nameMask ) ) {
add = true;
}
if ( !Utils.isEmpty( excludeNameMask ) && object.getName().matches( excludeNameMask ) ) {
add = false;
}
if ( add ) {
list.add( object );
}
}
}
if ( directory.getChildren() != null ) {
for ( RepositoryDirectoryInterface subdir : directory.getChildren() ) {
list.addAll( getRepositoryObjects( subdir, nameMask, excludeNameMask ) );
}
}
return list;
}
示例9: restoreSelectedObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public boolean restoreSelectedObjects() {
TreeItem[] items = wTree.getSelection();
boolean error = false;
for ( int i = 0; i < items.length; i++ ) {
final RepositoryElementMetaInterface repositoryObject = objectMap.get( ConstUI.getTreePath( items[i], 0 ) );
if ( repositoryObject != null ) {
try {
rep.undeleteObject( repositoryObject );
} catch ( Exception e ) {
new ErrorDialog(
shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRestoring.Title" ), BaseMessages
.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRestoring.Message" ), e );
error = true;
}
}
}
refreshTree();
return !error;
}
示例10: loadRepositoryObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
protected static List<RepositoryElementMetaInterface> loadRepositoryObjects( RepositoryDirectoryInterface dir,
boolean getTransformations, boolean getJobs, Repository rep ) throws KettleDatabaseException {
// Then show the transformations & jobs in that directory...
List<RepositoryElementMetaInterface> repositoryObjects = new ArrayList<RepositoryElementMetaInterface>();
if ( dir.getRepositoryObjects() == null ) {
try {
dir.setRepositoryObjects( rep.getJobAndTransformationObjects( dir.getObjectId(), false ) );
} catch ( KettleException e ) {
throw new KettleDatabaseException( e );
}
}
List<RepositoryObjectType> allowedTypes = new ArrayList<>( 2 );
if ( getTransformations ) {
allowedTypes.add( RepositoryObjectType.TRANSFORMATION );
}
if ( getJobs ) {
allowedTypes.add( RepositoryObjectType.JOB );
}
for ( RepositoryElementMetaInterface repoObject : dir.getRepositoryObjects() ) {
if ( allowedTypes.contains( repoObject.getObjectType() ) ) {
repositoryObjects.add( repoObject );
}
}
return repositoryObjects;
}
示例11: addToTree
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
private static void addToTree( TreeItem ti, String filterString, Pattern pattern,
List<RepositoryElementMetaInterface> repositoryObjects ) {
for ( int i = 0; i < repositoryObjects.size(); i++ ) {
boolean add = false;
RepositoryElementMetaInterface repositoryObject = repositoryObjects.get( i );
if ( filterString == null && pattern == null ) {
add = true;
} else {
add |= addItem( repositoryObject.getName(), filterString, pattern );
add |= addItem( repositoryObject.getDescription(), filterString, pattern );
add |= addItem( repositoryObject.getModifiedUser(), filterString, pattern );
if ( !add && repositoryObject.getModifiedDate() != null ) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat( DATE_FORMAT );
add = addItem( simpleDateFormat.format( repositoryObject.getModifiedDate() ), filterString, pattern );
}
if ( !add && repositoryObject.getObjectType() != null ) {
add = addItem( repositoryObject.getObjectType().getTypeDescription(), filterString, pattern );
}
}
if ( add ) {
createTreeItem( ti, repositoryObject );
}
}
}
示例12: getJobAndTrans
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
@Override
public List<?> getJobAndTrans(T entity) throws KettleException {
List<KettleTree> list = new ArrayList<KettleTree>();
if (null != get(entity)) {
RepositoryDirectoryInterface rdi = repo
.loadRepositoryDirectoryTree().findDirectory(
entity.getDir());
getDirectory(rdi, list);
ObjectId id = new StringObjectId(entity.getId());
List<RepositoryElementMetaInterface> li = repo
.getJobAndTransformationObjects(id, false);
if (null != li) {
for (RepositoryElementMetaInterface repel : li) {
if (Constant.TYPE_JOB.equals(repel.getObjectType()
.toString())
|| Constant.TYPE_TRANS.equals(repel.getObjectType()
.toString())) {
KettleTree c = new KettleTree();
c.setId(id + repel.getObjectId().toString());
c.setpId(id.toString());
c.setName(repel.getName());
c.setAlt(repel.getObjectType().toString());
c.setaId(repel.getObjectId().toString());
c.setClick("true");
c.setOpen("false");
c.setIsParent("false");
c.setDir(rdi.getPath());
c.setType(repel.getObjectType().toString());
list.add(c);
}
}
}
}
return list;
}
示例13: getTransformationObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public List<RepositoryElementMetaInterface> getTransformationObjects(ObjectId id_directory, boolean includeDeleted) throws KettleException
{
List<RepositoryElementMetaInterface> objects = getRepositoryObjects(quoteTable(KettleDatabaseRepository.TABLE_R_TRANSFORMATION), RepositoryObjectType.TRANSFORMATION, id_directory);
if (objects.size()>0) {
System.out.println(objects.get(0).getRepositoryDirectory().getPath());
}
return objects;
}
示例14: getJobAndTransformationObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public List<RepositoryElementMetaInterface> getJobAndTransformationObjects(ObjectId id_directory, boolean includeDeleted)
throws KettleException {
// TODO not the most efficient impl; also, no sorting is done
List<RepositoryElementMetaInterface> objs = new ArrayList<RepositoryElementMetaInterface>();
objs.addAll(getJobObjects(id_directory, includeDeleted));
objs.addAll(getTransformationObjects(id_directory, includeDeleted));
return objs;
}
示例15: getTransformationObjects
import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入依赖的package包/类
public List<RepositoryElementMetaInterface> getTransformationObjects(ObjectId idDirectory, boolean includeDeleted) throws KettleException {
try {
List<RepositoryElementMetaInterface> list = new ArrayList<RepositoryElementMetaInterface>();
RepositoryDirectoryInterface tree = loadRepositoryDirectoryTree();
RepositoryDirectoryInterface directory = tree.findDirectory(idDirectory);
String folderName = calcDirectoryName(directory);
FileObject folder = KettleVFS.getFileObject(folderName);
for (FileObject child : folder.getChildren()) {
if (child.getType().equals(FileType.FILE)) {
if (!child.isHidden() || !repositoryMeta.isHidingHiddenFiles()) {
String name = child.getName().getBaseName();
if (name.endsWith(EXT_TRANSFORMATION)) {
String transName = name.substring(0, name.length()-4);
ObjectId id = new StringObjectId(calcObjectId(directory, transName, EXT_TRANSFORMATION));
Date date = new Date(child.getContent().getLastModifiedTime());
list.add( new RepositoryObject(id, transName, directory, "-", date, RepositoryObjectType.TRANSFORMATION, "", false) );
}
}
}
}
return list;
}
catch(Exception e) {
throw new KettleException("Unable to get list of transformations in folder with id : "+idDirectory, e);
}
}