Examples of RestLike


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

      handleError(response);
      String responseContent = getContent(response);

      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);
      if((Boolean) responseJson.get("like")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha1.class,"invalid response",null);
      }
    } catch (IOException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha1.class,"invalid response",null);
View Full Code Here

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

      String responseContent = getContent(response);
      handleError(response);
      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);

      if(!(Boolean) responseJson.get("like")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha1.class,"invalid response",null);
      }
    } catch (IOException e){
      throw new ServiceException(e.getMessage(),e);
View Full Code Here

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

      HttpResponse response = executePost(LIKE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);
      if((Boolean) responseJson.get("liked")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha2.class, "invalid response", null);
      }
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha2.class, "invalid response", null);
View Full Code Here

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

      HttpResponse response = executePost(LIKE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);
      if(!(Boolean) responseJson.get("liked")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha2.class, "invalid response", null);
      }
    } catch (SocialHttpClientException e){
      throw new ServiceException(ActivityServiceImplV1Alpha2.class, e.getMessage(), e);
View Full Code Here

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

      HttpResponse response = executePost(LIKE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);
      if((Boolean) responseJson.get("liked")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, "invalid response", null);
      }
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, "invalid response", null);
View Full Code Here

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

      HttpResponse response = executePost(LIKE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);
      if(!(Boolean) responseJson.get("liked")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, "invalid response", null);
      }
    } catch (SocialHttpClientException e){
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
View Full Code Here

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

  @Test
  public void shouldCreateLikeInstance() {
    final String activityId = "1234";
    final String identityId = "abcdegheogi30";
    RestLike restLike = new RestLike(activityId, identityId);
    assertThat("restLike must not be null", restLike, notNullValue());
    assertThat("restLike.getActivityId() must return: " + activityId , restLike.getActivityId(), equalTo(activityId));
    assertThat("restLike.getIdentityId() must return: " + identityId, restLike.getIdentityId(), equalTo(identityId));
  }
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.