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

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


    final String POST_ACTIVITY_REQUEST_URL = BASE_URL+"activity.json";
      try{
        HttpResponse response = executePost(POST_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH, newInstance);
        handleError(response);
        String responseContent = getContent(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } 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


    final String GET_ACTIVITY_REQUEST_URL = BASE_URL+"activity/"+uuid+".json";
      try{
        HttpResponse response = executeGet(GET_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
        handleError(response);
        String responseContent = getContent(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } 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

    final String DELETE_ACTIVITY_REQUEST_URL = BASE_URL+"activity/destroy/"+existingInstance.getId()+".json";
    try{
      HttpResponse response = executePost(DELETE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } 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

    final String POST_ACTIVITY_REQUEST_URL = BASE_URL+"activity.json";
      try{
        HttpResponse response = executePost(POST_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH, newInstance);
        String responseContent = getContent(response);
        handleError(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } 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

    try{
      HttpResponse response = executePost(POST_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH, newActivity);
      String responseContent = getContent(response);
      handleError(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } 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

    final String GET_ACTIVITY_REQUEST_URL = BASE_URL+"activity/"+uuid+".json";
      try{
        HttpResponse response = executeGet(GET_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
        String responseContent = getContent(response);
        handleError(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } 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

    final String DELETE_ACTIVITY_REQUEST_URL = BASE_URL+"activity/destroy/"+existingInstance.getId()+".json";
    try{
      HttpResponse response = executePost(DELETE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      String responseContent = getContent(response);
      handleError(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } 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

    final String GET_ACTIVITY_REQUEST_URL = BASE_URL+"activity/"+activityId+".json?" + queryParams.buildQuery();
    try{
      HttpResponse response = executeGet(GET_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      handleError(response);
      String responseContent = getContent(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } 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

      activityService.get("notfound");
      fail("Expecting ServiceException from ActivityService#get(String)");
    } catch (ServiceException se) {

    }
    RestActivity activity = new RestActivity();
    activity.setTitle("Hello There");
    try {
      activityService.create(activity);
      fail("Expecting ServiceException from ActivityService#create(RestActivity)");
    } catch (ServiceException se) {

    }

    try {
      activityService.update(activity);
      fail("Expecting UnsupportedMethodException from ActivityService#update(RestActivity)");
    } catch (UnsupportedMethodException e) {

    }

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

    RestComment comment = new RestComment();
    comment.setText("comment");
View Full Code Here

    if (!canRunTest()) {
      return;
    }
    startSessionAs("root", "gtn");
    RestIdentity restIdentity = identityService.getIdentity("organization", "root");
    RestActivity activity = new RestActivity();
    activity.setTitle("Hello World");
    RestActivity resultActivity = activityService.create(activity);

    assertThat("resultActivity's title should be: \"Hello World\"", "Hello World", equalTo(resultActivity.getTitle()));

    assertThat("resultActivity's identityId should be:  restIdentity.getId()", restIdentity.getId(), equalTo(resultActivity.getIdentityId()));
  }
View Full Code Here

TOP

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

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.