Package org.projectforge.web.user

Examples of org.projectforge.web.user.GroupsProvider


    training.setFullAccessGroupIds(new GroupsProvider().getGroupIds(fullAccessGroups));
  }

  public Collection<GroupDO> getSortedFullAccessGroups(final TrainingDO training)
  {
    return new GroupsProvider().getSortedGroups(training.getFullAccessGroupIds());
  }
View Full Code Here


   * @param training
   * @param readonlyAccessGroups
   */
  public void setReadOnlyAccessGroups(final TrainingDO training, final Collection<GroupDO> readonlyAccessGroups)
  {
    training.setReadOnlyAccessGroupIds(new GroupsProvider().getGroupIds(readonlyAccessGroups));
  }
View Full Code Here

    training.setReadOnlyAccessGroupIds(new GroupsProvider().getGroupIds(readonlyAccessGroups));
  }

  public Collection<GroupDO> getSortedReadOnlyAccessGroups(final TrainingDO training)
  {
    return new GroupsProvider().getSortedGroups(training.getReadOnlyAccessGroupIds());
  }
View Full Code Here

    }

    gridBuilder.newSplitPanel(GridSize.COL50, GridType.CONTAINER);
    // Full access groups
    fs = gridBuilder.newFieldset(getString("plugins.teamcal.fullAccess"), getString("plugins.teamcal.access.groups"));
    final GroupsProvider groupsFullAccessProvider = new GroupsProvider();
    final Collection<GroupDO> fullAccessGroups = new GroupsProvider().getSortedGroups(getData().getFullAccessGroupIds());
    fullAccessGroupsListHelper = new MultiChoiceListHelper<GroupDO>().setComparator(new GroupsComparator()).setFullList(
        groupsFullAccessProvider.getSortedGroups());
    if (fullAccessGroups != null) {
      for (final GroupDO group : fullAccessGroups) {
        fullAccessGroupsListHelper.addOriginalAssignedItem(group).assignItem(group);
      }
    }
    final Select2MultiChoice<GroupDO> groupsFullAccess = new Select2MultiChoice<GroupDO>(fs.getSelect2MultiChoiceId(),
        new PropertyModel<Collection<GroupDO>>(this.fullAccessGroupsListHelper, "assignedItems"), groupsFullAccessProvider);
    fs.add(groupsFullAccess);

    // Full access groups inherited rights
    fs = gridBuilder.newFieldset("", getString("plugins.skillmatrix.skill.inherited"));
    @SuppressWarnings("serial")
    final DivTextPanel labelFull = new DivTextPanel(fs.newChildId(), new Model<String>() {
      /**
       * @see org.apache.wicket.model.Model#getObject()
       */
      @Override
      public String getObject()
      {
        if (getData().getParent() != null) {
          return getGroupnames(skillRight.getFullAccessGroupIds(getData().getParent()));
        }
        return "";
      }
    });
    fs.suppressLabelForWarning();
    fs.add(labelFull);
    ajaxTargets.add(labelFull.getLabel4Ajax());

    gridBuilder.newSplitPanel(GridSize.COL50, GridType.CONTAINER);
    {
      // Read-only access groups
      fs = gridBuilder.newFieldset(getString("plugins.teamcal.readonlyAccess"), getString("plugins.teamcal.access.groups"));
      final GroupsProvider groupsProvider = new GroupsProvider();
      final Collection<GroupDO> readOnlyAccessGroups = new GroupsProvider().getSortedGroups(getData().getReadOnlyAccessGroupIds());
      readOnlyAccessGroupsListHelper = new MultiChoiceListHelper<GroupDO>().setComparator(new GroupsComparator()).setFullList(
          groupsProvider.getSortedGroups());
      if (readOnlyAccessGroups != null) {
        for (final GroupDO group : readOnlyAccessGroups) {
          readOnlyAccessGroupsListHelper.addOriginalAssignedItem(group).assignItem(group);
        }
      }
      final Select2MultiChoice<GroupDO> groups = new Select2MultiChoice<GroupDO>(fs.getSelect2MultiChoiceId(),
          new PropertyModel<Collection<GroupDO>>(this.readOnlyAccessGroupsListHelper, "assignedItems"), groupsProvider);
      fs.add(groups);

      // Read-only access groups inherited rights
      fs = gridBuilder.newFieldset("", getString("plugins.skillmatrix.skill.inherited"));
      @SuppressWarnings("serial")
      final DivTextPanel labelReadOnly = new DivTextPanel(fs.newChildId(), new Model<String>() {
        /**
         * @see org.apache.wicket.model.Model#getObject()
         */
        @Override
        public String getObject()
        {
          if (getData().getParent() != null) {
            return getGroupnames(skillRight.getReadOnlyAccessGroupIds(getData().getParent()));
          }
          return "";
        }
      });
      fs.add(labelReadOnly);
      fs.suppressLabelForWarning();
      ajaxTargets.add(labelReadOnly.getLabel4Ajax());
    }

    gridBuilder.newSplitPanel(GridSize.COL50, GridType.CONTAINER);
    {
      // Training access groups
      fs = gridBuilder.newFieldset(getString("plugins.skillmatrix.skill.trainingAccess"), getString("plugins.teamcal.access.groups"));
      final GroupsProvider groupsProvider = new GroupsProvider();
      final Collection<GroupDO> trainingAccessGroups = new GroupsProvider().getSortedGroups(getData().getTrainingAccessGroupIds());
      trainingAccessGroupsListHelper = new MultiChoiceListHelper<GroupDO>().setComparator(new GroupsComparator()).setFullList(
          groupsProvider.getSortedGroups());
      if (trainingAccessGroups != null) {
        for (final GroupDO group : trainingAccessGroups) {
          trainingAccessGroupsListHelper.addOriginalAssignedItem(group).assignItem(group);
        }
      }
View Full Code Here

TOP

Related Classes of org.projectforge.web.user.GroupsProvider

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.