Janrain: User management platform for the social web

JRActivityObject Class Reference

An activity object you create, populate, and post to the user's activity stream. More...

Inherits Serializable, and JRJsonifiable.

List of all members.

Private Attributes

The various properties of the JRActivityObject that you can access and configure through the object's constructor, getters, and setters

String mAction
String mUrl
String mUserGeneratedContent
String mTitle
String mDescription
List< JRActionLinkmActionLinks
List< JRMediaObject > mMedia
JRDictionary mProperties
JREmailObject mEmail
JRSmsObject mSms

Constructors

Constructor for JRActivityObject

 JRActivityObject (String action, String url)

Getters/Setters

Getters and setters for the JRActivityObject's private properties

String getAction ()
String getUrl ()
String getUserGeneratedContent ()
void setUserGeneratedContent (String userGeneratedContent)
String getTitle ()
void setTitle (String title)
String getDescription ()
void setDescription (String description)
List< JRActionLinkgetActionLinks ()
void setActionLinks (List< JRActionLink > actionLinks)
void addActionLink (JRActionLink actionLink)
void addMedia (JRMediaObject media)
List< JRMediaObject > getMedia ()
void setMedia (List< JRMediaObject > media)
void setMedia (JRMediaObject mediaObject)
Map< String, Object > getProperties ()
void setProperties (JRDictionary properties)
JREmailObject getEmail ()
void setEmail (JREmailObject email)
JRSmsObject getSms ()
void setSms (JRSmsObject sms)

Detailed Description

An activity object you create, populate, and post to the user's activity stream.

Create an activity object, fill in the object's fields, and pass the object to the JREngage library when you are ready to publish. Currently supported providers are:

  • Facebook
  • LinkedIn
  • Twitter
  • MySpace
  • Yahoo!

Janrain Engage will make a best effort to use all of the fields submitted in the activity request, but note that how they get presented (and which ones are used) ultimately depends on the provider.

This API will work if and only if:

  • Your Janrain Engage application has been configured with the given provider
  • The user has already authenticated and has given consent to publish activity

Otherwise, you will be given an error response indicating what was wrong. Detailed error responses will also be given if the activity parameter does not meet the formatting requirements described below.

See also:
For more information of Janrain Engage's activity api, see the activity section of our API Documentation.

Constructor

JRActivityObject ( String  action,
String  url 
)

Returns a JRActivityObject initialized with the given action and URL.

Parameters:
actionA string describing what the user did, written in the third person. This value cannot be null
urlThe URL of the resource being mentioned in the activity update. Null for no resource link.
Exceptions:
IllegalArgumentExceptionif action is null

Member Function Documentation

String getAction ( )

Getter for the activity object's mAction property.

Returns:
A string describing what the user did, written in the third person (e.g., "wrote a restaurant review", "posted a comment", "took a quiz")
String getUrl ( )

Getter for the activity object's mUrl property.

Returns:
The URL of the resource being mentioned in the activity update
String getUserGeneratedContent ( )

Getter for the activity object's mUserGeneratedContent property.

Returns:
A string containing user-supplied content, such as a comment or the first paragraph of an article that the user wrote
void setUserGeneratedContent ( String  userGeneratedContent)

Setter for the activity object's mUserGeneratedContent property.

Parameters:
userGeneratedContentA string containing user-supplied content, such as a comment or the first paragraph of an article that the user wrote
String getTitle ( )

Getter for the activity object's mTitle property.

Returns:
The title of the resource being mentioned in the activity update
void setTitle ( String  title)

Setter for the activity object's mTitle property.

Parameters:
titleThe title of the resource being mentioned in the activity update
String getDescription ( )

Getter for the activity object's mDescription property.

Returns:
A description of the resource mentioned in the activity update
void setDescription ( String  description)

Setter for the activity object's mDescription property.

Parameters:
descriptionA description of the resource mentioned in the activity update
List<JRActionLink> getActionLinks ( )

Getter for the activity object's mActionLinks property.

Returns:
An array of JRActionLink objects, each having two attributes: text and href. An action link is a link a user can use to take action on an activity update on the provider
void setActionLinks ( List< JRActionLink actionLinks)

Setter for the activity object's mActionLinks property.

Parameters:
actionLinksAn array of JRActionLink objects, each having two attributes: text and href. An action link is a link a user can use to take action on an activity update on the provider
void addActionLink ( JRActionLink  actionLink)

Add to the activity object's mActionLinks property.

Parameters:
actionLinkA single JRActionLink to be added to the array of action links, creating the array if it hasn't already been created
void addMedia ( JRMediaObject  media)

Alias for addMedia(JRMediaObject)

Parameters:
mediaA single JRImageMediaObject, JRFlashMediaObject, or JRMp3MediaObject to be added to the array of media objects, creating the array if it hasn't already been created
List<JRMediaObject> getMedia ( )

Getter for the activity object's mMedia property.

