Package com.daikit.commons.shared.bean

Examples of com.daikit.commons.shared.bean.BaseUser


   * @param exception
   */
  public void handleAuthenticationErrorUserLoggedChanged(final BaseAction<?> callingAction,
      final DkUserLoggedChangedException exception)
  {
    final BaseUser userLogged = DkMain.model().getUserLogged();
    final BaseUser previousLoggedUser = DkMain.model().getPreviousUserLogged();
    if (DkObjectUtils.equalsWithNull(AbstractDkBeanWithId.getId(userLogged), exception.getNewLoggedUserId())
        || userLogged == null
        && DkObjectUtils.equalsWithNull(AbstractDkBeanWithId.getId(previousLoggedUser), exception.getNewLoggedUserId()))
    {
      // In this case the new logged user is the same than the old one.
View Full Code Here


   * @return the connect action
   */
  public static BaseAction<ConnectionReturnData> get(final ConnectionData connectionData,
      final BaseAction<?> customChainActionIfLoginSucceded)
  {
    final BaseUser previousLoggedUser = DkMain.model().getPreviousUserLogged();
    final BaseAction<ConnectionReturnData> actionDoConnect = BaseSimpleConnectAction.get(connectionData, DkMain.controller()
        .getConnectionReturnProcessor());
    actionDoConnect.setLastChainAction(BaseAfterConnectAction.get(previousLoggedUser, customChainActionIfLoginSucceded));
    return actionDoConnect;
  }
View Full Code Here

public class BaseOnServerLoggedUserChangedAction
{

  public static BaseAction<?> get(final BaseAction<?> chainAction)
  {
    final BaseUser previousLoggedUser = DkMain.model().getUserLogged();

    final BaseAction<BaseUser> actionLoadSynchronizedLoggedUser = new BaseAction<BaseUser>("")
    {
      @Override
      protected void run()
      {
        DkMain.controller().baseRpcUser().getSynchronizedCurrentUser(new BaseAsyncCallback<BaseUser>(this, true)
        {
          @Override
          public void processSuccess(final BaseUser result)
          {
            DkMain.model().setUserLogged(result);
          }
        });
      }
    };
    // create different action according to the current logged user.
    actionLoadSynchronizedLoggedUser.setLastChainActionCreator(new ChainActionCreator()
    {
      @Override
      public BaseAction<?> getCreatedActions()
      {
        final BaseUser loggedUser = DkMain.model().getUserLogged();
        BaseAction<?> afterLoginChainAction = null;
        if (loggedUser != null)
        {
          afterLoginChainAction = chainAction != null ? chainAction : BaseAfterConnectAction.get(previousLoggedUser);
        }
View Full Code Here

   * @return the {@link BaseAction} called once the application is loaded. It is the only chain action called at this
   *         time, it retrieves current logged user and shows default screen.
   */
  public static BaseAction<?> get()
  {
    final BaseUser previousLoggedUser = DkMain.model().getUserLogged();

    // first retrieve the current logged user on server side
    final BaseAction<BaseUser> actionLoadCurrentLoggedUser = new BaseAction<BaseUser>("")
    {
      @Override
      protected void run()
      {
        DkMain.controller().baseRpcUser().getCurrentUser(new BaseAsyncCallback<BaseUser>(this, true)
        {
          @Override
          public void processSuccess(final BaseUser result)
          {
            BaseLogger.getLog(BaseOnApplicationLoadedAction.class).debug("setUserLogged(" + result + ")");
            DkMain.model().setUserLogged(result);
          }
        });
      }
    };

    // create different action according to the current logged user.
    actionLoadCurrentLoggedUser.setLastChainActionCreator(new ChainActionCreator()
    {
      @Override
      public BaseAction<?> getCreatedActions()
      {
        final BaseUser loggedUser = DkMain.model().getUserLogged();
        BaseAction<?> chainAction = null;
        if (loggedUser != null)
        {
          chainAction = BaseAfterConnectAction.get(previousLoggedUser, null);
        }
View Full Code Here

  /**
   * @return the action to execute when a Stand-alone application has been loaded
   */
  public static BaseAction<?> get()
  {
    final BaseUser previousLoggedUser = DkMain.model().getUserLogged();
    final BaseAction<?> actionLoadCurrentLoggedUser = BaseLoadCurrentLoggedUserAction.get();
    // create different action according to the current logged user.
    actionLoadCurrentLoggedUser.setLastChainActionCreator(new ChainActionCreator()
    {
      @Override
      public BaseAction<?> getCreatedActions()
      {
        final BaseUser loggedUser = DkMain.model().getUserLogged();
        BaseAction<?> chainAction = null;
        // if the logged user is null, show the connection popup.
        // consider using the cookie here to retrieve the connection parameters of the user to
        // connect him automatically
        if (loggedUser == null)
View Full Code Here

TOP

Related Classes of com.daikit.commons.shared.bean.BaseUser

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.