Examples of IEntityGroup


Examples of org.jasig.portal.groups.IEntityGroup

                Element anode = (Element) anodes.item(j);
                String groupStr = XML.getElementText(anode).trim();
                // need to look up corresponding group id
                // ie: Everyone = local.0
                //     Developers = local.4
                IEntityGroup group = getGroup(groupStr, IPerson.class);

                if (group != null)
                    ci.groups[j] = group;
                else
                    throw new Exception(
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

     * Gets the portal administrators group.
     */
    private IEntityGroup[] getAdminGroup() throws Exception
    {
        String dg = GroupService.PORTAL_ADMINISTRATORS;
        IEntityGroup e = GroupService.getDistinguishedGroup(dg);
        return new IEntityGroup[] { e };
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

     * @param groupName a <code>String</code> value
     * @param entityType the kind of entity the group contains
     * @return a group key
     */
    private static IEntityGroup getGroup(String groupName, Class<? extends IBasicEntity> entityType) throws Exception {
        IEntityGroup group = null;
        EntityIdentifier[] groups = GroupService.searchForGroups(groupName, IGroupConstants.IS, entityType);
        if (groups != null && groups.length > 0) {
            group = GroupService.findGroup(groups[0].getKey());
        } else {
            // An actual group key might be specified, so try looking up group directly
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

   
    // if the entity type is a group, use the group service's findGroup method
    // to locate it
    if(entityEnum.isGroup()) {
      // attempt to find the entity
      IEntityGroup entity = GroupService.findGroup(entityId);
      if(entity == null) {
        return null;
      } else {
        JsonEntityBean jsonBean = new JsonEntityBean(entity, entityEnum.toString());
        if (populateChildren) {
          @SuppressWarnings("unchecked")
          Iterator<IGroupMember> members = (Iterator<IGroupMember>) entity.getMembers();
          jsonBean = populateChildren(jsonBean, members);
        }
        return jsonBean;
      }
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

    /* (non-Javadoc)
     * @see org.jasig.portal.security.xslt.IXalanGroupMembershipHelper#isChannelDeepMemberOf(java.lang.String, java.lang.String)
     */
    public boolean isChannelDeepMemberOf(String fname, String groupKey) {
        final IEntityGroup distinguishedGroup = GroupService.findGroup(groupKey);
        if (distinguishedGroup == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No group found for key '" + groupKey + "'");
            }
           
            return false;
        }
       
        final IChannelDefinition channelDefinition;
        try {
            channelDefinition = this.channelRegistryStore.getChannelDefinition(fname);
        }
        catch (Exception e) {
            this.logger.warn("Caught exception while retrieving channel definition for fname '" + fname + "'", e);
            return false;
        }
       
        if (channelDefinition == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No channel found for key '" + fname + "'");
            }
           
            return false;
        }
       
        final Integer channelId = channelDefinition.getId();
        final IEntity entity = GroupService.getEntity(channelId.toString(), IChannelDefinition.class);
        if (entity == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No channel found for id '" + channelId + "'");
            }
           
            return false;
        }
       
        return distinguishedGroup.deepContains(entity);
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

    /* (non-Javadoc)
     * @see org.jasig.portal.security.xslt.IXalanGroupMembershipHelper#isUserDeepMemberOf(java.lang.String, java.lang.String)
     */
    public boolean isUserDeepMemberOf(String userName, String groupKey) {
        final IEntityGroup distinguishedGroup = GroupService.findGroup(groupKey);
        if (distinguishedGroup == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No group found for key '" + groupKey + "'");
            }
           
            return false;
        }
       
        final IEntity entity = GroupService.getEntity(userName, IPerson.class);
        if (entity == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No user found for key '" + userName + "'");
            }
           
            return false;
        }
       
        return distinguishedGroup.deepContains(entity);
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

            if ( log.isDebugEnabled() )
                { log.debug( DEBUG_CLASS_NAME + ".find(): file does not exist: " + path ); }
            return null;
        }

        IEntityGroup group = newInstance(f);
        groupHolder = new GroupHolder(group, f.lastModified()) ;
        cachePut(key, groupHolder);
    }
    return groupHolder.getGroup();
}
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

*/
public Iterator findContainingGroups(IGroupMember gm) throws GroupsException
{
    if ( gm.isGroup() )
    {
        IEntityGroup group = (IEntityGroup) gm;
        return findContainingGroups(group);
    }
    else
    {
        IEntity ent = (IEntity) gm;
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

       Collection<IEntityGroup> groupDefs = groupDefinitions.values();
      
       for ( i=groupDefs.iterator(); i.hasNext(); )
       {
           GroupDefinition groupDef = (GroupDefinition) i.next();
           IEntityGroup group = new EntityTestingGroupImpl(groupDef.getKey(), IPERSON_CLASS);
           group.setName(groupDef.getName());
           group.setDescription(groupDef.getDescription());
           cachePut(group);
       }
       cacheContainingGroupsForGroups();
   }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

       IEntityGroup[] parentGroupsArray = parentGroupsList.toArray(new IEntityGroup[parentGroupsList.size()]);
        
       // Check each group for its parents and cache the references.
       for (i=groups.values().iterator(); i.hasNext();)
       {
           IEntityGroup childGroup = i.next();
           parentGroupsList = new ArrayList<IEntityGroup>(5);
           for (int idx=0; idx<parentGroupsArray.length; idx++)
           {
               if ( contains(parentGroupsArray[idx], childGroup) )
                   { parentGroupsList.add(parentGroupsArray[idx]); }
           }
           containingGroups.put(childGroup.getLocalKey(), parentGroupsList);
       }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.