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

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


                                populate();
                            }
                        }
                    });
            PersonJoinedGroupsModel.getInstance().fetch(
                    new GetFollowersFollowingRequest(EntityType.GROUP, Session.getInstance().getCurrentPerson()
                            .getAccountId(), 0, Integer.MAX_VALUE), true);
        }
        if (subscribedGroupIds == null)
        {
            eventBus.addObserver(GotGroupActivitySubscriptionsResponseEvent.class,
View Full Code Here


     * Initialize..
     */
    public void init()
    {
        pager = new BasicPager();
        model.fetch(new GetFollowersFollowingRequest(entityType, entityKey, pager.getStartItem(), pager.getEndItem()),
                false);
    }
View Full Code Here

     * Next.
     */
    public void next()
    {
        pager.nextPage();
        model.fetch(new GetFollowersFollowingRequest(entityType, entityKey, pager.getStartItem(), pager.getEndItem()),
                false);

    }
View Full Code Here

     * Prev.
     */
    public void prev()
    {
        pager.previousPage();
        model.fetch(new GetFollowersFollowingRequest(entityType, entityKey, pager.getStartItem(), pager.getEndItem()),
                false);
    }
View Full Code Here

    public void setUp()
    {
        sut = new GetFollowingExecution(personAccountIdToIdLookupMapper, idsMapper, bulkModelViewMapper,
                followerStatusPopulator);

        final GetFollowersFollowingRequest rqst = new GetFollowersFollowingRequest(EntityType.PERSON, ACCOUNT_ID,
                START_INDEX, END_INDEX);
        context.checking(new Expectations()
        {
            {
                allowing(actionContext).getParams();
View Full Code Here

                        Session.getInstance().getCurrentPerson().getAccountId()))
                {  
                    // Update "Followers" tab so that the removed
                    // follower no longer appears.
                    BasicPager pager = new BasicPager();
                    fetch(new GetFollowersFollowingRequest(EntityType.GROUP,
                        request.getGroupShortName(), pager.getStartItem(), pager.getEndItem()), false);
                   
                    // Update the Group 'Followers' #
                    GroupModel.getInstance().fetch(request.getGroupShortName(), false);
                }
View Full Code Here

     *            the action context
     */
    @Override
    public void authorize(final PrincipalActionContext inActionContext)
    {
        GetFollowersFollowingRequest actionRequest = (GetFollowersFollowingRequest) inActionContext.getParams();

        EntityType targetType = actionRequest.getEntityType();

        if (targetType == EntityType.PERSON)
        {
            return;
        }

        if (targetType == EntityType.GROUP)
        {
            long userId = inActionContext.getPrincipal().getId();
            String groupShortName = actionRequest.getEntityId();
            List<DomainGroupModelView> groups = groupMapper.execute(Collections.singletonList(groupShortName));

            if (groups.size() > 0)
            {
                DomainGroupModelView group = groups.get(0);
View Full Code Here

                if (currentPrincipal == null)
                {
                    throw new ProtocolException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server Error");
                }

                GetFollowersFollowingRequest currentRequest = new GetFollowersFollowingRequest(EntityType.PERSON,
                        currentPrincipal.getAccountId(), 0, Integer.MAX_VALUE);

                ServiceActionContext currentContext = new ServiceActionContext(currentRequest, currentPrincipal);

                PagedSet<PersonModelView> peopleResults = (PagedSet<PersonModelView>) serviceActionController.execute(
View Full Code Here

     */
    @Override
    public PagedSet<FollowerStatusable> execute(final PrincipalActionContext inActionContext)
    {
        // get the request
        GetFollowersFollowingRequest inRequest = (GetFollowersFollowingRequest) inActionContext.getParams();

        // get the unique entity Id
        final String entityUniqueId = inRequest.getEntityId();

        final long currentUserId = inActionContext.getPrincipal().getId();

        Long entityId = getPersonIdByAccountIdMapper.execute(entityUniqueId);

        List<Long> allIds = idsMapper.execute(entityId);

        // determine the page
        int startIndex = (inRequest.getStartIndex()).intValue();
        int endIndex = (inRequest.getEndIndex()).intValue();

        PagedSet<FollowerStatusable> pagedSet;
        if (allIds.isEmpty())
        {
            pagedSet = new PagedSet<FollowerStatusable>();
View Full Code Here

     */
    @Override
    public PagedSet<Person> execute(final PrincipalActionContext inActionContext)
    {
        // get the request
        GetFollowersFollowingRequest inRequest = (GetFollowersFollowingRequest) inActionContext.getParams();

        // get the unique entity Id
        final String uniqueEntityId = inRequest.getEntityId();

        // get the entity type.
        EntityType targetType = inRequest.getEntityType();

        // get the start value.
        Integer startValue = (inRequest.getStartIndex()).intValue();

        // get the end value.
        Integer endValue = (inRequest.getEndIndex()).intValue();

        // given the entity type, get the follow mapper.
        FollowMapper mapper = pickMapper(targetType);

        PagedSet<Person> connections = mapper.getFollowers(uniqueEntityId, startValue, endValue);
View Full Code Here

TOP

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

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.