Package es.ipsa.atril.doc.volumes

Examples of es.ipsa.atril.doc.volumes.VolumeManager


  public Volume getVolume(AtrilSession oSes) throws ElementNotFoundException {
    if (oDoc==null) {
      return null;
    } else {
      VolumeManager oVolm = oSes.getDms().getVolumeManager();
      if (oVolm.hasVolume(oDoc))
        return oVolm.getVolume(oDoc);
      else
        return null;
    }     
  }
View Full Code Here


    final String sRepositoryFullPath = Gadgets.chomp(sVolumesMountBase,File.separator)+sVolumeSubpath+File.separator+sRepositorySubpath;
    Log.out.debug("FileSystem.mkdirs(file://"+sRepositoryFullPath+")");
    oFs.mkdirs("file://"+sRepositoryFullPath);
    File oFl = new File(sRepositoryFullPath);
    if (!oFl.exists()) throw new FileNotFoundException("Could not create directory "+sRepositoryFullPath);
    VolumeManager oVolm = oDms.getVolumeManager();
    Log.out.debug("VolumeManager.createVolume("+sVolumeName+","+Gadgets.chomp(sVolumesMountBase,File.separator)+sVolumeSubpath+File.separator+","+sRepositorySubpath+","+String.valueOf(iMaxDocSize)+")");
    Volume oVol = oVolm.createVolume(sVolumeName, Gadgets.chomp(sVolumesMountBase,File.separator)+sVolumeSubpath+File.separator, sRepositorySubpath, iMaxDocSize);
    oVol.setTotalSpace(lTotalSpace);
    oVol.setMaxFiles(65535);
    oVol.setMaxDirectories(65535);
    oVol.addDocument(getDocument());
    oVol.save();
View Full Code Here

  public Volume getVolume(AtrilSession oSes) throws ElementNotFoundException {
    Document oDoc = getDocument();
    if (oDoc==null) {
      return null;
    } else {
      VolumeManager oVolm = oSes.getDms().getVolumeManager();
      if (oVolm.hasVolume(oDoc))
        return oVolm.getVolume(oDoc);
      else {
        Document oTxp = oSes.getDms().getDocument(getTaxPayer());
        if (oVolm.hasVolume(oTxp))
          return oVolm.getVolume(oTxp);
        else
          return null;       
      }
    }     
  }
View Full Code Here

    oSess.commit();

    String sMountBase = "/usr/local/apache-tomcat-6.0.36/webapps/zesped/WEB-INF/volumes/"; // DAO.getVolumesMountBase();
    if (sMountBase.length()>0) {
      boolean bDefaultVolumeExists = false;
      VolumeManager oVolm = oDms.getVolumeManager();
      for (Volume v : oVolm.getVolumeList()) {
        bDefaultVolumeExists = v.name().equals("Default");
        if (bDefaultVolumeExists) break;
      }
      if (!bDefaultVolumeExists) {
        sMountBase = Gadgets.chomp(sMountBase, File.separator);
          FileSystem oFs = new FileSystem();
          try {
        oFs.mkdirs("file://"+sMountBase+"default");
      } catch (Exception e) {
        throw new FileNotFoundException("Could not create directory "+sMountBase+"default");
      }
          if (!new File(sMountBase).exists()) throw new FileNotFoundException("Could not create directory "+sMountBase+"default");
          Volume oVol = oVolm.createVolume("Default", sMountBase, "default", 20*1048576);
          oVol.setTotalSpace(100*1048576);
          oVol.setDescription("Default Zesped Volume");
          oVol.setMounted(true);
          oVol.setUsable(true);
          oVol.setMaxDirectories(1000);
View Full Code Here

      Document dCts = oDms.newDocument(oDms.getDocumentType("CaptureTypes"), oDms.getRootDocument());
      dCts.save("");
      oUsrsGrp.grantReadOnly(dCts);
      oOpersGrp.grantReadOnly(dCts);
      oSes.commit();
      VolumeManager oVolm = oDms.getVolumeManager();
      Volume oVol = DAO.defaultVolume(oVolm);
      oVol.addDocument(dCts);
      oVol.save();
      oSes.commit();
      oCts = new CaptureTypes(dCts);
View Full Code Here

TOP

Related Classes of es.ipsa.atril.doc.volumes.VolumeManager

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.