You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Cassie Doll (JIRA)" <ji...@apache.org> on 2008/03/13 12:13:51 UTC

[jira] Commented: (SHINDIG-124) Implementation POJO for opensocial.Enum.xx and opensocial.Message

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

Cassie Doll commented on SHINDIG-124:
-------------------------------------

Hey Michael - 

Thanks for the patch! Unfortunately though I need you to make the diff for the patch from within your shindig directory. Right now the patch has lines that look like this: --- C:/work/OpenSocial_Project/projects/piczo_sd/src/java/gadgets/... which means that when I patch it it creates a new directory called "C:" with a work dir inside etc etc. 

Please refer to the patch instructions on our website if I didn't explain that well enough. 

Also, some quick things I noticed so far: 
- we use 2 space indents, so you should probably change your editor to use that standard and re-indent those files
- and the enum logic is a little off, i know this is pretty confusing in the spec so let me try to explain it a little better

So, the smoker field in the Person class needs to return an Enum object. (That's pretty easy: private Enum smoker)
Then, the smoker.getKey() should equal NO, YES, SOCIALLY, etc, or null.
Lastly, the smokers displayValue() should return something usable as a string. For now this is usually just the non-caps case, "no", "yes", "socially" etc. It can be any string though. Especially if the getKey() returned null.

This handles the following cases:
- pretend social network A allows you to set your smoking preference. On their site you can say "yes, no, twice a week". When contructing opensocial objects this would correspond to: 
-- smoker : {key: YES, displayValue: yes  }
-- smoker : {key: NO, displayValue: no }  
-- smoker : {key: null, displayValue: twice a week  }

or if the user spoke german and smoked:
-- smoker : {key: YES, displayValue: ya }

The gadget can always use person.getField('smoker').getDisplayValue() when they just want to display something on the screen. If they want to generate smoker stats then they can use the key value to guarantee consistency across containers and languages.  

This new explanation I think changes what you have just a little. Let me know if you have any more questions. Thanks!

- Cassie

> Implementation POJO for opensocial.Enum.xx and opensocial.Message
> -----------------------------------------------------------------
>
>                 Key: SHINDIG-124
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-124
>             Project: Shindig
>          Issue Type: New Feature
>          Components: Gadgets Server - Java
>            Reporter: Michael Papp
>         Attachments: fix-124-1-bug.patch.txt, fix-124-bug.patch.txt
>
>
> Submitting proposed implementation for opensocial.Enum and opensocial.Enum.Drinker, opensocial.Enum.Gender, and opensocial.Enum.Smoker.  This is a best guess pass as there are a number of ways of implementing this, and opensocial 0.7 spec for the getKey() is rather nebulous.  Anyway, hope this helps.  If approach is right, then I can amend patch to include tests.
> M. Papp

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