Package ca.carleton.gcrc.couch.app

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


    ,AtlasProperties atlasProperties
    ) throws Exception {
   
    CouchDb couchDb = CommandSupport.createCouchDb(gs, atlasProperties);
   
    DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
    DocumentUpdateListener l = new UpdateProgress(gs);
    updateProcess.setListener(l);
   
    return updateProcess;
  }
View Full Code Here


    // Load properties for atlas
    AtlasProperties atlasProperties = AtlasProperties.fromAtlasDir(atlasDir);

    // Prepare update process
    DocumentUpdateProcess updateProcess =
        CommandUpdate.createDocumentUpdateProcess(gs, atlasProperties);
   
    // Update site design document
    try {
      pushSiteDesign(gs, atlasDir, atlasProperties, updateProcess);
View Full Code Here

    ,AtlasProperties atlasProperties
    ) throws Exception {
   
    CouchDb couchDb = CommandSupport.createCouchDb(gs, atlasProperties);
   
    DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
    DocumentUpdateListener l = new UpdateProgress(gs);
    updateProcess.setListener(l);
   
    return updateProcess;
  }
View Full Code Here

    // Load properties for atlas
    AtlasProperties atlasProperties = AtlasProperties.fromAtlasDir(atlasDir);

    // Prepare update process
    DocumentUpdateProcess updateProcess =
        CommandUpdate.createDocumentUpdateProcess(gs, atlasProperties);
   
    // Update site design document
    try {
      pushSiteDesign(gs, atlasDir, atlasProperties, updateProcess);
View Full Code Here

    ,AtlasProperties atlasProperties
    ) throws Exception {
   
    CouchDb couchDb = CommandSupport.createCouchDb(gs, atlasProperties);
   
    DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
    DocumentUpdateListener l = new UpdateProgress(gs);
    updateProcess.setListener(l);
   
    return updateProcess;
  }
View Full Code Here

    // Load properties for atlas
    AtlasProperties atlasProperties = AtlasProperties.fromAtlasDir(atlasDir);

    // Prepare update process
    DocumentUpdateProcess updateProcess =
        CommandUpdate.createDocumentUpdateProcess(gs, atlasProperties);
   
    // Update site design document
    try {
      pushSiteDesign(gs, atlasDir, atlasProperties, updateProcess);
View Full Code Here

      throw new ServletException("Unable to read server design document",e);
    }
   
    // Update document
    try {
      DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(serverDesign);
      updateProcess.update(doc);
    } catch(Exception e) {
      throw new ServletException("Unable to update server design document",e);
    }
   
    try {
View Full Code Here

      throw new ServletException("Unable to read server design document",e);
    }
   
    // Update document
    try {
      DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(serverDesign);
      updateProcess.update(doc);
    } catch(Exception e) {
      throw new ServletException("Unable to update server design document",e);
    }
   
    try {
View Full Code Here

        throw new ServletException("Unable to find design document source for upload");
      }
    }

    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
          );
     
    } catch(Exception e) {
View Full Code Here

  }

  private void initDatabaseDocuments(ServletContext servletContext) throws ServletException {

    // Create update process for database
    DocumentUpdateProcess updateProcess = null;
    try {
      updateProcess = new DocumentUpdateProcess(couchDb);
      updateProcess.setListener(UpdateListener._singleton);
    } catch (Exception e) {
      throw new ServletException("Unable to create update process", e);
    }

    // Find root directory for initializing documents
    {
      File documentsDir = null;
      {
        documentsDir = new File(webInfDirectory, "initializeDocs");
        if( false == documentsDir.exists() || false == documentsDir.isDirectory() ) {
          documentsDir = null;
        }
      }
     
      if( null == documentsDir ) {
        logger.error("Unable to find document directory for initializing");
      } 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);

          } 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
              );

          } catch(Exception e) {
View Full Code Here

TOP

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

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.