This chapter provides an overview of the MCFIMInfo class and the MCFIMSingleButton class and discusses:
MCFIMInfo class
MCFIMSingleButton class
This section provides an overview of:
Using the MCFIMInfo class.
Data type for MCFIMInfo objects.
Scope of MCFIMInfo objects.
Use the MCFIMInfo class to launch an instant messaging session from a PeopleSoft page and initiate a chat. A developer can use either the PeopleCode class or a push-button with specific characteristics in Application Designer to initiate an instant messaging session.
Note. PeopleSoft recommends using the Application Designer push-button rather than PeopleCode in most applications. The PeopleCode program determines user presence information from the application server, whereas the push-button determines user presence from the browser. The application server must wait until it has all the presence information for that page before it can render the page. Though this processing is multi-threaded, it can still be slower than the push-button.
See Also
Configuring Instant Messaging in PeopleSoft MultiChannel Framework
Only use the MCFIMInfo class if your application requires the flexibility the PeopleCode can provide. The only supported networks are AOL and Yahoo. SameTime is supported using the Application Designer push-button, but not in PeopleCode.
Instant messages are sent by using the native instant message clients. This means that you can only use this for Microsoft Windows.
The page from which you launch the instant messaging session must be refreshed in order to update presence status.
MCFIMInfo objects are declared as type MCFIMInfo. For example:
Local MCFIMInfo &MyChat;
An MCFIMInfo object can be only instantiated from PeopleCode.
Use this object only in PeopleCode programs that are associated with an online process, not in an Application Engine program, a message subscription, a Component Interface, and so on.
Use the MCFIMSingleButton class to generate a single presence icon that displays all specified screen names. When a user moves the mouse pointer over a single presence icon, it will open a menu with all specified user screen names and their current online status.
See Also
The MCFIMSingleButton class is an application classes, not a built-in class, like Rowset, Field, Record, MCFIMInfo, and so on. Before you can use this class in your PeopleCode program, you must import it into your program. An import statement either names a particular application class or imports all the classes in a package. Using the asterisks after the package name makes all the application classes directly contained in the named package available. Application classes contained in subpackages of the named package are not made available.
To import the MCFIMSingleButton class, use the following import statement:
import PT_MCF_IM:*;
In this section, the MCFIMInfo class methods are presented in alphabetical order.
Syntax
AddUser(User)
Description
Use the AddUser method to add a user to the instant messaging session.
Parameters
User |
Specify the user that you want to add to the instant messaging session, as a string. |
Returns
A Boolean value: True if the user was successfully added, False otherwise.
Syntax
CheckAll()
Description
Use the CheckAll method to check the status of users on the instant messaging session.
This method makes the actual network requests to retrieve presence information.
Parameters
None.
Returns
A Boolean: True if the check is successful, False otherwise.
Syntax
GetAdditionalUserInfo()
Description
This method returns additional user information.
Parameters
None.
Returns
String.
Syntax
GetErrorImageName()
Description
Use GetErrorImageName to return the name of the image used for errors.
Parameters
None.
Returns
String.
Syntax
GetOffLineImageName()
Description
Use GetOffLineImageName to return the name of the image used to indicate off line status.
Parameters
None.
Returns
String.
Syntax
GetOnlineImageName()
Description
Use GetOnlineImageName to return the name of the image used to indicate online status.
Parameters
None.
Returns
String.
Syntax
GetUnknownImageName()
Description
Use GetUnknownImageName to return the image of unknown users.
Parameters
None.
Returns
String.
Syntax
GetLaunchURL(User)
Description
Use the GetLaunchURL method to return the URL that launches the native client and contacts the user. This is a local URL of one of the following forms:
aim:. . .
or
ymsgr:. . .
Parameters
User |
Specify the user that you want to contact via the launch URL. |
Returns
A string representing the URL to launch the native client.
Syntax
GetStatus(User)
Description
Use the GetStatus method to return the current online status of the user specified by User. This is the status at the time of the last call to CheckAll.
Parameters
User |
Specify the name of the user for whom you want to check the status of. |
Returns
An integer. The values are:
Value |
Description |
-1 |
Network Disabled |
0 |
User offline |
1 |
User online |
2 |
User Unknown |
3 |
Error |
Syntax
RemoveUser(User)
Description
Use the RemoveUser method to remove a user from the instant messaging session.
Parameters
User |
Specify the name of the user you want to remove from the session, as a string. |
Returns
A Boolean value: True if the user was successfully removed, False otherwise.
In this section, the MCFIMSingleButton class methods are presented in alphabetical order.
See Also
Developing a Sample Application with Single Presence Button.
Syntax
generateHTML(&RS, slide_dir, X_pos, Y_pos, width, height, seq_num)
Description
Use this method to generate the HTML code as a string that is needed to display the single presence IM button on a page.
Parameters
&RS |
Specifies the Rowset object that contains the IM user IDs, protocols, domains, and other IM information in the format of the MCF_IMSCRNNAMES record. |
slide_dir |
Specifies the direction of the sliding window as a string. Valid values are: left, right, up, down. |
X_pos |
Specifies the X coordinate (in pixels) of the sliding window's upper left corner as an Integer. |
Y_pos |
Specifies the Y coordinate (in pixels) of the sliding window's upper left corner as an Integer. |
width |
Specifies the minimum width of the sliding window as an Integer (in pixels) |
height |
Specifies the minimum height of the sliding window as an Integer (in pixels) |
seq_num |
Specifies a unique sequence number for this single presence button as an Integer. If there is more than one single presence button per page, each needs to be identified with a unique sequence number. |
Returns
A string representing the HTML code for the single presence button.
Example
Use the page activate event to place the single presence button on a page:
import PT_MCF_IM:*; Global PT_MCF_IM:MCFIMSingleButton &single; Local Rowset &RS1; &single = create PT_MCF_IM:MCFIMSingleButton(); /* Number of milliseconds that we want to show sliding window even after we */ /* remove cursor from single presence button. */ &single.hideDelay = 5325; &RS1 = CreateRowset(Record.MCF_IMSCRNNAMES); /* &RS1 have all screen names, right is direction of sliding window. 190 is */ /* X coordinate of top left corner of sliding window, 200 is Y coordinate of */ /* top left corner of sliding window, 350 is height of sliding window, 450 */ /* is width of sliding window, 1 is some unique no of sliding window on that */ /* page. If there are many single presence icons on page, then it would be */ /* useful for uniqness. */ RECORDNAME.MCF_IM_HTMLAREA.Value = &single.generateHTML(&RS1, "right", 190, 200,⇒ 350, 450, 1); RECORDNAME.MCF_XMPPHEADER = &single.generateJavaScript();
See Also
Syntax
generateJavaScript()
Description
Use this method to generate JavaScript code that will be used to show single button presence. Call this method only after calling generateHTML.
Parameters
None.
Returns
A string representing the JavaScript code.
See Also
Syntax
insertXMPPServerUserData(PS_user_ID, protocol, XMPP_domain, IM_user_ID, IM_pwd)
Description
Use this method to insert a row of user data into the PS_MCF_USER_IM_CFG table.
Parameters
None.
PS_user_ID |
Specifies the PeopleSoft user ID as a string. |
protocol |
Specifies the XMPP protocol as a string. The only valid value is: XMPP. |
XMPP_domain |
Specifies the XMPP domain name as a string. |
IM_user_ID |
Specifies the email user ID on the XMPP server as a string. For example, if the email ID is first.last@company.com, then the IM_user_ID parameter must be set to: first.last. |
IM_pwd |
Specifies the password for the email user ID as a string. |
Returns
A Boolean value: True if insert was successful, False otherwise.
Syntax
MCFIMSingleButton()
Description
Use this constructor to instantiate a MCFIMSingleButton object.
Parameters
None.
Returns
A MCFIMSingleButton object.
Syntax
updateXMPPServerUserData(PS_user_ID, protocol, XMPP_domain, IM_user_ID, IM_pwd)
Description
Use this method to update a row of user data in the PS_MCF_USER_IM_CFG table.
Parameters
None.
PS_user_ID |
Specifies the PeopleSoft user ID as a string. |
protocol |
Specifies the XMPP protocol as a string. The only valid value is: XMPP. |
XMPP_domain |
Specifies the XMPP domain name as a string. |
IM_user_ID |
Specifies the email user ID on the XMPP server as a string. For example, if the email ID is first.last@company.com, then the IM_user_ID parameter must be set to: first.last. |
IM_pwd |
Specifies the password for the email user ID as a string. |
Returns
A Boolean value: True if update was successful, False otherwise.
In this section, the MCFIMSingleButton class properties are presented in alphabetical order.
Description
Use this property to set or return an Integer value representing a delay in milliseconds. A user removes the mouse pointer from the single presence button, the delay determines the amount of time the menu remains displayed before it is hidden. The default value is 1,325 milliseconds.
This property is read-write.