Author: kien_nguyen
Date: 2011-01-14 07:02:08 -0500 (Fri, 14 Jan 2011)
New Revision: 5747
Modified:
exo/portal/branches/3.1.x/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIAddGadgetForm.java
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
Log:
EXOGTN-244 Throwing an error This application is not exist or may be deleted.
Modified:
exo/portal/branches/3.1.x/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIAddGadgetForm.java
===================================================================
---
exo/portal/branches/3.1.x/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIAddGadgetForm.java 2011-01-14
09:01:08 UTC (rev 5746)
+++
exo/portal/branches/3.1.x/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIAddGadgetForm.java 2011-01-14
12:02:08 UTC (rev 5747)
@@ -96,14 +96,12 @@
//TODO make sure it's an rss feed
// TODO make sure that we did not add it already
uiGadget = uiForm.createUIComponent(context, UIGadget.class, null, null);
- uiGadget.setState(new
TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>(gadget.getName()));
+
+ org.exoplatform.portal.pom.spi.gadget.Gadget contentState = new
org.exoplatform.portal.pom.spi.gadget.Gadget();
+ contentState.addUserPref("{'rssurl':'" + url +
"'}");
+ TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>
applicationState = new
TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>(gadget.getName(),
contentState);
- String params = "{'rssurl':'" + url +
"'}";
-
- // Julien : I commented those 2 lines
- // we need to save the same way it is done in the UIGadget clas
- // UserGadgetStorage userGadgetStorage =
uiForm.getApplicationComponent(UserGadgetStorage.class);
- // userGadgetStorage.save(Util.getPortalRequestContext().getRemoteUser(),
gadget.getName(), "" + url.hashCode(), UIGadget.PREF_KEY, params);
+ uiGadget.setState(applicationState);
}
uiContainer.addUIGadget(uiGadget, 0, 0);
Modified:
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
===================================================================
---
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2011-01-14
09:01:08 UTC (rev 5746)
+++
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2011-01-14
12:02:08 UTC (rev 5747)
@@ -31,6 +31,7 @@
gadgets.ExoBasedUserPrefStore.prototype.savePrefs = function(gadget, newPrefs) {
//TODO: dang.tung - sent event to portal
var prefs = eXo.core.JSON.stringify(newPrefs || gadget.userPrefs_);
+ prefs = encodeURIComponent(prefs);
var DOMUtil = eXo.core.DOMUtil;
var gadget = document.getElementById("gadget_" + gadget.id) ;
if(gadget != null ) {