Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IEntity


    * @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


      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

      channelRegistryStore.saveChannelDefinition(definition);
      definition = channelRegistryStore.getChannelDefinition(definition.getFName());

      // Delete existing category memberships for this channel
      String chanKey = String.valueOf(definition.getId());
      IEntity channelDefEntity = GroupService.getEntity(chanKey, IChannelDefinition.class);
    @SuppressWarnings("unchecked")
      Iterator iter = channelDefEntity.getAllContainingGroups();
      while (iter.hasNext()) {
          IEntityGroup group = (IEntityGroup) iter.next();
          group.removeMember(channelDefEntity);
          group.update();
      }
View Full Code Here

  public void removeChannelDefinition(IChannelDefinition channelDefinition, IPerson person) {
    IChannelDefinition channelDef = channelRegistryStore.getChannelDefinition(channelDefinition.getId());

      // Delete existing category memberships for this channel
      String chanKey = String.valueOf(channelDefinition.getId());
      IEntity channelDefEntity = GroupService.getEntity(chanKey, IChannelDefinition.class);
    @SuppressWarnings("unchecked")
      Iterator iter = channelDefEntity.getAllContainingGroups();
      while (iter.hasNext()) {
          IEntityGroup group = (IEntityGroup) iter.next();
          group.removeMember(channelDefEntity);
          group.update();
      }
View Full Code Here

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

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

     * @throws org.jasig.portal.groups.GroupsException
     */
    @SuppressWarnings("unchecked")
    public ChannelCategory[] getParentCategories(IChannelDefinition child) throws GroupsException {
        String childKey = String.valueOf(child.getId());
        IEntity childEntity = GroupService.getEntity(childKey, IChannelDefinition.class);
        Set<ChannelCategory> parents = new HashSet<ChannelCategory>();
        Iterator iter = childEntity.getContainingGroups();
        while (iter.hasNext()) {
            IGroupMember gm = (IGroupMember)iter.next();
            if (gm.isGroup()) {
                String categoryId = gm.getKey();
                parents.add(getChannelCategory(categoryId));
View Full Code Here

        categoryE.setAttribute("name", name);
        categoryE.setAttribute("description", description);
        parentGroup.appendChild(categoryE);
        processGroupsRecursively(memberGroup, owner, categoryE);
      } else {
        IEntity channelDefMember = (IEntity)member;
        int channelPublishId = CommonUtils.parseInt(channelDefMember.getKey());
        if ( channelPublishId > 0 ) {
         IChannelDefinition channelDef = crs.getChannelDefinition(channelPublishId);
         if (channelDef != null) {
          // Make sure channel is approved
          Date approvalDate = channelDef.getApprovalDate();
View Full Code Here

            for (int j = 0; j < anodes.getLength(); j++)
            {
                Element anode = (Element) anodes.item(j);
                String userStr = XML.getElementText(anode).trim();
                // 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

       
        return userPrincipal.canRender(channelId);
    }
   
    protected IAuthorizationPrincipal getUserPrincipal(final String userName) {
        final IEntity user = GroupService.getEntity(userName, IPerson.class);
        if (user == null) {
            return null;
        }
       
        final AuthorizationService authService = AuthorizationService.instance();
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.