Package org.jasig.portal.layout.dlm.remoting.registry

Examples of org.jasig.portal.layout.dlm.remoting.registry.ChannelCategoryBean


  }
 
  private ChannelCategoryBean addChildren(ChannelCategory category, List<IChannelDefinition> allChannels, IPerson user, String type) {
   
    // construct a new channel category bean for this category
    ChannelCategoryBean categoryBean = new ChannelCategoryBean(category);
   
    // add the direct child channels for this category
    IChannelDefinition[] channels;   
    if(type.equals(TYPE_MANAGE)) {
      channels = channelRegistryStore.getManageableChildChannels(category, user);
    } else {
      channels = channelRegistryStore.getChildChannels(category, user);
    }
   
    for(IChannelDefinition channelDef : channels) {
     
      // construct a new channel bean from this channel
      ChannelBean channel = new ChannelBean(channelDef);
      categoryBean.addChannel(channel);
     
      // remove the channel of the list of all channels
      allChannels.remove(channel);
    }

    /* Now add child categories. */
    for(ChannelCategory childCategory : channelRegistryStore.getChildCategories(category)) {
      ChannelCategoryBean childCategoryBean = addChildren(childCategory, allChannels, user, type);
     
      categoryBean.addCategory(childCategoryBean);
    }
   
    return categoryBean;
View Full Code Here


  }
 
  private ChannelCategoryBean addChildren(WebRequest request, PortletCategory category, List<IPortletDefinition> allChannels, IPerson user, String type, Locale locale) {
   
    // construct a new channel category bean for this category
    ChannelCategoryBean categoryBean = new ChannelCategoryBean(category);
        categoryBean.setName(messageSource.getMessage(category.getName(), new Object[] {}, locale));
   
    // add the direct child channels for this category
    Set<IPortletDefinition> portlets = portletCategoryRegistry.getChildPortlets(category);   
    EntityIdentifier ei = user.getEntityIdentifier();
      IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
    boolean isManage = type.equals(TYPE_MANAGE);
   
    for(IPortletDefinition channelDef : portlets) {
     
      if ((isManage && ap.canManage(channelDef.getPortletDefinitionId()
          .getStringId()))
          || (!isManage && ap.canSubscribe(channelDef
              .getPortletDefinitionId().getStringId()))) {
        // construct a new channel bean from this channel
        ChannelBean channel = getChannel(channelDef, request, locale);
        categoryBean.addChannel(channel);
      }
     
      // remove the channel of the list of all channels
      allChannels.remove(channelDef);
    }

    /* Now add child categories. */
    for(PortletCategory childCategory : this.portletCategoryRegistry.getChildCategories(category)) {
     
      // TODO subscribe check?
      ChannelCategoryBean childCategoryBean = addChildren(request, childCategory, allChannels, user, type, locale);
     
      categoryBean.addCategory(childCategoryBean);
    }
   
    return categoryBean;
View Full Code Here

TOP

Related Classes of org.jasig.portal.layout.dlm.remoting.registry.ChannelCategoryBean

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.