Package org.davinci.server.review

Examples of org.davinci.server.review.Comment


      resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, errorString);
    }
  }

  private Comment extractComment(HttpServletRequest req) {
    Comment comment = new Comment();
    String paramValue;

    paramValue = req.getParameter(Comment.ID);
    comment.setId(paramValue);
   
    paramValue = req.getParameter(Comment.DESIGNER_ID);
    comment.setDesignerId(paramValue);

    paramValue = req.getParameter(Comment.CONTENT);
    comment.setContent(paramValue);

    paramValue = req.getParameter(Comment.PAGE_STATE);
    comment.setPageState(paramValue);

    paramValue = req.getParameter(Comment.PAGE_STATE_LIST);
    comment.setPageStateList(paramValue);

    paramValue = req.getParameter(Comment.VIEW_SCENE);
    comment.setViewScene(paramValue);

    paramValue = req.getParameter(Comment.VIEW_SCENE_LIST);
    comment.setViewSceneList(paramValue);

    paramValue = req.getParameter(Comment.SUBJECT);
    comment.setSubject(paramValue);

    paramValue = req.getParameter(Comment.DRAWING_JSON);
    comment.setDrawingJson(paramValue);

    comment.setCreated(new Date());

    return comment;
  }
View Full Code Here


 
  private boolean updateComments(List<Comment> commentList) throws Exception {
    if (commentList == null || commentList.isEmpty())
      return true;

    Comment existingComment;
    List<Comment> subCommentList = null;

    for (Comment comment : commentList) {
      existingComment = ReviewCacheManager.$.getComment(comment.getProject(), comment.getId());
      if (existingComment != null) {
        existingComment = (Comment)Utils.deepClone(existingComment); // Make a copy of it
        if (comment.getContent() != null)
          existingComment.setContent(comment.getContent());
        if (comment.getPageState() != null)
          existingComment.setPageState(comment.getPageState());
        if (comment.getPageStateList() != null)
          existingComment.setPageStateList(comment.getPageStateList());
        if (comment.getViewScene() != null)
          existingComment.setViewScene(comment.getViewScene());
        if (comment.getViewSceneList() != null)
          existingComment.setViewSceneList(comment.getViewSceneList());
        if (comment.getSubject() != null)
          existingComment.setSubject(comment.getSubject());
        if (comment.getDrawingJson() != null)
          existingComment.setDrawingJson(comment.getDrawingJson());
        if(null == subCommentList){
          subCommentList = new ArrayList<Comment>();
        }
        subCommentList.add(existingComment);
        ReviewCacheManager.$.updateComments(subCommentList);
View Full Code Here

TOP

Related Classes of org.davinci.server.review.Comment

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.