private String getGroupKey() { EntityIdentifier[] groups = null; try { groups = GroupService.searchForGroups( groupName, IGroupConstants.SearchMethod.DISCRETE, IPerson.class); } catch (GroupsException e1) { throw new RuntimeException( "An exception occurred searching for " + "the group " + groupName + ".", e1); } if (groups == null || groups.length == 0) throw new RuntimeException( "Group with name '" + groupName + "' not found for " + this.getClass().getName() + ". All evaluations will return false."); return groups[0].getKey(); }
GroupService.searchForGroups( e.getText(), IGroupConstants.SearchMethod.DISCRETE, c); switch (eis.length) {
/** * Find {@link IEntityGroup} from group name (case sensitive). * * @param groupName name of group to search from {@code GroupService} * @return {@code IEntityGroup} with given name or null if no group with given name found * @see org.apereo.portal.services.GroupService#searchForEntities(String, * org.apereo.portal.groups.IGroupConstants.SearchMethod, Class) * @see org.apereo.portal.services.GroupService#findGroup(String) */ private static IEntityGroup findGroupByName(String groupName) { EntityIdentifier[] identifiers = GroupService.searchForGroups( groupName, GroupService.SearchMethod.DISCRETE, IPerson.class); for (EntityIdentifier entityIdentifier : identifiers) { if (entityIdentifier.getType().equals(IEntityGroup.class)) { return GroupService.findGroup(entityIdentifier.getKey()); } } return null; }
/** * Convert a list of group names to a list of groups. * * @param groupNames the list of group names - case sensitive. * @return the list of groups. */ private Set<IGroupMember> toGroupMembers(List<String> groupNames, String fname) { final Set<IGroupMember> groups = new HashSet<>(); for (String groupName : groupNames) { // Assumes the groupName case matches the DB values. EntityIdentifier[] gs = GroupService.searchForGroups( groupName, IGroupConstants.SearchMethod.DISCRETE, IPerson.class); IGroupMember group; if (gs != null && gs.length > 0) { group = GroupService.findGroup(gs[0].getKey()); } else { // An actual group key might be specified, so try looking up group directly group = GroupService.findGroup(groupName); } if (group == null) { throw new IllegalArgumentException( "No group '" + groupName + "' found when importing portlet: " + fname); } groups.add(group); } return groups; }
for (int i = 0; i < leafTypes.length && rslt == null; i++) { EntityIdentifier[] eis = GroupService.searchForGroups( memberValue, IGroupConstants.SearchMethod.DISCRETE, leafTypes[i]); if (eis.length == 1) {
/** * Find {@link IEntityGroup} from group name (case sensitive). * * @param groupName name of group to search from {@code GroupService} * @return {@code IEntityGroup} with given name or null if no group with given name found * @see org.apereo.portal.services.GroupService#searchForEntities(String, * org.apereo.portal.groups.IGroupConstants.SearchMethod, Class) * @see org.apereo.portal.services.GroupService#findGroup(String) */ private static IEntityGroup findGroupByName(String groupName) { EntityIdentifier[] identifiers = GroupService.searchForGroups( groupName, GroupService.SearchMethod.DISCRETE, IPerson.class); for (EntityIdentifier entityIdentifier : identifiers) { if (entityIdentifier.getType().equals(IEntityGroup.class)) { return GroupService.findGroup(entityIdentifier.getKey()); } } return null; }
@Override public boolean isUserDeepMemberOfGroupName(String userName, String groupName) { final EntityIdentifier[] results = GroupService.searchForGroups( groupName, GroupService.SearchMethod.DISCRETE, IPerson.class); if (results == null || results.length == 0) {
@Override public boolean isUserDeepMemberOfGroupName(String userName, String groupName) { final EntityIdentifier[] results = GroupService.searchForGroups( groupName, GroupService.SearchMethod.DISCRETE, IPerson.class); if (results == null || results.length == 0) {
for (final String categoryName : permittedCategories) { EntityIdentifier[] cats = GroupService.searchForGroups( categoryName, IGroupConstants.SearchMethod.DISCRETE,
GroupService.searchForGroups( group, IGroupConstants.SearchMethod.DISCRETE, IPerson.class); if (results == null || results.length == 0) {
GroupService.searchForGroups( group, IGroupConstants.SearchMethod.DISCRETE, IPerson.class); if (results == null || results.length == 0) {
GroupService.searchForGroups( groupName, GroupService.SearchMethod.DISCRETE, IPerson.class); if (results == null || results.length == 0) {
for (int i = 0; i < leafTypes.length && rslt == null; i++) { EntityIdentifier[] eis = GroupService.searchForGroups( memberValue, IGroupConstants.SearchMethod.DISCRETE, leafTypes[i]); if (eis.length == 1) {
GroupService.searchForGroups( groupName, IGroupConstants.SearchMethod.DISCRETE_CI, IPerson.class); EntityIdentifier[] portlets = GroupService.searchForGroups( groupName, IGroupConstants.SearchMethod.DISCRETE_CI,
GroupService.searchForGroups( searchTerm, GroupService.SearchMethod.CONTAINS_CI,
GroupService.searchForGroups( searchTerm, GroupService.SearchMethod.CONTAINS_CI,
if (StringUtils.isNotEmpty(groupName)) { EntityIdentifier[] identifiers = GroupService.searchForGroups( groupName, GroupService.SearchMethod.DISCRETE,
GroupService.searchForGroups( categoryName, IGroupConstants.SearchMethod.DISCRETE,
@Override public PortletCategory getPortletCategoryByName(String portletCategoryName) { final EntityIdentifier[] eids = GroupService.searchForGroups( portletCategoryName, IGroupConstants.SearchMethod.DISCRETE_CI, IPortletDefinition.class); if (eids == null || eids.length == 0) { return null; } else if (eids.length > 1) { throw new IllegalStateException( "More than one group found with name '" + portletCategoryName + "' (case insensitive)"); } final IEntityGroup categoryGroup = GroupService.findGroup(eids[0].getKey()); final PortletCategory category = new PortletCategory(eids[0].getKey()); category.setName(categoryGroup.getName()); category.setDescription(categoryGroup.getDescription()); category.setCreatorId(categoryGroup.getCreatorID()); return category; }
@Override public PortletCategory getPortletCategoryByName(String portletCategoryName) { final EntityIdentifier[] eids = GroupService.searchForGroups( portletCategoryName, IGroupConstants.SearchMethod.DISCRETE_CI, IPortletDefinition.class); if (eids == null || eids.length == 0) { return null; } else if (eids.length > 1) { throw new IllegalStateException( "More than one group found with name '" + portletCategoryName + "' (case insensitive)"); } final IEntityGroup categoryGroup = GroupService.findGroup(eids[0].getKey()); final PortletCategory category = new PortletCategory(eids[0].getKey()); category.setName(categoryGroup.getName()); category.setDescription(categoryGroup.getDescription()); category.setCreatorId(categoryGroup.getCreatorID()); return category; }