public boolean existsUserInfo( RepositoryElementInterface user ) throws KettleException { return ( user.getObjectId() != null || getUserID( user.getName() ) != null ); }
buf.append( getParentPath( file.getPath() ) ); buf.append( RepositoryFile.SEPARATOR ); buf.append( checkAndSanitize( element.getName() ) ); switch ( element.getRepositoryElementType() ) { case DATABASE:
public String calcObjectId( RepositoryElementInterface element ) { RepositoryDirectoryInterface directory = element.getRepositoryDirectory(); String name = element.getName(); String extension = element.getRepositoryElementType().getExtension(); return calcObjectId( directory, name, extension ); }
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$ }
FileObject getFileObject( RepositoryElementInterface element ) throws KettleFileException { return KettleVFS.getFileObject( calcFilename( element.getRepositoryDirectory(), element.getName(), element .getRepositoryElementType().getExtension() ) ); }
final ObjectId id ) throws KettleException { if ( element != null && ( element.getObjectId() == null || element.getObjectId().getId() == null ) ) { throw new IllegalArgumentException( element.getName() + " has a null id" );
protected void savePartitionSchema( final RepositoryElementInterface element, final String versionComment, Calendar versionDate ) { try { // Even if the object id is null, we still have to check if the element is not present in the PUR // For example, if we import data from an XML file and there is a element with the same name in it. // if ( element.getObjectId() == null ) { element.setObjectId( getPartitionSchemaID( element.getName() ) ); } saveRepositoryElement( element, versionComment, partitionSchemaTransformer, getPartitionSchemaParentFolderId() ); } catch ( KettleException ke ) { ke.printStackTrace(); } }
protected void saveSlaveServer( final RepositoryElementInterface element, final String versionComment, Calendar versionDate ) throws KettleException { try { // Even if the object id is null, we still have to check if the element is not present in the PUR // For example, if we import data from an XML file and there is a element with the same name in it. // if ( element.getObjectId() == null ) { element.setObjectId( getSlaveID( element.getName() ) ); } saveRepositoryElement( element, versionComment, slaveTransformer, getSlaveServerParentFolderId() ); } catch ( KettleException ke ) { ke.printStackTrace(); } }
protected void saveClusterSchema( final RepositoryElementInterface element, final String versionComment, Calendar versionDate ) { try { // Even if the object id is null, we still have to check if the element is not present in the PUR // For example, if we import data from an XML file and there is a element with the same name in it. // if ( element.getObjectId() == null ) { element.setObjectId( getClusterID( element.getName() ) ); } saveRepositoryElement( element, versionComment, clusterTransformer, getClusterSchemaParentFolderId() ); } catch ( KettleException ke ) { ke.printStackTrace(); } }
return false; // never been saved String filename = element.getName(); switch ( element.getRepositoryElementType() ) { case TRANSFORMATION:
element.setObjectId( getDatabaseID( element.getName() ) ); checkAndSanitize( RepositoryFilenameUtils.escape( element.getName(), pur.getReservedChars() ) + RepositoryObjectType.DATABASE.getExtension() ) ).title( RepositoryFile.DEFAULT_LOCALE, element.getName() ).createdDate( createdDate ).versioned( VERSION_SHARED_OBJECTS ).build(); BaseMessages.getString( PKG, "PurRepository.ERROR_0004_DATABASE_UPDATE_ACCESS_DENIED", element.getName() ), e );
element.getName() + element.getRepositoryElementType().getExtension() ) ); new RepositoryFile.Builder( file ).title( RepositoryFile.DEFAULT_LOCALE, element.getName() ).createdDate( versionDate != null ? versionDate.getTime() : new Date() ).description( RepositoryFile.DEFAULT_LOCALE, Const.NVL( element.getDescription(), "" ) ).build(); renameKettleEntity( element, null, element.getName() ); try { 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, Const.NVL( element.getDescription(), "" ) ).build();
new RepositoryFile.Builder( file ).title( RepositoryFile.DEFAULT_LOCALE, element.getName() ).description( RepositoryFile.DEFAULT_LOCALE, Const.NVL( element.getDescription(), "" ) ).build(); 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( VERSION_SHARED_OBJECTS ).build();