Package ca.carleton.gcrc.couch.client

Examples of ca.carleton.gcrc.couch.client.CouchUserDocContext


  public void performSubmittedWork(JSONObject submissionDoc, JSONObject targetDoc) throws Exception {
    // Find roles associated with the user who submitted the change
    String userId = submissionDoc
      .getJSONObject("nunaliit_last_updated")
      .getString("name");
    CouchUserDocContext userDoc = null;
    try {
      userDoc = userDb.getUserFromName(userId);
    } catch(Exception e) {
      // Ignore if we can not find user
    }

    // Check if submission should be automatically approved
    boolean approved = false;
    if( null != userDoc ) {
      List<String> roles = userDoc.getRoles();
      for(String role : roles){
        if( "_admin".equals(role) ){
          approved = true;
          break;
        } else if( "administrator".equals(role) ){
View Full Code Here


    if( null != created ){
      userId = created.optString("name", null);
    }

    // Get user document
    CouchUserDocContext userDocContext = null;
    if( null != userId ){
      try {
        userDocContext = userDb.getUserFromName(userId);
      } catch(Exception e) {
        // Ignore if we can not find user
      }
    }
   
    // Get list of e-mails
    List<String> emails = new Vector<String>();
    String userName = null;
    if( null != userDocContext ){
      JSONObject userDoc = userDocContext.getUserDoc();
     
      Set<String> validatedEmails = new HashSet<String>();
      JSONArray jsonValidated = userDoc.optJSONArray("nunaliit_validated_emails");
      if( null != jsonValidated ){
        for(int i=0; i<jsonValidated.length(); ++i){
View Full Code Here

   
    // Find user that submitted the update
    String userId = submissionInfo.optString("submitter_name");

    // Get user document
    CouchUserDocContext userDocContext = null;
    if( null != userId ){
      try {
        userDocContext = userDb.getUserFromName(userId);
      } catch(Exception e) {
        // Ignore if we can not find user
      }
    }
   
    // Get list of e-mails
    List<String> emails = new Vector<String>();
    String userName = null;
    if( null != userDocContext ){
      JSONObject userDoc = userDocContext.getUserDoc();
     
      Set<String> validatedEmails = new HashSet<String>();
      JSONArray jsonValidated = userDoc.optJSONArray("nunaliit_validated_emails");
      if( null != jsonValidated ){
        for(int i=0; i<jsonValidated.length(); ++i){
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.client.CouchUserDocContext

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.