Package org.eurekastreams.server.action.request.profile

Examples of org.eurekastreams.server.action.request.profile.SetFollowingStatusRequest


        }
        unfollowLink.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                SetFollowingStatusRequest request = new SetFollowingStatusRequest(Session.getInstance()
                        .getCurrentPerson().getAccountId(), inFollowable.getUniqueId(), inFollowable.getEntityType(),
                        false, Follower.FollowerStatus.NOTFOLLOWING);

                if (inFollowable.getEntityType() == EntityType.PERSON)
                {
                    PersonFollowersModel.getInstance().insert(request);
                }
                else if (inFollowable.getEntityType() == EntityType.GROUP)
                {
                    GroupMembersModel.getInstance().insert(request);
                }
                else
                {
                    Window.alert("Unsupported");
                }

                unfollowLink.setVisible(false);
                followLink.setVisible(true);
            }
        });

        this.add(unfollowLink);

        if (followStyle != null)
        {
            followLink.addStyleName(followStyle);
        }
        if (commonStyle != null)
        {
            followLink.addStyleName(commonStyle);
        }
        followLink.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                SetFollowingStatusRequest request = new SetFollowingStatusRequest(Session.getInstance()
                        .getCurrentPerson().getAccountId(), inFollowable.getUniqueId(), inFollowable.getEntityType(),
                        false, Follower.FollowerStatus.FOLLOWING);

                if (inFollowable.getEntityType() == EntityType.PERSON)
                {
View Full Code Here


                oneOf(groupFollowerIdsMapperMock).execute(GROUP_ID);
                will(returnValue(followerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.FOLLOWING);
        TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator
                .createTaskHandlerContextWithPrincipal(currentRequest, principal);
        Serializable result = sut.execute(actionContext);
View Full Code Here

     * Tests a user approving another to follow a private group.
     */
    @Test
    public void testFollowPrivateGroup()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest(FOLLOWER_ACCOUNT, GROUP_UNIQUEID,
                EntityType.GROUP, false, FollowerStatus.FOLLOWING);

        final RequestForGroupMembershipRequest mapperRequest1 = new RequestForGroupMembershipRequest(GROUP_ID,
                FOLLOWER_ID);

View Full Code Here

                oneOf(groupFollowerIdsMapperMock).execute(GROUP_ID);
                will(returnValue(followerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.NOTFOLLOWING);
        TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator
                .createTaskHandlerContextWithPrincipal(currentRequest, principal);
        Serializable result = sut.execute(actionContext);
View Full Code Here

                oneOf(groupFollowerIdsMapperMock).execute(GROUP_ID);
                will(returnValue(followerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.NOTFOLLOWING);
        TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator
                .createTaskHandlerContextWithPrincipal(currentRequest, principal);
        Serializable result = sut.execute(actionContext);
    }
View Full Code Here

                oneOf(groupFollowerIdsMapperMock).execute(GROUP_ID);
                will(returnValue(followerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.NOTFOLLOWING);
        TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator
                .createTaskHandlerContextWithPrincipal(currentRequest, principal);
        Serializable result = sut.execute(actionContext);
    }
View Full Code Here

                oneOf(getPersonIdFromAccountIdMapper).execute(with(any(String.class)));
                will(throwException(new Exception("BAD")));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.FOLLOWING);
        sut.execute(TestContextCreator.createTaskHandlerContextWithPrincipal(currentRequest, null, 0));

        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(groupFollowerIdsMapperMock).execute(GROUP_ID);
                will(returnValue(followerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.NOTSPECIFIED);
        TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator
                .createTaskHandlerContextWithPrincipal(currentRequest, principal);
        Serializable result = sut.execute(actionContext);
View Full Code Here

                {
                    if (new WidgetJSNIFacadeImpl().confirm("Are you sure you want to remove " + item.getDisplayName()
                            + " from this group?"))
                    {
                        GroupMembersModel.getInstance().delete(
                                new SetFollowingStatusRequest(item.getAccountId(), groupUniqueId, EntityType.GROUP,
                                        false, FollowerStatus.NOTFOLLOWING, group.getShortName()));
                    }
                }
            });
        }
View Full Code Here

     * Test the validate method for success.
     */
    @Test
    public void testValidate()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "followingntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);

        context.checking(new Expectations()
        {
            {
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.profile.SetFollowingStatusRequest

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.