You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Kai Feng Zhang (JIRA)" <ji...@apache.org> on 2011/01/11 10:59:47 UTC

[jira] Commented: (SHINDIG-1465) set userPrefs key with wrong default value in DefaultIframeUriManager for new common container

    [ https://issues.apache.org/jira/browse/SHINDIG-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980028#action_12980028 ] 

Kai Feng Zhang commented on SHINDIG-1465:
-----------------------------------------

Request to close this issue, not a problem for me any more.
Thanks.

> set userPrefs key with wrong default value in DefaultIframeUriManager for new common container
> ----------------------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1465
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1465
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Kai Feng Zhang
>             Fix For: 3.0.0
>
>         Attachments: userPrefs_20101108.patch
>
>
> When using new common container to render gadget, the ifr request url will be from gadget metadata request. At the back end,  method makeRenderingUri() will be called on DefaultIframeUriManager class to generate the ifr url. In this method, there are following code snippet to add default user prefs into url.
>     // Add all UserPrefs
>     UserPrefs prefs = context.getUserPrefs();
>     for (UserPref up : gadget.getSpec().getUserPrefs().values()) {
>       String name = up.getName();
>       String data = prefs.getPref(name);
>       if (data == null) {
>         data = up.getDefaultValue();
>       }
>       boolean upInFragment = !view.needsUserPrefSubstitution();
>       addParam(uri, UriCommon.USER_PREF_PREFIX + up.getName(), data, useTpl, upInFragment);
>     }
> Such as if gadget spec xml defined a pref named "mycolor" with default value "Green", but the addParam method will change the "mycolor" value to "%up_mycolor%" because useTpl is true. Thus, ifr url will be requested with all invalid user prefs values. And when you try to get some default value from user prefs, it return invalid value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.