Examples of updateDocument()


Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

         
          // Update document before saving
          CouchNunaliitUtils.adjustDocumentForStorage(doc, userContext);
         
          try {
            userCouchDb.updateDocument(doc);
           
            logger.info("onLoad update: "+doc.optString("_id")+" -> "+actualFile);
          } catch(Exception e) {
            logger.error("Unable to save information about file: "+actualFile.getName(),e);
          }
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

    jsonDoc.put("nunaliit_date_clusters", tree.toJSON());
    CouchAuthenticationContext authContext = db.getClient().getSession().getAuthenticationContext();
    CouchNunaliitUtils.adjustDocumentForStorage(jsonDoc, authContext);
    if( exists ){
      db.updateDocument(jsonDoc);
    } else {
      db.createDocument(jsonDoc);
    }
  }
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

          }
        }
      }
    }
    if( documentUpdated ) {
      db.updateDocument(jsonDoc);
      logger.info("Indexed date structures: "+jsonDoc.getString("_id"));
    }
  }
 
  private void performReloadTree() throws Exception {
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

    if( approved ) {
      CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
      submissionDoc.getJSONObject("nunaliit_submission")
        .put("state", "approved");
      submissionDb.updateDocument(submissionDoc);
    } else {
      CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
      submissionDoc.getJSONObject("nunaliit_submission")
        .put("state", "waiting_for_approval");
      submissionDb.updateDocument(submissionDoc);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

      submissionDb.updateDocument(submissionDoc);
    } else {
      CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
      submissionDoc.getJSONObject("nunaliit_submission")
        .put("state", "waiting_for_approval");
      submissionDb.updateDocument(submissionDoc);
     
logger.error("Sending waiting for approval notification for submission");     
      this.mailNotifier.sendSubmissionWaitingForApprovalNotification(submissionDoc);
    }
  }
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

      targetDb.createDocument(originalDoc);
     
      CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
      submissionDoc.getJSONObject("nunaliit_submission")
        .put("state", "complete");
      submissionDb.updateDocument(submissionDoc);
     
    } else if( isDeletion ) {
      CouchDb targetDb = documentDbDesignDocument.getDatabase();
      JSONObject toDeleteDoc = targetDb.getDocument(docId);
      targetDb.deleteDocument(toDeleteDoc);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

      targetDb.deleteDocument(toDeleteDoc);
     
      CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
      submissionDoc.getJSONObject("nunaliit_submission")
        .put("state", "complete");
      submissionDb.updateDocument(submissionDoc);
     
    } else {
      String currentVersion = currentDoc.getString("_rev");
     
      JSONObject approvedDoc = SubmissionUtils.getApprovedDocumentFromSubmission(submissionDoc);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

     
      if( currentVersion.equals(approvedVersion) ) {
        // No changes since approval. Simply update the document
        // database.
        CouchDb targetDb = documentDbDesignDocument.getDatabase();
        targetDb.updateDocument(approvedDoc);
       
        CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
        submissionDoc.getJSONObject("nunaliit_submission")
          .put("state", "complete");
        submissionDb.updateDocument(submissionDoc);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

        targetDb.updateDocument(approvedDoc);
       
        CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
        submissionDoc.getJSONObject("nunaliit_submission")
          .put("state", "complete");
        submissionDb.updateDocument(submissionDoc);
      } else {
        // Get document that the changes were made against
        CouchDb couchDb = documentDbDesignDocument.getDatabase();
        CouchDocumentOptions options = new CouchDocumentOptions();
        options.setRevision(approvedVersion);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDb.updateDocument()

          logger.error("rootDoc: "+rootDoc);
          logger.error("submissionPatch: "+submissionPatch);
          logger.error("databasePatch: "+databasePatch);
          logger.error("no collision: "+doc1);
          CouchDb targetDb = documentDbDesignDocument.getDatabase();
          targetDb.updateDocument(doc1);
         
          CouchDb submissionDb = submissionDbDesignDocument.getDatabase();
          submissionDoc.getJSONObject("nunaliit_submission")
            .put("state", "complete");
          submissionDb.updateDocument(submissionDoc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.