public String getId() { return group.getId(); } }
/** * {@inheritDoc} */ public ListAccess<Membership> findAllMembershipsByGroup(Group group) throws Exception { String findQuery = "select m from m in class org.exoplatform.services.organization.impl.MembershipImpl where m.groupId = '" + group.getId() + "'"; String countQuery = "select count(m) from m in class org.exoplatform.services.organization.impl.MembershipImpl where m.groupId = '" + group.getId() + "'"; return new HibernateListAccess<Membership>(service_, findQuery, countQuery); }
static void removeMembershipEntriesOfGroup(Group group, Session session) throws Exception { List<?> entries = session.createQuery(queryFindMembershipsByGroup).setString("groupid", group.getId()).list(); for (int i = 0; i < entries.size(); i++) session.delete(entries.get(i)); }
/** * {@inheritDoc} */ public ListAccess<Membership> findAllMembershipsByGroup(Group group) throws Exception { return new MembershipsByGroupLdapListAccess(ldapService, this, ldapAttrMapping, group.getId()); }
public Collection findMembershipsByGroup(Group group) throws Exception { return findMembershipsByGroupId(group.getId()); }
/** * {@inheritDoc} */ public Collection<?> findGroups(Group parent) throws Exception { Session session = service_.openSession(); if (parent == null) return session.createQuery(queryFindRootGroups).list(); return session.createQuery(queryFindGroupByParent).setString("parentid", parent.getId()).list(); }
private boolean hasChildrenGroups(Group parent) throws Exception { Session session = service_.openSession(); long countChildrenGroup = (Long)session.createQuery(queryFindCountGroupByParent).setString("parentid", parent.getId()).list().get(0); return countChildrenGroup > 0; }
/** * {@inheritDoc} */ public Collection<?> findMembershipsByGroup(Group group) throws Exception { Session session = service_.openSession(); List<?> memberships = session.createQuery(queryFindMembershipsByGroup).setString("groupid", group.getId()).list(); return memberships; }
protected String createSubDN(Group parent) { if (parent == null) return createSubDN(""); return createSubDN(parent.getId()); }
/** * {@inheritDoc} */ public Collection<?> findMembershipsByGroup(Group group) throws Exception { if (group == null) return null; List<MembershipImpl> list = new ArrayList<MembershipImpl>(); DBObjectQuery<MembershipImpl> query = new DBObjectQuery<MembershipImpl>(MembershipImpl.class); query.addLIKE("GROUP_ID", group.getId()); loadInstances(query.toQuery(), list); return list; }
public ListAccess<Membership> findAllMembershipsByGroup(Group group) throws Exception { String plGroupName = getPLIDMGroupName(getGroupNameFromId(group.getId())); String gid = getIdentitySession().getPersistenceManager() .createGroupKey(plGroupName, getGroupTypeFromId(group.getId())); org.picketlink.idm.api.Group gtnGroup = service_.getIdentitySession().getPersistenceManager().findGroupByKey(gid); if (gtnGroup == null) { log.log(LogLevel.ERROR, "Internal ERROR. Cannot obtain group: " + group.getId()); return new ListAccessImpl(Membership.class, Collections.emptyList()); } return new IDMMembershipListAccess(gtnGroup, !orgService.getConfiguration().isSkipPaginationInMembershipQuery()); }
private List<LocalPath> getPath(List<LocalPath> list, String id) throws Exception { if (list == null) list = new ArrayList<LocalPath>(5); if (id == null) return list; OrganizationService service = getApplicationComponent(OrganizationService.class); Group group = service.getGroupHandler().findGroupById(id); if (group == null) return list; list.add(0, new LocalPath(group.getId(), group.getGroupName())); getPath(list, group.getParentId()); return list; }
private List<LocalPath> getPath(List<LocalPath> list, String id) throws Exception { if (list == null) list = new ArrayList<LocalPath>(5); if (id == null) return list; OrganizationService service = getApplicationComponent(OrganizationService.class); Group group = service.getGroupHandler().findGroupById(id); if (group == null) return list; list.add(0, new LocalPath(group.getId(), group.getGroupName())); getPath(list, group.getParentId()); return list; }
private boolean hasChildrenGroups(Group parent) throws Exception { String parentId = parent == null ? "/" : parent.getId(); DBObjectQuery<GroupImpl> query = new DBObjectQuery<GroupImpl>(GroupImpl.class); query.addSelectCount("PARENT_ID"); query.addEQ("PARENT_ID", parentId); DBPageList<GroupImpl> pageList = new DBPageList<GroupImpl>(20, this, query); return pageList.getTo() > 0; }
/** * {@inheritDoc} */ public ListAccess<Membership> findAllMembershipsByGroup(Group group) throws Exception { if (group == null) { return null; } DBObjectQuery<MembershipImpl> query = new DBObjectQuery<MembershipImpl>(MembershipImpl.class); query.addLIKE("GROUP_ID", group.getId()); return new JDBCListAccess<Membership>(this, query.toQuery(), query.toCountQuery()); }
public void execute(Event<UIGroupMembershipSelector> event) throws Exception { UIGroupMembershipSelector uiMemebershipSelector = event.getSource(); UISelector uiSelector = uiMemebershipSelector.<UIComponent> getParent().getParent(); String membershipType = event.getRequestContext().getRequestParameter(OBJECTID); uiSelector.setMembership(uiMemebershipSelector.getCurrentGroup().getId(), membershipType); UIForm uiForm = uiSelector.getAncestorOfType(UIForm.class); if (uiForm != null) { //event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent()); uiForm.broadcast(event, event.getExecutionPhase()); } } }