Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BACKLOG-39531] RunInBackground functionality still existing in the Platform #5522

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading