Package org.projectforge.user

Examples of org.projectforge.user.PFUserDO


          final String errorMsgKey = ((UserDao) getBaseDao()).checkPasswordQuality(passwordInput);
          if (errorMsgKey != null) {
            passwordUser = null;
            validatable.error(new ValidationError().addMessageKey(errorMsgKey));
          } else {
            passwordUser = new PFUserDO();
            ((UserDao) getBaseDao()).createEncryptedPassword(passwordUser, passwordInput);
          }
        }
      }
View Full Code Here


      updateCost2ChoiceValidation();
    }
    {
      // User
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("user"));
      PFUserDO user = data.getUser();
      if (Hibernate.isInitialized(user) == false) {
        user = userGroupCache.getUser(user.getId());
        data.setUser(user);
      }
      userSelectPanel = new UserSelectPanel(fs.newChildId(), new PropertyModel<PFUserDO>(data, "user"), parentPage, "userId");
      userSelectPanel.setRequired(true);
      fs.add(userSelectPanel);
View Full Code Here

    addCurrency(mapping, OrderCol.INVOICED, invoicedSum);
    addCurrency(mapping, OrderCol.TO_BE_INVOICED, toBeInvoicedSum);
    mapping.add(OrderCol.COMPLETELY_INVOICED, order.isVollstaendigFakturiert() == true ? "x" : "");
    final Set<RechnungsPositionVO> invoicePositions = rechnungCache.getRechnungsPositionVOSetByAuftragId(order.getId());
    mapping.add(OrderCol.INVOICES, getInvoices(invoicePositions));
    final PFUserDO contactPerson = Registry.instance().getUserGroupCache().getUser(order.getContactPersonId());
    mapping.add(OrderCol.CONTACT_PERSON, contactPerson != null ? contactPerson.getFullname() : "");
    mapping.add(OrderCol.REFERENCE, order.getReferenz());
    mapping.add(OrderCol.COMMENT, order.getBemerkung());
  }
View Full Code Here

      form.datePanel2[idx].markModelAsChanged();
    } else if (property.startsWith("taskId:") == true) {
      final TaskDO task = taskDao.getById((Integer) selectedValue);
      form.scriptParameters.get(idx).setTask(task);
    } else if (property.startsWith("userId:") == true) {
      final PFUserDO user = userDao.getById((Integer) selectedValue);
      form.scriptParameters.get(idx).setUser(user);
    } else {
      log.error("Property '" + property + "' not supported for selection.");
    }
  }
