Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IEntityGroup


    // Delete existing category memberships for this channel  
    String chanKey = String.valueOf(channelDef.getId());
    IEntity channelDefEntity = GroupService.getEntity(chanKey, ChannelDefinition.class);
    Iterator iter = channelDefEntity.getAllContainingGroups();
    while (iter.hasNext()) {
        IEntityGroup group = (IEntityGroup) iter.next();
        group.removeMember(channelDefEntity);
        group.update();
    }

    // For each category ID, add channel to category
    for (int i = 0; i < categoryIDs.length; i++) {
      categoryIDs[i] = categoryIDs[i].startsWith("cat") ? categoryIDs[i].substring(3) : categoryIDs[i];
View Full Code Here


        // Disassociate from parent categories (delete from UP_GROUP_MEMBERSHIP)
        IEntity channelDefEntity = GroupService.getEntity(String.valueOf(channelPublishId), ChannelDefinition.class);
        Iterator iter = channelDefEntity.getContainingGroups();
        while (iter.hasNext()) {
          IEntityGroup parentGroup = (IEntityGroup)iter.next();
          parentGroup.removeMember(channelDefEntity);
          parentGroup.updateMembers();
        }

        // Notify the cache
        try {
          EntityCachingService.instance().remove(channelDef);
View Full Code Here

   * 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(ChannelDefinition.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

  public ChannelCategory newChannelCategory( String name,
                                             String description,
                                             String creatorId )
      throws GroupsException
    {
        IEntityGroup categoryGroup = GroupService.newGroup(ChannelDefinition.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

   * @param channelCategoryId the id of the category to get
   * @return channelCategory the channel category
   * @throws org.jasig.portal.groups.GroupsException
   */
  public ChannelCategory getChannelCategory(String channelCategoryId) throws GroupsException {
    IEntityGroup categoryGroup = GroupService.findGroup(channelCategoryId);
    ChannelCategory category = new ChannelCategory(channelCategoryId);
    category.setName(categoryGroup.getName());
    category.setDescription(categoryGroup.getDescription());
    category.setCreatorId(categoryGroup.getCreatorID());
    return category;
  }
View Full Code Here

   * Gets top level channel category
   * @return channelCategories the new channel category
   * @throws org.jasig.portal.groups.GroupsException
   */
  public ChannelCategory getTopLevelChannelCategory() throws GroupsException {
    IEntityGroup categoryGroup = GroupService.getDistinguishedGroup(GroupService.CHANNEL_CATEGORIES);
    return getChannelCategory(categoryGroup.getKey());
  }
View Full Code Here

   * @return channelCategories the children categories
   * @throws org.jasig.portal.groups.GroupsException
   */
  public ChannelCategory[] getChildCategories(ChannelCategory parent) throws GroupsException {
    String parentKey = String.valueOf(parent.getId());
    IEntityGroup parentGroup = GroupService.findGroup(parentKey);
    List categories = new ArrayList();
    Iterator iter = parentGroup.getMembers();
    while (iter.hasNext()) {
      IGroupMember gm = (IGroupMember)iter.next();
      if (gm.isGroup()) {
        String categoryId = gm.getKey();
        categories.add(getChannelCategory(categoryId));
View Full Code Here

   * @throws java.sql.SQLException
   * @throws org.jasig.portal.groups.GroupsException
   */
  public ChannelDefinition[] getChildChannels(ChannelCategory parent) throws SQLException, GroupsException {
    String parentKey = String.valueOf(parent.getId());
    IEntityGroup parentGroup = GroupService.findGroup(parentKey);
    List channelDefs = new ArrayList();
    Iterator iter = parentGroup.getMembers();
    while (iter.hasNext()) {
      IGroupMember gm = (IGroupMember)iter.next();
      if (gm.isEntity()) {
        int channelPublishId = Integer.parseInt(gm.getKey());
        channelDefs.add(getChannelDefinition(channelPublishId));
View Full Code Here

   * @return parents, the parent categories.
   * @throws org.jasig.portal.groups.GroupsException
   */
  public ChannelCategory[] getParentCategories(ChannelCategory child) throws GroupsException {
    String childKey = String.valueOf(child.getId());
    IEntityGroup childGroup = GroupService.findGroup(childKey);
    List parents = new ArrayList();
    Iterator iter = childGroup.getContainingGroups();
    while (iter.hasNext()) {
      IGroupMember gm = (IGroupMember)iter.next();
      if (gm.isGroup()) {
        String categoryId = gm.getKey();
        parents.add(getChannelCategory(categoryId));
View Full Code Here

   * 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

TOP

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

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.