40 Using People Connections Data Controls and Java APIs

This chapter provides an overview of People Connections service data controls and Java APIs. It further provides details about each data control and how to add it to your project and a pointer to information about how to use data controls in a WebCenter Portal application.

This chapter includes the following sections:

40.1 Using People Connections Data Controls

The People Connections service provides data controls that enables you to create your own visualization of the People Connections functionality. This section provides an overview of the following data controls and lists and describes their supported methods, attributes, and classes:

  • People Connections Management Data Control

  • Profile Data Control

This section includes the following subsections:

40.1.1 Adding a Data Control to Your Project

Add a data control to your project by right-clicking it in the Resource Palette and selecting Add to Project from the resulting context menu. Once added, you can browse the data control's methods and attributes by expanding it in the Data Controls panel in the Application Navigator.

Add a data control to an application page by dragging it onto the page from the Data Controls panel. Once placed, a context menu opens with options for selecting the type of component to which to bind the data, such as a button or a text box.

See Also:

For information about using data controls in a WebCenter Portal application, see Section 7.1.3, "Using WebCenter Data Controls."

40.1.2 Working with People Connections Management Data Control

The People Connections Management Data Control provides methods for adding and managing connections and connections lists. The primary methods exposed include:

The subsections in this section list and describe the methods associated with the People Connections Management Data Control.

40.1.2.1 connectionLists

A collection of details about connections lists, including the list ID, name, localized name, number of members, whether or not the list is modifiable, and member user IDs. Table 40-1 lists and describes the attributes associated with this method.

Table 40-1 Attributes of the Method connectionLists

Attribute Description

id

The connections lists IDs

listName

The names of connections lists

localizedName

The localized names of connections lists

memberCount

The number of members on each named connections list

modifiable

Information about whether a named connections list can be modified

memberUserIds

The user IDs of members on each named connections list


40.1.2.2 groupedPeopleCounts

The number of connections contained in each connections group.

40.1.2.3 receivedInvitations

A collection of details about a received invitation to connect, including when the invitation was sent and received, the invitation's GUID, the invitation message, and the user IDs of the user who sent the invitation and who received it. Table 40-2 lists and describes the attributes associated with this method.

Table 40-2 Attributes of the Method receivedInvitations

Attribute Description

dateFormattedAsReceived

The date the invitation was received according to the recipient's time stamp

dateFormattedAsSent

The date the inviation was sent according to the sender's time stamp.

id

The GUID of the received invitation

invitationMessage

The invitation message

inviteeUserid

The user ID of the person who received the invitation

invitorUserid

The user ID of the person who sent the invitation

sentDate

The date the invitation was sent according to the system time stamp


40.1.2.4 sentInvitations

A collection of details about a sent invitation to connect, including when the invitation was sent and received, the invitation's GUID, the invitation message, and the user IDs of the user who sent the invitation and who received it. lists and describes the attributes associated with this method. Table 40-3 lists and describes the attributes associated with this method.

Table 40-3 Attributes of the Method sentInvitations

Attribute Description

dateFormattedAsReceived

The date the invitation was received according to the recipient's time stamp

dateFormattedAsSent

The date the inviation was sent according to the sender's time stamp

id

The unique GUID of the received invitation

invitationMessage

The invitation message

inviteeUserid

The user ID of the person who received the invitation

invitorUserid

The user ID of the person who sent the invitation

sentDate

The date the invitation was sent according to the system time stamp


40.1.2.5 acceptInvitation(String invitationId)

A method for accepting invitations to connect. Table 40-4 lists and describes the parameters associated with this method.

Table 40-4 Parameters of the Method acceptInvitations

Parameter Description

invitationId

The GUID of the invitation to connect to be accepted


40.1.2.6 addConnectionsToList(List userids, String listName)

A method for adding identified users to a named connections list. Table 40-5 lists and describes the parameters associated with this method.

Table 40-5 Parameters of the Method addConnectionsToList

Parameter Description

userids

The user names of the users to add to the named connections list

listName

The name of the connections list to which to add identified users


40.1.2.7 createConnectionList(String listName)

A method for creating a connections list. Table 40-6 lists and describes the parameters associated with this method.

Table 40-6 Parameters ofthe Method createConnectionList

Parameter Description

