@Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(getClass().getSimpleName()); ret.append(":["); ret.append("id='"); ret.append(this.getId()); ret.append("', parentGroupId='"); ret.append(parentGroupId); ret.append("', name='"); ret.append(name); ret.append("', shortName='"); ret.append(this.getShortName()); ret.append("', description='"); ret.append(description); ret.append("', voId='"); ret.append(voId); ret.append("']"); return ret.toString(); }
@Override public String serializeToString() { StringBuilder str = new StringBuilder(); return str.append(this.getClass().getSimpleName()).append(":[").append( "id=<").append(getId()).append(">").append( ", parentGroupId=<").append(getParentGroupId() == null ? "\\0" : getParentGroupId()).append(">").append( ", name=<").append(getName() == null ? "\\0" : BeansUtils.createEscaping(getName())).append(">").append( ", shortName=<").append(getShortName() == null ? "\\0" : BeansUtils.createEscaping(getShortName())).append(">").append( ", description=<").append(getDescription() == null ? "\\0" : BeansUtils.createEscaping(getDescription())).append(">").append( ", voId=<").append(getVoId()).append(">").append( ']').toString(); }
/** * Gets collections as map of collectionID => Group. * * @return Map of collection IDs to group. */ private Map<String, Group> getCollectionIDsToGroupsMap (PerunSession session, Perun perun, Group collectionsGroup) throws GroupNotExistsException, WrongAttributeAssignmentException, InternalErrorException, AttributeNotExistsException, PrivilegeException { Map<String, Group> collectionIDsToGroupMap = new HashMap<>(); for (Group group : perun.getGroupsManager().getSubGroups(session, collectionsGroup)) { for (Group subgroup : perun.getGroupsManager().getSubGroups(session, group)) { if (REPRESENTATIVES_GROUP_NAME.equals(subgroup.getShortName())) { Attribute collectionID = perun.getAttributesManager().getAttribute(session, subgroup, COLLECTION_ID_ATTR_NAME); collectionIDsToGroupMap.put(collectionID.valueAsString(), subgroup); } } } return collectionIDsToGroupMap; }
/** * Gets collections as map of collectionID => Group. * * @return Map of collection IDs to group. */ private Map<String, Group> getNetworkIDsToGroupsMap (PerunSession session, Perun perun, Group networksGroup) throws GroupNotExistsException, WrongAttributeAssignmentException, InternalErrorException, AttributeNotExistsException, PrivilegeException { Map<String, Group> networkIDsToGroupMap = new HashMap<>(); for (Group group : perun.getGroupsManager().getSubGroups(session, networksGroup)) { for (Group subgroup : perun.getGroupsManager().getSubGroups(session, group)) { if (REPRESENTATIVES_GROUP_NAME.equals(subgroup.getShortName())) { Attribute networkID = perun.getAttributesManager().getAttribute(session, subgroup, NETWORK_ID_ATTR_NAME); networkIDsToGroupMap.put(networkID.valueAsString(), subgroup); } } } return networkIDsToGroupMap; }
mailText = mailText.replace("{groupName}", group.getShortName()); } else { mailText = mailText.replace("{groupName}", "");
mailText = mailText.replace("{groupName}", app.getGroup().getShortName()); } else { mailText = mailText.replace("{groupName}", "");
if (g.contains(group)) { throw new RegistrarException("User to invite is already member of your group: "+group.getShortName());