Expand my Community achievements bar.

SOLVED

Deprecated Comment Class

Avatar

Level 5

    Hi Guys,

       I am using AEM5.6.1 with social packge 1.4 installed. When i use com.adobe.cq.social.commons.Comment i am getting a warning saying the Comment class is deprecated.

But the docs does not say something like that. Can someone please let me know if it is deprecated or not.

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi Jayapal,

The documentation for latest version for AEM 5.6.1 for communities package 1.4 mentions that you should use the AEM 6.0 communities documentation instead of 5.6.1.  In other words

this section http://docs.adobe.com/docs/en/cq/5-6-1/developing/DevelopingWithSocialCommunities.html#Social%20Comm...%20Version%201.4

refers to this page http://docs.adobe.com/docs/en/aem/6-0/develop/social-communities.html

There is a page with basic information about components for developers, including links to the APIs.

  http://docs.adobe.com/docs/en/aem/6-0/develop/social-communities/essentials/comments.html

If you go to the APIs, http://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/index.html, and select Deprecated, you will see

 com.adobe.cq.social.commons.Comment
          @since AEM 6.0. Use CommentOperations and Comment instead. 

com.adobe.cq.social.commons.CommentSystem
          @since AEM 6.0. Use CommentOperations and CommentCollection instead. 

 

Just to be clear, AEM/CQ 5.6.1 shipped with communities package 1.3 and is documented in the 5.6.1 doc tree.

If you install communities package 1.4 on AEM 5.6.1, the communities functionality is documented in the 6.0 doc tree.

Hope this helps.

-JK

View solution in original post

4 Replies

Avatar

Correct answer by
Level 9

Hi Jayapal,

The documentation for latest version for AEM 5.6.1 for communities package 1.4 mentions that you should use the AEM 6.0 communities documentation instead of 5.6.1.  In other words

this section http://docs.adobe.com/docs/en/cq/5-6-1/developing/DevelopingWithSocialCommunities.html#Social%20Comm...%20Version%201.4

refers to this page http://docs.adobe.com/docs/en/aem/6-0/develop/social-communities.html

There is a page with basic information about components for developers, including links to the APIs.

  http://docs.adobe.com/docs/en/aem/6-0/develop/social-communities/essentials/comments.html

If you go to the APIs, http://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/index.html, and select Deprecated, you will see

 com.adobe.cq.social.commons.Comment
          @since AEM 6.0. Use CommentOperations and Comment instead. 

com.adobe.cq.social.commons.CommentSystem
          @since AEM 6.0. Use CommentOperations and CommentCollection instead. 

 

Just to be clear, AEM/CQ 5.6.1 shipped with communities package 1.3 and is documented in the 5.6.1 doc tree.

If you install communities package 1.4 on AEM 5.6.1, the communities functionality is documented in the 6.0 doc tree.

Hope this helps.

-JK

Avatar

Level 10

Many a times, doc may not have been updated !

Avatar

Level 5

Thanks for the response JK. But i have the following code,

import com.adobe.cq.social.blog.Blog; import com.adobe.cq.social.blog.BlogEntry; import com.adobe.cq.social.blog.BlogManager; import java.util.Iterator; BlogManager blogMgr =     resource.getResourceResolver().adaptTo(BlogManager.class); Blog blog = blogMgr.getBlog(req, resource.getPath()); BlogEntry entry =   blog.getEntry();Iterator commentsIterator   =   entry.getComments();

The last line returns me AEM5.6.1 com.adobe.cq.social.commons.Comment. But it should have actually returned the AEM6.0 comments interface. 

If i have installed social package 1.4 why i still have this confusion.  Can you please comment on this. ?

Avatar

Level 9

The Blog feature did not change from 5.6.1 to 6.0 because it needed to be reworked into the Social Communities Framework (SCF).   In AEM 6.1, the Blog components and templates are deprecated and the Journal components have been renamed the Blog feature (a feature named 'Journal' no longer exists).

Since the Blog feature was not updated in 6.0, it still uses the deprecated Comments code.

It's only a warning.

 

Why was this done?  The 6.0 and earlier implementation of the Blog feature was template based and only allowed content to be entered in the author environment.  In that sense, it was not a community expererience.

The re-implementation of the Blog feature, by re-using the Journal components, will allow user generated content (UGC) to be entered in the publish environment by members (signed in users) who are authorized to do so.

-JK