listName

The name to give the new connections list


40.1.2.8 declineInvitation(String invitationId)

A method for declining an invitation to connect. Table 40-7 lists and describes the parameters associated with this method.

Table 40-7 Parameters of the Method declineInvitation

Parameter Description

invitationId

The unique GUID of the declined invitation


40.1.2.9 dropConnectionList(String listName)

Method for deleting a connections list. Table 40-8 lists and describes the parameters associated with this method.

Table 40-8 Parameters of the Method dropConnectionList

Parameter Description

listName

The name of the connections list to delete


40.1.2.10 getConnectionList(String connectionListName)

Returns an object that represents a Connections List. This object provides details about a connections list acquired for the given connection list name. Table 40-9 lists and describes the parameters associated with this method. Table 40-10 lists and describes the attributes associated with this method.

Table 40-9 Parameters of the Method getConnectionList

Parameter Description

connectionListName

The name of the connections list for which to return the following attributes (see Table 40-10):

  • id

  • listName

  • localizedName

  • memberCount

  • modifiable

  • memberUserIds


Table 40-10 Attributes of the Method getConnectionList

Attribute Description

id

The unique GUID of the connections list to return

listName

The name of the connections list to return

localizedName

The localized name of the connections list to return

memberCount

The number of members on the connections list to return

modifiable

An indicator of whether the returned connections list can be modified

memberUserIds

The user IDs of the members of a returned connections list


40.1.2.11 getConnections(String userid, String connectionListName, String filterPattern, String sortBy, int startIndex, int fetchSize)

Returns the Connection object, which provides details about the connection, including the connection's user ID, the connections lists on which the connection is a member, and details from a connection's profile. Table 40-11 lists and describes the parameters associated with this method. Table 40-12 lists and describes the attributes associated with this method.

Table 40-11 Parameters of the Method getConnections

Parameter Description

userid

The user ID for each returned connection

connectionListName

The name of the connection list from which to obtain connections

filterPattern

A filter to use against returned connections, such as "co," which returns condoleezza as well as nicole

sortBy

The order by which to sort connections

Enter LAST_ACTIVITY_TIME to sort connections in descending date/time order. Leave blank to sort alphabetically by name.

startIndex

The point from which to start fetching results

This is used for pagination. For example, the search can return 50 matching records, and only 10 are needed, starting from 1. Set startIndex to 1 and fetchSize to 10.

fetchSize

The number of results to return (see startIndex)


Table 40-12 Attributes of the Method getConnections

Attribute Description

connecteeUserId

The user ID of a connection

connectionListsMembershipList

The names of connections lists of which the connection is a member

connecteeUserProfile

The connectee's Profile details


40.1.2.12 getNumberOfConnections(String userid, String connectionListName, String filterPattern)

Returns the number of users (int) connected to the identified user. Table 40-13 lists and describes the parameters associated with this method. Table 40-14 lists and describes the attributes associated with this method.

Table 40-13 Parameters of the Method getNumberOfConnections

Parameter Description

userid

The user ID for whom to return the number of connections

connectionListName

The name of the connection list from which to obtain a count

filterPattern

A filter to use against returned connections, such as "co," which returns condoleezza as well as nicole


Table 40-14 Attributes of the Method getNumberOfConnections

Attribute Description

Int

The number of connections to return


40.1.2.13 ignoreInvitation(String invitationId)

Specifies that the invitation with the specified ID should be ignored. Table 40-15 lists and describes the parameters associated with this method.

Table 40-15 Parameters of the Method ignoreInvitation

Parameter Description

invitationId

The GUID of the connection invitation to ignore


40.1.2.14 inviteUserForConnection(String userid, String invitationMessage, Collection connectionListNames)

A means of inviting the user with the specified user ID to connect. Includes the invitation message, such as, "I would like you to be my connection." Also includes one or more connection list names to which to add the invitee once the invitation is accepted. Table 40-16 lists and describes the parameters associated with this method.

Table 40-16 Parameters of the Method inviteUserForConnection

Parameter Description

userid

User ID of the invitee

invitationMessage

Connection message, such as, "Let's connect!"

connectionListNames

The names of the connecitons lists to add the invitee to once the invitation is accepted


40.1.2.15 isConnectionListModifiable(String listName)

