Search in sources :

Example 1 with SocialPaged

use of org.ext.uberfire.social.activities.model.SocialPaged in project kie-wb-common by kiegroup.

the class SocialHomePageSidePresenter method onOpen.

@OnOpen
public void onOpen() {
    final SocialPaged socialPaged = new SocialPaged(5);
    socialUserRepositoryAPI.call(new RemoteCallback<SocialUser>() {

        public void callback(SocialUser socialUser) {
            SimpleSocialTimelineWidgetModel model = new SimpleSocialTimelineWidgetModel(socialUser, new UserTimeLineFileChangesPredicate(), placeManager, socialPaged).withOnlyMorePagination(new Next() {

                {
                    setText(Constants.INSTANCE.PaginationMore());
                }
            }).withIcons(iconLocator.getResourceTypes()).withLinkCommand(generateLinkCommand());
            view.setupWidget(model);
        }
    }).findSocialUser(loggedUser.getIdentifier());
}
Also used : UserTimeLineFileChangesPredicate(org.kie.workbench.common.screens.social.hp.predicate.UserTimeLineFileChangesPredicate) SocialPaged(org.ext.uberfire.social.activities.model.SocialPaged) SocialUser(org.ext.uberfire.social.activities.model.SocialUser) Next(org.ext.uberfire.social.activities.client.widgets.pagination.Next) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback) SimpleSocialTimelineWidgetModel(org.ext.uberfire.social.activities.client.widgets.timeline.simple.model.SimpleSocialTimelineWidgetModel) OnOpen(org.uberfire.lifecycle.OnOpen)

Example 2 with SocialPaged

use of org.ext.uberfire.social.activities.model.SocialPaged in project kie-wb-common by kiegroup.

the class UserHomePageMainPresenter method setupUser.

private void setupUser(final String username) {
    final SocialPaged socialPaged = new SocialPaged(5);
    socialUserRepositoryAPI.call(new RemoteCallback<SocialUser>() {

        @Override
        public void callback(SocialUser socialUser) {
            if (isThisUserStillCurrentActiveUser(socialUser)) {
                generateConnectionsList(socialUser);
                setupMainWidget(socialUser, socialPaged);
            }
        }
    }).findSocialUser(username);
}
Also used : SocialPaged(org.ext.uberfire.social.activities.model.SocialPaged) SocialUser(org.ext.uberfire.social.activities.model.SocialUser) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 3 with SocialPaged

use of org.ext.uberfire.social.activities.model.SocialPaged in project kie-wb-common by kiegroup.

the class SocialTimelineRulesQuery method getNEventsFromEachType.

@Override
public List<SocialActivitiesEvent> getNEventsFromEachType(int numberOfEvents, String... typeNames) {
    List<SocialActivitiesEvent> events = new ArrayList<>();
    for (String type : typeNames) {
        PagedSocialQuery query = socialTypeTimelinePagedRepositoryAPI.getEventTimeline(type, new SocialPaged(numberOfEvents), new HashMap());
        events.addAll(query.socialEvents());
    }
    return events;
}
Also used : SocialPaged(org.ext.uberfire.social.activities.model.SocialPaged) HashMap(java.util.HashMap) SocialActivitiesEvent(org.ext.uberfire.social.activities.model.SocialActivitiesEvent) ArrayList(java.util.ArrayList) PagedSocialQuery(org.ext.uberfire.social.activities.model.PagedSocialQuery)

Aggregations

SocialPaged (org.ext.uberfire.social.activities.model.SocialPaged)3 SocialUser (org.ext.uberfire.social.activities.model.SocialUser)2 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Next (org.ext.uberfire.social.activities.client.widgets.pagination.Next)1 SimpleSocialTimelineWidgetModel (org.ext.uberfire.social.activities.client.widgets.timeline.simple.model.SimpleSocialTimelineWidgetModel)1 PagedSocialQuery (org.ext.uberfire.social.activities.model.PagedSocialQuery)1 SocialActivitiesEvent (org.ext.uberfire.social.activities.model.SocialActivitiesEvent)1 UserTimeLineFileChangesPredicate (org.kie.workbench.common.screens.social.hp.predicate.UserTimeLineFileChangesPredicate)1 OnOpen (org.uberfire.lifecycle.OnOpen)1