Author: tuancn
Date: 2010-01-28 01:51:43 -0500 (Thu, 28 Jan 2010)
New Revision: 1455
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
GTNPORTAL-424: Update portlet and show a message when save a deleted gadget
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-01-27
10:49:38 UTC (rev 1454)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-01-28
06:51:43 UTC (rev 1455)
@@ -26,20 +26,22 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Properties;
-import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.data.ModelDataStorage;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.WebAppController;
+import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.gadget.GadgetApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.exception.MessageException;
import org.json.JSONException;
import org.json.JSONObject;
-import java.util.Iterator;
import java.util.Random;
import java.util.UUID;
@@ -419,7 +421,14 @@
UIGadget uiGadget = event.getSource();
//
-
uiGadget.addUserPref(event.getRequestContext().getRequestParameter("userPref"));
+ try{
+
uiGadget.addUserPref(event.getRequestContext().getRequestParameter("userPref"));
+ } catch(Exception e){
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ UIPortletApplication uiPortlet =
uiGadget.getAncestorOfType(UIPortletApplication.class);
+ context.addUIComponentToUpdateByAjax(uiPortlet);
+ throw new MessageException(new
ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null,
ApplicationMessage.ERROR));
+ }
//
if (uiGadget.isLossData())
Show replies by date