Search in sources :

Example 1 with GetUserProfile

use of org.activityinfo.legacy.shared.command.GetUserProfile in project activityinfo by bedatadriven.

the class UserProfilePage method bindProfile.

private void bindProfile() {
    userProfile = new UserProfileDTO();
    AuthenticatedUser user = new ClientSideAuthProvider().get();
    dispatcher.execute(new GetUserProfile(user.getUserId()), new AsyncCallback<UserProfileDTO>() {

        @Override
        public void onFailure(Throwable caught) {
            Log.error("error binding profile", caught);
            MessageBox.alert(I18N.CONSTANTS.serverError(), caught.getMessage(), null);
        }

        @Override
        public void onSuccess(UserProfileDTO userProfileDTO) {
            userProfile = userProfileDTO;
            binding.bind(userProfile);
            UserProfilePage.this.show();
            maybeShowSwitchLocaleLink();
        }
    });
}
Also used : ClientSideAuthProvider(org.activityinfo.ui.client.inject.ClientSideAuthProvider) GetUserProfile(org.activityinfo.legacy.shared.command.GetUserProfile) UserProfileDTO(org.activityinfo.legacy.shared.model.UserProfileDTO) AuthenticatedUser(org.activityinfo.legacy.shared.AuthenticatedUser)

Aggregations

AuthenticatedUser (org.activityinfo.legacy.shared.AuthenticatedUser)1 GetUserProfile (org.activityinfo.legacy.shared.command.GetUserProfile)1 UserProfileDTO (org.activityinfo.legacy.shared.model.UserProfileDTO)1 ClientSideAuthProvider (org.activityinfo.ui.client.inject.ClientSideAuthProvider)1