Skip to main content

XML Document Management Server

3 replies [Last post]
harishvhb
Offline
Joined: 2008-09-12
Points: 0

Hi all,

How resource list managed by mobicents XML Document Management Server.How XML documents updated .Please give me any sample codes.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
eduardomartins
Offline
Joined: 2005-10-10
Points: 0

If you are looking for non JAIN SLEE java client code you can take a look at the junit xdm tests @ http://mobicents.googlecode.com/svn/trunk/servers/sip-presence/xdms/test....

Regarding JAIN SLEE clients running in same container as the XDM, those can take advantage of internal SBB interface to use in child relations, which can be checked on http://code.google.com/p/mobicents/source/browse/tags/mobicents-sip-pres....

In a short course you must define you SBB as an implementation of XDMClientControlParentSbbLocalObject, that interface has the callbacks that the XDM will use to give you async results to your operations, and create a child relation to the XDMClientControlSbbLocalObject:

// --- XDM CLIENT CHILD SBB
public abstract ChildRelation getXDMClientControlChildRelation();
public XDMClientControlSbbLocalObject getXDMChildSbb() {

ChildRelation childRelation = getXDMClientControlChildRelation();
Iterator childRelationIterator = childRelation.iterator();
if (childRelationIterator.hasNext()) {
return (XDMClientControlSbbLocalObject) childRelationIterator.next();
}
else {
try {
XDMClientControlSbbLocalObject sbbLocalObject = (XDMClientControlSbbLocalObject) childRelation.create();
sbbLocalObject.setParentSbb((XDMClientControlParentSbbLocalObject)this.sbbContext.getSbbLocalObject());
return sbbLocalObject;
} catch (Exception e) {
logger.error("failed to create child sbb", e);
return null;
}
}

}

Note that this is only the code, you need to define the child relation in sbb-jar descriptor too as usual, also note that when the child is created the sbb immediately uses setParentSbb, this will give to the child sbb the interface to do the callbacks explained above.

Then it's as simple as it gets, to get a document:

getXDMChildSbb().get(new DocumentUriKey(documentSelector));

you will recieve the document in callback

/**
* async get response from xdm client
*/
public void getResponse(XcapUriKey key, int responseCode, String mimetype,
String content, String tag) {

}

To subscribe a document:

getXDMChildSbb().subscribeDocument(documentSelector);

You will get notifications through callbacks:

public void documentUpdated(DocumentSelector documentSelector,String oldETag,String newETag,String documentAsString) {

// bla bla bla
}

// atm only processing update per doc "granularity"
public void attributeUpdated(DocumentSelector documentSelector,
NodeSelector nodeSelector, AttributeSelector attributeSelector,
Map namespaces, String oldETag, String newETag,
String documentAsString, String attributeValue) {
documentUpdated(documentSelector, oldETag, newETag, documentAsString);
}
public void elementUpdated(DocumentSelector documentSelector,
NodeSelector nodeSelector, Map namespaces,
String oldETag, String newETag, String documentAsString,
String elementAsString) {
documentUpdated(documentSelector, oldETag, newETag, documentAsString);
}

harishvhb
Offline
Joined: 2008-09-12
Points: 0

Thanks for your reply,
i have another query ..how presence status is generated and stored in server?what is structure of XML file generated in the server(XML document format including all elements,attributes like friends status....).please help me in this issue.

Harish

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

http://groups.google.com/group/mobicents-public/web/section-Mobicents_XM... , there you have the specs, such as OMA Presence Enabler