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));
}
}
Aggregations