Package ca.carleton.gcrc.couch.app

Examples of ca.carleton.gcrc.couch.app.Document


    if( false == ddDir.exists() || false == ddDir.isDirectory() ) {
      throw new ServletException("Invalid directory for server design doc: "+ddDir.getAbsolutePath());
    }

    // Load server design document
    Document doc = null;
    try {
      FSEntry entry = new FSEntryFile(ddDir);
      doc = DocumentFile.createDocument(entry);
    } catch(Exception e){
      throw new ServletException("Unable to read server design document",e);
View Full Code Here


    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/mobile document...
    Document doc = null;
    {
      File userDesignDir = PathComputer.computeUserDesignDir(gs.getInstallDir());
         
      FSEntry fileEntry = new FSEntryFile(userDesignDir);
      doc = DocumentFile.createDocument(fileEntry);
View Full Code Here

    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/site document...
    Document doc = null;
    {
      List<FSEntry> mergedEntries = new Vector<FSEntry>();
     
      // htdocs from atlas project
      File htdocsDir = new File(atlasDir, "htdocs");
View Full Code Here

    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/atlas document...
    Document doc = null;
    {
      File installDir = gs.getInstallDir();

      List<FSEntry> entries = new Vector<FSEntry>();
     
View Full Code Here

    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/mobile document...
    Document doc = null;
    {
      File mobileDesignDir = PathComputer.computeMobileDesignDir(gs.getInstallDir());
         
      FSEntry fileEntry = new FSEntryFile(mobileDesignDir);
      doc = DocumentFile.createDocument(fileEntry);
View Full Code Here

      String[] subDirNames = docsDir.list( gs.getFilenameFilter() );
      for(String subDirName : subDirNames){
        File subDir = new File(docsDir, subDirName);
        if( subDir.exists() && subDir.isDirectory() ) {
          // OK, let's create a document based on this
          Document doc = null;
          try {
            FSEntryFile entry = new FSEntryFile(subDir);
            doc = DocumentFile.createDocument(entry);
          } catch(Exception e){
            throw new Exception("Unable to read document at: "+subDir.getName(), e);
View Full Code Here

    try {
      DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
      updateProcess.setListener(UpdateListener._singleton);
     
      FSEntry fileEntry = new FSEntryFile(ddDir);
      Document doc = DocumentFile.createDocument(fileEntry);

      updateProcess.update(
          doc
          ,DocumentUpdateProcess.Schedule.UPDATE_EVEN_IF_MODIFIED
          );
View Full Code Here

        for(String fileName : fileNames) {
          File file = new File(documentsDir, fileName);
   
          try {
            FSEntry fileEntry = new FSEntryFile(file);
            Document doc = DocumentFile.createDocument(fileEntry);

            updateProcess.update(doc);

          } catch(Exception e) {
            throw new ServletException("Problem pushing document: "+file.getAbsolutePath(), e);
          }
        }
      }
    }
   
    // Find root directory for updating documents
    {
      File documentsDir = null;
      {
        documentsDir = new File(webInfDirectory, "updateDocs");
        if( false == documentsDir.exists() || false == documentsDir.isDirectory() ) {
          documentsDir = null;
        }
      }
     
      if( null == documentsDir ) {
        logger.error("Unable to find document directory for updating");
      } else {
        String[] fileNames = documentsDir.list();
        for(String fileName : fileNames) {
          File file = new File(documentsDir, fileName);
   
          try {
            FSEntry fileEntry = new FSEntryFile(file);
            Document doc = DocumentFile.createDocument(fileEntry);

            updateProcess.update(
              doc
              ,DocumentUpdateProcess.Schedule.UPDATE_EVEN_IF_MODIFIED
              );
View Full Code Here

    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/site document...
    Document doc = null;
    {
      List<FSEntry> mergedEntries = new Vector<FSEntry>();
     
      // htdocs from atlas project
      {
View Full Code Here

        cssProcess.generate(nunaliitDir);
      }
    }
   
    // Create _design/atlas document...
    Document doc = null;
    {
      File installDir = gs.getInstallDir();

      List<FSEntry> entries = new Vector<FSEntry>();
     
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.app.Document

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.