[b]xcap存放数据是按用户管理auid来实现的,也就是按照用户来存放文件的【具体管理类似于Linux下用户管理方式】,如下图所示:[/b]
[img]http://dl.iteye.com/upload/picture/pic/91906/9512b20c-6e56-37d9-b578-ffa20bdaca9b.jpg[/img]
其中.xcapclient.ini的内容如下
执行xcapclient -i /opt/rls.xml put
这样将把以前的内容文档替换为以上内容
[b]执行:[/b]
[b]结果:[/b]
[b]执行:[/b]
[b]结果:[/b]
[b]<auids>表示存放的文件的根标签可以填写的值,<namespaces>为对应的命名空间,
例如下面的符合规范,可以存放在openxcap服务器上。[/b]
********rls.xml***************我将它存放在/opt目录下********************
<rls-services xmlns="urn:ietf:params:xml:ns:rls-services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</rls-services>
************************************************************************
上面内容的格式需要通过文档查看
[b]1、文档存放[/b]
[b]执行:[/b]
[b]结果:[/b]
其中201代表创建,200代表覆盖
[b]2、文档获取[/b]
[b]3、文档删除[/b]
以上的--app后面的值是auid的值,并不是xml文件的名称
[b]4、获取节点值[/b]
[b]5、元素的增、删、改[/b]
文件add.xml的内容为<display-name>addTest</display-name>
[b]替换entry中的值:[/b]
[b]命令:[/b]
[b]结果:[/b]
[b]替换list为xiaozhao的值:[/b]
[b]命令:[/b]
[b]结果:[/b]
[b]增加节点:[/b]
[b]list[/b]
add.xml为
<list name="jefry">
<display-name>jefry</display-name>
</list>
[b]entry[/b]
add.xml为
<entry uri="sip:hello@open-ims.test">
<display-name>123@1</display-name>
</entry>
[b]执行命令:[/b]
[b]删除节点:[/b]
[b]list:[/b]
[b]命令:[/b]
[b]结果:[/b]
[b]entry:
命令:[/b]
[b]结果:[/b]
[img]http://dl.iteye.com/upload/picture/pic/91906/9512b20c-6e56-37d9-b578-ffa20bdaca9b.jpg[/img]
其中.xcapclient.ini的内容如下
[Account]
sip_address=emily@open-ims.test
password=emily
xcap_root = http://xdms.open-ims.test/xcap-root
<rls-services xmlns="urn:ietf:params:xml:ns:rls-services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</rls-services>
执行xcapclient -i /opt/rls.xml put
这样将把以前的内容文档替换为以上内容
[b]执行:[/b]
xcapclient -i /opt/rls.xml put
[b]结果:[/b]
put http://xdms.open-ims.test/xcap-root/rls-services/users/sip:xudazhao@open-ims.test/index
201 Created
etag: "cd12752ba6e6ece92d2d85cdb0cdb18b"
content-type: application/rls-services+xml
[b]执行:[/b]
xcapclient --app xcap-caps get
[b]结果:[/b]
<?xml version='1.0' encoding='UTF-8'?>
<xcap-caps xmlns="urn:ietf:params:xml:ns:xcap-caps">
<auids>
<auid>org.openxcap.watchers</auid>
<auid>org.openmobilealliance.pres-rules</auid>
<auid>rls-services</auid>
<auid>resource-lists</auid>
<auid>xcap-caps</auid>
<auid>org.openxcap.dialog-rules</auid>
<auid>test-app</auid>
<auid>oma_status-icon</auid>
<auid>pidf-manipulation</auid>
<auid>pres-rules</auid>
<auid>org.openmobilealliance.xcap-directory</auid>
</auids>
<extensions/>
<namespaces>
<namespace>http://openxcap.org/ns/watchers</namespace>
<namespace>urn:ietf:params:xml:ns:pres-rules</namespace>
<namespace>urn:ietf:params:xml:ns:rls-services</namespace>
<namespace>urn:ietf:params:xml:ns:resource-lists</namespace>
<namespace>urn:ietf:params:xml:ns:xcap-caps</namespace>
<namespace>http://openxcap.org/ns/dialog-rules</namespace>
<namespace>test-app</namespace>
<namespace>urn:oma:xml:prs:pres-content</namespace>
<namespace>urn:ietf:params:xml:ns:pidf</namespace>
<namespace>urn:ietf:params:xml:ns:pres-rules</namespace>
<namespace>urn:oma:xml:xdm:xcap-directory</namespace>
</namespaces>
</xcap-caps>
[b]<auids>表示存放的文件的根标签可以填写的值,<namespaces>为对应的命名空间,
例如下面的符合规范,可以存放在openxcap服务器上。[/b]
********rls.xml***************我将它存放在/opt目录下********************
<rls-services xmlns="urn:ietf:params:xml:ns:rls-services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</rls-services>
************************************************************************
上面内容的格式需要通过文档查看
[b]1、文档存放[/b]
[b]执行:[/b]
xcapclient -i /opt/rls.xml put
[b]结果:[/b]
put http://xdms.open-ims.test/xcap-root/rls-services/users/sip:xudazhao@open-ims.test/index
201 Created
etag: "cd12752ba6e6ece92d2d85cdb0cdb18b"
content-type: application/rls-services+xml
其中201代表创建,200代表覆盖
[b]2、文档获取[/b]
xcapclient --app resource-lists get
xcapclient --app pres-rules get
xcapclient --app rls-services get
[b]3、文档删除[/b]
xcapclient --app resource-lists delete
以上的--app后面的值是auid的值,并不是xml文件的名称
[b]4、获取节点值[/b]
xcapclient --app resource-lists get '/resource-lists/list[@name="xiaozhao"]/entry[1]/display-name'
[b]5、元素的增、删、改[/b]
文件add.xml的内容为<display-name>addTest</display-name>
[b]替换entry中的值:[/b]
[b]命令:[/b]
xcapclient -i add.xml put '/resource-lists/list[@name="xiaozhao"]/entry[1]/display-name'
[b]结果:[/b]
put http://xdms.open-ims.test/xcap-root/resource-lists/users/sip:emily@open-ims.test/index/~~/resource-lists/list[@name="xiaozhao"]/entry[1]/display-name
200 OK
etag: "9506e9af10e2d330206b5c5c4e254170"
content-type: application/xcap-el+xml
[b]替换list为xiaozhao的值:[/b]
[b]命令:[/b]
xcapclient -i add.xml put '/resource-lists/list[@name="xiaozhao"]/display-name'
[b]结果:[/b]
put http://xdms.open-ims.test/xcap-root/resource-lists/users/sip:emily@open-ims.test/index/~~/resource-lists/list[@name="xiaozhao"]/display-name
200 OK
etag: "572081fb135fdfe2f4e1f6735a7ce12c"
content-type: application/xcap-el+xml
[b]增加节点:[/b]
[b]list[/b]
add.xml为
<list name="jefry">
<display-name>jefry</display-name>
</list>
xcapclient -i add.xml put '/resource-lists/list[@name="jefry"]'
put http://xdms.open-ims.test/xcap-root/resource-lists/users/sip:emily@open-ims.test/index/~~/resource-lists/list[@name="jefry"]
201 Created
etag: "320c411f469e883faa46b7a88cb5762b"
content-type: application/xcap-el+xml
root@jefry-desktop:/opt# vi add.xml
[b]entry[/b]
add.xml为
<entry uri="sip:hello@open-ims.test">
<display-name>123@1</display-name>
</entry>
[b]执行命令:[/b]
xcapclient -i add.xml put '/resource-lists/list[@name="xiaozhao"]/entry[2][@uri="sip:hello@open-ims.test"]'
执行[b]结果:[/b]
put http://xdms.open-ims.test/xcap-root/resource-lists/users/sip:emily@open-ims.test/index/~~/resource-lists/list[@name="xiaozhao"]/entry[2][@uri="sip:hello@open-ims.test"]
201 Created
etag: "d82d211b029ebbe7652f1cdc70bee9e7"
content-type: application/xcap-el+xml
[b]删除节点:[/b]
[b]list:[/b]
[b]命令:[/b]
xcapclient delete '/resource-lists/list[@name="xiaozhao"]/entry[2]'
[b]结果:[/b]
delete http://xdms.open-ims.test/xcap-root/resource-lists/users/sip:emily@open-ims.test/index/~~/resource-lists/list[@name="xiaozhao"]/entry[2]
200 OK
etag: "d07fce45b9cda6a7e9dc0edabdb148f2"
content-type: application/xcap-el+xml
[b]entry:
命令:[/b]
xcapclient delete '/resource-lists/list[@name="xiaojing"]'
[b]结果:[/b]
delete http://xdms.open-ims.test/xcap-root/resource-lists/users/sip:emily@open-ims.test/index/~~/resource-lists/list[@name="xiaojing"]
200 OK
etag: "e44c7fe55213515bdc8b3552622da154"