コード例 #1
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
  private void initVersionDir(IDesignerUser user, String timeStamp) {
    IStorage versionDir =
        baseDirectory.newInstance(user.getCommentingDirectory(), "snapshot/" + timeStamp);
    if (versionDir.exists()) return;
    versionDir.mkdir();
    IStorage userDir = user.getUserDirectory();

    IStorage[] files = userDir.listFiles();
    for (int i = 0; i < files.length; i++) {
      String path = files[i].getAbsolutePath();
      if (files[i].isFile() && path.indexOf(IDavinciServerConstants.WORKING_COPY_EXTENSION) < 0) {
        IStorage destination = baseDirectory.newInstance(versionDir, files[i].getName());
        copyFile(files[i], destination);
      } else if (files[i].isDirectory()
          //					&& path.indexOf(IDavinciServerConstants.SETTINGS_DIRECTORY_NAME) < 0  // Need to
          // copy the settings
          && path.indexOf(IDavinciServerConstants.DOWNLOAD_DIRECTORY_NAME) < 0
          && path.indexOf(Constants.REVIEW_DIRECTORY_NAME) < 0
          && path.indexOf(".svn") < 0
          && containsPublishedFiles(files[i], user, timeStamp)) {
        IStorage destination = baseDirectory.newInstance(versionDir, files[i].getName());
        copyDirectory(files[i], destination);
      }
    }
  }
コード例 #2
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
 public void saveDraft(String name, Version version) {
   IDesignerUser user = getDesignerUser(name);
   IStorage commentingDir = user.getCommentingDirectory();
   if (!commentingDir.exists()) {
     commentingDir.mkdir();
     (baseDirectory.newInstance(commentingDir, "snapshot")).mkdir();
     (baseDirectory.newInstance(commentingDir, "livedoc")).mkdir();
   }
   saveVersionFile(user);
 }
コード例 #3
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
  public void publish(String name, Version version) {
    IDesignerUser user = getDesignerUser(name);
    IStorage commentingDir = user.getCommentingDirectory();
    if (!commentingDir.exists()) {
      commentingDir.mkdir();
      (baseDirectory.newInstance(commentingDir, "snapshot")).mkdir();
      (baseDirectory.newInstance(commentingDir, "livedoc")).mkdir();
    }

    initVersionDir(user, version.getTime());
    saveVersionFile(user);

    // Persist review information
    this.saveReviewerVersionFiles(version);
  }
コード例 #4
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
  private void copyDirectory(IStorage sourceDir, IStorage destinationDir) {
    destinationDir.mkdirs();
    IStorage[] file = sourceDir.listFiles();
    for (int i = 0; i < file.length; i++) {
      if (file[i].isFile()) {

        IStorage sourceFile = file[i];

        IStorage targetFile = baseDirectory.newInstance(destinationDir, file[i].getName());
        copyFile(sourceFile, targetFile);
      }
      if (file[i].isDirectory()) {
        IStorage destination = baseDirectory.newInstance(destinationDir, file[i].getName());
        copyDirectory(file[i], destination);
      }
    }
  }
コード例 #5
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
 private IStorage getReviewerVersionDirectory() {
   // Init the directory to hold version info for all of the reviewers and return it
   IStorage reviewerVersionsDirectory =
       baseDirectory.newInstance(baseDirectory, Constants.REVIEW_DIRECTORY_NAME);
   if (!reviewerVersionsDirectory.exists()) {
     reviewerVersionsDirectory.mkdir();
   }
   return reviewerVersionsDirectory;
 }
コード例 #6
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
 public ReviewManager() {
   String basePath =
       ServerManager.getServerManger()
           .getDavinciProperty(IDavinciServerConstants.BASE_DIRECTORY_PROPERTY);
   baseDirectory = ServerManager.getServerManger().getBaseDirectory().newInstance(".");
   if (basePath != null) {
     IStorage dir = baseDirectory.newInstance(basePath);
     if (dir.exists()) baseDirectory = dir;
   }
   if (ServerManager.DEBUG_IO_TO_CONSOLE)
     System.out.println("\nSetting [user space] to: " + baseDirectory.getAbsolutePath());
 }
コード例 #7
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
 /** *********************************************** */
 public void saveVersionFile(IDesignerUser user) {
   IStorage versionFile =
       baseDirectory.newInstance(user.getCommentingDirectory(), "snapshot/versions.xml");
   VersionFile file = new VersionFile();
   file.save(versionFile, user);
 }
コード例 #8
0
ファイル: ReviewManager.java プロジェクト: nogsantos/maqetta
 private IStorage getReviewerVersionFile(Reviewer reviewer) {
   IStorage versionFile =
       baseDirectory.newInstance(
           getReviewerVersionDirectory(), this.buildBaseFileForFromReviewer(reviewer));
   return versionFile;
 }