[gatein-issues] [JBoss JIRA] Updated: (GTNPORTAL-511) userPref of gadgets are not sometime not saved correctly

jerem j (JIRA) jira-events at lists.jboss.org
Mon Jan 18 00:37:47 EST 2010


     [ https://jira.jboss.org/jira/browse/GTNPORTAL-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jerem j updated GTNPORTAL-511:
------------------------------

     Original Estimate: 3 days  (was: 2 days)
    Remaining Estimate: 3 days  (was: 2 days)
           Description: 
Every call to gadgets.Prefs.set generate a call to save the data in the backend (an action in the dashboard portlet). To save we send all the set of preferences.

The jira gadget call this API multiple times in a very short time. So there is multiple ajax request sent to the backend but not in a precise order. So it might happen that the first request arrive the last one, and so old preferences are saved.

To fix:
In the file Gadgets.js, function "gadgets.IfrGadgetService.prototype.setUserPref", prefs is updated with all the name/value, and ALL the prefs object is saved. Instead of saving all the preferences, we should only save the updated preferences.

In org.exoplatform.portal.pom.spi.gadget.Gadget it will be needed to be able to add preference by name, something like :
public void setUserPref(String name, String value)

code :
Gadgets.js: http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js?r=HEAD
ExoBasedUserPrefStore.js: http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js?r=HEAD

links:
API doc about adgets.Prefs.set: http://code.google.com/apis/gadgets/docs/reference/#gadgets.Prefs.set
Jira gadget to test: http://jira4j.exoplatform.org/rest/gadgets/1.0/g/com.atlassian.jira.gadgets:watched-gadget/gadgets/watched-gadget.xml


  was:
Every call to gadgets.Prefs.set generate a call to save the data in the backend (an action in the dashboard portlet). To save we send all the set of preferences.

The jira gadget call this API multiple times in a very short time. So there is multiple ajax request sent to the backend but not in a precise order. So it might happen that the first request arrive the last one, and so old preferences are saved.

To fix:
In the file Gadgets.js, function "gadgets.IfrGadgetService.prototype.setUserPref", prefs is updated with all the name/value, and ALL the prefs object is saved. Instead of saving all the preferences, we should only save the updated preferences.

code :
Gadgets.js: http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js?r=HEAD
ExoBasedUserPrefStore.js: http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js?r=HEAD

links:
API doc about adgets.Prefs.set: http://code.google.com/apis/gadgets/docs/reference/#gadgets.Prefs.set
Jira gadget to test: http://jira4j.exoplatform.org/rest/gadgets/1.0/g/com.atlassian.jira.gadgets:watched-gadget/gadgets/watched-gadget.xml




> userPref of gadgets are not sometime not saved correctly
> --------------------------------------------------------
>
>                 Key: GTNPORTAL-511
>                 URL: https://jira.jboss.org/jira/browse/GTNPORTAL-511
>             Project: GateIn Portal
>          Issue Type: Bug
>          Components: User Interface
>    Affects Versions: 3.0.0-Beta04
>         Environment: svn r1330
>            Reporter: jerem j
>             Fix For: 3.0.0-CR01
>
>   Original Estimate: 3 days
>  Remaining Estimate: 3 days
>
> Every call to gadgets.Prefs.set generate a call to save the data in the backend (an action in the dashboard portlet). To save we send all the set of preferences.
> The jira gadget call this API multiple times in a very short time. So there is multiple ajax request sent to the backend but not in a precise order. So it might happen that the first request arrive the last one, and so old preferences are saved.
> To fix:
> In the file Gadgets.js, function "gadgets.IfrGadgetService.prototype.setUserPref", prefs is updated with all the name/value, and ALL the prefs object is saved. Instead of saving all the preferences, we should only save the updated preferences.
> In org.exoplatform.portal.pom.spi.gadget.Gadget it will be needed to be able to add preference by name, something like :
> public void setUserPref(String name, String value)
> code :
> Gadgets.js: http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js?r=HEAD
> ExoBasedUserPrefStore.js: http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js?r=HEAD
> links:
> API doc about adgets.Prefs.set: http://code.google.com/apis/gadgets/docs/reference/#gadgets.Prefs.set
> Jira gadget to test: http://jira4j.exoplatform.org/rest/gadgets/1.0/g/com.atlassian.jira.gadgets:watched-gadget/gadgets/watched-gadget.xml

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the gatein-issues mailing list