Examples of IEntityGroup


Examples of org.jasig.portal.groups.IEntityGroup

     * Creates a new channel category.
     * @return channelCategory the new channel category
     * @throws org.jasig.portal.groups.GroupsException
     */
    public ChannelCategory newChannelCategory() throws GroupsException {
        IEntityGroup categoryGroup = GroupService.newGroup(IChannelDefinition.class);
        categoryGroup.setName(""); // name cannot be null
        categoryGroup.setCreatorID(""); // creatorId cannot be null
        categoryGroup.update();
        String id = categoryGroup.getKey();
        return new ChannelCategory(id);
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

    public ChannelCategory newChannelCategory( String name,
            String description,
            String creatorId )
    throws GroupsException
    {
        IEntityGroup categoryGroup = GroupService.newGroup(IChannelDefinition.class);
        categoryGroup.setName( name ); // name cannot be null
        categoryGroup.setCreatorID( creatorId ); // creatorId cannot be null
        categoryGroup.setDescription( description );
        categoryGroup.update();
        String id = categoryGroup.getKey();
        ChannelCategory cat = new ChannelCategory(id);
        cat.setName( name );
        cat.setDescription( description );
        cat.setCreatorId( creatorId );
        return cat;
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

     * @param parent the category to remove from
     * @throws org.jasig.portal.groups.GroupsException
     */
    public void removeCategoryFromCategory(ChannelCategory child, ChannelCategory parent) throws GroupsException {
        String childKey = String.valueOf(child.getId());
        IEntityGroup childGroup = GroupService.findGroup(childKey);
        String parentKey = String.valueOf(parent.getId());
        IEntityGroup parentGroup = GroupService.findGroup(parentKey);
        parentGroup.removeMember(childGroup);
        parentGroup.updateMembers();
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

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

Examples of org.jasig.portal.groups.IEntityGroup

     * Persists a channel category.
     * @param category the channel category to persist
     * @throws org.jasig.portal.groups.GroupsException
     */
    public void saveChannelCategory(ChannelCategory category) throws GroupsException {
        IEntityGroup categoryGroup = GroupService.findGroup(category.getId());
        categoryGroup.setName(category.getName());
        categoryGroup.setDescription(category.getDescription());
        categoryGroup.setCreatorID(category.getCreatorId());
        categoryGroup.update();
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

  public static Document getChannelRegistryXML() throws Exception {
    Document doc = DocumentFactory.getNewDocument();
    Element registry = doc.createElement("registry");
    doc.appendChild(registry);

    IEntityGroup channelCategoriesGroup = GroupService.getDistinguishedGroup(GroupService.CHANNEL_CATEGORIES);
    processGroupsRecursively(channelCategoriesGroup, doc, registry);

    return doc;
  }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

    Date now = new Date();
    Iterator iter = group.getMembers();
    while (iter.hasNext()) {
      IGroupMember member = (IGroupMember)iter.next();
      if (member.isGroup()) {
        IEntityGroup memberGroup = (IEntityGroup)member;
        String key = memberGroup.getKey();
        String name = memberGroup.getName();
        String description = memberGroup.getDescription();

        // Create category element and append it to its parent
        Element categoryE = owner.createElement("category");
        categoryE.setAttribute("ID", "cat" + key);
        categoryE.setIdAttribute("ID", true);
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

                        "CHAN_ID." + String.valueOf(form.getId()));
                for (int mp = 0; mp < prins.length; mp++) {
                  JsonEntityBean bean;
                 
                  // first assume this is a group
                  IEntityGroup group = GroupService.findGroup(prins[mp].getKey());
                  if (group != null) {
                      bean = new JsonEntityBean(group, EntityEnum.GROUP.toString());
                  }
                 
                  // if a matching group can't be found, try to find a matching
                  // non-group entity
                  else {
                      IGroupMember member = AuthorizationService.instance().getGroupMember(prins[mp]);
                      bean = new JsonEntityBean(member, EntityEnum.PERSON.toString());
                      String name = groupListHelper.lookupEntityName(bean);
                      bean.setName(name);
                  }
                 
                    form.addGroup(bean);
                }
      } catch (GroupsException e) {
        e.printStackTrace();
      }
    }
       
        // otherwise, if this is a new channel, pre-populate the categories
        // and groups with some reasonable defaults
        else {
         
      // pre-populate with top-level category
      IEntityGroup channelCategoriesGroup = GroupService.getDistinguishedGroup(GroupService.CHANNEL_CATEGORIES);
      form.addCategory(new JsonEntityBean(channelCategoriesGroup, groupListHelper.getEntityType(channelCategoriesGroup)));

      // pre-populate with top-level group
      IEntityGroup everyoneGroup = GroupService.getDistinguishedGroup(GroupService.EVERYONE);
      form.addGroup(new JsonEntityBean(everyoneGroup, groupListHelper.getEntityType(everyoneGroup)));
    }

    return form;
  }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

        int x = 0;
        while (i.hasNext()){
          if (x > 0){
            buf.append(", ");
          }
           IEntityGroup g = (IEntityGroup) i.next();
           buf.append(g.getName());
           x++;
        }
      }
      r = buf.toString();
    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

                Element anode = (Element) anodes.item(j);
                String catString = XML.getElementText(anode).trim();
                // need to look up corresponding category id
                // ie: Applications = local.50
                //     Entertainment = local.51
                IEntityGroup cat = getGroup(catString, IChannelDefinition.class);

                if (cat != null)
                    ci.categories[j] = crs.getChannelCategory(cat.getKey());
                else
                    throw new Exception(
                        "Invalid entry '" + catString + "' for category.");
            }
        }
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.