Alona Kaplan has uploaded a new change for review.

Change subject: webadmin: add showErrorDialog property to runMultipleAction
......................................................................

webadmin: add showErrorDialog property to runMultipleAction

The property will alow to controll whether to show a pop-up dialog with
the error or not.

Change-Id: I703c95dd2c8bfc2ff3cc997019dcd15fd671d234
Signed-off-by: Alona Kaplan <alkap...@redhat.com>
---
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
1 file changed, 68 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/22/37722/1

diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
index fbaba27..9bc001e 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
@@ -388,6 +388,20 @@
     }
 
     /**
+     * Run an action of the specified action type using the passed in 
parameters. No object state.
+     * @param actionType The action type of the action to perform.
+     * @param parameters The parameters of the action.
+     * @param callback The callback to call when the action is completed.
+     * @param showErrorDialog Whether to show a pop-up dialog with the error 
or not.
+     */
+    public void runAction(final VdcActionType actionType,
+            final VdcActionParametersBase parameters,
+            final IFrontendActionAsyncCallback callback,
+            final boolean showErrorDialog) {
+        runAction(actionType, parameters, callback, null, showErrorDialog);
+    }
+
+    /**
      * Run an action of the specified action type using the passed in 
parameters, also pass in a state object.
      * @param actionType The action type of the action to perform.
      * @param parameters The parameters of the action.
@@ -472,13 +486,31 @@
      * @param parameters The parameters to the actions.
      * @param callback The callback to call after the operation happens.
      * @param state A state object.
+     * @param showErrorDialog Should we show an error dialog?
+     */
+    public void runMultipleAction(final VdcActionType actionType,
+            final List<VdcActionParametersBase> parameters,
+            final IFrontendMultipleActionAsyncCallback callback,
+            final Object state,
+            final boolean showErrorDialog) {
+        runMultipleAction(actionType, parameters, false, callback, state, 
showErrorDialog);
+    }
+
+    /**
+     * Identical to 5 parameter RunMultipleAction, but isRunOnlyIfAllCanDoPass 
is false.
+     * @param actionType The action type of the actions to run.
+     * @param parameters The parameters to the actions.
+     * @param callback The callback to call after the operation happens.
+     * @param state A state object.
+     * @param showErrorDialog Should we show an error dialog?
      */
     public void runMultipleAction(final VdcActionType actionType,
             final List<VdcActionParametersBase> parameters,
             final IFrontendMultipleActionAsyncCallback callback,
             final Object state) {
-        runMultipleAction(actionType, parameters, false, callback, state);
+        runMultipleAction(actionType, parameters, false, callback, state, 
true);
     }
+
 
     /**
      * RunMultipleActions without passing state.
@@ -488,7 +520,7 @@
     public void runMultipleAction(final VdcActionType actionType,
             final List<VdcActionParametersBase> parameters,
             final IFrontendMultipleActionAsyncCallback callback) {
-        runMultipleAction(actionType, parameters, callback, null);
+        runMultipleAction(actionType, parameters, callback, null, true);
     }
 
     /**
@@ -498,11 +530,24 @@
      */
     public void runMultipleAction(final VdcActionType actionType,
             final List<VdcActionParametersBase> parameters) {
-        runMultipleAction(actionType, parameters, null, null);
+        runMultipleAction(actionType, parameters, null, null, true);
     }
 
     /**
-     * Run multiple actions using the same {@code VdcActionType}.
+     * RunMultipleActions without passing state.
+     * @param actionType The type of action to perform.
+     * @param parameters The parameters of the action.
+     * @param showErrorDialog Should we show an error dialog?
+     */
+    public void runMultipleAction(final VdcActionType actionType,
+            final List<VdcActionParametersBase> parameters,
+            final IFrontendMultipleActionAsyncCallback callback,
+            final boolean showErrorDialog) {
+        runMultipleAction(actionType, parameters, callback, null, 
showErrorDialog);
+    }
+
+    /**
+     * Run multiple without passing <code>showErrorDialog</code>
      * @param actionType The action type.
      * @param parameters The list of parameters.
      * @param isRunOnlyIfAllCanDoPass A flag to only run the actions if all 
can be completed.
@@ -514,6 +559,24 @@
             final boolean isRunOnlyIfAllCanDoPass,
             final IFrontendMultipleActionAsyncCallback callback,
             final Object state) {
+        runMultipleAction(actionType, parameters, isRunOnlyIfAllCanDoPass, 
callback, state, true);
+    }
+
+    /**
+     * Run multiple actions using the same {@code VdcActionType}.
+     * @param actionType The action type.
+     * @param parameters The list of parameters.
+     * @param isRunOnlyIfAllCanDoPass A flag to only run the actions if all 
can be completed.
+     * @param callback The callback to call when the operation completes.
+     * @param state The state.
+     * @param showErrorDialog Should we show an error dialog?
+     */
+    public void runMultipleAction(final VdcActionType actionType,
+            final List<VdcActionParametersBase> parameters,
+            final boolean isRunOnlyIfAllCanDoPass,
+            final IFrontendMultipleActionAsyncCallback callback,
+            final Object state,
+            final boolean showErrorDialog) {
         VdcOperationCallbackList<VdcOperation<VdcActionType, 
VdcActionParametersBase>, List<VdcReturnValueBase>>
         multiCallback = new 
VdcOperationCallbackList<VdcOperation<VdcActionType, VdcActionParametersBase>,
         List<VdcReturnValueBase>>() {
@@ -530,7 +593,7 @@
                     }
                 }
 
-                if (!failed.isEmpty()) {
+                if (showErrorDialog && !failed.isEmpty()) {
                     translateErrors(failed);
                     getEventsHandler().runMultipleActionFailed(actionType, 
failed);
                 }


-- 
To view, visit http://gerrit.ovirt.org/37722
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I703c95dd2c8bfc2ff3cc997019dcd15fd671d234
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to