summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-07-30 02:44:12 (EDT)
committer Stephan Born2013-09-23 04:56:34 (EDT)
commit77cfdb36ce58850cddf8b4da253df082c1b03f5d (patch)
tree157c343f8e8eb235baa5bdce77aecba29c320cc4
parent0bd6ca648dd4959950d9f1298f03d374065508fe (diff)
downloadorg.eclipse.stardust.ui.web-77cfdb36ce58850cddf8b4da253df082c1b03f5d.zip
org.eclipse.stardust.ui.web-77cfdb36ce58850cddf8b4da253df082c1b03f5d.tar.gz
org.eclipse.stardust.ui.web-77cfdb36ce58850cddf8b4da253df082c1b03f5d.tar.bz2
Jira-ID: CRNT-29771
Added interface MessageDialogHandler.java , callbackHandler for message/MessageDialog.java Made flag delayViewClose to WorkflowActivityCompletionLog, used to set callbackHandler on message/MessageDialog.java git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@66333 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialog.java17
-rw-r--r--portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialogHandler.java16
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java6
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/WorkflowActivityCompletionLog.java10
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/view/ActivityDetailsBean.java20
5 files changed, 65 insertions, 4 deletions
diff --git a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialog.java b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialog.java
index 026af60..10cc6e7 100644
--- a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialog.java
+++ b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialog.java
@@ -48,6 +48,7 @@ public class MessageDialog extends PopupDialog
private Throwable exception;
private PortalUiController portalUiController;
+ private MessageDialogHandler callbackHandler;
/**
*
@@ -240,6 +241,10 @@ public class MessageDialog extends PopupDialog
public void closePopup()
{
clearMessages();
+ if (null != callbackHandler)
+ {
+ callbackHandler.accept();
+ }
super.closePopup();
}
@@ -308,5 +313,17 @@ public class MessageDialog extends PopupDialog
{
return exception;
}
+
+ public MessageDialogHandler getCallbackHandler()
+ {
+ return callbackHandler;
+ }
+
+ public void setCallbackHandler(MessageDialogHandler callbackHandler)
+ {
+ this.callbackHandler = callbackHandler;
+ }
+
+
}
diff --git a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialogHandler.java b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialogHandler.java
new file mode 100644
index 0000000..ef72441
--- /dev/null
+++ b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/message/MessageDialogHandler.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2011 SunGard CSA LLC and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SunGard CSA LLC - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.stardust.ui.web.common.message;
+
+public interface MessageDialogHandler
+{
+ boolean accept();
+}
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java
index 9d8a94d..31b6310 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java
@@ -443,6 +443,7 @@ public class PPUtils
boolean closeViewAndProceed = true;
boolean success = false;
+ boolean delayViewClose = false;
try
{
@@ -476,11 +477,13 @@ public class PPUtils
}
catch (ConcurrencyException ce)
{
+ delayViewClose = true;
ExceptionHandler.handleException(ce,
MessagePropertiesBean.getInstance().getString("views.activityPanel.concurrencyError"));
}
catch (AccessForbiddenException af)
{
+ delayViewClose = true;
ExceptionHandler.handleException(af,
MessagePropertiesBean.getInstance().getString("views.activityPanel.acccessForbiddenError"));
}
@@ -492,6 +495,7 @@ public class PPUtils
}
catch (InternalException ie)
{
+ delayViewClose = true;
ExceptionHandler.handleException(ie);
}
catch (Exception e)
@@ -500,7 +504,7 @@ public class PPUtils
ExceptionHandler.handleException(e);
}
- return new WorkflowActivityCompletionLog(completedAi, newInstance, success, closeViewAndProceed);
+ return new WorkflowActivityCompletionLog(completedAi, newInstance, success, closeViewAndProceed, delayViewClose);
}
/**
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/WorkflowActivityCompletionLog.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/WorkflowActivityCompletionLog.java
index 114b324..bb58452 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/WorkflowActivityCompletionLog.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/WorkflowActivityCompletionLog.java
@@ -26,6 +26,7 @@ public class WorkflowActivityCompletionLog implements Serializable
final private ActivityInstance nextActivity;
final private boolean success;
final private boolean closeViewAndProceed;
+ final private boolean delayViewClose;
/**
* @param completedActivity
@@ -34,13 +35,14 @@ public class WorkflowActivityCompletionLog implements Serializable
* @param closeViewAndProceed
*/
public WorkflowActivityCompletionLog(ActivityInstance completedActivity, ActivityInstance nextActivity,
- boolean success, boolean closeViewAndProceed)
+ boolean success, boolean closeViewAndProceed, boolean delayViewClose)
{
super();
this.completedActivity = completedActivity;
this.nextActivity = nextActivity;
this.success = success;
this.closeViewAndProceed = closeViewAndProceed;
+ this.delayViewClose = delayViewClose;
}
public ActivityInstance getCompletedActivity()
@@ -62,4 +64,10 @@ public class WorkflowActivityCompletionLog implements Serializable
{
return closeViewAndProceed;
}
+
+ public boolean isDelayViewClose()
+ {
+ return delayViewClose;
+ }
+
}
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/view/ActivityDetailsBean.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/view/ActivityDetailsBean.java
index 0402138..3750aed 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/view/ActivityDetailsBean.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/view/ActivityDetailsBean.java
@@ -65,6 +65,7 @@ import org.eclipse.stardust.ui.web.common.event.ViewEvent;
import org.eclipse.stardust.ui.web.common.event.ViewEvent.ViewEventType;
import org.eclipse.stardust.ui.web.common.event.ViewEventHandler;
import org.eclipse.stardust.ui.web.common.message.MessageDialog;
+import org.eclipse.stardust.ui.web.common.message.MessageDialogHandler;
import org.eclipse.stardust.ui.web.common.util.FacesUtils;
import org.eclipse.stardust.ui.web.common.util.ReflectionUtils;
import org.eclipse.stardust.ui.web.common.util.SessionRendererHelper;
@@ -135,7 +136,7 @@ import com.icesoft.faces.context.effects.JavascriptContext;
*/
public class ActivityDetailsBean extends UIComponentBean
implements ActivityEventObserver, NoteEventObserver, DocumentEventObserver, ViewEventHandler, DisposableBean,
- Activator
+ Activator, MessageDialogHandler
{
private static final long serialVersionUID = 1L;
@@ -1787,7 +1788,15 @@ public class ActivityDetailsBean extends UIComponentBean
skipViewEvents = true;
int viewIndex = PortalApplication.getInstance().getViewIndex(getThisView());
- PortalApplication.getInstance().closeView(thisView, true);
+ if (completionLog.isDelayViewClose())
+ {
+ //Current view will close on Popup Close
+ MessageDialog.getInstance().setCallbackHandler(this);
+ }
+ else
+ {
+ PortalApplication.getInstance().closeView(thisView, true);
+ }
if (completionLog.isSuccess())
{
@@ -3423,4 +3432,11 @@ public class ActivityDetailsBean extends UIComponentBean
this.doNotShowMsgAgain = doNotShowMsgAgain;
}
}
+
+ public boolean accept()
+ {
+ PortalApplication.getInstance().closeView(thisView, true);
+ return true;
+ }
+
} \ No newline at end of file