<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: get comments from a document in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314599#M1600</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You've got a &lt;A href="http://community.nuxeo.com/api/nuxeo/5.4/javadoc/org/nuxeo/ecm/platform/comment/api/CommentManager.html"&gt;getComments(DocumentModel)&lt;/A&gt; method exposed by the &lt;A href="http://explorer.nuxeo.org/nuxeo/site/distribution/Nuxeo%20DM-5.4.2/viewService/org.nuxeo.ecm.platform.comment.api.CommentManager"&gt;CommentManager&lt;/A&gt; service. I hope it will help you.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2011 14:24:24 GMT</pubDate>
    <dc:creator>Arnaud_Kervern</dc:creator>
    <dc:date>2011-09-28T14:24:24Z</dc:date>
    <item>
      <title>get comments from a document</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314598#M1599</link>
      <description>&lt;P&gt;How can i get comments data from a DocumentModel?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 14:13:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314598#M1599</guid>
      <dc:creator>iry_</dc:creator>
      <dc:date>2011-09-28T14:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: get comments from a document</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314599#M1600</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You've got a &lt;A href="http://community.nuxeo.com/api/nuxeo/5.4/javadoc/org/nuxeo/ecm/platform/comment/api/CommentManager.html"&gt;getComments(DocumentModel)&lt;/A&gt; method exposed by the &lt;A href="http://explorer.nuxeo.org/nuxeo/site/distribution/Nuxeo%20DM-5.4.2/viewService/org.nuxeo.ecm.platform.comment.api.CommentManager"&gt;CommentManager&lt;/A&gt; service. I hope it will help you.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 14:24:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314599#M1600</guid>
      <dc:creator>Arnaud_Kervern</dc:creator>
      <dc:date>2011-09-28T14:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: get comments from a document</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314600#M1601</link>
      <description>&lt;P&gt;Yes, thank you but I want to get the comment from the event to send it in the email notification&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 14:56:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314600#M1601</guid>
      <dc:creator>iry_</dc:creator>
      <dc:date>2011-09-28T14:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: get comments from a document</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314601#M1602</link>
      <description>&lt;P&gt;/**
*
*/&lt;/P&gt;
&lt;P&gt;package org.nuxeo.yourcompany.automation;&lt;/P&gt;
&lt;P&gt;import java.util.List;&lt;/P&gt;
&lt;P&gt;import org.nuxeo.ecm.automation.core.Constants;
import org.nuxeo.ecm.automation.core.annotations.Context;
import org.nuxeo.ecm.automation.core.annotations.Operation;
import org.nuxeo.ecm.automation.core.annotations.OperationMethod;
import org.nuxeo.ecm.automation.core.collectors.DocumentModelListCollector;
import org.nuxeo.ecm.core.api.CoreSession;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.core.api.DocumentModelList;
import org.nuxeo.ecm.core.api.impl.DocumentModelListImpl;
import org.nuxeo.ecm.platform.comment.api.CommentManager;
import org.nuxeo.runtime.api.Framework;&lt;/P&gt;
&lt;P&gt;/**&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;@author pjenicot
*/
@Operation(id=GetComments.ID, category=Constants.CAT_DOCUMENT, label="GetComments", description="Renvoie les commentaires d'un document")
public class GetComments {&lt;/P&gt;
&lt;P&gt;public static final String ID = "Document.GetComments";&lt;/P&gt;
&lt;P&gt;@Context
protected CoreSession session;&lt;/P&gt;
&lt;P&gt;protected CommentManager commentManager;&lt;/P&gt;
&lt;P&gt;private static CommentManager getCommentManager() {
try {
return ((CommentManager)Framework.getService(CommentManager.class));
} catch (Exception e) {}&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; return null;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;@OperationMethod(collector=DocumentModelListCollector.class)
public DocumentModelList run(DocumentModel doc) throws Exception {&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; DocumentModelListImpl docs = new DocumentModelListImpl();

 CommentManager commentManager = getCommentManager();
 List&amp;lt;DocumentModel&amp;gt; comments = commentManager.getComments(doc);

 if (!comments.isEmpty())
 {	
 	for(DocumentModel comment : comments)
 		docs.add(comment);
 }
 return docs;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2012 08:31:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/get-comments-from-a-document/m-p/314601#M1602</guid>
      <dc:creator>Pierre_Jenicot1</dc:creator>
      <dc:date>2012-07-02T08:31:07Z</dc:date>
    </item>
  </channel>
</rss>

