Package org.apache.shindig.social.core.model

Examples of org.apache.shindig.social.core.model.ActivityImpl


    johnDoe.setEmails(Lists.<ListField> newArrayList(
        new ListFieldImpl("work", "john.doe@work.bar"), new ListFieldImpl("home",
            "john.doe@home.bar")));

    activity = new ActivityImpl("activityId", johnDoe.getId());

    activity.setMediaItems(Lists.<MediaItem> newArrayList(new MediaItemImpl("image/jpg",
        MediaItem.Type.IMAGE, "http://foo.bar")));

    Injector injector = Guice.createInjector(new JsonLibTestsGuiceModule());
View Full Code Here


        "My home address")));

    johnDoe.setEmails(Lists.<ListField> newArrayList(new ListFieldImpl("work",
        "john.doe@work.bar"), new ListFieldImpl("home", "john.doe@home.bar")));

    activity = new ActivityImpl("activityId", johnDoe.getId());

    activity.setMediaItems(Lists.<MediaItem> newArrayList(new MediaItemImpl(
        "image/jpg", MediaItem.Type.IMAGE, "http://foo.bar")));
    activity.setUrl("http://foo.com");
View Full Code Here

    {
        sut = new ActivityServiceImpl(getUserActivitiesAction, deleteUserActivitiesAction,
                serviceActionControllerMock, principalDao, postActivityServiceActionMock, gadgetDefMapper,
                gadgetMetaDataFetcher);

        testActivity = new ActivityImpl(TEST_ACTIVITY_ID, testId.getUserId());

        activityIds.add("1");
        activityIds.add("2");
        activityIds.add("3");
    }
View Full Code Here

    assertEquals(actual.getTitle(), expected.getTitle());
    assertEquals(actual.getBody(), expected.getBody());
  }
 
  public static Activity buildTestActivity(String id, String userId, String title, String body) {
    Activity activity = new ActivityImpl(id, userId);
    activity.setTitle(title);
    activity.setBody(body);
    return activity;
  }
View Full Code Here

public class RestfulXmlActivityTest extends AbstractLargeRestfulTests {
  private Activity johnsActivity;

  @Before
  public void restfulXmlActivityTestBefore() throws Exception {
    johnsActivity = new ActivityImpl("1", "john.doe");
    johnsActivity.setTitle("yellow");
    johnsActivity.setBody("what a color!");
  }
View Full Code Here

        "My home address")));

    johnDoe.setEmails(Lists.<ListField> newArrayList(new ListFieldImpl("work",
        "john.doe@work.bar"), new ListFieldImpl("home", "john.doe@home.bar")));

    activity = new ActivityImpl("activityId", johnDoe.getId());
    activity.setUrl("http://foo.com/");

    activity.setMediaItems(Lists.<MediaItem> newArrayList(new MediaItemImpl(
        "image/jpg", MediaItem.Type.IMAGE, "http://foo.bar")));
View Full Code Here

  @Test
  public void testHandleGetActivityById() throws Exception {
    String path = "/activities/john.doe/@friends/@app/1";
    RestHandler operation = registry.getRestHandler(path, "GET");

    Activity activity = new ActivityImpl();
    org.easymock.EasyMock.expect(activityService.getActivity(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.friends, null)),
        eq("appId"), eq(ImmutableSet.<String>of()), eq("1"), eq(token))).andReturn(
        ImmediateFuture.newInstance(activity));
View Full Code Here

    String jsonActivity = "{title: hi mom!, etc etc}";

    String path = "/activities/john.doe/@self/@app";
    RestHandler operation = registry.getRestHandler(path, method);

    Activity activity = new ActivityImpl();
    org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivity), eq(Activity.class)))
        .andReturn(activity);

    org.easymock.EasyMock.expect(activityService.createActivity(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
View Full Code Here

     *            - eurekastreams ActivityDTO to be converted.
     * @return converted OpenSocial Activity object.
     */
    private Activity convertActivityFromEurekaActivityDTOToOS(final ActivityDTO inEurekaActivityDTO)
    {
        Activity osActivity = new ActivityImpl();

        // TODO: this code needs to be refactor when new message object rearch is done.
        // Populate the OpenSocial Activity properties.
        // osActivity.setAppId(inEurekaActivity.getAppId());
        // osActivity.setBody(inEurekaActivity.getBody());
        // osActivity.setBodyId(inEurekaActivity.getBodyId());
        osActivity.setExternalId(String.valueOf(inEurekaActivityDTO.getId()));
        // osActivity.setId(String.valueOf(inEurekaActivityDTO.getEntityId()));
        osActivity.setUpdated(inEurekaActivityDTO.getPostedTime());
        // osActivity.setPriority(inEurekaActivity.getPriority());
        // osActivity.setStreamFaviconUrl(inEurekaActivity.getStreamFaviconUrl());
        // osActivity.setStreamSourceUrl(inEurekaActivity.getStreamSourceUrl());
        osActivity.setStreamTitle(inEurekaActivityDTO.getDestinationStream().getDisplayName());
        // osActivity.setStreamUrl(inEurekaActivity.getStreamUrl());
        // osActivity.setTemplateParams(inEurekaActivity.getTemplateParams());
        osActivity.setTitle(inEurekaActivityDTO.getBaseObjectProperties().get("Content"));
        // osActivity.setTitleId(inEurekaActivity.getTitleId());
        // osActivity.setUrl(inEurekaActivity.getUrl());
        osActivity.setUserId(inEurekaActivityDTO.getActor().getUniqueIdentifier());

        return osActivity;
    }
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.core.model.ActivityImpl

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.