buf.append( RepositoryFile.SEPARATOR ); buf.append( checkAndSanitize( element.getName() ) ); switch ( element.getRepositoryElementType() ) { case DATABASE: buf.append( RepositoryObjectType.DATABASE.getExtension() );
public String calcObjectId( RepositoryElementInterface element ) { RepositoryDirectoryInterface directory = element.getRepositoryDirectory(); String name = element.getName(); String extension = element.getRepositoryElementType().getExtension(); return calcObjectId( directory, name, extension ); }
throws KettleException { ISharedObjectsTransformer objectTransformer; switch ( element.getRepositoryElementType() ) { case TRANSFORMATION: objectTransformer = transDelegate;
private String calcFilename( RepositoryElementInterface element ) { return calcFilename( element.getRepositoryDirectory(), element.getName(), element .getRepositoryElementType().getExtension() ); }
public PurRepositoryRevisionBrowserDialog( Shell parent, int style, Repository repository, RepositoryElementInterface element ) { this.display = parent.getDisplay(); this.props = PropsUI.getInstance(); this.repository = repository; this.element = element; try { if ( repository.hasService( IRevisionService.class ) ) { revisionService = (IRevisionService) repository.getService( IRevisionService.class ); } else { throw new IllegalStateException(); } } catch ( KettleException e ) { throw new IllegalStateException( e ); } String name = element.getRepositoryElementType().toString() + " " + element.getRepositoryDirectory().getPath(); if ( !name.endsWith( "/" ) ) name += "/"; name += element.getName(); this.elementDescription = name; shell = new Shell( display, style | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); shell.setText( BaseMessages.getString( PKG, "PurRepositoryRevisionBrowserDialog.Dialog.Main.Title" ) ); //$NON-NLS-1$ }
protected ObjectId renameKettleEntity( final RepositoryElementInterface transOrJob, final RepositoryDirectoryInterface newDirectory, final String newName ) throws KettleException { switch ( transOrJob.getRepositoryElementType() ) { case TRANSFORMATION: return renameTransformation( transOrJob.getObjectId(), null, newDirectory, newName ); case JOB: return renameJob( transOrJob.getObjectId(), null, newDirectory, newName ); default: throw new KettleException( "Unknown RepositoryObjectType. Should be TRANSFORMATION or JOB " ); } }
FileObject getFileObject( RepositoryElementInterface element ) throws KettleFileException { return KettleVFS.getFileObject( calcFilename( element.getRepositoryDirectory(), element.getName(), element .getRepositoryElementType().getExtension() ) ); }
RepositoryObjectType typeToUpdate = element != null ? element.getRepositoryElementType() : type; RepositoryElementInterface elementToUpdate = null; List<? extends SharedObjectInterface> origSharedObjects = null;
switch ( element.getRepositoryElementType() ) { case TRANSFORMATION: saveTrans( element, versionComment, versionDate );
switch ( element.getRepositoryElementType() ) { case TRANSFORMATION: filename += RepositoryObjectType.TRANSFORMATION.getExtension();
element.getName() + element.getRepositoryElementType().getExtension() ) ); file = new RepositoryFile.Builder( checkAndSanitize( element.getName() + element.getRepositoryElementType().getExtension() ) ).versioned( true ).title( RepositoryFile.DEFAULT_LOCALE, element.getName() ).createdDate( versionDate != null ? versionDate.getTime() : new Date() ).description( RepositoryFile.DEFAULT_LOCALE, if ( element.getRepositoryElementType() == RepositoryObjectType.TRANSFORMATION ) { TransMeta transMeta = loadTransformation( objectId, null ); ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.TransImportAfterSaveToRepo.id, transMeta );
switch ( repositoryElement.getRepositoryElementType() ) { case JOB: securityProvider.validateAction( RepositoryOperation.MODIFY_JOB ); default: throw new KettleException( "We can't save the element with type [" + repositoryElement.getRepositoryElementType() + "] in the repository" );
file = new RepositoryFile.Builder( checkAndSanitize( element.getName() + element.getRepositoryElementType().getExtension() ) ) .title( RepositoryFile.DEFAULT_LOCALE, element.getName() ) .description( RepositoryFile.DEFAULT_LOCALE, Const.NVL( element.getDescription(), "" ) ).versioned(