There are other fields that currently have substitutions on igoogle that
aren't mentioned in the spec (relatively important ones like
[EMAIL PROTECTED] and the various image urls). I'm of the opinion that
all of these should be performed. In my current refactoring work (see...a
half dozen open JIRA issues :)) I'm just assuming that the missing fields in
the spec are an oversight. I'll drop an email to the spec discussion group
in a few minutes to clarify.

On Sun, Mar 2, 2008 at 11:42 PM, <[EMAIL PROTECTED]> wrote:

> Author: lindner
> Date: Sun Mar  2 23:42:48 2008
> New Revision: 632970
>
> URL: http://svn.apache.org/viewvc?rev=632970&view=rev
> Log:
> Apply patch from Nik Haldimann for SHINDIG-95, apply hangman substitutions
> on screenshot
> thumbnail.
>
> This appears to be an oversight in step 4 of the Gadgets spec:
>
>  v. Perform substitutions of each hangman expansion in the following
> fields:
>   a. [EMAIL PROTECTED], [EMAIL PROTECTED],
> [EMAIL PROTECTED], [EMAIL PROTECTED], Module.Content
>
> If this is the desired behavior (I'm guessing not, since we do want to
> i18n our images)
> then I can revert...
>
>
> Modified:
>
>  
> incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java
>
> Modified:
> incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java
> URL:
> http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java?rev=632970&r1=632969&r2=632970&view=diff
>
> ==============================================================================
> ---
> incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java
> (original)
> +++
> incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/Gadget.java
> Sun Mar  2 23:42:48 2008
> @@ -138,16 +138,19 @@
>    * @return URI used as a target for Gadget's title link, or null if
> malformed
>    */
>   public URI getTitleURI() {
> -    URI ret = null;
> -    if (baseSpec.getTitleURI() != null) {
> -      String uriStr = baseSpec.getTitleURI().toString();
> +    return substitutedURI(baseSpec.getTitleURI());
> +  }
> +
> +  private URI substitutedURI(URI uri) {
> +    if (uri != null) {
> +      String uriStr = uri.toString();
>       try {
> -        ret = new URI(substitutions.substitute(uriStr));
> +        return new URI(substitutions.substitute(uriStr));
>       } catch (URISyntaxException e) {
>         return null;
>       }
>     }
> -    return ret;
> +    return null;
>   }
>
>   /**
> @@ -180,11 +183,11 @@
>   }
>
>   public URI getScreenshot() {
> -    return baseSpec.getScreenshot();
> +    return substitutedURI(baseSpec.getScreenshot());
>   }
>
>   public URI getThumbnail() {
> -    return baseSpec.getThumbnail();
> +    return substitutedURI(baseSpec.getThumbnail());
>   }
>
>   public List<String> getCategories() {
>
>
>


-- 
~Kevin

Reply via email to