Search in sources :

Example 11 with SocialUser

use of org.ext.uberfire.social.activities.model.SocialUser 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 12 with SocialUser

use of org.ext.uberfire.social.activities.model.SocialUser 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 13 with SocialUser

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

the class UserHomePageSidePresenter method createLoggedUserActionLink.

private void createLoggedUserActionLink(final SocialUser socialUser, final Button followUnfollow) {
    followUnfollow.setText(Constants.INSTANCE.Edit());
    followUnfollow.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            editUserForm.show(socialUser, new ParameterizedCommand<SocialUser>() {

                @Override
                public void execute(SocialUser socialUser) {
                    socialUserService.call().update(socialUser);
                    refreshPage(socialUser.getUserName());
                    userEditedEvent.fire(new UserEditedEvent(socialUser.getUserName()));
                }
            });
        }
    });
}
Also used : UserEditedEvent(org.kie.workbench.common.screens.social.hp.client.homepage.events.UserEditedEvent) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) SocialUser(org.ext.uberfire.social.activities.model.SocialUser) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand)

Example 14 with SocialUser

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

the class UserHomePageSidePresenter method refreshCacheAndGeneratesSelectEvent.

void refreshCacheAndGeneratesSelectEvent(final String userName) {
    socialUserRepositoryAPI.call(new RemoteCallback<SocialUser>() {

        public void callback(final SocialUser user) {
            users.put(user.getUserName(), user);
            selectedEvent.fire(new UserHomepageSelectedEvent(userName));
        }
    }).findSocialUser(userName);
}
Also used : UserHomepageSelectedEvent(org.kie.workbench.common.screens.social.hp.client.homepage.events.UserHomepageSelectedEvent) SocialUser(org.ext.uberfire.social.activities.model.SocialUser) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Aggregations

SocialUser (org.ext.uberfire.social.activities.model.SocialUser)14 Date (java.util.Date)4 SocialActivitiesEvent (org.ext.uberfire.social.activities.model.SocialActivitiesEvent)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)3 SocialPaged (org.ext.uberfire.social.activities.model.SocialPaged)2 Before (org.junit.Before)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 ContextNotActiveException (javax.enterprise.context.ContextNotActiveException)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 SocialUserRepositoryAPI (org.ext.uberfire.social.activities.service.SocialUserRepositoryAPI)1 SocialUserServiceAPI (org.ext.uberfire.social.activities.service.SocialUserServiceAPI)1 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)1 NewRepositoryEvent (org.guvnor.structure.repositories.NewRepositoryEvent)1 UserImpl (org.jboss.errai.security.shared.api.identity.UserImpl)1 UserEditedEvent (org.kie.workbench.common.screens.social.hp.client.homepage.events.UserEditedEvent)1 UserHomepageSelectedEvent (org.kie.workbench.common.screens.social.hp.client.homepage.events.UserHomepageSelectedEvent)1