Returns true or false (boolean) as to whether the named connections list can be modified. Table 40-17 lists and describes the parameters associated with this method. Table 40-18 lists and describes the attributes associated with this method.

Table 40-17 Parameters of the Method isConnectionListModifiable

Parameter Description

listName

The name of the connections list for which to determine whether it can be modified


Table 40-18 Attributes of the MethodisConnecitonListModifiable

Attribute Description

boolean

True or false, depending on whether the named connections list can be modified


40.1.2.16 isConnectionPartOfUnmodifiableList(String connecteeGuid)

Returns true or false (boolean) as to whether the identified user is a member of a connections list that cannot be modified. Table 40-19 lists and describes the parameters associated with this method.

Table 40-19 Parameters of the Method isConnectionPartOfUnmodifiableList

Parameter Description

connecteeGuid

The GUID of the connection for whom to determine whether this connection is a member of a connections list that cannot be modified


40.1.2.17 removeConnection(String userid, boolean fromListOnly, String listName)

A method for removing the identified connection either as a connection or from a connections list. Table 40-20 lists and describes the parameters associated with this method.

Table 40-20 Parameters of the Method removeConnection

Parameter Description

userid

The user name of the connection to remove from the specified list

fromListsOnly

A flag (true or false) indicating whether to remove the user as a connection or remove the user only from the specified connections list

listName

The name of the connections list from which to remove the specified user


40.1.2.18 searchUsers(String filterPattern, int startIndex, int fetchSize)

Returns the object Users, which is a collection of details about returned users, including the user's relational attributes, GUID, and profile details. Table 40-21 lists and describes the parameters associated with this method. Table 40-22 lists and describes the attributes associated with this method.

Table 40-21 Parameters of the Method searchUsers

Parameter Description

filterPattern

A filter to use against returned search terms, such as "co," which returns condoleezza as well as nicole

startIndex

The point from which to start fetching results

This is used for pagination. For example, the search can return 50 matching records, and only 10 are needed, starting from 1. Set startIndex to 1 and fetchSize to 10.

fetchSize

The number of results to return (see startIndex)


Table 40-22 Attributes of the Method searchUsers

Attribute Description

relationalAttributes

userGuid

The user's unique GUID

userProfile

The user's Profile details


40.1.2.19 updateConnectionListsMembership(String member, Collection addListIds, Collection removeListIds)

Provides a means of updating an identified connection's list membership by adding the connection to identified connections lists and removing the connection from identified connections lists. Table 40-23 lists and describes the parameters associated with this method.

Table 40-23 Parameters of the updateConnectionListsMembership Method

Parameter Description

member

The user name of the member whose connections list membership to manage

addListIds

The names of the connections lists to which to add the identified user

removeListIds

The names of the connections lists from which to remove the identified user


40.1.3 Working with Profile Data Control

The Profile Data Control provides methods for returning and updating Profile details.

The subsections in this section list and describe the methods associated with the Profile Data Control.

40.1.3.1 Method: getProfile(String userId)

A method for returning the WCUserProfile object, which is a collection of user Profile details. Table 40-24 lists and describes the parameters associated with this method.

Table 40-24 Parameters for the getProfile Method

Parameter Description

userID

The ID of the user for whom to return Profile details


Tip:

To see the attributes associated with the WCUserProfile object, expand the WCUserProfile node under the getProfile method on the Data Controls panel in the Application Navigator.

40.1.3.2 Method: getProfileForUpdate(String userId)

A method for updating the WCUserProfile object, which is a collection of user Profile details. Table 40-25 lists and describes the parameters associated with this method.

Table 40-25 Parameters for the getProfileForUpdate Method

Parameter Description

userID

The ID of the user for whom to update Profile details


Tip:

To see the attributes associated with the WCUserProfile object, expand the WCUserProfile node under the getProfileForUpdate method on the Data Controls panel in the Application Navigator.

40.2 People Connections Service Java APIs

The People Connections service has associated Java APIs that you can use to work with service features. These include:

  • oracle.webcenter.peopleconnections.connections

  • oracle.webcenter.peopleconnections.wall

  • oracle.webcenter.activitystreaming

Look in Oracle Fusion Middleware Java API Reference for Oracle WebCenter for more information