Search in sources :

Example 11 with RepositoryExtended

use of org.pentaho.di.repository.RepositoryExtended in project pentaho-kettle by pentaho.

the class UIRepositoryDirectory method refresh.

/**
 * Synchronize this folder with the back-end
 */
public void refresh() {
    try {
        kidElementCache = null;
        kidDirectoryCache = null;
        if (this == getRootDirectory()) {
            RepositoryDirectoryInterface localRoot;
            if (rep instanceof RepositoryExtended) {
                localRoot = ((RepositoryExtended) rep).loadRepositoryDirectoryTree("/", "*.ktr|*.kjb", -1, BooleanUtils.isTrue(rep.getUserInfo().isAdmin()), true, true).findDirectory(rd.getObjectId());
            } else {
                localRoot = rep.findDirectory(rd.getObjectId());
            }
            rd = localRoot;
            // Rebuild caches
            fireCollectionChanged();
        } else {
            getRootDirectory().refresh();
        }
    } catch (Exception e) {
        // TODO: Better error handling
        e.printStackTrace();
    }
}
Also used : RepositoryDirectoryInterface(org.pentaho.di.repository.RepositoryDirectoryInterface) RepositoryExtended(org.pentaho.di.repository.RepositoryExtended) KettleException(org.pentaho.di.core.exception.KettleException)

Aggregations

RepositoryExtended (org.pentaho.di.repository.RepositoryExtended)11 KettleException (org.pentaho.di.core.exception.KettleException)7 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)7 KettleJobException (org.pentaho.di.core.exception.KettleJobException)3 KettleObjectExistsException (org.pentaho.di.core.exception.KettleObjectExistsException)3 KettleTransException (org.pentaho.di.core.exception.KettleTransException)3 ArrayList (java.util.ArrayList)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 FormAttachment (org.eclipse.swt.layout.FormAttachment)2 FormData (org.eclipse.swt.layout.FormData)2 FormLayout (org.eclipse.swt.layout.FormLayout)2 Button (org.eclipse.swt.widgets.Button)2 Event (org.eclipse.swt.widgets.Event)2 Listener (org.eclipse.swt.widgets.Listener)2 Shell (org.eclipse.swt.widgets.Shell)2 Tree (org.eclipse.swt.widgets.Tree)2 Test (org.junit.Test)2 ObjectId (org.pentaho.di.repository.ObjectId)2 UserInfo (org.pentaho.di.repository.UserInfo)2