|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.code.facebookapi.TemplatizedAction
public class TemplatizedAction
Utility class to assist in creating a templatized action for publishing to the minifeed/newsfeed, because the API call Facebook decided to add in order to do it is ridiculously complex.
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
log
|
static java.lang.String |
UID_TOKEN
|
| Constructor Summary | |
|---|---|
TemplatizedAction(java.lang.String titleTemplate)
Constructor |
|
TemplatizedAction(java.lang.String titleTemplate,
java.lang.String bodyTemplate)
Constructor |
|
TemplatizedAction(java.lang.String titleTemplate,
java.lang.String bodyTemplate,
java.lang.String bodyGeneral)
Constructor |
|
| Method Summary | |
|---|---|
void |
addBodyParam(java.lang.String key,
java.lang.String value)
Add a parameter value for the body template. |
void |
addPicture(java.lang.Long imageUid,
java.lang.String linkHref)
Add a picture to be associated with this feed entry, along with a link to be associated with the picture (clicking on the picture in the feed will go to the specified link). Note that only 4 pictures may be present at any given time. |
void |
addPicture(java.lang.String imageHref)
Add a picture to be associated with this feed entry, the picture will not have an associated link. |
void |
addPicture(java.lang.String imageHref,
java.lang.String linkHref)
Add a picture to be associated with this feed entry, along with a link to be associated with the picture (clicking on the picture in the feed will go to the specified link). Note that only 4 pictures may be present at any given time. |
void |
addTargetIds(java.util.Collection<java.lang.Object> facebookIds)
Append to the set of friends who are associated with this action. |
void |
addTargetIds(java.lang.String newIds)
Append to the list of friends who are associated with this action. This method *will not* clear out any previously added target ids. |
void |
addTitleParam(java.lang.String key,
java.lang.String value)
Add a parameter value for the title template. |
java.lang.String |
getBodyGeneral()
|
java.lang.String |
getBodyParams()
Get the body params as a JSON-formatted string. |
java.lang.String |
getBodyTemplate()
|
java.lang.Long |
getPageActorId()
|
java.util.Collection<IPair<java.lang.Object,java.net.URL>> |
getPictures()
Get the list of pictures. |
java.lang.String |
getTargetIds()
|
java.lang.String |
getTitleParams()
Get the title params as a JSON-formatted string. |
java.lang.String |
getTitleTemplate()
|
void |
removePicture(int index)
Remove a picture from the list, this can be used to revise the list/free up space for alternate pictures. |
void |
setBodyGeneral(java.lang.String bodyGeneral)
Set the general body content for this feed entry. |
void |
setBodyTemplate(java.lang.String bodyTemplate)
Set the body template for this feed entry. |
void |
setPageActorId(java.lang.Long pageActorId)
|
void |
setPictures(java.util.List<IPair<java.lang.Object,java.net.URL>> pics)
Set the pictures to display all at once, if you feel like building the Collection |
void |
setTargetIds(java.util.Collection<java.lang.Object> facebookIds)
Set the target ids of friends who are associated with this action. |
void |
setTargetIds(java.lang.String targetIds)
Set the target ids of friends who are associated with this action. |
void |
setTitleTemplate(java.lang.String titleTemplate)
Set the title template for this feed entry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
public static final java.lang.String UID_TOKEN
| Constructor Detail |
|---|
public TemplatizedAction(java.lang.String titleTemplate)
titleTemplate - the title-template to set.
public TemplatizedAction(java.lang.String titleTemplate,
java.lang.String bodyTemplate)
titleTemplate - the title template to usebodyTemplate - the body template to use
public TemplatizedAction(java.lang.String titleTemplate,
java.lang.String bodyTemplate,
java.lang.String bodyGeneral)
titleTemplate - the title template to usebodyTemplate - the body template to usebodyGeneral - the non-templatized body content to use| Method Detail |
|---|
public void removePicture(int index)
index - the index to remove from.
public void addPicture(java.lang.Long imageUid,
java.lang.String linkHref)
imageUid - the id of the image to display. This can be a picture id or a Facebook user-id.linkHref - the URL of the link to go to when the image is clicked.
public void addPicture(java.lang.String imageHref,
java.lang.String linkHref)
imageHref - the URL of the image to display in the feed.linkHref - the URL of the link to go to when the image is clicked.public void addPicture(java.lang.String imageHref)
imageHref - the URL of the image to display in the feed.public void setPictures(java.util.List<IPair<java.lang.Object,java.net.URL>> pics)
pics - the pictures to set.public java.util.Collection<IPair<java.lang.Object,java.net.URL>> getPictures()
public void addTitleParam(java.lang.String key,
java.lang.String value)
key - the name of the parameter/token.value - the value to set it to.
public void addBodyParam(java.lang.String key,
java.lang.String value)
key - the name of the parameter/token.value - the value to set it to.public java.lang.String getTitleParams()
public java.lang.String getBodyParams()
public java.lang.String getBodyGeneral()
public void setBodyGeneral(java.lang.String bodyGeneral)
bodyGeneral - non-templatized markup that will be displayed in this feed entry. When multiple entries are aggregated, only the bodyGeneral from (an arbitrarily
chosen) one of them will appear in the aggregate entry, meaning that any markup specified here must be generic enough that it can make sense in any
context.public java.lang.String getBodyTemplate()
public void setBodyTemplate(java.lang.String bodyTemplate)
bodyTemplate - templatized markup that will be used to compute the body section of this feed entry. Unlike titleTemplate, this markup *is not* required to utilize the
"{actor}" token, although you may choose to use any desired tokens in this section if you wish.public java.lang.String getTargetIds()
public void setTargetIds(java.lang.String targetIds)
targetIds - a comma-seperated list of Facebook UID's representing any friends of the current user who are associated with the action being published (so if the
action is "Bob waves to Sally and Susie", Sally and Susie are the targets).public void addTargetIds(java.lang.String newIds)
newIds - a comma-seperated list of Facebook UID's representing any friends of the current user who are associated with the action being published (so if the
action is "Bob waves to Sally and Susie", Sally and Susie are the targets).public void setTargetIds(java.util.Collection<java.lang.Object> facebookIds)
facebookIds - a list of all the Facebook UID to specify as targets. The elements in the collection may only be of type Integer or type String.public void addTargetIds(java.util.Collection<java.lang.Object> facebookIds)
facebookIds - a list of all the Facebook UID to specify as targets. The elements in the collection may only be of type Long or type String.public java.lang.String getTitleTemplate()
public void setTitleTemplate(java.lang.String titleTemplate)
titleTemplate - templatized markup to use as the title of this feed entry. It must contain the "{actor}" token.public java.lang.Long getPageActorId()
public void setPageActorId(java.lang.Long pageActorId)
pageActorId - the page actor-id to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||