[
http://jira.amdatu.org/jira/browse/AMDATUOPENSOCIAL-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11331#comment-11331
]
Ivo Ladage - van Doorn commented on AMDATUOPENSOCIAL-83:
--------------------------------------------------------
Ok, I got it working using the cookie based userpreferences store shipped with
Shindig but disabled by default. Unfortunately, a lot of modifications were
required to get it working, part of them covered by the issue
https://issues.apache.org/jira/browse/SHINDIG-1248. Required modifications:
- Overrule the feature.xml of the shindig.conatiner feature and append the
cookiebaseduserprefstore.js to it. It is not included by default.
- Overrule the shindig-container.js and:
- Remove the lines that set the UserPrefStore to the DefaultUserPrefStore
- Modify the shindig.IfrGadgetService.prototype.setUserPref function as
applied in this patch, default Shindig function is not completely correct
- In shindig.Gadget.prototype.getUserPrefs, add loading the default user
preferences from the UserPrefStore, as applied in this patch
- Overrule the cookiebaseduserprefstore.js and:
- Change all "gadgets." prefixes in "shindig.". The cookiebaseduserprefstore
shipped with 2.0.2 still relies on gadgets.js contained by 1.1 but replaced
with shindig-container.js in 2.0
- In gadgets.CookieBasedUserPrefStore.prototype.getPrefs, update the userpref
returned to be an object instead of a single value, as applied in this patch
- In shindig.CookieBasedUserPrefStore.prototype.savePrefs change getUserPref
into getUserPrefValue
So basically there are three issues with the default userprefs in Shindig:
- The cookiebaseduserprefstore is disabled by default
- The cookiebaseduserprefstore still uses the JS API of 1.1 and was not yet
upgraded to 2.0
- At some point in time the type of userpref was changed from String to an
object holding 'value' and 'type' properties. But these changes were not
applied to all code yet.
> JavaScript error 'this.userPrefs is undefined' when rendering external
> gadgets in the dashboard
> -----------------------------------------------------------------------------------------------
>
> Key: AMDATUOPENSOCIAL-83
> URL: http://jira.amdatu.org/jira/browse/AMDATUOPENSOCIAL-83
> Project: Amdatu OpenSocial
> Issue Type: Bug
> Components: OpenSocial services
> Affects Versions: 0.2.0
> Reporter: Ivo Ladage - van Doorn
> Fix For: 0.2.0
>
>
> Many gadgets cause this JS error, like this one:
> http://www.google.com/ig/modules/tabnews.xml
> It seems that user preferences are not supported by default in Shindig, see
> also this post:
> http://mail-archives.apache.org/mod_mbox/shindig-users/201010.mbox/%[email protected]%3E
> Indeed, in the default shindig-container.js the shindig.DefaultUserPrefStore
> is used to store user preferences. This implementation is empty however.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Amdatu-developers mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-developers