Class SocialFeedManager

Provides access to social feeds. It provides methods to create posts, delete posts, read posts, and perform other operations on posts.

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(context: ClientRuntimeContext): SocialFeedManager

Parameters

Returns

SocialFeedManager

Methods

public createImageAttachment(name: string, description: string, imageData: any): SocialAttachment

Creates an image attachment for a future post.

Parameters

  • name: string
  • description: string
  • imageData: any

Returns

SocialAttachment

public createPost(targetId: string, creationData: SocialPostCreationData): SocialThread

Creates a post in the current user's newsfeed, in the specified user's feed, or in the specified thread. This method returns a new or a modified thread.

Parameters

  • targetId: string

    Optional, specifies the target of the post. If this parameter is null, the post is created as a root post in the current user's feed. If this parameter is set to a site URL or a site actor identification, the post is created as a root post in the specified site feed. If this parameter is set to a thread identification, the post is created as a reply post in the specified thread.

  • creationData: SocialPostCreationData

    Specifies the format and content of the post.

Returns

SocialThread

public customFromJson(initValue: any): boolean

Parameters

  • initValue: any

Returns

boolean

public deletePost(postId: string): SocialThread

Deletes the specified post. This method returns a digest of the modified thread. If the entire thread is deleted, this method returns null. If the post being deleted is the root post of a thread, all reply posts are also deleted.

Parameters

  • postId: string

    Specifies the post to be deleted. Corresponds the value returned from SocialPost.get_id().

Returns

SocialThread

public fromJson(initValue: any)

Parameters

  • initValue: any

public getAllLikers(postId: string): SocialActor[]

Returns the set of users who have liked the specified post.

Parameters

  • postId: string

    Specifies the post being queried for information about users that like the post. Corresponds the value returned from SocialPost.get_id().

Returns

SocialActor[]

public getFeed(type: SocialFeedType, options: SocialFeedOptions): SocialFeed

Returns a feed for the current user. The feed consists of an array of message threads. Each thread consists of a root post and an array of reply posts.

Parameters

Returns

SocialFeed

public getFeedFor(actorId: string, options: SocialFeedOptions): SocialFeed

Returns the public feed for a user or for a site. The feed lists activity by the user and posts created by the server for that user. For example, the feed can include posts indicating the user's birthday or indicating that the user liked a post.

Parameters

  • actorId: string

    Corresponds to the value returned by SocialActor.get_id(). If the actorId specifies the current user, this method returns the public feed for the current user.

  • options: SocialFeedOptions

Returns

SocialFeed

public getFullThread(threadId: string): SocialThread

Returns the root post and all reply posts in the thread.

Parameters

  • threadId: string

Returns

SocialThread

public getMentions(clearUnreadMentions: boolean, options: SocialFeedOptions): SocialFeed

Returns a feed containing mention reference threads from the current user's personal feed.

Parameters

Returns

SocialFeed

public getPreview(itemUrl: string): SocialAttachment

Generates a preview for the content specified by the URL.

Parameters

  • itemUrl: string

Returns

SocialAttachment

public getPreviewImage(url: string, key: string, iv: string): any

Returns the preview image data for an image attachment.

Parameters

  • url: string

    Specifies the URL of the preview image relative to the personal site portal.

  • key: string

    Specifies the URL-encoded key to decrypt the image.

  • iv: string

    Specifies the URL-encoded initialization vector for decrypting the image.

Returns

any

public getUnreadMentionCount(): IntResult

Returns the server's count of unread mentions of the current user. The server maintains a count of unread mentions in posts, but does not track which mentions have been read. When a new mention is stored on the server, it increments the unread mention for the user specified by the mention. The unread mention count is cleared by the GetMentions method.

Returns

IntResult

public get_context(): ClientRuntimeContext

Returns

ClientRuntimeContext

public get_objectVersion(): string

Returns

string

public get_owner(): SocialActor

Returns the current user

Returns

SocialActor

public get_path(): ObjectPath

Returns

ObjectPath

public get_personalSitePortalUri(): string

Specifies the URI of the personal site portal.

Returns

string

public get_serverObjectIsNull(): boolean

Returns

boolean

public get_typedObject(): ClientObject

Returns

ClientObject

public isObjectPropertyInstantiated(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public isPropertyAvailable(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public likePost(postId: string): SocialThread

Specifies that the current user likes the specified post. Returns a digest thread containing the specified post. A digest thread contains the root post and a selection of reply posts

Parameters

  • postId: string

Returns

SocialThread

public lockThread(threadId: string): SocialThread

Prevents any user from adding a new reply post to the specified thread. Once a thread is locked, no new reply posts can be added until after the thread has been unlocked with the unlockThread method. This method returns a digest of the locked thread

Parameters

  • threadId: string

Returns

SocialThread

public refreshLoad()

public retrieve()

public retrieve(propertyNames: Array<string>)

Parameters

  • propertyNames: Array<string>

public set_objectVersion(value: string)

Parameters

  • value: string

public suppressThreadNotifications(threadId: string)

Suppresses activity notifications for the current user of updates to the specified thread.

Parameters

  • threadId: string

public unlikePost(postId: string): SocialThread

Specifies that the current user does not like the specified post. Returns a digest thread containing the specified post.

Parameters

  • postId: string

Returns

SocialThread

public unlockThread(threadId: string): SocialThread

Allows users to add new reply posts to the specified thread.

Parameters

  • threadId: string

Returns

SocialThread