You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Kevin Brown (JIRA)" <ji...@apache.org> on 2008/07/02 19:09:45 UTC

[jira] Commented: (SHINDIG-421) Shindig uses fields that might not be supported

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

Kevin Brown commented on SHINDIG-421:
-------------------------------------

I believe you can specify the fields your container supports in your container.js under the "opensocial-xxxx" feature.

> Shindig uses fields that might not be supported
> -----------------------------------------------
>
>                 Key: SHINDIG-421
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-421
>             Project: Shindig
>          Issue Type: Bug
>          Components: Features (Javascript)
>            Reporter: Henning Schmiedehausen
>
> In opensocial-reference/person.js, there is the following code:
> var ORDERED_NAME_FIELDS_ = [
>     opensocial.Name.Field.HONORIFIC_PREFIX,
>     opensocial.Name.Field.GIVEN_NAME,
>     opensocial.Name.Field.FAMILY_NAME,
>     opensocial.Name.Field.HONORIFIC_SUFFIX,
>     opensocial.Name.Field.ADDITIONAL_NAME];
> [...]
>  // Next try to construct the name from the individual components
>     var fullName = '';
>     for (var i = 0; i < ORDERED_NAME_FIELDS_.length; i++) {
>       var nameValue = name.getField(ORDERED_NAME_FIELDS_[i]);
>       if (nameValue) {
>         fullName += nameValue + ' ';
>       }
>     }
>     return fullName.replace(/^\s+|\s+$/g, '') ;
> However, our container will not support some of these fields. Shouldn't Shindig check for this using supportsField() ?
>     var fullName = '';
>     for (var i = 0; i < ORDERED_NAME_FIELDS_.length; i++) {
>       if (opensocial.getEnvironment().supportsField(opensocial.Environment.ObjectType.NAME, ORDERED_NAME_FIELDS_[i])) {
>         var nameValue = name.getField(ORDERED_NAME_FIELDS_[i]);
>         if (nameValue) {
>           fullName += nameValue + ' ';
>         }
>       }
>     }

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