Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.SecUser


   *
   * @throws InterruptedException
   */
  private void doDelete() throws InterruptedException {

    final SecUser anUser = getUser();

    // Show a confirm box
    String msg = Labels.getLabel("message.Question.Are_you_sure_to_delete_this_record") + "\n\n --> " + anUser.getUsrLoginname() + " | " + anUser.getUsrFirstname() + " ,"
        + anUser.getUsrLastname();
    String title = Labels.getLabel("message.Deleting.Record");

    MultiLineMessageBox.doSetTemplate();
    if (MultiLineMessageBox.show(msg, title, MultiLineMessageBox.YES | MultiLineMessageBox.NO, MultiLineMessageBox.QUESTION, true, new EventListener() {
      @Override
      public void onEvent(Event evt) {
        switch (((Integer) evt.getData()).intValue()) {
        case MultiLineMessageBox.YES:
          deleteUser();
        case MultiLineMessageBox.NO:
          break; //
        }
      }

      private void deleteUser() {

        /**
         * Prevent the deleting of the demo users
         */
        try {
          if (anUser.getId() <= 14 && anUser.getId() >= 10) {
            ZksampleMessageUtils.doShowNotAllowedForDemoRecords();
            return;
          } else {

            // delete from database
View Full Code Here


   */
  @Secured( { btnCtroller_ClassPrefix + "btnSave" })
  public void doSave() throws InterruptedException {
    System.out.println("doSave");

    final SecUser anUser = getUser();

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // force validation, if on, than execute by component.getValue()
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if (!isValidationOn()) {
      doSetValidation();
    }

    // fill the object with the components data
    doWriteComponentsToBean(anUser);

    // validate password again
    usrPassword.getValue();
    usrPasswordRetype.getValue();

    /* if a language is selected get the object from the listbox */
    Listitem item = lbox_usrLocale.getSelectedItem();

    if (item != null) {
      ListModelList lml1 = (ListModelList) lbox_usrLocale.getListModel();
      Language lang = (Language) lml1.get(item.getIndex());
      anUser.setUsrLocale(lang.getLanLocale());
    }

    // save it to database
    try {
      getUserService().saveOrUpdate(anUser);
View Full Code Here

  private static final Logger logger = Logger.getLogger(UserListModelItemRenderer.class);

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final SecUser user = (SecUser) data;

    Listcell lc;
    lc = new Listcell(user.getUsrLoginname());
    lc.setParent(item);
    lc = new Listcell(user.getUsrLastname());
    lc.setParent(item);
    lc = new Listcell(user.getUsrEmail());
    lc.setParent(item);

    lc = new Listcell();
    Checkbox cb = new Checkbox();
    cb.setChecked(user.isUsrEnabled());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell();
    cb = new Checkbox();
    cb.setChecked(user.isUsrAccountnonexpired());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell();
    cb = new Checkbox();
    cb.setChecked(user.isUsrCredentialsnonexpired());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell();
    cb = new Checkbox();
    cb.setChecked(user.isUsrAccountnonlocked());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    // lc = new Listcell();
View Full Code Here

    if (cm != null) {
      cm.clear();
    }

    final SecUser user = ((UserImpl) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getSecUser();
    // List<MyCalendarEvent> list =
    // getCalendarEventService().getAllCalendarEvents(user.getId());
    List<MyCalendarEvent> list = getCalendarEventService().getCalendarEventsFromToDate(beginDate, endDate, user.getId());

    cm = new SimpleCalendarModel();

    for (MyCalendarEvent myCalendarEvent : list) {
      sce = new MySimpleCalendarEvent();
View Full Code Here

  private transient UserService userService;

  @Override
  public UserDetails loadUserByUsername(String userId) {

    SecUser user = null;
    Collection<GrantedAuthority> grantedAuthorities = null;

    try {
      user = getUserByLoginname(userId);

      if (user == null) {
        throw new UsernameNotFoundException("Invalid User");
      }

      grantedAuthorities = getGrantedAuthority(user);

    } catch (final NumberFormatException e) {
      throw new DataRetrievalFailureException("Cannot loadUserByUsername userId:" + userId + " Exception:" + e.getMessage(), e);
    }

    // Create the UserDetails object for a specified user with
    // their grantedAuthorities List.
    final UserDetails userDetails = new UserImpl(user, grantedAuthorities);

    if (logger.isDebugEnabled()) {
      logger.debug("Rights for '" + user.getUsrLoginname() + "' (ID: " + user.getId() + ") evaluated. [" + this + "]");
    }

    return userDetails;
  }
View Full Code Here

    ppcnt.setRawValue("");
    ppbt.setSelectedIndex(0);
    ppet.setSelectedIndex(0);

    final SecUser user = ((UserImpl) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getSecUser();

    // prepare the backend Bean
    MyCalendarEvent calEvt = getCalendarEventService().getNewCalendarEvent();
    calEvt.setSecUser(user);
    calEvt.setTitle(ce.getTitle());
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.model.SecUser

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.