Package org.activiti.explorer.identity

Examples of org.activiti.explorer.identity.LoggedInUser


   
    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


   
    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

   
    public void onLogin(LoginEvent event) {
      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

          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

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.