如何获取要在IBM Connections 3.0中回复的附加文件的文件名

时间:2014-08-22 06:53:29

标签: atom-feed ibm-connections

我正在研究IBM连接应用程序。我的应用程序依赖于IBM connections 3.0 Atom API调用。

在处理论坛,主题和回复时,我发现原子API供稿缺少附加文件名。 IBM为文件定义了单独的API,这些文件具有针对"我的文件"的详细API。和#34;共享文件"。但无法找到与社区/论坛中上传的文件相关的API。

这是我在获取论坛回复时获得的原子馈送的部分。

<snx:field name="Re: New topic test" fid="b4ee2735-aca3-4e57-a2a4-4a027bf1a35a" type="file">
    <link type="image/jpeg" href="https://lc.myserver.com/forums/atom/download?nodeId=b4ee2735-aca3-4e57-a2a4-4a027bf1a35a" length="120540"/>
</snx:field>

以下是我用于获取回复原子Feed的网址示例。

http: //myserver.com/forums/atom/replies?topicUuid=_TOPICID_&sortOrder=asc&ps=30

修改

以下是附件回复的完整ATOM Feed

<entry>
    <id>urn:lsid:ibm.com:forum:c5db8cbd-5b4e-496c-8480-da2acb60f240</id>
    <title type="text">Re: New topic test</title>
    <published>2014-08-21T06:09:20.887Z</published>
    <updated>2014-08-21T06:17:20.223Z</updated>
    <author><email>vishal.kardode@abc.com</email>
    <name>Vishal Kardode</name>
    <snx:userid>3C557865-5F1B-45CC-8D96-F8836734E8F4</snx:userid>
    <snx:userState>active</snx:userState></author>
    <link href="https://octositc.polarisft.com:9444/forums/atom/reply?replyUuid=c5db8cbd-5b4e-496c-8480-da2acb60f240" rel="self" type="application/atom+xml"/>
    <link href="https://octositc.polarisft.com:9444/forums/atom/reply?replyUuid=c5db8cbd-5b4e-496c-8480-da2acb60f240" rel="edit" type="application/atom+xml"/>
    <snx:field name="Re: New topic test" fid="9703a25e-7625-4491-b6d7-d364ac1e9951" type="file">
        <link type="application/json" href="https://lc.myserver.com/forums/atom/download?nodeId=9703a25e-7625-4491-b6d7-d364ac1e9951" length="2920"/>
    </snx:field>
    <snx:field name="Re: New topic test" fid="b4ee2735-aca3-4e57-a2a4-4a027bf1a35a" type="file">
        <link type="image/jpeg" href="https://lc.myserver.com/forums/atom/download?nodeId=b4ee2735-aca3-4e57-a2a4-4a027bf1a35a" length="120540"/>
    </snx:field>
    <category term="forum-reply" scheme="http://www.ibm.com/xmlns/prod/sn/type"/>
    <link href="https://lc.myserver.com/forums/html/topic?id=eff2d6c3-e415-4f39-b04e-16bb5e8d9216#c5db8cbd-5b4e-496c-8480-da2acb60f240" rel="alternate" type="text/html"/>
    <link href="https://lc.myserver.com/forums/atom/replies?replyUuid=c5db8cbd-5b4e-496c-8480-da2acb60f240" rel="replies" type="application/atom+xml" thr:count="0"/>
    <thr:in-reply-to ref="urn:lsid:ibm.com:forum:eff2d6c3-e415-4f39-b04e-16bb5e8d9216" href="https://lc.myserver.com/forums/atom/topics?forumUuid=eff2d6c3-e415-4f39-b04e-16bb5e8d9216" type="application/atom+xml"/>
    <content type="html">
    test attachment
    </content>
    <snx:permissions>none, view_forum, create_post, edit_personal_post, del_personal_post, subscribe, create_topictag, del_personal_topictag, view_category, edit_personal_question</snx:permissions>
</entry>

我正在使用LC 3.0,并在&#34; name&#34;中返回主题标题而不是&#34; snx:field&#34;的文件名。标签。现在我认为它在3.0中的LC服务中的问题已在4.5中得到修复

1 个答案:

答案 0 :(得分:0)

我提出了回复请求 https://sdkdemo.swg.usma.ibm.com:444/forums/atom/replies?topicUuid=e6363aa5-38b7-4955-8a78-555db8151877

