Search in sources :

Example 1 with RepositoryExtension

use of org.pentaho.di.ui.repository.RepositoryExtension in project pdi-dataservice-server-plugin by pentaho.

the class DeleteRepositoryObjectExtensionPointPlugin method callExtensionPoint.

@Override
public void callExtensionPoint(LogChannelInterface log, Object object) throws KettleException {
    RepositoryExtension repositoryExtension = (RepositoryExtension) object;
    UIRepositoryObject repositoryObject = repositoryExtension.getRepositoryObject();
    // if a directory get all transformations recursively
    if (repositoryObject instanceof UIRepositoryDirectory) {
        List<UIRepositoryObject> transformationList = new ArrayList<UIRepositoryObject>();
        getAllTransformations((UIRepositoryDirectory) repositoryObject, transformationList);
        for (UIRepositoryObject uiRepositoryObject : transformationList) {
            Repository repository = uiRepositoryObject.getRepository();
            metaStoreUtil.clearReferences(repository.loadTransformation(uiRepositoryObject.getObjectId(), null));
        }
    } else if (repositoryObject.getRepositoryElementType().equals(RepositoryObjectType.TRANSFORMATION)) {
        Repository repository = repositoryObject.getRepository();
        metaStoreUtil.clearReferences(repository.loadTransformation(repositoryObject.getObjectId(), null));
    }
}
Also used : UIRepositoryObject(org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryObject) UIRepositoryDirectory(org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectory) Repository(org.pentaho.di.repository.Repository) RepositoryExtension(org.pentaho.di.ui.repository.RepositoryExtension) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Repository (org.pentaho.di.repository.Repository)1 RepositoryExtension (org.pentaho.di.ui.repository.RepositoryExtension)1 UIRepositoryDirectory (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectory)1 UIRepositoryObject (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryObject)1