WebSphere brand IBM WebSphere XML Document Management Server, Version 7.0

xcap-diff examples

The following are examples of xcap-dff subscription events:

Notification for subscriptions using the xcap-diff event vary depending on the level of subscription. Subscriptions to documents can receive patch operations. The changelog element is not used in xcap-diff events; instead, the patch operations appear in the xcap-diff element. Notifications for subscriptions using xcap-diff events at the element and attribute levels do not return patch operations; instead, the patch operations appear in the document element.

Note: To enable subscription and notification at the element or attribute level, node level constraints must be defined in the AUID descriptor files. Information on customizing the AUID descriptor files is available in the IMS Enablement Toolkit information center.

About node level constraints

Subscriptions to document elements and attributes must follow the defined node level constraints for each application. Attributes are not defined in the node level constraints, but can be subscribed to if they are appended to a matched element node level. The applications that are shipped with IBM® XDMS have the following default constraints:
Note: $1 is a wildcard variable.
resource-lists:
resource-lists/list[@name="$1"]
rls-services
rls-services/service[@uri="$1"]
pres-rules
ruleset/rule[@id="$1"]
group-usage-list
resource-lists/list[@name="$1"]
acls
ruleset/rule[@id="$1"]
groups
group/list-service[@uri="$1"]
user-profile
user-profile/user-profiles[@uri="$1"]
locked user-profile
user-profile/user-profiles[@uri="$1"]
access-rules
ruleset/rule[@id="$1"]

xcap-diff event document- or directory-level notifications

xcap-diff subscription notifications at the document or directory level are similar to UA-profile events. Each receives back the new and previous e-tag for the document and patch operations. The xcap-diff event does not use the change log. Instead, patch operations at the document level might look like this:
	<document new-etag="MTE0OTU0MzIxNjkxNQ==" doc-selector="resource-lists/users/sip:john.doe@us.example.com/MyBuddies.xml" previous-etag="MTE0OTU0MzIxNjkxNQ==">

<add sel="resource-lists/list"><entry uri="buddy1@us.example.com"></entry></add>

	</document>

xcap-diff event element- or attribute-level descriptions

For xcap-diff subscriptions at the node level, either element or attribute, no patch operations are provided. Instead, the content is provided. For example, if you were subscribed to a list in a document with the name attribute equal to friends, the notification for that element may look like this:
<element sel="resource-lists/global/doc.xml/~~/resource-lists/list[@name="friends"]" exists="true"/>
	<list name="friends">
  		<display-name>Golf Friends</display-name>
  		<entry uri="sip:tiger.woods@example.com">
  			<display-name>Tiger Woods</display-name>
     </entry>
     <entry uri="sip:vijay.singh@example.com">
        <display-name>Vijay Singh</display-name>
     </entry>
   </list>
</element>
The following is an example of an initial notification following a subscribe, showing all the resources you are subscribed to. Subsequent notifies will contain only one resource per notify.
NOTIFY sip:user1@example.com:5060;transport=UDP 
Subscription-State: active;expires=120
Event: xcap-diff;diff-processing=xcap-patching
Content-Type: application/xcap-diff+xml

<?xml version="1.0" encoding="UTF-8"?> 
<xcap-diff xmlns="urn:ietf:params:xml:ns:xcap-diff" xcap-root="localhost:9080/services">
	<document sel="resource-lists/users/sip:xdms1@us.acme.com/doc1.xml" new-etag="123213234"/> 
	<document sel="resource-lists/users/sip:xdms1@us.acme.com/doc2.xml" new-etag="434543533"/>
	<document sel="rls-services/users/sip:xdms1@us.acme.com/index" new-etag="454355765"/> 
	<element sel="resource-lists/global/doc.xml/~~/resource-lists/list[@name="friends"]" exists="true"/> 
		<list name="friends"> 
			<display-name>Golf Friends</display-name>
				<entry uri="sip:tiger.woods@example.com"> 
					<display-name>Tiger Woods</display-name> 
				</entry> 
				<entry uri="sip:vijay.singth@example.com">
					<display-name>Vijay Singh</display-name> 
				</entry> 
		</list> 
	</element> 
	<attribute sel="resource-lists/global/doc.xml/~~/resource-lists/list[@name="buddies"]/@id" exists="true"/>5</attribute> 
</xcap-diff>



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.