Projects >> nuxeo-features >>a34924470bc5df3027c264ffefb3dd67bc34d4c3

Chunk
Conflicting content
        DocumentModel createdComment;

        try {
<<<<<<< HEAD
            createdComment = createCommentDocModel(session, docModel, comment);
=======
            createdComment = createCommentDocModel(docModel, comment);
>>>>>>> fba20f9b3e679554f8a8b6872f386ab29d9b9b29

            RelationManager relationManager = getRelationManager();
            List statementList = new ArrayList();
Solution content
        DocumentModel createdComment;

        try {
            createdComment = createCommentDocModel(session, docModel, comment);

            RelationManager relationManager = getRelationManager();
            List statementList = new ArrayList();
File
CommentManagerImpl.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    public DocumentModel createComment(DocumentModel docModel,
            DocumentModel parent, DocumentModel child) throws ClientException {
<<<<<<< HEAD
        LoginContext loginContext = null;
        CoreSession session = null;
            DocumentModel parentDocModel = session.getDocument(parent.getRef());
        try {
            loginContext = Framework.login();
            session = openCoreSession(docModel.getRepositoryName());

            String author = updateAuthor(docModel, child);
            DocumentModel newComment = createComment(session, parentDocModel,
                    child);
            session.save();

            UserManager userManager = Framework.getService(UserManager.class);
            NuxeoPrincipal principal = userManager.getPrincipal(author);
            notifyEvent(docModel, CommentEvents.COMMENT_ADDED, parent,
                    newComment, principal);

            return newComment;

        } catch (Exception e) {
            throw new ClientException(e);
        } finally {
            closeCoreSession(loginContext, session);
        }
=======
        String author = updateAuthor(docModel, child);
        String commentId = parent.getId();
        DocumentModel parentDocModel = getRepositorySession(
                docModel.getRepositoryName()).getDocument(new IdRef(commentId));
        DocumentModel newComment = createComment(parentDocModel, child);

        NuxeoPrincipal principal = null;
        try {
            UserManager userManager = Framework.getService(UserManager.class);
            principal = userManager.getPrincipal(author);
        } catch (Exception e) {
            log.error("Error building principal for notification", e);
        }
        notifyEvent(docModel, CommentEvents.COMMENT_ADDED, parent, newComment,
                principal);
        return newComment;
>>>>>>> fba20f9b3e679554f8a8b6872f386ab29d9b9b29
    }

    private static NuxeoPrincipal getAuthor(DocumentModel docModel)
Solution content
    public DocumentModel createComment(DocumentModel docModel,
            DocumentModel parent, DocumentModel child) throws ClientException {
        LoginContext loginContext = null;
        CoreSession session = null;
        try {
            loginContext = Framework.login();
            session = openCoreSession(docModel.getRepositoryName());


            String author = updateAuthor(docModel, child);
            DocumentModel parentDocModel = session.getDocument(parent.getRef());
            DocumentModel newComment = createComment(session, parentDocModel,
                    child);
            session.save();

            UserManager userManager = Framework.getService(UserManager.class);
            NuxeoPrincipal principal = userManager.getPrincipal(author);
            notifyEvent(docModel, CommentEvents.COMMENT_ADDED, parent,
                    newComment, principal);

            return newComment;

        } catch (Exception e) {
            throw new ClientException(e);
        } finally {
            closeCoreSession(loginContext, session);
        }
    }

    private static NuxeoPrincipal getAuthor(DocumentModel docModel)
File
CommentManagerImpl.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Return statement
Try statement
Variable