public GroupContactsRemovedForFacility(Group group, ContactGroup contactGroup) { this.group = group; this.contactGroup = contactGroup; this.message = formatMessage("Group (%d) successfully removed from contact groups %s.", group.getId(), contactGroup); }
@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(); }
public void updateGroup(Group group, ModificationItem[] modificationItems) { ldapTemplate.modifyAttributes(getGroupDN(String.valueOf(group.getVoId()), String.valueOf(group.getId())), modificationItems); log.debug("Entry modified in LDAP: Group {}.", group); }
public boolean groupAttributeExist(Group group, String ldapAttributeName) throws InternalErrorException { Object o = null; try { setLdapAttributeName(ldapAttributeName); o = ldapTemplate.lookup(getGroupDN(String.valueOf(group.getVoId()), String.valueOf(group.getId())), new AttributeContextMapper()); } catch (NameNotFoundException ex) { return false; } if(o == null) return false; return true; }
public boolean isAlreadyMember(Member member, Group group) { Object o = ldapTemplate.lookup(getUserDN(String.valueOf(member.getUserId())), new UserMemberOfContextMapper()); String[] memberOfInformation = (String []) o; if(memberOfInformation != null) { for(String s: memberOfInformation) { if(s.equals(EventProcessorImpl.ldapAttrPerunGroupId + "=" + group.getId() + "," + EventProcessorImpl.ldapAttrPerunVoId + "=" + group.getVoId() + "," + ldapProperties.getLdapBase())) return true; } } return false; }
public MailForGroupIdAdded(ApplicationMail mail, Group group) { this.mail = mail; this.group = group; this.message = formatMessage("Mail ID: %d of Type: %s/%s added for Group ID: %d.", mail.getId(), mail.getMailType(), mail.getAppType(), group.getId()); }
public MailForGroupIdUpdated(ApplicationMail mail, Group group) { this.mail = mail; this.group = group; this.message = formatMessage("Mail ID: %d of Type: %s/%s updated for Group ID: %d.", mail.getId(), mail.getMailType(), mail.getAppType(), group.getId()); }
public MailForGroupIdRemoved(ApplicationMail mail, Group group) { this.mail = mail; this.group = group; this.message = formatMessage("Mail ID: %d of Type: %s/%s removed for Group ID: %d.", mail.getId(), mail.getMailType(), mail.getAppType(), group.getId()); }
@Override public int compareTo(PerunBean perunBean) { if(perunBean == null) throw new NullPointerException("PerunBean to compare with is null."); if(perunBean instanceof Group) { Group group = (Group) perunBean; if (this.getName() == null && group.getName() != null) return -1; if (group.getName() == null && this.getName() != null) return 1; if (this.getName() == null && group.getName() == null) return 0; return this.getName().compareToIgnoreCase(group.getName()); } else { return (this.getId() - perunBean.getId()); } }
public ApplicationVerified(Application app) { this.app = app; this.message = formatMessage("Application ID=%d voID=%d %s has been verified.", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public ApplicationRejected(Application application) { this.app = application; this.message = formatMessage("Application ID=%d voID=%d %s has been rejected.", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public FormItemsUpdated(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form ID=%d voID=%d %s has had its items updated.", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public ApplicationDeleted(Application app) { this.app = app; this.message = formatMessage("Application ID=%d voID=%d %s has been deleted", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public FormItemAdded(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form item ID=%d voID=%d %s has been added", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public FormUpdated(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form ID=%d voID=%d %s has been updated.", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public FormItemDeleted(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form item ID=%d voID=%d %s has been deleted", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public ApplicationApproved(Application app) { this.app = app; this.message = formatMessage("Application ID=%d voID=%d %s was approved.", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public FormItemUpdated(ApplicationForm form, ApplicationFormItem item) { this.form = form; this.item = item; this.message = formatMessage("Application form ID=%d voID=%d %s has had it itemID=%d updated.", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : ""), item.getId()); }
@Override public void createApplicationFormInGroup(PerunSession sess, Group group) throws InternalErrorException, PrivilegeException { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "createApplicationFormInGroup"); } int id = Utils.getNewId(jdbc, "APPLICATION_FORM_ID_SEQ"); try { jdbc.update("insert into application_form(id, vo_id, group_id) values (?,?,?)", id, group.getVoId(), group.getId()); } catch (DuplicateKeyException ex) { throw new ConsistencyErrorException("Group can have defined only one application form. Can't insert another.", ex); } }
public RichGroup(Group group, List<Attribute> attrs) { super(group.getId(), group.getName(), group.getDescription(), group.getCreatedAt(), group.getCreatedBy(), group.getModifiedAt(), group.getModifiedBy(), group.getParentGroupId(), group.getCreatedByUid(), group.getModifiedByUid()); this.setVoId(group.getVoId()); this.groupAttributes = attrs; }