Returns:
An array of objects with base class JRMediaObject (i.e. JRImageMediaObject, JRFlashMediaObject, JRMp3MediaObject)
void setMedia ( List< JRMediaObject >  media)

Setter for the activity object's mMedia property.

Parameters:
mediaAn array of objects with base class JRMediaObject (i.e. JRImageMediaObject, JRFlashMediaObject, JRMp3MediaObject)
void setMedia ( JRMediaObject  mediaObject)

Setter for the activity object's mMedia property.

Deprecated:
use addMedia(JRMediaObject)
Parameters:
mediaObjectA single JRImageMediaObject, JRFlashMediaObject, or JRMp3MediaObject to be added to the array of media objects, creating the array if it hasn't already been created
Map<String, Object> getProperties ( )

Getter for the activity object's mProperties property.

Returns:
An object with attributes describing properties of the update. An attribute value can be a string or an object with two attributes, text and href.
void setProperties ( JRDictionary  properties)

Setter for the activity object's mProperties property.

Parameters:
propertiesAn object with attributes describing properties of the update. An attribute value can be a string or an object with two attributes, text and href.
JREmailObject getEmail ( )

Getter for the activity object's mEmail property.

Returns:
An JREmailObject containing the content that a user can send via SMS to share an activity
void setEmail ( JREmailObject  email)

Setter for the activity object's mEmail property.

Parameters:
emailAn JREmailObject containing the content that a user can send via email to share an activity
JRSmsObject getSms ( )

Getter for the activity object's mSms property.

Returns:
An JRSmsObject containing the content that a user can send via SMS to share an activity
void setSms ( JRSmsObject  sms)

Setter for the activity object's mSms property.

Parameters:
smsAn JRSmsObject containing the content that a user can send via SMS to share an activity

Variables

String mAction [private]

A string describing what the user did, written in the third person (e.g., "wrote a restaurant review", "posted a comment", "took a quiz").

Getter:

String mUrl [private]

The URL of the resource being mentioned in the activity update.

Getter:
getUrl()
String mUserGeneratedContent [private]

A string containing user-supplied content, such as a comment or the first paragraph of an article that the user wrote.

Note:
Some providers (Twitter in particular) may truncate this value.
Getter/Setter:
getUserGeneratedContent(), setUserGeneratedContent()
String mTitle [private]

The title of the resource being mentioned in the activity update.

Note:
No length restriction on the status is imposed by Janrain Engage, however Yahoo truncates this value to 256 characters.
Getter/Setter:
getTitle(), setTitle()
String mDescription [private]

A description of the resource mentioned in the activity update.

Getter/Setter:
getDescription(), setDescription()
List<JRActionLink> mActionLinks [private]

An array of JRActionLink objects, each having two attributes: text and href. An action link is a link a user can use to take action on an activity update on the provider.

Example:
 action_links:
 [
   {
     "text": "Rate this quiz result",
     "href": "http://example.com/quiz/12345/result/6789/rate"
   },
   {
     "text": "Take this quiz",
     "href": "http://example.com/quiz/12345/take"
   }
 ]
Note:
Any objects added to this array that are not of type JRActionLink will be ignored.
Getter/Setter:
getActionLinks(), setActionLinks(), addActionLink()
List<JRMediaObject> mMedia [private]

An array of objects with base class JRMediaObject (i.e. JRImageMediaObject, JRFlashMediaObject, JRMp3MediaObject).

To publish attached media objects with your activity, create the preferred object, populate the object's fields, then add the object to the mMedia array. You can attach pictures, videos, and mp3s to your activity, although how the media objects get presented and whether or not they are used, depend on the provider.

If you include more than one media type in the array, JREngage will choose only one of these types, in this order:

  1. image
  2. flash
  3. mp3

Also, any objects added to this array that do not inherit from JRMediaObject will be ignored.

See also:
Media object format and rules are identical to those described on the Facebook Developer page on Attachments.
Getter/Setter:
getMedia(), setMedia(List<JRMediaObject>), setMedia(JRMediaObject)

An object with attributes describing properties of the update. An attribute value can be a string or an object with two attributes, text and href.

Example:
   properties:
   {
       "Time": "05:00",
       "Location":
       {
           "text": "Portland",
           "href": "http://en.wikipedia.org/wiki/Portland,_Oregon"
       }
   }
Getter/Setter:
getProperties(), setProperties()
JREmailObject mEmail [private]

An JREmailObject containing the subject and message body of an email, if the user wishes to share via email.

Getter/Setter:
getEmail(), setEmail()
JRSmsObject mSms [private]

A JRSmsObject containing the message body of an SMS, if the user wishes to share via SMS.

Getter/Setter:
getSms(), setSms()

The documentation for this class was generated from the following file:
  • /Users/nathan/android-code/engage.android/JREngage/src/com/janrain/android/engage/types/JRActivityObject.java
Copyright © 2017 Janrain, Inc.