Package org.projectforge.user

Examples of org.projectforge.user.GroupDO


      return null;
    }
    final int[] ids = StringHelper.splitToInts(groupIds, ",", false);
    final List<String> list = new ArrayList<String>();
    for (final int id : ids) {
      final GroupDO group = getUserGroupCache().getGroup(id);
      if (group != null) {
        list.add(group.getName());
      } else {
        log.warn("Group with id '" + id + "' not found in UserGroupCache. groupIds string was: " + groupIds);
      }
    }
    return list;
View Full Code Here


      return null;
    }
    sortedGroups = new TreeSet<GroupDO>(groupsComparator);
    final int[] ids = StringHelper.splitToInts(groupIds, ",", false);
    for (final int id : ids) {
      final GroupDO group = getUserGroupCache().getGroup(id);
      if (group != null) {
        sortedGroups.add(group);
      } else {
        log.warn("Group with id '" + id + "' not found in UserGroupCache. groupIds string was: " + groupIds);
      }
View Full Code Here

    for (final String str : ids) {
      final Integer groupId = NumberHelper.parseInteger(str);
      if (groupId == null) {
        continue;
      }
      final GroupDO group = getUserGroupCache().getGroup(groupId);
      if (group != null) {
        list.add(group);
      }
    }
    return list;
View Full Code Here

    return adminUser;
  }

  private void addGroup(final ProjectForgeGroup projectForgeGroup, final String description, final Set<PFUserDO> users)
  {
    final GroupDO group = new GroupDO();
    group.setName(projectForgeGroup.toString());
    group.setDescription(description);
    group.setAssignedUsers(users);
    // group.setNestedGroupsAllowed(false);
    group.setLocalGroup(true); // Do not synchronize group with external user management system by default.
    groupDao.internalSave(group);
  }
View Full Code Here

  {
    final String tutorialReference = getTutorialReference(reference);
    if (doesEntryAlreadyExist(groupDao, tutorialReference) == true) {
      return;
    }
    final GroupDO group;
    if (REF_GROUP_JAVA_GURUS.equals(reference) == true) {
      group = createGroup("JavaGurus employees", "linda", "dave", "betty");
    } else if (REF_GROUP_ACME_WEBPORTAL.equals(reference) == true) {
      group = createGroup("ACME web portal team", "linda", "dave", "betty");
    } else {
      log.warn("Unknown tutorial request: group=" + reference);
      setResponsePage(new MessagePage("tutorial.unknown").setWarning(true));
      return;
    }
    if (group != null) {
      group.setDescription(tutorialReference);
      final GroupEditPage groupEditPage = new GroupEditPage(group);
      setResponsePage(groupEditPage);
    }
  }
View Full Code Here

    }
  }

  private GroupDO createGroup(final String name, final String... usernames)
  {
    final GroupDO group = new GroupDO();
    group.setName(name);
    if (usernames != null) {
      for (final String username : usernames) {
        final PFUserDO user = getRequiredUser(username);
        if (user == null) {
          return null;
        }
        group.addUser(user);
      }
    }
    return group;
  }
View Full Code Here

    if (doesEntryAlreadyExist(accessDao, tutorialReference) == true) {
      return;
    }
    final GroupTaskAccessDO access;
    TaskDO task = null;
    GroupDO group = null;
    if ("JavaGurusEmployees".equals(reference) == true) {
      task = getRequiredTask(REF_TASK_JAVA_GURUS);
      group = getRequiredGroup(REF_GROUP_JAVA_GURUS);
      access = createAccess(task, group, ACCESS_TEMPLATE_EMPLOYEE, tutorialReference);
    } else if ("ACME-WebPortal".equals(reference) == true) {
View Full Code Here

    return null;
  }

  private GroupDO getRequiredGroup(final String reference)
  {
    final GroupDO group = (GroupDO) getEntry(groupDao, getTutorialReference(reference));
    if (group == null) {
      setResponsePage(new MessagePage("tutorial.expectedGroupNotFound", reference).setWarning(true));
    }
    return group;
  }
View Full Code Here

  {
    final List<IColumn<GroupDO, String>> columns = new ArrayList<IColumn<GroupDO, String>>();
    final CellItemListener<GroupDO> cellItemListener = new CellItemListener<GroupDO>() {
      public void populateItem(final Item<ICellPopulator<GroupDO>> item, final String componentId, final IModel<GroupDO> rowModel)
      {
        final GroupDO group = rowModel.getObject();
        appendCssClasses(item, group.getId(), group.isDeleted());
      }
    };
    columns.add(new CellItemListenerPropertyColumn<GroupDO>(new Model<String>(getString("name")), getSortable("name", sortable), "name",
        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<GroupDO>> item, final String componentId, final IModel<GroupDO> rowModel)
      {
        final boolean updateAccess = groupDao.hasLoggedInUserAccess(null, null, OperationType.UPDATE, false);
        final GroupDO group = rowModel.getObject();
        if (isSelectMode() == true) {
          item.add(new ListSelectActionPanel(componentId, rowModel, caller, selectProperty, group.getId(), group.getName()));
          addRowClick(item);
        } else if (updateAccess == true) {
          item.add(new ListSelectActionPanel(componentId, rowModel, GroupEditPage.class, group.getId(), returnToPage, group.getName()));
          addRowClick(item);
        } else {
          item.add(new Label(componentId, group.getName()));
        }
        cellItemListener.populateItem(item, componentId, rowModel);
      }
    });
    columns.add(new CellItemListenerPropertyColumn<GroupDO>(new Model<String>(getString("organization")), getSortable("organization",
View Full Code Here

    return null;
  }

  public static GroupDO convert(final LdapGroup ldapGroup)
  {
    final GroupDO group = new GroupDO();
    group.setId(getId(ldapGroup));
    group.setName(ldapGroup.getCommonName());
    group.setOrganization(ldapGroup.getOrganization());
    group.setDescription(ldapGroup.getDescription());
    if (isPosixAccountValuesEmpty(ldapGroup) == false) {
      group.setLdapValues(getLdapValuesAsXml(ldapGroup));
    }
    return group;
  }
View Full Code Here

TOP

Related Classes of org.projectforge.user.GroupDO

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.