public List<PublicRenderParameterHolder> getSupportedPublicRenderParameterHolders(
     EntityID portletEntityId, Map<String, String[]> renderParameters) {
   PortletID portletID = portletEntityId.getPortletID();
   List<PublicRenderParameterHolder> publicRenderParameterHolders =
       new ArrayList<PublicRenderParameterHolder>();
   if (portletID != null) {
     List<PublicRenderParameterHolder> supportingPublicRenderParameterHolders =
         this.portletSupportingPublicRenderParameters.get(portletID);
     Set<Map.Entry<String, List<PublicRenderParameterHolder>>> entries =
         this.appPublicRenderParameterHolders.entrySet();
     for (Map.Entry<String, List<PublicRenderParameterHolder>> mapEntry : entries) {
       if (supportingPublicRenderParameterHolders != null) {
         if (renderParameters == null) {
           for (PublicRenderParameterHolder publicRenderParameterHolder : mapEntry.getValue()) {
             if (supportingPublicRenderParameterHolders.contains(publicRenderParameterHolder)) {
               publicRenderParameterHolders.add(publicRenderParameterHolder);
             }
           }
         } else {
           for (PublicRenderParameterHolder publicRenderParameterHolder : mapEntry.getValue()) {
             if (renderParameters.containsKey(publicRenderParameterHolder.getIdentifier())
                 && supportingPublicRenderParameterHolders.contains(publicRenderParameterHolder)) {
               publicRenderParameterHolders.add(publicRenderParameterHolder);
             }
           }
         }
       }
     }
   }
   return publicRenderParameterHolders;
 }
 public EventHolder verifySupportedProcessingEvent(
     EntityID portletEntityId, EventHolder supportedEventHolder) {
   List<PortletID> portlets =
       getEventPublishingProcessingPortlets(
           this.eventProcessingPortlets, supportedEventHolder.getQName());
   PortletID portletID = portletEntityId.getPortletID();
   if (portlets.contains(portletID)) {
     return supportedEventHolder;
   } else {
     // Check whether supportedEventQName is present in the aliases of any event definition
     // or whether the supportedEventQName is same as the qname of any event definition
     // or whether aliases of the supportedEvent contains the eventQName
     // or whether any qname is common in both aliases
     // if yes use the event qname of that event definition to get the portlet list
     for (List<EventHolder> allEventHolders : this.appEventHolders.values()) {
       for (EventHolder eventHolder : allEventHolders) {
         if (eventHolder.getAliases().contains(supportedEventHolder.getQName())
             || eventHolder.getQName().equals(supportedEventHolder.getQName())
             || supportedEventHolder.getAliases().contains(eventHolder.getQName())
             || checkAliases(eventHolder, supportedEventHolder)) {
           portlets =
               getEventPublishingProcessingPortlets(
                   this.eventProcessingPortlets, eventHolder.getQName());
           if (portlets != null && portlets.contains(portletID)) {
             return eventHolder;
           }
         }
       }
     }
   }
   return null;
 }
 public Map<String, String> verifySupportedPublicRenderParameters(
     EntityID portletEntityId,
     List<PublicRenderParameterHolder> supportedPublicRenderParameterHolders) {
   Map<String, String> supportedPublicRenderParametersMap = null;
   if (supportedPublicRenderParameterHolders != null) {
     supportedPublicRenderParametersMap =
         new HashMap<String, String>(supportedPublicRenderParameterHolders.size());
     for (PublicRenderParameterHolder supportedPublicRenderParameterHolder :
         supportedPublicRenderParameterHolders) {
       List<PortletID> portlets =
           this.publicRenderParameterSupportingPortlets.get(supportedPublicRenderParameterHolder);
       if (portlets != null) {
         PortletID portletID = portletEntityId.getPortletID();
         if (portlets.contains(portletID)) {
           supportedPublicRenderParametersMap.put(
               supportedPublicRenderParameterHolder.getIdentifier(),
               supportedPublicRenderParameterHolder.getIdentifier());
         } else {
           // Check whether supportedPublicRenderParameterHolder's qname is present in the aliases
           // of any
           // public render parameter definition or whether supportedPublicRenderParameterHolder's
           // qname is
           // same as the qname of any public render parameter definition or whether aliases of the
           // supportedPublicRenderParameterHolder contains the qname of any public render
           // parameter definition
           // if yes use the render parameter qname of that public render parameter definition to
           // get the portlet list
           for (List<PublicRenderParameterHolder> allPublicRenderParameterHolders :
               this.appPublicRenderParameterHolders.values()) {
             for (PublicRenderParameterHolder publicRenderParameterHolder :
                 allPublicRenderParameterHolders) {
               List<QName> aliases = publicRenderParameterHolder.getAliases();
               if (aliases.contains(supportedPublicRenderParameterHolder.getQName())
                   || publicRenderParameterHolder
                       .getQName()
                       .equals(supportedPublicRenderParameterHolder.getQName())
                   || supportedPublicRenderParameterHolder
                       .getAliases()
                       .contains(publicRenderParameterHolder.getQName())) {
                 portlets =
                     this.publicRenderParameterSupportingPortlets.get(publicRenderParameterHolder);
                 if (portlets != null && portlets.contains(portletID)) {
                   supportedPublicRenderParametersMap.put(
                       supportedPublicRenderParameterHolder.getIdentifier(),
                       publicRenderParameterHolder.getIdentifier());
                 }
               }
             }
           }
         }
       }
     }
   }
   if (supportedPublicRenderParametersMap == null) return Collections.emptyMap();
   else return supportedPublicRenderParametersMap;
 }
 public void setSupportedProcessingEvent(EntityID portletEntityId, EventHolder eventHolder)
     throws PublicDescriptorHolderException {
   if (this.portletSupportingProcessingEvents != null) {
     List<EventHolder> eventHolders =
         this.portletSupportingPublishingEvents.get(portletEntityId.getPortletID());
     if (eventHolders != null && eventHolders.contains(eventHolder)) {
       throw new PublicDescriptorHolderException(
           "The SupportingProcessingEvent:" + eventHolder.getQName() + " is already present");
     }
   }
   List<EventHolder> eventHolders = new ArrayList<EventHolder>();
   eventHolders.add(eventHolder);
   Map<PortletID, List<EventHolder>> processingEvents =
       new HashMap<PortletID, List<EventHolder>>();
   processingEvents.put(portletEntityId.getPortletID(), eventHolders);
   createEventProcessingPortlets(processingEvents);
   // print information
   printInformation();
 }
 public List<EventHolder> getSupportedProcessingEventHolders(EntityID portletEntityId) {
   PortletID portletID = portletEntityId.getPortletID();
   List<EventHolder> eventHolders = null;
   if (portletID != null) {
     eventHolders = this.portletSupportingProcessingEvents.get(portletID);
   }
   if (eventHolders == null) {
     return Collections.emptyList();
   }
   return eventHolders;
 }
 public void setSupportedPublicRenderParameter(
     EntityID portletEntityId, PublicRenderParameterHolder publicRenderParameterHolder)
     throws PublicDescriptorHolderException {
   if (this.portletSupportingPublicRenderParameters != null) {
     List<PublicRenderParameterHolder> publicRenderParameterHolders =
         this.portletSupportingPublicRenderParameters.get(portletEntityId.getPortletID());
     if (publicRenderParameterHolders != null
         && publicRenderParameterHolders.contains(publicRenderParameterHolder)) {
       throw new PublicDescriptorHolderException(
           "The SupportedPublicRenderParameter:"
               + publicRenderParameterHolder.getQName()
               + " is already present");
     }
   }
   List<PublicRenderParameterHolder> publicRenderParameterHolders =
       new ArrayList<PublicRenderParameterHolder>();
   publicRenderParameterHolders.add(publicRenderParameterHolder);
   Map<PortletID, List<PublicRenderParameterHolder>> publicRenderParameters =
       new HashMap<PortletID, List<PublicRenderParameterHolder>>();
   publicRenderParameters.put(portletEntityId.getPortletID(), publicRenderParameterHolders);
   createPublicRenderParameterPortlets(publicRenderParameters);
   // print information
   printInformation();
 }
 public EventHolder verifySupportedPublishingEvent(
     EntityID portletEntityId, EventHolder supportedEventHolder) {
   // Check whether it supports any ContainerEvent, if yes do not publish it
   if (getContainerEventService() != null
       && getContainerEventService()
           .getSupportedEvents()
           .contains(supportedEventHolder.getQName())) {
     return null;
   }
   List<PortletID> portlets =
       getEventPublishingProcessingPortlets(
           this.eventPublishingPortlets, supportedEventHolder.getQName());
   PortletID portletID = portletEntityId.getPortletID();
   if (portlets.contains(portletID)) {
     return supportedEventHolder;
   }
   return null;
 }