我得到了

   <?xml version="1.0" encoding="UTF-8"?>
    <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <opensearch:totalResults xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">1</opensearch:totalResults>
    <opensearch:startIndex xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">1</opensearch:startIndex>
    <opensearch:itemsPerPage xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">10</opensearch:itemsPerPage>
    <id>https://sdkdemo.swg.usma.ibm.com:444/forums/atom/replies?topicUuid=e6363aa5-38b7-4955-8a78-555db8151877</id>
    <link href="https://sdkdemo.swg.usma.ibm.com:444/forums/html/topic?id=e6363aa5-38b7-4955-8a78-555db8151877" rel="alternate">
    </link>
    <link href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/replies?topicUuid=e6363aa5-38b7-4955-8a78-555db8151877" rel="self">
    </link>
    <title type="text">testTopic1 Replies</title>
    <updated>2014-08-22T12:11:27.970Z</updated>
    <generator uri="http://www.ibm.com/xmlns/prod/sn" version="4.5.0.0">IBM Connections - Discussion Forum</generator>
    <link href="http://sdkdemo.swg.usma.ibm.com:81/communities/service/atom/community/instance?communityUuid=c5de2ed9-f856-4000-8e53-aa8dc57a23f5" rel="http://www.ibm.com/xmlns/prod/sn/container" type="application/atom+xml">
    </link>
    <snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">c5de2ed9-f856-4000-8e53-aa8dc57a23f5</snx:communityUuid>
    <entry xmlns:app="http://www.w3.org/2007/app" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <id>urn:lsid:ibm.com:forum:47595fe8-2bff-44f1-9340-9527ec015095</id>
    <title type="text">Re: testTopic1</title>
    <category term="NotRecommendedByCurrentUser" scheme="http://www.ibm.com/xmlns/prod/sn/flags">
    </category>
    <link xmlns:snx="http://www.ibm.com/xmlns/prod/sn" href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/recommendation/entries?postUuid=47595fe8-2bff-44f1-9340-9527ec015095" rel="recommendations" type="application/atom+xml" snx:recommendation="0">
    </link>
    <published>2014-08-22T12:11:27.970Z</published>
    <author>
    <email>fadams@renovations.com</email>
    <name>Frank Adams</name>
    <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">6B54D23A-0A70-C7A4-8525-7CA50082A393</snx:userid>
    <snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
    </author>
    <updated>2014-08-22T12:11:27.970Z</updated>
    <link href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/reply?replyUuid=47595fe8-2bff-44f1-9340-9527ec015095" rel="self" type="application/atom+xml">
    </link>
    <link href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/reply?replyUuid=47595fe8-2bff-44f1-9340-9527ec015095" rel="edit" type="application/atom+xml">
    </link>
    <snx:field xmlns:snx="http://www.ibm.com/xmlns/prod/sn" name="CreateBlogComment.java" fid="66bc2e2e-5f7f-4303-9a05-c250b9c5b53a" type="file">
    <link name="CreateBlogComment.java" type="application/octet-stream" href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/download/CreateBlogComment.java?nodeId=66bc2e2e-5f7f-4303-9a05-c250b9c5b53a" length="4032">
    </link>
    <published>2014-08-22T12:11:28.375Z</published>
    <updated>2014-08-22T12:11:28.375Z</updated>
    </snx:field>
    <category term="forum-reply" scheme="http://www.ibm.com/xmlns/prod/sn/type">
    </category>
    <link href="https://sdkdemo.swg.usma.ibm.com:444/forums/html/topic?id=e6363aa5-38b7-4955-8a78-555db8151877#47595fe8-2bff-44f1-9340-9527ec015095" rel="alternate" type="text/html">
    </link>
    <link xmlns:thr="http://purl.org/syndication/thread/1.0" href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/replies?replyUuid=47595fe8-2bff-44f1-9340-9527ec015095" rel="replies" type="application/atom+xml" thr:count="0">
    </link>
    <thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" ref="urn:lsid:ibm.com:forum:e6363aa5-38b7-4955-8a78-555db8151877" href="https://sdkdemo.swg.usma.ibm.com:444/forums/atom/topics?forumUuid=e6363aa5-38b7-4955-8a78-555db8151877" type="application/atom+xml">
    </thr:in-reply-to>
    <content type="html">
    &lt;p dir="ltr"&gt;
    &amp;nbsp;
    &lt;/p&gt;
    </content>
    <snx:permissions xmlns:snx="http://www.ibm.com/xmlns/prod/sn">none, create_forum, view_forum, edit_forum, del_forum, create_post, edit_personal_post, edit_all_post, del_personal_post, del_all_post, pin_topic, subscribe, lock_node, create_topictag, del_all_topictag, del_personal_topictag, create_forumtag, del_all_forumtag, del_personal_forumtag, view_category, edit_personal_question, edit_all_question, add_moderator</snx:permissions>
    </entry>
    </feed>

你应该寻找一个snx:字段,如下所示:

 <snx:field xmlns:snx="http://www.ibm.com/xmlns/prod/sn" name="CreateBlogComment.java" fid="66bc2e2e-5f7f-4303-9a05-c250b9c5b53a" type="file">

它是描述文件/ id和名称的元素。

授予这是Connections 4.5。如果您想要对3.0发表评论,则必须发布XML响应以在服务器上调用相同的API