Package org.eurekastreams.server.search.modelview

Examples of org.eurekastreams.server.search.modelview.PersonModelView


                will(returnValue(TARGET_USER));

                oneOf(getCurrentUserFollowingStatusRequest).getEntityType();
                will(returnValue(EntityType.PERSON));

                PersonModelView target = new PersonModelView();
                target.setEntityId(TARGET_USER_ID);
                oneOf(getPersonModelViewsByAccountIdsMapper).execute(with(any(List.class)));
                will(returnValue(Collections.singletonList(target)));

                oneOf(getFollowerIds).execute(TARGET_USER_ID);
                will(returnValue(Collections.singletonList(CURRENT_USER_ID)));
View Full Code Here


                will(returnValue(targetUser));

                oneOf(targetUser).getAccountId();
                will(returnValue(TARGET_USER));

                PersonModelView target = new PersonModelView();
                target.setEntityId(TARGET_USER_ID);
                oneOf(getPersonModelViewsByAccountIdsMapper).execute(with(any(List.class)));
                will(returnValue(Collections.singletonList(target)));

                oneOf(getFollowerIds).execute(TARGET_USER_ID);
                will(returnValue(new ArrayList<PersonModelView>()));
View Full Code Here

        final CommentDTO c1 = context.mock(CommentDTO.class, "c1");
        final CommentDTO c2 = context.mock(CommentDTO.class, "c2");
        final CommentDTO c3 = context.mock(CommentDTO.class, "c3");
        final CommentDTO c4 = context.mock(CommentDTO.class, "c4");

        final PersonModelView p1 = context.mock(PersonModelView.class, "p1");
        final PersonModelView p3 = context.mock(PersonModelView.class, "p3");
        final PersonModelView p5 = context.mock(PersonModelView.class, "p5");

        final List<CommentDTO> a4c = Collections.singletonList(c4);

        final DomainMapper personMapper = context.mock(DomainMapper.class, "personMapper");
View Full Code Here

        final StreamEntityDTO e1o = context.mock(StreamEntityDTO.class, "e1o");
        final StreamEntityDTO e3o = context.mock(StreamEntityDTO.class, "e3o");
        final ActivityDTO a1 = context.mock(ActivityDTO.class, "a1");
        final ActivityDTO a2 = context.mock(ActivityDTO.class, "a2");
        final ActivityDTO a3 = context.mock(ActivityDTO.class, "a3");
        final PersonModelView p7 = context.mock(PersonModelView.class, "p7");
        final PersonModelView p8 = context.mock(PersonModelView.class, "p8");
        final PersonModelView p9 = context.mock(PersonModelView.class, "p9");

        context.checking(new Expectations()
        {
            {
                allowing(a1).getActor();
View Full Code Here

                        break;
                    }
                }
                if (!ignore)
                {
                    PersonModelView currentPerson = new PersonModelView();
                    currentPerson.setEntityId(Session.getInstance().getCurrentPerson().getId());
                    currentPerson.setAvatarId(Session.getInstance().getCurrentPerson().getAvatarId());
                    currentPerson.setDisplayName(Session.getInstance().getCurrentPerson().getDisplayName());
                    currentPerson.setAccountId(Session.getInstance().getCurrentPerson().getAccountId());

                    if (likers.size() >= MAXLIKERSSHOWN)
                    {
                        likerOverflow = likers.get(MAXLIKERSSHOWN - 1);
                        likers.remove(MAXLIKERSSHOWN - 1);
View Full Code Here

        final InAppNotificationDTO notif5 = new InAppNotificationDTO();
        notif5.setAvatarOwnerType(EntityType.GROUP);
        notif5.setAvatarOwnerUniqueId("avatarlessgroup");
        notif5.setNotificationType(NotificationType.COMMENT_TO_COMMENTED_POST);

        final PersonModelView person = new PersonModelView();
        person.setAccountId("knownperson");
        person.setAvatarId("avatar1");
        final DomainGroupModelView group = new DomainGroupModelView();
        group.setShortName("knowngroup");
        group.setAvatarId("avatar2");
        final DomainGroupModelView group2 = new DomainGroupModelView();
        group2.setShortName("avatarlessgroup");
View Full Code Here

                new Observer<GotPersonalInformationResponseEvent>()
                {
                    public void update(final GotPersonalInformationResponseEvent event)
                    {
                        widget.removeStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectLoading());
                        PersonModelView entity = event.getResponse();

                        if (entity == null)
                        {
                            final AvatarWidget blankAvatar = new AvatarWidget(EntityType.PERSON, Size.Normal);
                            blankAvatar.addStyleName(StaticResourceBundle.INSTANCE.coreCss()
                                    .eurekaConnectBadgeAvatar());

                            widget.add(blankAvatar);

                            final Label blankName = new Label(accountId);
                            blankName.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectBadgeName());

                            widget.add(blankName);
                        }
                        else
                        {
                            Widget linkPanel = AvatarLinkPanel.create(entity, Size.Normal, false);
                            linkPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectBadgeAvatar());
                            widget.add(linkPanel);

                            String linkUrl = "/#"
                                    + Session.getInstance().generateUrl(
                                            new CreateUrlRequest(Page.PEOPLE, entity.getAccountId()));

                            Anchor name = new Anchor(entity.getDisplayName(), linkUrl, "_BLANK");
                            name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectBadgeName());

                            Label title = new Label(entity.getTitle());
                            title.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectBadgeTitle());

                            Label company = new Label(entity.getCompanyName());
                            company.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectBadgeCompany());

                            widget.add(name);
                            widget.add(title);
                            widget.add(company);
View Full Code Here

        personStream.setStreamUniqueKey("personA");
        groupStream.setStreamType(ScopeType.GROUP);
        groupStream.setStreamEntityId(groupId);
        groupStream.setStreamUniqueKey("groupA");

        final PersonModelView p = new PersonModelView();
        p.setEntityId(personId);
        p.setDisplayName(personDisplayName);
        p.setAvatarId("personAvatarId");
        p.setAccountId("personA");

        final DomainGroupModelView g = new DomainGroupModelView();
        g.setEntityId(groupId);
        g.setName(groupDisplayName);
        g.setAvatarId(groupAvatarId);
View Full Code Here

     * Test compare when PersonModelView and DomainGroupModelView are passed in with the same follower count.
     */
    @Test
    public void testCompareWhenEqualGroupAndPerson()
    {
        PersonModelView pmv = new PersonModelView(1L, "persona", "Person", "last", null, "", 50, new Date(), 4L);
        DomainGroupModelView gmv = new DomainGroupModelView(1L, "groupb", "Group B", 50L, new Date(), 5L);

        Assert.assertTrue(sut.compare(pmv, gmv) > 0);
        Assert.assertTrue(sut.compare(gmv, pmv) < 0);
    }
View Full Code Here

     * Test compare when two PersonModelViews are passed in with equal followers count.
     */
    @Test
    public void testCompareWhenTwoPeopleEqualCount()
    {
        PersonModelView pmv1 = new PersonModelView(1L, "persona", "Person", "A", null, "", 50, new Date(), 6L);
        PersonModelView pmv2 = new PersonModelView(2L, "personb", "Person", "B", null, "", 50, new Date(), 7L);

        Assert.assertTrue(sut.compare(pmv1, pmv2) < 0);
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.search.modelview.PersonModelView

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.