public RepositoryDirectory getRepositoryDirectory() { return uiParent.getDirectory(); }
public void onRemove( UIRepositoryObject child ) { List<? extends RepositoryElementMetaInterface> dirRepoObjects = getDirectory().getRepositoryObjects(); if ( dirRepoObjects != null ) { Iterator<? extends RepositoryElementMetaInterface> iter = dirRepoObjects.iterator(); while ( iter.hasNext() ) { RepositoryElementMetaInterface e = iter.next(); if ( child.getObjectId().equals( e.getObjectId() ) ) { iter.remove(); return; } } } } };
public void onDragFromGlobalTree( DropEvent event ) { for ( UIRepositoryDirectory uiRepositoryDirectory : this.getSelectedFolderItems() ) { String path = uiRepositoryDirectory.getDirectory().getPath(); if ( path.equals( HOME_PATH ) || path.equals( PUBLIC_PATH ) ) { event.setAccepted( false ); return; } } event.setAccepted( true ); }
public void move( UIRepositoryDirectory newParentDir ) throws KettleException { if ( newParentDir != null ) { rep.renameJob( obj.getObjectId(), newParentDir.getDirectory(), null ); newParentDir.refresh(); } }
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(); }
public void exportFolder() throws Exception { for ( Object object : folderTree.getSelectedItems() ) { if ( object instanceof UIRepositoryDirectory ) { repoDir = (UIRepositoryDirectory) object; // Export the directories one by one... // if ( Spoon.getInstance().exportRepositoryDirectory( repoDir.getDirectory() ) ) { return; } } } }
public void move( UIRepositoryDirectory newParentDir ) throws KettleException { if ( newParentDir != null ) { rep.renameTransformation( obj.getObjectId(), newParentDir.getDirectory(), null ); newParentDir.refresh(); } }
public void delete() throws Exception { if ( uiParent.checkDirNameExistsInRepo( getName() ) != null ) { rep.deleteRepositoryDirectory( getDirectory() ); } uiParent.getChildren().remove( this ); if ( uiParent.getRepositoryObjects().contains( this ) ) { uiParent.getRepositoryObjects().remove( this ); } uiParent.refresh(); }
@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(); } } }
public UIRepositoryDirectory createFolder( String name ) throws Exception { RepositoryDirectoryInterface thisDir = getDirectory(); RepositoryDirectoryInterface dir; //PDI-5202: the directory might exist already. If so, don't create a new one. String dirName = checkDirNameExistsInRepo( name ); if ( dirName == null ) { dir = rep.createRepositoryDirectory( thisDir, name ); } else { dir = rep.findDirectory( thisDir.getPath() + "/" + dirName ); } UIRepositoryDirectory newDir = null; try { newDir = UIObjectRegistry.getInstance().constructUIRepositoryDirectory( dir, this, rep ); } catch ( UIObjectCreationException uoe ) { newDir = new UIRepositoryDirectory( dir, this, rep ); } UIRepositoryDirectories directories = getChildren(); if ( !contains( directories, newDir ) ) { directories.add( newDir ); } else { throw new KettleException( "Unable to create folder with the same name [" + name + "]" ); } kidElementCache = null; // rebuild the element cache for correct positioning. return newDir; }
List<RepositoryElementMetaInterface> jobsAndTransformations = getDirectory().getRepositoryObjects(); if ( jobsAndTransformations == null ) { RepositoryDirectoryInterface dir = getDirectory(); jobsAndTransformations = rep.getJobAndTransformationObjects( dir.getObjectId(), false ); dir.setRepositoryObjects( jobsAndTransformations );