View Full Code Here

    final boolean updateAccess = userDao.hasLoggedInUserAccess(null, null, OperationType.UPDATE, false);
    final List<IColumn<PFUserDO, String>> columns = new ArrayList<IColumn<PFUserDO, String>>();
    final CellItemListener<PFUserDO> cellItemListener = new CellItemListener<PFUserDO>() {
      public void populateItem(final Item<ICellPopulator<PFUserDO>> item, final String componentId, final IModel<PFUserDO> rowModel)
      {
        final PFUserDO user = rowModel.getObject();
        appendCssClasses(item, user.getId(), user.hasSystemAccess() == false);
      }
    };
    columns.add(new CellItemListenerPropertyColumn<PFUserDO>(getString("user.username"), getSortable("username", sortable), "username",
        cellItemListener) {
      /**
       * @see org.projectforge.web.wicket.CellItemListenerPropertyColumn#populateItem(org.apache.wicket.markup.repeater.Item,
       *      java.lang.String, org.apache.wicket.model.IModel)
       */
      @Override
      public void populateItem(final Item<ICellPopulator<PFUserDO>> item, final String componentId, final IModel<PFUserDO> rowModel)
      {
        final PFUserDO user = rowModel.getObject();
        if (isSelectMode() == true) {
          item.add(new ListSelectActionPanel(componentId, rowModel, caller, selectProperty, user.getId(), user.getUsername()));
          addRowClick(item);
        } else if (updateAccess == true) {
          item.add(new ListSelectActionPanel(componentId, rowModel, UserEditPage.class, user.getId(), returnToPage, user.getUsername()));
          addRowClick(item);
        } else {
          item.add(new Label(componentId, user.getUsername()));
        }
        cellItemListener.populateItem(item, componentId, rowModel);
      }
    });
    columns.add(new CellItemListenerPropertyColumn<PFUserDO>(new Model<String>(getString("user.activated")), getSortable("deactivated",
        sortable), "deactivated", cellItemListener) {
      @Override
      public void populateItem(final Item<ICellPopulator<PFUserDO>> item, final String componentId, final IModel<PFUserDO> rowModel)
      {
        final PFUserDO user = rowModel.getObject();
        if (user.isDeactivated() == false) {
          item.add(new IconPanel(componentId, IconType.ACCEPT));
        } else {
          item.add(new IconPanel(componentId, IconType.DENY));
        }
        cellItemListener.populateItem(item, componentId, rowModel);
      }
    });
    columns.add(new CellItemListenerPropertyColumn<PFUserDO>(getString("name"), getSortable("lastname", sortable), "lastname",
        cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<PFUserDO>(getString("firstName"), getSortable("firstname", sortable), "firstname",
        cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<PFUserDO>(getString("user.personalPhoneIdentifiers"), getSortable(
        "personalPhoneIdentifiers", sortable), "personalPhoneIdentifiers", cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<PFUserDO>(getString("description"), getSortable("description", sortable), "description",
        cellItemListener));
    if (updateAccess == true) {
      // Show these columns only for admin users:
      columns.add(new AbstractColumn<PFUserDO, String>(new Model<String>(getString("user.assignedGroups"))) {
        public void populateItem(final Item<ICellPopulator<PFUserDO>> cellItem, final String componentId, final IModel<PFUserDO> rowModel)
        {
          final PFUserDO user = rowModel.getObject();
          final String groups = userDao.getGroupnames(user);
          final Label label = new Label(componentId, new Model<String>(groups));
          cellItem.add(label);
          cellItemListener.populateItem(cellItem, componentId, rowModel);
        }
      });
      columns.add(new AbstractColumn<PFUserDO, String>(new Model<String>(getString("access.rights"))) {
        public void populateItem(final Item<ICellPopulator<PFUserDO>> cellItem, final String componentId, final IModel<PFUserDO> rowModel)
        {
          final PFUserDO user = rowModel.getObject();
          final List<UserRightDO> rights = userDao.getUserRights(user.getId());
          final StringBuffer buf = new StringBuffer();
          if (rights != null) {
            boolean first = true;
            for (final UserRightDO right : rights) {
              if (right.getValue() != null && right.getValue() != UserRightValue.FALSE) {
View Full Code Here

   * @param ownerId If null, then task will be set to null;
   * @see BaseDao#getOrLoad(Integer)
   */
  public void setOwner(final PersonalContactDO personalContact, final Integer ownerId)
  {
    final PFUserDO user = userDao.getOrLoad(ownerId);
    personalContact.setOwner(user);
  }
View Full Code Here

  private void checkAccess(final PersonalContactDO obj)
  {
    Validate.notNull(obj);
    Validate.notNull(obj.getOwnerId());
    Validate.notNull(obj.getContactId());
    final PFUserDO owner = PFUserContext.getUser();
    if (owner == null || owner.getId().equals(obj.getOwnerId()) == false) {
      throw new AccessException("address.accessException.userIsNotOwnerOfPersonalAddress");
    }
    accessChecker.checkRestrictedOrDemoUser();
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
  public PersonalContactDO getByContactId(final Integer contactId)
  {
    final PFUserDO owner = PFUserContext.getUser();
    Validate.notNull(owner);
    Validate.notNull(owner.getId());
    final List<PersonalContactDO> list = getHibernateTemplate().find(
        "from " + PersonalContactDO.class.getSimpleName() + " t where t.owner.id = ? and t.contact.id = ?",
        new Object[] { owner.getId(), contactId});
    if (list != null) {
      if (list.size() == 0) {
        return null;
      }
      if (list.size() > 1) {
        log.error("Multiple personal address book entries for same user ("
            + owner.getId()
            + " and same address ("
            + contactId
            + "). Should not occur?!");
      }
      return list.get(0);
View Full Code Here

   * @return the list of all PersonalContactDO entries for the context user.
   */
  @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
  public List<PersonalContactDO> getList()
  {
    final PFUserDO owner = PFUserContext.getUser();
    Validate.notNull(owner);
    Validate.notNull(owner.getId());
    @SuppressWarnings("unchecked")
    final List<PersonalContactDO> list = getHibernateTemplate().find(
        "from "
            + PersonalContactDO.class.getSimpleName()
            + " t join fetch t.contact where t.owner.id=? and t.contact.deleted=false order by t.contact.name, t.contact.firstName",
            owner.getId());
    return list;
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
  public Map<Integer, PersonalContactDO> getPersonalAddressByAddressId()
  {
    final PFUserDO owner = PFUserContext.getUser();
    Validate.notNull(owner);
    Validate.notNull(owner.getId());
    final List<PersonalContactDO> list = getHibernateTemplate().find(
        "from " + PersonalContactDO.class.getSimpleName() + " t where t.owner.id = ?", owner.getId());
    final Map<Integer, PersonalContactDO> result = new HashMap<Integer, PersonalContactDO>();
    for (final PersonalContactDO entry : list) {
      if (entry.isFavorite() == true) {
        result.put(entry.getContactId(), entry);
      }
View Full Code Here

TOP

Related Classes of org.projectforge.user.PFUserDO

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.