/** * Gets the name of the transformation. * * @return the transformation name */ public String getName() { if ( transMeta == null ) { return null; } return transMeta.getName(); }
@Override public int showChangedWarning() throws KettleException { return showChangedWarning( transMeta.getName() ); }
/** * Checks if the transformation is referenced by a file. If the transformation is not referenced by a repository, it * is assumed to be referenced by a file. * * @return true if the transformation is referenced by a file, false otherwise * @see #isRepReference() */ public boolean isFileReference() { return !isRepReference( getFilename(), this.getName() ); }
/** * Checks if the transformation is referenced by a repository. * * @return true if the transformation is referenced by a repository, false otherwise */ public boolean isRepReference() { return isRepReference( getFilename(), this.getName() ); }
public void registerTransformation( Trans trans, TransConfiguration transConfiguration ) { trans.setContainerObjectId( UUID.randomUUID().toString() ); CarteObjectEntry entry = new CarteObjectEntry( trans.getTransMeta().getName(), trans.getContainerObjectId() ); transMap.put( entry, new TransData( trans, transConfiguration ) ); }
@Override public TransMeta answer( InvocationOnMock invocation ) throws Throwable { String transName = String.class.cast( invocation.getArguments()[ 0 ] ); TransMeta transMeta = Mockito.mock( TransMeta.class ); Mockito.when( transMeta.getXML() ).thenReturn( "<" + transName + ">" + "found" + "</" + transName + ">" ); Mockito.when( transMeta.getName() ).thenReturn( transName ); return transMeta; } };
/** * Gets the repository directory path and name of the transformation. * * @return The repository directory path plus the name of the transformation */ public String getPathAndName() { if ( getRepositoryDirectory().isRoot() ) { return getRepositoryDirectory().getPath() + getName(); } else { return getRepositoryDirectory().getPath() + RepositoryDirectory.DIRECTORY_SEPARATOR + getName(); } }
private Trans createLegacyTrans() { try { return new Trans( transMeta, spoon.rep, transMeta.getName(), transMeta.getRepositoryDirectory().getPath(), transMeta.getFilename() ); } catch ( KettleException e ) { throw new RuntimeException( e ); } }
private boolean isTransOpened( String id, String path, String name ) { List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList(); for ( TransMeta t : openedTransFiles ) { if ( t.getObjectId() != null && id.equals( t.getObjectId().getId() ) || ( path.equals( t.getRepositoryDirectory().getPath() ) && name.equals( t.getName() ) ) ) { return true; } } return false; }
public synchronized void openServerSocket( BaseStep baseStep ) throws IOException { this.baseStep = baseStep; int portNumber = Integer.parseInt( baseStep.environmentSubstitute( port ) ); SocketRepository socketRepository = baseStep.getSocketRepository(); serverSocket = socketRepository.openServerSocket( portNumber, baseStep.getTransMeta().getName() + " - " + baseStep.toString() ); // Add this socket to the steps server socket list // That way, the socket can be closed during transformation cleanup // That is called when the cluster has finished processing. // baseStep.getServerSockets().add( serverSocket ); }
public void analyseImpact( List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMeta prev, String[] input, String[] output, RowMeta info ) throws KettleStepException { DatabaseImpact ii = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ_WRITE, transMeta.getName(), stepMeta.getName(), databaseMeta.getDatabaseName(), BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Unknown.Label" ), BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Unknown2.Label" ), BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Unknown3.Label" ), stepMeta.getName(), sql, BaseMessages.getString( PKG, "ExecSQLMeta.DatabaseMeta.Title" ) ); impact.add( ii ); }
public static String getName( ReportSubjectLocation filename ) throws KettleException { if ( filename.isTransformation() ) { return TransformationInformation.getInstance().getTransMeta( filename ).getName(); } else { return JobInformation.getInstance().getJobMeta( filename ).getName(); } }
private void addFileToResultFilesName( FileObject file ) throws Exception { if ( meta.getAddResultFile() ) { // Add this to the result file names... ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, file, getTransMeta().getName(), getStepname() ); resultFile.setComment( "File was read by a LoadFileInput step" ); addResultFile( resultFile ); } }
private void addFileToResultFilesname( FileObject file ) { if ( meta.addResultFile() ) { // Add this to the result file names... ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, file, getTransMeta().getName(), getStepname() ); resultFile.setComment( BaseMessages.getString( PKG, "JsonInput.Log.FileAddedResult" ) ); addResultFile( resultFile ); } }
private void addFilenameToResult() throws KettleException { try { if ( meta.isAddToResultFiles() ) { // Add this to the result file names... ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, data.file, getTransMeta().getName(), getStepname() ); resultFile.setComment( "This file was created with an Excel output step by Pentaho Data Integration" ); addResultFile( resultFile ); } } catch ( Exception e ) { throw new KettleException( "Unable to add filename to the result", e ); } }
private void addFileToResultFilesname( FileObject file ) throws Exception { if ( meta.addResultFile() ) { // Add this to the result file names... ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, file, getTransMeta().getName(), getStepname() ); resultFile.setComment( BaseMessages.getString( PKG, "YamlInput.Log.FileAddedResult" ) ); addResultFile( resultFile ); } }
private void addFileToResultFilesname( FileObject file ) throws Exception { if ( meta.addResultFile() ) { // Add this to the result file names... ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, file, getTransMeta().getName(), getStepname() ); resultFile.setComment( BaseMessages.getString( PKG, "GetXMLData.Log.FileAddedResult" ) ); addResultFile( resultFile ); } }
private void saveTransformationToRepo( TransMeta transMeta, RepositoryImportFeedbackInterface feedback ) throws KettleException { try { transMeta.lookupRepositoryReferences( rep ); } catch ( LookupReferencesException e ) { // log and continue; might fail from exports performed before PDI-5294 feedback.addLog( BaseMessages.getString( PKG, "RepositoryImporter.LookupRepoRefsError.Log", transMeta.getName(), RepositoryObjectType.TRANSFORMATION ) ); feedback.addLog( BaseMessages .getString( PKG, "RepositoryImporter.LookupRepoRefsError.Log.Cause", e.objectTypePairsToString() ) ); } rep.save( transMeta, "import object reference specification", null ); }
private void addFilenameToResult() throws FileSystemException { if ( meta.isaddTargetFileNametoResult() ) { // Add this to the result file names... ResultFile resultFile = new ResultFile( ResultFile.FILE_TYPE_GENERAL, data.zipFile, getTransMeta().getName(), getStepname() ); resultFile.setComment( BaseMessages.getString( PKG, "ZipFile.Log.FileAddedResult" ) ); addResultFile( resultFile ); if ( log.isDetailed() ) { log.logDetailed( toString(), BaseMessages.getString( PKG, "ZipFile.Log.FilenameAddResult", data.sourceFile .toString() ) ); } } }
@Test public void testLoadReferencedObject() { BaseStreamStepMeta meta = new StuffStreamMeta(); meta.setFileName( getClass().getResource( "/org/pentaho/di/trans/subtrans-executor-sub.ktr" ).getPath() ); meta.setSpecificationMethod( ObjectLocationSpecificationMethod.FILENAME ); try { TransMeta subTrans = (TransMeta) meta.loadReferencedObject( 0, null, null, new Variables() ); assertEquals( "subtrans-executor-sub", subTrans.getName() ); } catch ( KettleException e ) { fail(); } testRoundTrip( meta ); }