Package org.davinci.server.review.user

Examples of org.davinci.server.review.user.IDesignerUser


      throws IOException {

    Comment comment = extractComment(req);
   
    String designerName = comment.getDesignerId();
    IDesignerUser du = ReviewManager.getReviewManager().getDesignerUser(designerName);
    DavinciProject project = new DavinciProject();
    project.setOwnerId(du.getName());
   
    comment.setProject(project);
    Comment existingComm = ReviewCacheManager.$.getComment(project, comment.getId());
    Version version = du.getVersion(existingComm.getPageVersion());
    try {
      if (version != null && version.isClosed()){
        throw new Exception("The version is closed by others during your editting. Please reload the review data.");
      }
View Full Code Here


  public void handleCommand(HttpServletRequest req, HttpServletResponse resp, IUser user)
      throws IOException {
    String type = req.getParameter("type"); // three types: close, open, delete and publish
    String vTime = req.getParameter("vTime");
    IDesignerUser du = ReviewManager.getReviewManager()
        .getDesignerUser(user);
    Version version = du.getVersion(vTime);
    ReviewManager reviewManager = ReviewManager.getReviewManager();
    if ("close".equalsIgnoreCase(type)) {
      version.closeVersion();
      reviewManager.saveVersionFile(du);
    } else if ("open".equalsIgnoreCase(type)) {
      version.openVersion();
      version.setHasRestarted(false);
      reviewManager.saveVersionFile(du);
    } else if ("publish".equalsIgnoreCase(type)) {
      version.setDraft(false);
      reviewManager.publish(du, version);
    } else if ("delete".equalsIgnoreCase(type)) {
      du.deleteVersion(vTime);
      reviewManager.saveVersionFile(du);
      IDavinciProject project = new DavinciProject();
      project.setOwnerId(du.getName());
      ReviewCacheManager.$.clearReviewByProject(project);
      // TODO delete the version folder
    }
    this.responseString = "OK";
  }
View Full Code Here

TOP

Related Classes of org.davinci.server.review.user.IDesignerUser

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.