Package org.activiti.explorer.identity

Examples of org.activiti.explorer.identity.LoggedInUser


      }
    });
    inboxEntry.setCount(inboxCount);
   
    // Tasks
    LoggedInUser user = ExplorerApp.get().getLoggedInUser();
    long tasksCount = new TasksListQuery().size();
    ToolbarEntry tasksEntry = addToolbarEntry(ENTRY_TASKS, i18nManager.getMessage(Messages.TASK_MENU_TASKS), new ToolbarCommand() {
      public void toolBarItemSelected() {
        viewManager.showTasksPage();
      }
    });
    tasksEntry.setCount(tasksCount);
   
    // Queued
    List<Group> groups = identityService.createGroupQuery().groupMember(user.getId()).list();
    ToolbarPopupEntry queuedItem = addPopupEntry(ENTRY_QUEUED, (i18nManager.getMessage(Messages.TASK_MENU_QUEUED)));
    long queuedCount = 0;
    for (final Group group : groups) {
      if (group.getType().equals("assignment")) {
        long groupCount = new QueuedListQuery(group.getId()).size();
View Full Code Here


   
    return button;
  }
 
  protected void initProfileButton() {
    final LoggedInUser user = ExplorerApp.get().getLoggedInUser();

    // User name + link to profile
    MenuBar profileMenu = new MenuBar();
    profileMenu.addStyleName(ExplorerLayout.STYLE_HEADER_PROFILE_BOX);
    MenuItem rootItem = profileMenu.addItem(user.getFirstName() + " " + user.getLastName(), null);
    rootItem.setStyleName(ExplorerLayout.STYLE_HEADER_PROFILE_MENU);
   
    if(useProfile()) {
      // Show profile
      rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_SHOW), new Command() {
        public void menuSelected(MenuItem selectedItem) {
          ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
        }
      });
     
      // Edit profile
      rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_EDIT), new Command() {
       
        public void menuSelected(MenuItem selectedItem) {
          // TODO: Show in edit-mode
          ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
        }
      });
     
      // Change password
      rootItem.addItem(i18nManager.getMessage(Messages.PASSWORD_CHANGE), new Command() {
View Full Code Here

//    return window;
//  }
 
  @Override
  public void close() {
    final LoggedInUser theUser = getLoggedInUser();
   
    // Clear the logged in user
    setUser(null);
   
    // Call loginhandler
View Full Code Here

  public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {
    // Set current application object as thread-local to make it easy accessible
    current.set(this);
   
    // Authentication: check if user is found, otherwise send to login page
    LoggedInUser user = (LoggedInUser) getUser();
    if (user == null) {
      // First, try automatic login
      user = loginHandler.authenticate(request, response);
      if(user == null) {
        if (mainWindow != null && !mainWindow.isShowingLoginPage()) {
          viewManager.showLoginPage();
        }
      } else {
        setUser(user);
      }
    }

    if(user != null) {
      Authentication.setAuthenticatedUserId(user.getId());
      if (mainWindow != null && mainWindow.isShowingLoginPage()) {
        viewManager.showDefaultPage();
      }
    }
   
View Full Code Here

//    return window;
//  }
 
  @Override
  public void close() {
    final LoggedInUser theUser = getLoggedInUser();
   
    // Clear the logged in user
    setUser(null);
   
    // Call loginhandler
View Full Code Here

  public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {
    // Set current application object as thread-local to make it easy accessible
    current.set(this);
   
    // Authentication: check if user is found, otherwise send to login page
    LoggedInUser user = (LoggedInUser) getUser();
    if (user == null) {
      // First, try automatic login
      user = loginHandler.authenticate(request, response);
      if(user == null) {
        if (mainWindow != null && !mainWindow.isShowingLoginPage()) {
          viewManager.showLoginPage();
        }
      } else {
        setUser(user);
      }
    }

    if(user != null) {
      Authentication.setAuthenticatedUserId(user.getId());
      if (mainWindow != null && mainWindow.isShowingLoginPage()) {
        viewManager.showDefaultPage();
      }
    }
   
View Full Code Here

   
    initSelectMyselfButton(searchLayout);
  }

  protected void initSelectMyselfButton(HorizontalLayout searchLayout) {
    final LoggedInUser loggedInUser = ExplorerApp.get().getLoggedInUser();
    if (ignoredUserIds == null || !ignoredUserIds.contains(loggedInUser.getId())) {
      Button meButton = new Button(i18nManager.getMessage(Messages.PEOPLE_SELECT_MYSELF));
      meButton.setIcon(Images.USER_16);
      searchLayout.addComponent(meButton);
      searchLayout.setComponentAlignment(meButton, Alignment.MIDDLE_LEFT);
     
      if (multiSelect) {
        meButton.addListener(new ClickListener() {
          public void buttonClick(ClickEvent event) {
            selectUser(loggedInUser.getId(), loggedInUser.getFullName());
          }
        });
      } else {
        meButton.addListener(new ClickListener() {
          public void buttonClick(ClickEvent event) {
            addMatchingUser(loggedInUser.getId(), loggedInUser.getFullName());
            matchingUsersTable.select(loggedInUser.getId());
            fireEvent(new SubmitEvent(doneButton, SubmitEvent.SUBMITTED));
            close();
          }
        });
      }
View Full Code Here

          resetAddButton();
        } else if ("enter".equals(action.getCaption())) {
          if (newTaskTextField != null && newTaskTextField.getValue() != null
                  && !"".equals(newTaskTextField.getValue().toString())) {
           
            LoggedInUser loggedInUser = ExplorerApp.get().getLoggedInUser();
           
            // save task
            Task newTask = taskService.newTask();
            newTask.setParentTaskId(parentTask.getId());
            if (parentTask.getAssignee() != null) {
              newTask.setAssignee(parentTask.getAssignee());
            } else {
              newTask.setAssignee(loggedInUser.getId());
            }
            if (parentTask.getOwner() != null) {
              newTask.setOwner(parentTask.getOwner());
            } else {
              newTask.setOwner(loggedInUser.getId());
            }
            newTask.setName(newTaskTextField.getValue().toString());
            taskService.saveTask(newTask);
           
            // Reset the add button to its original state
View Full Code Here

    public void onLogin(LoginEvent event) {
      try {
        String userName = event.getLoginParameter("username"); // see the input field names in CustomLoginForm
        String password = event.getLoginParameter("password")// see the input field names in CustomLoginForm
        // Delegate authentication to handler
        LoggedInUser loggedInUser = loginHandler.authenticate(userName, password);
        if (loggedInUser != null) {
          ExplorerApp.get().setUser(loggedInUser);
          viewManager.showDefaultPage();
        } else {
          refreshUi();
View Full Code Here

      }
    });
    inboxEntry.setCount(inboxCount);
   
    // Tasks
    LoggedInUser user = ExplorerApp.get().getLoggedInUser();
    long tasksCount = new TasksListQuery().size();
    ToolbarEntry tasksEntry = addToolbarEntry(ENTRY_TASKS, i18nManager.getMessage(Messages.TASK_MENU_TASKS), new ToolbarCommand() {
      public void toolBarItemSelected() {
        viewManager.showTasksPage();
      }
    });
    tasksEntry.setCount(tasksCount);
   
    // Queued
    List<Group> groups = user.getGroups();
    ToolbarPopupEntry queuedItem = addPopupEntry(ENTRY_QUEUED, (i18nManager.getMessage(Messages.TASK_MENU_QUEUED)));
    long queuedCount = 0;
    for (final Group group : groups) {
      long groupCount = new QueuedListQuery(group.getId()).size();
View Full Code Here

TOP

Related Classes of org.activiti.explorer.identity.LoggedInUser

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.