Hi Yong
With respect to your second question. I have the same question.
So far: I have found in the GadgetFactory class two methods addSubstitutions 
and applySubstitutions. This class is used by MetadataHandler which handles the 
metadata request. It looks to me like this is the point where one should apply 
the substitutions to restore the user's preferences. The GadgetFactory class 
has the gadget url available as $this->context->getUrl(); and the token as 
$this->token assuming the service was called with a token, so one could use 
these to access the stored values I guess.
This is what I'm planning to do but to be honest I'm not 100% sure. I'm 
fumbling around in the dark a little.
Hope that helps even a little bit.
Justin







> 
> Date: Sun, 13 Jun 2010 21:46:06 +0800
> Subject: Questions about the user prefs storage
> From: [email protected]
> To: [email protected]
> 
> Hello All,
> 
> I want to store the gadgets user prefs on the web server side.
> Currently, there is a cookie-based storage for demo. I want to replace
> the save/read to cookie functions in saveprefs/getprefs, for example,
> use the gadgets.io.makeNonProxiedRequest functions to post the data to
> a servlet, then save the data to a database. However, I do not know
> how to handle the callback functions. If there is any network
> connection error, the getPrefs/savePrefs functions do not know if the
> call is OK.
> 
> Another question, how to restore these user prefs data? during the
> metadata request, there is no user-defined data, only the default
> value, Can I modify the rpcservlet process function to add the
> user-defined value in the gadget json array, then return to the
> client?
> 
> Thanks a lot !
> 
> Yong
                                          
_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now

Reply via email to