Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IEntityNameFinder


    public PermissibleSubscribeChannels () {
        try {
            activities.put("SUBSCRIBE", "Subscribe to Channel");
            Document chanregistry = ChannelRegistryManager.getChannelRegistry();
            NodeList chans = chanregistry.getElementsByTagName("channel");
            IEntityNameFinder chanf = EntityNameFinderService.instance().getNameFinder(IChannelDefinition.class);
            for (int i = 0; i < chans.getLength(); i++) {
                Element chan = (Element)chans.item(i);
                String chanID = chan.getAttribute("ID");
                if (chanID.indexOf("chan") == 0) {
                    chanID = chanID.substring(4);
                }
                targets.put("CHAN_ID." + chanID, chanf.getName(chanID));
            }
        } catch (Exception e) {
            log.error(e, e);
        }
    }
View Full Code Here


/**
* @return org.jasig.portal.groups.IEntityNameFinder
*/
public IEntityNameFinder getNameFinder(Class type) throws GroupsException
{
        IEntityNameFinder finder = (IEntityNameFinder) (getNameFinders().get(type));
        if ( finder == null )
            { throw new GroupsException("Name finder for " + type.getName() + " could not be located."); }
        return finder;
}
View Full Code Here

   * @return groupMember's name or null if there's an error
   */
  public String lookupEntityName(JsonEntityBean entity) {
   
    EntityEnum entityEnum = EntityEnum.getEntityEnum(entity.getEntityType());
    IEntityNameFinder finder;
    if (entityEnum.isGroup()) {
      finder = EntityNameFinderService.instance()
        .getNameFinder(IEntityGroup.class);
    } else {
      finder = EntityNameFinderService.instance()
        .getNameFinder(entityEnum.getClazz());
    }
   
    try {
      return finder.getName(entity.getId());
    } catch (Exception e) {
      /* An exception here isn't the end of the world.  Just log it
         and return null. */
      log.warn("Couldn't find name for entity " + entity.getId(), e);
      return null;
View Full Code Here

/**
* @return org.jasig.portal.groups.IEntityNameFinder
*/
public IEntityNameFinder getNameFinder(Class type) throws GroupsException
{
        IEntityNameFinder finder = (IEntityNameFinder) (getNameFinders().get(type));
        if ( finder == null )
            { throw new GroupsException("Name finder for " + type.getName() + " could not be located."); }
        return finder;
}
View Full Code Here

    public PermissibleSubscribeChannels () {
        try {
            activities.put("SUBSCRIBE", "Subscribe to Channel");
            Document chanregistry = ChannelRegistryManager.getChannelRegistry();
            NodeList chans = chanregistry.getElementsByTagName("channel");
            IEntityNameFinder chanf = EntityNameFinderService.instance().getNameFinder(Class.forName("org.jasig.portal.ChannelDefinition"));
            for (int i = 0; i < chans.getLength(); i++) {
                Element chan = (Element)chans.item(i);
                String chanID = chan.getAttribute("ID");
                if (chanID.indexOf("chan") == 0) {
                    chanID = chanID.substring(4);
                }
                targets.put("CHAN_ID." + chanID, chanf.getName(chanID));
            }
        } catch (Exception e) {
            log.error(e, e);
        }
    }
View Full Code Here

        
        for (IAuthorizationPrincipal principal : principals) {
            IGroupMember member = authService.getGroupMember(principal);
            if (member.isGroup()) {
                final EntityNameFinderService entityNameFinderService = EntityNameFinderService.instance();
                final IEntityNameFinder nameFinder = entityNameFinderService.getNameFinder(member.getType());
                try {
                    groupList.add(nameFinder.getName(member.getKey()));
                }
                catch (Exception e) {
                    throw new RuntimeException("Could not find group name for entity: " + member.getKey(), e);
                }
            } else {
View Full Code Here

   * @return groupMember's name or null if there's an error
   */
  public String lookupEntityName(JsonEntityBean entity) {
   
    EntityEnum entityEnum = entity.getEntityType();
    IEntityNameFinder finder;
    if (entityEnum.isGroup()) {
      finder = EntityNameFinderService.instance()
        .getNameFinder(IEntityGroup.class);
    } else {
      finder = EntityNameFinderService.instance()
        .getNameFinder(entityEnum.getClazz());
    }
   
    try {
      return finder.getName(entity.getId());
    } catch (Exception e) {
      /* An exception here isn't the end of the world.  Just log it
         and return null. */
      log.warn("Couldn't find name for entity " + entity.getId(), e);
      return null;
View Full Code Here

/**
* @return org.jasig.portal.groups.IEntityNameFinder
*/
public IEntityNameFinder getNameFinder(Class type) throws GroupsException
{
        IEntityNameFinder finder = (IEntityNameFinder) (getNameFinders().get(type));
        if ( finder == null )
            { throw new GroupsException("Name finder for " + type.getName() + " could not be located."); }
        return finder;
}
View Full Code Here

        EntityEnum entityEnum = EntityEnum.getEntityEnum(entity.getEntityType());
        return lookupEntityName(entityEnum,entity.getId());
    }

    public String lookupEntityName(EntityEnum entityType, String entityId) {
        IEntityNameFinder finder;
        if (entityType.isGroup()) {
            finder = EntityNameFinderService.instance()
                    .getNameFinder(IEntityGroup.class);
        } else {
            finder = EntityNameFinderService.instance()
                    .getNameFinder(entityType.getClazz());
        }

        try {
            return finder.getName(entityId);
        } catch (Exception e) {
      /* An exception here isn't the end of the world.  Just log it
         and return null. */
            log.warn("Couldn't find name for entity " + entityId, e);
            return null;
View Full Code Here

TOP

Related Classes of org.jasig.portal.groups.IEntityNameFinder

Copyright © 2018 www.massapicom. 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.