You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Mat Mannion (JIRA)" <ji...@apache.org> on 2010/04/21 18:07:51 UTC

[jira] Created: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Perform hangman variable substitution on variables with later precedence
------------------------------------------------------------------------

                 Key: SHINDIG-1320
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
             Project: Shindig
          Issue Type: Improvement
          Components: Java
            Reporter: Mat Mannion
            Priority: Minor


The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml

In the case of a gadget specification as follows:

<Module>
 <ModulePrefs title="__UP_title__">
  <Locale>
   <msg name="title">Gadget title</msg>
  </Locale>
 </ModulePrefs>
 <UserPref name="title" default_value="__MSG_title__" />
 <Content />
</Module>

it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.

Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Commented: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Mat Mannion (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861391#action_12861391 ] 

Mat Mannion commented on SHINDIG-1320:
--------------------------------------

Could somebody commit this if it's not too much trouble and it looks okay? I'd rather not get out of sync with latest SVN if at all possible.

> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Updated: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Mat Mannion (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mat Mannion updated SHINDIG-1320:
---------------------------------

    Attachment: shindig-1320.patch

New patch, reviewed at http://codereview.appspot.com/959042/show

> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Updated: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Mat Mannion (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mat Mannion updated SHINDIG-1320:
---------------------------------

    Attachment: shindig-1320.patch

Attached patch, code review here: http://codereview.appspot.com/959042/show

> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Updated: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Mat Mannion (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mat Mannion updated SHINDIG-1320:
---------------------------------

    Attachment:     (was: shindig-1320.patch)

> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Commented: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Mat Mannion (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859741#action_12859741 ] 

Mat Mannion commented on SHINDIG-1320:
--------------------------------------

The enum isn't actually relied upon in VariableSubstituter [sic], that just adds them in order.

I do agree that using an injected list would be better (and would make the order configurable) - I'll look into that when I get chance. 

> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Resolved: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Paul Lindner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Lindner resolved SHINDIG-1320.
-----------------------------------

    Fix Version/s: 1.1-BETA6
       Resolution: Fixed

patch applied, thanks!


> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>             Fix For: 1.1-BETA6
>
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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


[jira] Commented: (SHINDIG-1320) Perform hangman variable substitution on variables with later precedence

Posted by "Henry Saputra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859587#action_12859587 ] 

Henry Saputra commented on SHINDIG-1320:
----------------------------------------

Looks good but relying on order in the enum is kind of flaky in my opinion.

Better fix probably to add Substituer interface and create new substituer classes for Module and Message types to inject the List<Substitiuer> to VariableSubstituer via GadgetModule to maintain the right ordering to Substiutions class.

> Perform hangman variable substitution on variables with later precedence
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-1320
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1320
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Mat Mannion
>            Priority: Minor
>         Attachments: shindig-1320.patch
>
>
> The OpenSocial 0.9 specification http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/Gadgets-API-Specification.html#process has no explicit statement that says that hangman variables should be substituted in any kind of order or with precedence, but there are some gadgets that rely on this behaviour in iGoogle, for example their to do list gadget: http://www.google.com/ig/modules/todo.xml
> In the case of a gadget specification as follows:
> <Module>
>  <ModulePrefs title="__UP_title__">
>   <Locale>
>    <msg name="title">Gadget title</msg>
>   </Locale>
>  </ModulePrefs>
>  <UserPref name="title" default_value="__MSG_title__" />
>  <Content />
> </Module>
> it seems reasonable that the content would be "Gadget title", rather than "__MSG_title__" as it is at the moment. The Substitutions class already has some vague comments relating to precedence that don't seem to have been applied to the actual substitutions.
> Since the spec already has an order in the way it is written (MSG -> UP -> MODULE -> BIDI) it would seem reasonable to replicate this ordering in both the Substitutions.Type enum and in the order that substitutions are added in VariableSubstituter.substitute(), and then to allow substitutions to use pre-existing substitutions when they are added.

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