Package org.exoplatform.social.client.api.model

Examples of org.exoplatform.social.client.api.model.RestComment


    final String CREATE_COMMENT_REQUEST_URL = BASE_URL+"activity/"+ existingRestActivity.getId()+"/comment.json";
      try{
        HttpResponse response = executePost(CREATE_COMMENT_REQUEST_URL, POLICY.BASIC_AUTH, newRestComment);
        handleError(response);
        String responseContent = getContent(response);
        RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
        return restComment;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha1.class,e.getMessage(),null);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha1.class,e.getMessage(),null);
View Full Code Here


                                            existingRestComment.getId() + ".json";
    try{
      HttpResponse response = executePost(DELETE_COMMENT_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
      return restComment;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha1.class,"invalid response",null);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha1.class,"invalid response",null);
View Full Code Here

    final String CREATE_COMMENT_REQUEST_URL = BASE_URL+"activity/"+ existingRestActivity.getId()+"/comment.json";
      try{
        HttpResponse response = executePost(CREATE_COMMENT_REQUEST_URL, POLICY.BASIC_AUTH, newRestComment);
        String responseContent = getContent(response);
        handleError(response);
        RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
        return restComment;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha2.class, e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha2.class, e.getMessage(), e);
View Full Code Here

                                            existingRestComment.getId() + ".json";
    try{
      HttpResponse response = executePost(DELETE_COMMENT_REQUEST_URL, POLICY.BASIC_AUTH);
      String responseContent = getContent(response);
      handleError(response);
      RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
      return restComment;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha2.class, e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha2.class, e.getMessage(), e);
View Full Code Here

    //create a activity to demo's stream
    startSessionAs("root", "gtn");
    RestActivity demoActivity = createActivities(1).get(0);
    startSessionAsAnonymous();

    RestComment comment = new RestComment();
    comment.setText("comment");

    try {
      activityService.createComment(demoActivity, comment);
      fail("Expecting AccessDeniedException from ActivityService#createComment(RestActivity, RestComment)");
    } catch (ServiceException se) {
View Full Code Here

    //create a activity to demo's stream
    startSessionAs("root", "gtn");
    RestActivity demoActivity = createActivities(1).get(0);
    startSessionAs("mary", "gtn");

    RestComment comment = new RestComment();
    comment.setText("comment");

    try {
      activityService.createComment(demoActivity, comment);
      fail("Expecting AccessDeniedException from ActivityService#createComment(RestActivity, RestComment)");
    } catch (SocialClientLibException se) {
View Full Code Here

    final String CREATE_COMMENT_REQUEST_URL = BASE_URL+"activity/"+ existingRestActivity.getId()+"/comment.json";
      try{
        HttpResponse response = executePost(CREATE_COMMENT_REQUEST_URL, POLICY.BASIC_AUTH, newRestComment);
        String responseContent = getContent(response);
        handleError(response);
        RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
        return restComment;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
View Full Code Here

                                            existingRestComment.getId() + ".json";
    try{
      HttpResponse response = executePost(DELETE_COMMENT_REQUEST_URL, POLICY.BASIC_AUTH);
      String responseContent = getContent(response);
      handleError(response);
      RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
      return restComment;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
View Full Code Here

    final String id = "123sdge234";
    final String identityId = "136492yf9wfhw";
    final String activityId = "12345689abcdefgh";
    final long postedTime = System.currentTimeMillis();
    final String createdAt = "Tue Jun 21 15:09:19 +0700 2011";
    RestComment restComment = new RestComment(id, identityId, activityId, postedTime, createdAt);
    assertThat("restComment must not be null", restComment, notNullValue());
    assertThat("restComment.getId() must return: " + id, restComment.getId(), equalTo(id));
    assertThat("restComment.getIdentityId() must return: " + identityId, restComment.getIdentityId(), equalTo(identityId));
    assertThat("restComment.getActivityId() must return: " + activityId, restComment.getActivityId(), equalTo(activityId));
    assertThat("restComment.getPostedTime() must return: " + postedTime, restComment.getPostedTime(), equalTo(postedTime));
    assertThat("restComment.getCreatedAt() must return: " + createdAt, restComment.getCreatedAt(), equalTo(createdAt));
  }
View Full Code Here

    startSessionAs("root", "gtn");
   
    RestActivity demoActivity = createActivities(1).get(0);
    startSessionAsAnonymous();

    RestComment comment = new RestComment();
    comment.setText("comment");

    try {
      activityService.createComment(demoActivity, comment);
      fail("Expecting AccessDeniedException from ActivityService#createComment(RestActivity, RestComment)");
    } catch (ServiceException se) {
View Full Code Here

TOP

Related Classes of org.exoplatform.social.client.api.model.RestComment

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.