Oracle Server E10293-02 ユーザーズマニュアル

ページ / 108
Using the Presence Web Services Interfaces
OCMS Parlay X Web Services  6-5
Interface PresenceSupplier, Operation: publish and Oracle Specific 
"
Unpublish
"
This is the first operation the application must call before using another operation in 
this interface. It serves three purposes:
It allows the Web services to associate the current HTTP session with a user.
It publishes the user’s presence status.
It subscribes to watcher-info so that the Web services can keep track of any 
watcher requests.
There are three attributes that are of interest when performing a PUBLISH. These 
attributes can be set in a PresenceAttribute structure and passed into the PUBLISH 
method.
Presense status with a customized note: this is the customized note configured in 
the My Presence text box in Oracle Communicator. The <note> element is 
contained in the <person> element of the Presence Information Data Format 
(PIDF) XML file.
Device note: implicitly inserted by Oracle Communicator, or inserted from a Web 
service. The <note> element is contained in the <device> element of the Presence 
Information Data Format (PIDF) XML file.
Service note: configured in the Presence tab in the Oracle Communicator 
preferences. The <note> element is contained in the <tuple> element of the 
Presence Information Data Format (PIDF) XML file.
Code Example
// PresenceAttribute contains presence status and note.
typeValue.setUnionElement(PresenceAttributeType.Activity);
typeValue.setActivity(activity);
paActivity.setTypeAndValue(typeValue);
// Setting the customized note here.
paActivity.setNote(activityNote);
paActivity.setLastChange(dateTime);
// Create the PresenceAttribute containing device note.
AttributeTypeAndValue typeValueOther = createATV();
PresenceAttribute paOther = new PresenceAttribute();
// Device note is carried in a PresenceAttributeType.Other
typeValueOther.setUnionElement(PresenceAttributeType.Other);
// Set the name to "DeviceNote" to indicate the value
// should be used as device note.
other.setName("DeviceNote");
other.setValue(deviceName);
typeValueOther.setOther(other);
paOther.setTypeAndValue(typeValueOther);
// The note is not used. Can be anything.
paOther.setNote("OracleExtension");
paOther.setLastChange(dateTime);
// Create the PresenceAttribute containing service note.
AttributeTypeAndValue typeValueOther1 = createATV();
PresenceAttribute paOther1 = new PresenceAttribute();
// Service note is carried in another
// PresenceAttributeType.Other
typeValueOther1.setUnionElement(PresenceAttributeType.Other);
OtherValue other1 = new OtherValue();
// Set the name to "ServiceNote" to indicate the value