Search in sources :

Example 1 with EETransMeta

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);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) EETransMeta(org.pentaho.di.repository.pur.model.EETransMeta) RepositoryFile(org.pentaho.platform.api.repository2.unified.RepositoryFile) StringObjectId(org.pentaho.di.repository.StringObjectId) MetaStoreException(org.pentaho.metastore.api.exceptions.MetaStoreException) UnifiedRepositoryCreateFileException(org.pentaho.platform.api.repository2.unified.UnifiedRepositoryCreateFileException) UnifiedRepositoryUpdateFileException(org.pentaho.platform.api.repository2.unified.UnifiedRepositoryUpdateFileException) IdNotFoundException(org.pentaho.di.core.exception.IdNotFoundException) URISyntaxException(java.net.URISyntaxException) MetaStoreNamespaceExistsException(org.pentaho.metastore.api.exceptions.MetaStoreNamespaceExistsException) KettleFileException(org.pentaho.di.core.exception.KettleFileException) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) KettleException(org.pentaho.di.core.exception.KettleException) KettleSecurityException(org.pentaho.di.core.exception.KettleSecurityException)

Aggregations

URISyntaxException (java.net.URISyntaxException)1 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)1 IdNotFoundException (org.pentaho.di.core.exception.IdNotFoundException)1 KettleException (org.pentaho.di.core.exception.KettleException)1 KettleFileException (org.pentaho.di.core.exception.KettleFileException)1 KettleSecurityException (org.pentaho.di.core.exception.KettleSecurityException)1 StringObjectId (org.pentaho.di.repository.StringObjectId)1 EETransMeta (org.pentaho.di.repository.pur.model.EETransMeta)1 MetaStoreException (org.pentaho.metastore.api.exceptions.MetaStoreException)1 MetaStoreNamespaceExistsException (org.pentaho.metastore.api.exceptions.MetaStoreNamespaceExistsException)1 RepositoryFile (org.pentaho.platform.api.repository2.unified.RepositoryFile)1 UnifiedRepositoryCreateFileException (org.pentaho.platform.api.repository2.unified.UnifiedRepositoryCreateFileException)1 UnifiedRepositoryUpdateFileException (org.pentaho.platform.api.repository2.unified.UnifiedRepositoryUpdateFileException)1