Package org.davinci.server.review

Examples of org.davinci.server.review.CommentsDocument


    if (reviewHash != null)
      return reviewHash;

    // Load the review file from disk.
    Unmarshaller unmarshaller = new Unmarshaller();
    CommentsDocument document = null;
    synchronized(project){
      document = unmarshaller.unmarshall(project);

      List<Comment> commentList = document.getCommentList();
      reviewHash = new Hashtable<String, Comment>();
      for (Comment comment : commentList) {
        reviewHash.put(comment.getId(), comment);
      }
      reviewFilePool.put(project, reviewHash);
View Full Code Here


    Hashtable<String, Comment> reviewHash = reviewFilePool.get(project);
    if (null == reviewHash)
      return false;

    CommentsDocument doc = project.getCommentsDocument();
    if (null == doc) {
      doc = new CommentsDocument(project);
      project.setCommentsDocument(doc);
    }

//    reviewHash = (Hashtable<String, Comment>) Utils.deepClone(reviewHash);
    Comment lastAccessTime = reviewHash.get(LAST_ACCESS_TIME);
    reviewHash.remove(LAST_ACCESS_TIME);
    // clearUnconsistentComments(reviewHash);
    doc.setCommentList(new ArrayList<Comment>(reviewHash.values()));

    Marshaller marshaller = new Marshaller(project);
    try {
      synchronized(project){
        marshaller.marshall(false);
View Full Code Here

* Transform a XML document into a JAVA object.
*
*/
public class Unmarshaller {
  public CommentsDocument unmarshall(IDavinciProject project) {
    CommentsDocument commentsDoc = new CommentsDocument(project);
    try {
      IStorage file = project.getCommentsFileStorage();

      Document document = initCommentsFile(file);
      Node node = document.getFirstChild();
      NodeList children = node.getChildNodes();
      Comment comm;
      for (int i = 0; i < children.getLength(); i++) {
        node = children.item(i);
        if (node.getNodeType() == Node.ELEMENT_NODE
            && CommentsDocument.COMMENT.equalsIgnoreCase(node
                .getNodeName())) {
          comm = unmarshallComment(node);
          if (null != comm) {
            comm.setProject(project);
            commentsDoc.getCommentList().add(comm);
          }
        }
      }
    } catch (SAXException e) {
      // TODO Auto-generated catch block
View Full Code Here

TOP

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

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.