Examples of APIResponse


Examples of gwtappcontainer.shared.apis.APIResponse

  @Test
  public void cannotSetContentForInvalidTag() {
    ContentAPI api = new ContentAPI();
    String tag = "tag_" + UUID.randomUUID();
       
    APIResponse resp = api.setContent("test content", tag, true,
      helper.loginAsPortalAdmin());
    assertTrue(resp.statusCode == Status.ERROR_RESOURCE_DOES_NOT_EXIST);   
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

  @SuppressWarnings("unchecked")
  @Test
  public void canGetAllPublishedContents() {
    ContentAPI api = new ContentAPI();
       
    APIResponse response = api.getAllValidPublishedContents();
   
    //return code should be success, should be a map with no members
    assertTrue(response.statusCode == Status.SUCCESS);
   
    Map<String, String> published = (Map<String, String>) response.object;
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

   
    contentAPI.addNewTag("testtag", helper.loginAsDeveloper());
    contentAPI.setContent("content html", "testtag", true,
        helper.loginAsPortalAdmin());
   
    APIResponse response = contentAPI.getAllValidPublishedContents();
    Map<String, String> all = (Map<String, String>) response.object; 
    assertTrue(all.containsKey("testtag"));
   
   
    //set publish to false
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

 
  public APIResponse getAllCenters() {
    try {
      ArrayList<Center> centers = CenterRepository.getAll();
     
      return new APIResponse(Status.SUCCESS, centers);
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

      contactDetails.officePhone = officePhone;
      contactDetails.singaporeNRIC = singaporeNRIC;
         
      MemberRepository.add(contactDetails, owningCenterId, user.getEmail());
     
      return new APIResponse(Status.SUCCESS, "Successfully added member [" + contactDetails.email + "]");
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

      if (officePhone != null) contactDetails.officePhone = officePhone;
      if (singaporeNRIC != null) contactDetails.singaporeNRIC = singaporeNRIC;
             
      MemberRepository.updateContactDetails(memberId, contactDetails, user.getEmail());
     
      return new APIResponse(Status.SUCCESS, "Successfully updated member with [" + member.id + "]");     
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

  public APIResponse getMember(@Named("email") String email, User user) {
    try {
      AccessController.ensureLoggedin(user);
      Member member = MemberRepository.get(email, user.getEmail());
     
      return new APIResponse(Status.SUCCESS, member);
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

      unlistedProgram.year = year;
      unlistedProgram.teacher = teacher;
     
      MemberRepository.addUnlistedProgram(memberId, unlistedProgram, user.getEmail());
     
      return new APIResponse(Status.SUCCESS, "Unlisted program added to member");   
    } catch (Exception ex) {
      return new APIResponse(ex);
    }       
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

    try {
      AccessController.ensureLoggedin(user);
     
      MemberRepository.deleteUnlistedProgram(unlistedProgramId, user.getEmail());           
     
      return new APIResponse(Status.SUCCESS,
          "Unlisted program [" + unlistedProgramId + "] deleted");   
    } catch (Exception ex) {
      return new APIResponse(ex);
    }       
  }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

    }       
  }
 
  public APIResponse listProgramTypes() {
    try {
      return new APIResponse(Status.SUCCESS, ProgramTypeRepository.getAll());
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
  }
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.