Package net.relatedwork.shared.dto

Examples of net.relatedwork.shared.dto.Comments


    @Inject CommentsAccessHelper commentsAccessHelper;

    @Override
    public Comments execute(NewCommentAction newCommentAction, ExecutionContext executionContext) throws ActionException {
        Comments comment = newCommentAction.getComment();
        String targetUri = comment.getTargetUri();

        IOHelper.log(
                String.format("Creating new comment. Target[%s] Comment[%s]", targetUri, comment.getComment()));

        Node targetNode = commentsAccessHelper.getTargetNode(targetUri, comment.isReply());
        commentsAccessHelper.addComment(comment, targetNode);
        return comment;
    }
View Full Code Here


        } else {
            // fromNode is a Author/Paper node
            targetUri = (String) fromNode.getProperty(DBNodeProperties.URI);
        }

        Comments comment = new Comments();
        comment.setUri((String) commentNode.getProperty(DBNodeProperties.COMMENT_URI));
        comment.setAuthor(author);
        comment.setComment((String) commentNode.getProperty(DBNodeProperties.COMMENT_BODY));
        comment.setDate((String) commentNode.getProperty(DBNodeProperties.COMMENT_DATE));
        comment.setVoting((Integer) commentNode.getProperty(DBNodeProperties.COMMENT_VOTES));
        comment.setType(discussionTypeMapper.fromDBRelationship(relationshipType));
        comment.setTargetUri(targetUri);

        System.out.println("Got comment of type " + comment.getType() + ": " + comment.getComment());
        return comment;
    }
View Full Code Here

TOP

Related Classes of net.relatedwork.shared.dto.Comments

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.