Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IEntity


   * @param category the channel category to which to associate the channel definition
   * @throws org.jasig.portal.PortalException
   */
  public void addChannelToCategory(ChannelDefinition channelDef, ChannelCategory category) throws PortalException {
    String channelDefKey = String.valueOf(channelDef.getId());
    IEntity channelDefEntity = GroupService.getEntity(channelDefKey, ChannelDefinition.class);
    IEntityGroup categoryGroup = GroupService.findGroup(category.getId());
    categoryGroup.addMember(channelDefEntity);
    categoryGroup.updateMembers();
  }
View Full Code Here


   * @param category the channel category from which to disassociate the channel definition
   * @throws org.jasig.portal.PortalException
   */
  public void removeChannelFromCategory(ChannelDefinition channelDef, ChannelCategory category) throws PortalException {
    String channelDefKey = String.valueOf(channelDef.getId());
    IEntity channelDefEntity = GroupService.getEntity(channelDefKey, ChannelDefinition.class);
    String categoryKey = String.valueOf(category.getId());
    IEntityGroup categoryGroup = GroupService.findGroup(categoryKey);
    categoryGroup.removeMember(channelDefEntity);
    categoryGroup.updateMembers();
  }
View Full Code Here

      Document aDoc = sessionData.model;
      Element rootElem = (anElem != null ? anElem : GroupsManagerXML.createElement(ELEMENT_TAGNAME,
            aDoc, false));
      Utility.logMessage("DEBUG", "EntityWrapper.getXml(): START, Element: " + rootElem);
      try {
         IEntity ent = (IEntity) gm;
         rootElem.setAttribute("id", GroupsManagerXML.getNextUid());
         rootElem.setAttribute("key", gm.getKey());
         rootElem.setAttribute("type", gm.getLeafType().getName());
         rootElem.setAttribute("displayName", GroupsManagerXML.getEntityName(ent.getLeafType(),
               ent.getKey()));
         rootElem.setAttribute("selected", "false");
         // set user permissions for entity
         IGroupsManagerPermissions gmp = sessionData.gmPermissions;
         IAuthorizationPrincipal ap = sessionData.authPrincipal;
         applyPermissions (rootElem, gm, gmp, ap);
View Full Code Here

    * @param aKey
    * @param aType
    * @return IEntity
    */
   public static IEntity retrieveEntity (String aKey, String aType) {
      IEntity ent = null;
      try {
         Class iEntityClass = Class.forName(aType);
         ent = GroupService.getEntity(aKey, iEntityClass);
      } catch (Exception e) {
         Utility.logMessage("ERROR", "EntityWrapper.retrieveEntity(): ERROR retrieving entity "
View Full Code Here

            for (int j = 0; j < anodes.getLength(); j++)
            {
                Element anode = (Element) anodes.item(j);
                String userStr = XML.getElementText(anode);
                // need to look up corresponding user
                IEntity user = GroupService.getEntity(userStr, IPerson.class);

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

        IEntityGroup group = (IEntityGroup) gm;
        return findContainingGroups(group);
    }
    else
    {
        IEntity ent = (IEntity) gm;
        return findContainingGroups(ent);
    }
}
View Full Code Here

        // save the channel
        definition = portletDefinitionDao.updatePortletDefinition(definition);
        definition = portletDefinitionDao.getPortletDefinitionByFname(definition.getFName());

        final String defId = portletDefinitionId.getStringId();
        final IEntity portletDefEntity = GroupService.getEntity(defId, IPortletDefinition.class);

        //Sync on groups during update. This really should be a portal wide thread-safety check or
        //The groups service needs to deal with concurrent modification better.
        synchronized(this.groupUpdateLock) {
            // Delete existing category memberships for this channel
            if (!newChannel) {
                @SuppressWarnings("unchecked")
                final Iterator<IEntityGroup> iter = portletDefEntity.getAllContainingGroups();
                while (iter.hasNext()) {
                    final IEntityGroup group = iter.next();
                    group.removeMember(portletDefEntity);
                    group.update();
                }
View Full Code Here

    public void removePortletDefinition(IPortletDefinition portletDefinition, IPerson person) {
        IPortletDefinition portletDef = portletDefinitionDao.getPortletDefinition(portletDefinition.getPortletDefinitionId());

        // Delete existing category memberships for this channel
        String portletDefinitionId = portletDefinition.getPortletDefinitionId().getStringId();
        IEntity channelDefEntity = GroupService.getEntity(portletDefinitionId, IPortletDefinition.class);
        @SuppressWarnings("unchecked")
        Iterator<IEntityGroup> iter = channelDefEntity.getAllContainingGroups();
        while (iter.hasNext()) {
            IEntityGroup group = iter.next();
            group.removeMember(channelDefEntity);
            group.update();
        }
View Full Code Here

        IEntityGroup group = (IEntityGroup) gm;
        return findContainingGroups(group);
    }
    else
    {
        IEntity ent = (IEntity) gm;
        return findContainingGroups(ent);
    }
}
View Full Code Here

                        String groupMemberName = EntityService.instance().lookupEntityName(EntityEnum.GROUP,groupMember.getKey());
                        if(groupName.equalsIgnoreCase(groupMemberName)) {
                            Iterator it = groupMember.getAllMembers();

                            while(it.hasNext()) {
                                IEntity e = (IEntity)it.next();
                                EntityIdentifier ident = e.getUnderlyingEntityIdentifier();
                                Entity member = findMember(ident.getKey(),true);
                                members.add(member);
                            }
                            return members;
                        }
View Full Code Here

TOP

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

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.