@Test public void testCommentsStructure() { Comment c1 = commentManager.createComment(session, newComment(commentedDocModel.getId(), "I am a comment!")); Comment c2 = commentManager.createComment(session, newComment(c1.getId(), "I am a reply!")); Comment c3 = commentManager.createComment(session, newComment(c2.getId(), "Me too!")); DocumentModel domainDocModel = session.getDocument(new PathRef("/domain")); DocumentModel commentContainerDocModel = session.getChild(domainDocModel.getRef(), COMMENTS_DIRECTORY); DocumentRef[] c1ParentDocRefs = session.getParentDocumentRefs(c1.getDocument().getRef()); assertEquals(commentContainerDocModel.getRef(), c1ParentDocRefs[0]); assertEquals(domainDocModel.getRef(), c1ParentDocRefs[1]); DocumentRef[] c2ParentDocRefs = session.getParentDocumentRefs(c2.getDocument().getRef()); assertEquals(commentContainerDocModel.getRef(), c2ParentDocRefs[0]); assertEquals(domainDocModel.getRef(), c2ParentDocRefs[1]); DocumentRef[] c3ParentDocRefs = session.getParentDocumentRefs(c3.getDocument().getRef()); assertEquals(commentContainerDocModel.getRef(), c3ParentDocRefs[0]); assertEquals(domainDocModel.getRef(), c3ParentDocRefs[1]); assertEquals("/domain/test", commentedDocModel.getPathAsString()); assertEquals("/domain/Comments", commentContainerDocModel.getPathAsString()); assertEquals("/domain/Comments/comment", c1.getDocument().getPathAsString()); String c2Path = c2.getDocument().getPathAsString(); assertTrue("Reply path: " + c2Path + " is not correct", c2Path.startsWith("/domain/Comments/comment.")); String c3Path = c3.getDocument().getPathAsString(); assertTrue("Sub reply path: " + c3Path + " is not correct", c3Path.startsWith("/domain/Comments/comment.")); assertEquals(HIDDEN_FOLDER_TYPE, commentContainerDocModel.getType()); assertTrue(commentContainerDocModel.hasFacet(FOLDERISH)); assertTrue(commentContainerDocModel.hasFacet(HIDDEN_IN_NAVIGATION)); assertEquals(domainDocModel.getRef(), commentContainerDocModel.getParentRef()); }
@Override public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException("This service implementation does not implement deprecated API."); }
PropertyCommentManager extends AbstractCommentManager { @Override public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException("This service implementation does not implement deprecated API."); } }
PropertyCommentManager extends AbstractCommentManager { @Override public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException("This service implementation does not implement deprecated API."); }  }
PropertyCommentManager extends AbstractCommentManager { @Override public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException("This service implementation does not implement deprecated API."); }  @Override @SuppressWarnings("unchecked") List<DocumentModel> getComments(CoreSession session, DocumentModel docModel); @Override List<DocumentModel> getComments(DocumentModel docModel, DocumentModel parent); @Override DocumentModel createComment(DocumentModel docModel, String comment); @Override @SuppressWarnings("removal") DocumentModel createComment(DocumentModel docModel, String text, String author); @Override DocumentModel createComment(DocumentModel docModel, DocumentModel commentModel); @Override @SuppressWarnings("removal") DocumentModel createComment(DocumentModel docModel, DocumentModel parent, DocumentModel child); @Override @SuppressWarnings("removal") void deleteComment(DocumentModel docModel, DocumentModel comment); @Override @SuppressWarnings("removal") List<DocumentModel> getDocumentsForComment(DocumentModel comment); @Override DocumentModel getThreadForComment(DocumentModel comment); @Override DocumentModel createLocatedComment(DocumentModel docModel, DocumentModel comment, String path); @Override Comment createComment(CoreSession session, Comment comment); @Override Comment getComment(CoreSession session, String commentId); @Override @SuppressWarnings("unchecked") PartialList<Comment> getComments(CoreSession session, String documentId, Long pageSize,
            Long currentPageIndex, boolean sortAscending); @Override List<Comment> getComments(CoreSession session, Collection<String> documentIds); @Override Comment updateComment(CoreSession session, String commentId, Comment comment); @Override void deleteComment(CoreSession session, String commentId); @Override Comment getExternalComment(CoreSession session, String documentId, String entityId); @Override Comment updateExternalComment(CoreSession session, String documentId, String entityId, Comment comment); @Override void deleteExternalComment(CoreSession session, String documentId, String entityId); @Override boolean hasFeature(Feature feature); }
PropertyCommentManager extends AbstractCommentManager { @Override public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException("This service implementation does not implement deprecated API."); }  @Override @SuppressWarnings("unchecked") List<DocumentModel> getComments(CoreSession session, DocumentModel docModel); @Override List<DocumentModel> getComments(DocumentModel docModel, DocumentModel parent); @Override DocumentModel createComment(DocumentModel docModel, String comment); @Override @SuppressWarnings("removal") DocumentModel createComment(DocumentModel docModel, String text, String author); @Override DocumentModel createComment(DocumentModel docModel, DocumentModel commentModel); @Override @SuppressWarnings("removal") DocumentModel createComment(DocumentModel docModel, DocumentModel parent, DocumentModel child); @Override @SuppressWarnings("removal") void deleteComment(DocumentModel docModel, DocumentModel comment); @Override @SuppressWarnings("removal") List<DocumentModel> getDocumentsForComment(DocumentModel comment); @Override DocumentModel getThreadForComment(DocumentModel comment); @Override DocumentModel createLocatedComment(DocumentModel docModel, DocumentModel comment, String path); @Override Comment createComment(CoreSession session, Comment comment); @Override Comment getComment(CoreSession session, String commentId); @Override @SuppressWarnings("unchecked") PartialList<Comment> getComments(CoreSession session, String documentId, Long pageSize,
            Long currentPageIndex, boolean sortAscending); @Override List<Comment> getComments(CoreSession session, Collection<String> documentIds); @Override Comment updateComment(CoreSession session, String commentId, Comment comment); @Override void deleteComment(CoreSession session, String commentId); @Override Comment getExternalComment(CoreSession session, String documentId, String entityId); @Override Comment updateExternalComment(CoreSession session, String documentId, String entityId, Comment comment); @Override void deleteExternalComment(CoreSession session, String documentId, String entityId); @Override boolean hasFeature(Feature feature);  }