Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: FQL and SpringSocialFacebook

  1. #11
    Join Date
    Aug 2004
    Posts
    1,070

    Default

    These are all good things that you're pointing out. I'll look into this one...but it'd be helpful if you find things like this to open a bug in JIRA at https://jira.springsource.org/browse/SOCIALFB. Sometimes these comments in the forums get lost in all of the forum noise; but I notice open bugs in JIRA.
    Craig Walls
    Spring Social Project Lead

  2. #12
    Join Date
    Feb 2012
    Posts
    29

    Default

    Quote Originally Posted by habuma View Post
    These are all good things that you're pointing out. I'll look into this one...but it'd be helpful if you find things like this to open a bug in JIRA at https://jira.springsource.org/browse/SOCIALFB. Sometimes these comments in the forums get lost in all of the forum noise; but I notice open bugs in JIRA.
    I will do that. I do like to take my time, make sure I understand the code and intent before adding a bug. Nobody wants JIRA full of hundreds of wish-list items.

  3. #13
    Join Date
    Feb 2012
    Posts
    29

    Default

    https://jira.springsource.org/browse/SOCIALFB-75
    Mostly about the getList() issue, but touches on the whole set of getXYZ issues.

  4. #14
    Join Date
    Feb 2012
    Posts
    29

    Default FqlResult and list of primitive values

    Here is a possible modification to FqlResult, in the vein of FqlResultMapper:
    If you need to map an array of primitives, like Integer, String, or Array, the existing FqlResultMapper will not suffice.
    Class Cast Errors come out, since it tries to handle the data as a List of Map<String,Object>

    Would a FqlValueMapper make sense?
    Code:
    public interface FqlValueMapper<T> {
        T mapObject(Object objectValue);
    }
    with a function in FqlResult like
    Code:
    public <T> List<T> getList(String fieldName, FqlValueMapper<T> mapper) {
        // get field as List<Object>, and iterate over each item, passing it to the FqlValueMaper
        ....
    }
    This would let us handle the stream table that has a list of ids in 'tagged_ids' or the 'message_tags' that is a List<List<tagObject>>

    message_tags (class java.util.ArrayList): [[{id=100002886616615, name=Robert Blair, type=user, offset=0, length=12}]]

    Should I make a bug, or make a pull request. (not the git expert yet, mind you.)

  5. #15
    Join Date
    Feb 2012
    Posts
    29

    Default

    habuma, don't go rushing to add this stuff quite yet -
    I've found another facet in the facebook world.
    Some of the FQL values in json can come as a sparse array OR regular array
    eg,
    "message_tags": { "7": [ {
    "id": 157167397630682,
    "name": "INQ Mobile (SF)",
    "type": "page",
    "offset": 7,
    "length": 15
    }]},
    or
    message_tage[[{"offset":0, ...}]]

    Might add a getSparseArray(fieldName, Mapper()) function that handles that.
    It's a bit confusing, so I'll need to think if there is a better way, or one that does not require a library change.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •