Spring Social Facebook
  1. Spring Social Facebook
  2. SOCIALFB-73

Ability to access custom fields within a Page Object

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.0.1.RELEASE
    • Fix Version/s: 1.1.0.M3, 1.1.0.RELEASE
    • Component/s: API Binding
    • Labels:
      None
    • Environment:
      Windows 7/Eclipse

      Description

      Facebook provides some additional metadata about a Page in its response which is not accessible via the spring-social-facebook API without having to use the RestTemplate.

      For example, for the page about "A Scanner Darkly" (https://graph.facebook.com/11803178355), the metadata provided includes additional information relevant to that movie such as release date, director and actor.

      Despite having the category "Movie" this information is not necessarily guaranteed on all pages of this category, so it would appear these fields are optional or custom attributes of the page. As such having a getAttribute(String) method in the Page interface could be quite useful so these additional attributes can be made available.

      An alternative could be a Category specific Page object is returned which includes common features which may be relevant to that category - i.e. for a Book we could have 'author' and 'illustrator'; and for Movie 'director', 'release_date' and 'actor'.

        Activity

        Hide
        Craig Walls added a comment -

        Added 'extraData' property to capture any properties that are otherwise uncaptured.

        Uses Jackson's @JsonAnySetter. This mechanism is simple enough and could be applied in other Facebook domain types.

        Show
        Craig Walls added a comment - Added 'extraData' property to capture any properties that are otherwise uncaptured. Uses Jackson's @JsonAnySetter. This mechanism is simple enough and could be applied in other Facebook domain types.

          People

          • Assignee:
            Craig Walls
            Reporter:
            Barry John Williams
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: