use of org.pentaho.di.repository.pur.model.EETransMeta in project pentaho-kettle by pentaho.
the class PurRepository method loadTransformation.
@Override
public TransMeta loadTransformation(ObjectId idTransformation, String versionLabel) throws KettleException {
try {
RepositoryFile file = null;
EETransMeta transMeta = null;
readWriteLock.readLock().lock();
try {
if (versionLabel != null) {
file = pur.getFileAtVersion(idTransformation.getId(), versionLabel);
} else {
file = pur.getFileById(idTransformation.getId());
}
transMeta = new EETransMeta();
transMeta.setName(file.getTitle());
transMeta.setDescription(file.getDescription());
transMeta.setObjectId(new StringObjectId(file.getId().toString()));
transMeta.setObjectRevision(getObjectRevision(new StringObjectId(file.getId().toString()), versionLabel));
transMeta.setRepository(this);
transMeta.setRepositoryDirectory(findDirectory(getParentPath(file.getPath())));
transMeta.setRepositoryLock(unifiedRepositoryLockService.getLock(file));
// inject metastore
transMeta.setMetaStore(getMetaStore());
readTransSharedObjects(transMeta);
transDelegate.dataNodeToElement(pur.getDataAtVersionForRead(idTransformation.getId(), versionLabel, NodeRepositoryFileData.class).getNode(), transMeta);
} finally {
readWriteLock.readLock().unlock();
}
ExtensionPointHandler.callExtensionPoint(log, KettleExtensionPoint.TransformationMetaLoaded.id, transMeta);
transMeta.clearChanged();
return transMeta;
} catch (Exception e) {
throw new KettleException("Unable to load transformation with id [" + idTransformation + "]", e);
}
}
Aggregations