Skip to content

Commit

Permalink
Merge pull request #5522 from e-cuellar/DEV
Browse files Browse the repository at this point in the history
[BACKLOG-39531] RunInBackground functionality still existing in the Platform
  • Loading branch information
wseyler authored Feb 7, 2024
2 parents 0f8d8e2 + 1ff9ec2 commit 03fd757
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 726 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@
* See the GNU Lesser General Public License for more details.
*
*
* Copyright (c) 2002-2023 Hitachi Vantara. All rights reserved.
* Copyright (c) 2002-2024 Hitachi Vantara. All rights reserved.
*
*/

package org.pentaho.mantle.client;

import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestException;
import org.pentaho.gwt.widgets.client.filechooser.RepositoryFile;
import org.pentaho.mantle.client.events.EventBusUtil;
import org.pentaho.mantle.client.events.GenericEvent;
import org.pentaho.mantle.client.events.SolutionFileHandler;
import org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel;
import org.pentaho.mantle.client.solutionbrowser.filelist.FileItem;
import org.pentaho.mantle.client.ui.PerspectiveManager;

public class MantleUtils {
Expand All @@ -33,7 +36,6 @@ public class MantleUtils {
setupNativeHooks( new MantleUtils() );
}


public void setSchedulesPerspective() {
PerspectiveManager.getInstance().setPerspective( PerspectiveManager.SCHEDULES_PERSPECTIVE );
}
Expand Down Expand Up @@ -61,6 +63,34 @@ public void fireRefreshFolderEvent( String outputLocation ) {
EventBusUtil.EVENT_BUS.fireEvent( event );
}

public void handleRepositoryFileSelection( String solutionPath, Boolean isAdhoc) {
final SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
sbp.getFile( solutionPath, new SolutionFileHandler() {
@Override
public void handle( RepositoryFile repositoryFile ) {
if( isAdhoc ) {
openAdhocDialog( true );
} else {
FileItem fileItem = new FileItem( repositoryFile, null, null, false, null );
checkSchedulePermissionAndDialog( fileItem.getRepositoryFile().getId(), fileItem.getPath() );
}
}
} );
}

private native void openAdhocDialog( boolean feedback ) /*-{
$wnd.pho.showDialog(feedback);
}-*/;

private native void checkSchedulePermissionAndDialog( String repositoryFileId, String repositoryFilePath ) /*-{
$wnd.pho.checkSchedulePermissionAndDialog(repositoryFileId, repositoryFilePath);
}-*/;

public boolean checkSelectedPerspective() {
return !PerspectiveManager.getInstance().getActivePerspective().getId().equals(
PerspectiveManager.SCHEDULES_PERSPECTIVE );
}

public static native String getSchedulerPluginContextURL()/*-{
if (typeof $wnd.pho.getSchedulerPluginContextURL !== "undefined" ) {
return $wnd.pho.getSchedulerPluginContextURL();
Expand Down Expand Up @@ -93,5 +123,15 @@ private static native void setupNativeHooks( MantleUtils utils )
//CHECKSTYLE IGNORE LineLength FOR NEXT 1 LINES
[email protected]::fireRefreshFolderEvent(Ljava/lang/String;)(outputLocation);
}
$wnd.mantle.handleRepositoryFileSelection = function(solutionPath, isAdhoc) {
//CHECKSTYLE IGNORE LineLength FOR NEXT 1 LINES
[email protected]::handleRepositoryFileSelection(Ljava/lang/String;Ljava/lang/Boolean;)(solutionPath, isAdhoc);
}
$wnd.mantle.checkSelectedPerspective = function() {
//CHECKSTYLE IGNORE LineLength FOR NEXT 1 LINES
return [email protected]::checkSelectedPerspective()();
}
}-*/;
}

This file was deleted.

Loading

0 comments on commit 03fd757

Please sign in to comment.