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 void setPublicRenderParameterHolder( String portletAppName, PublicRenderParameterHolder publicRenderParameterHolder) throws PublicDescriptorHolderException { if (this.appPublicRenderParameterHolders != null) { // load PublicRenderParameterHolder objects of the portlet application List<PublicRenderParameterHolder> publicRenderParameterHolders = this.appPublicRenderParameterHolders.get(portletAppName); if (publicRenderParameterHolders == null) { publicRenderParameterHolders = new CopyOnWriteArrayList<PublicRenderParameterHolder>(); } if (!publicRenderParameterHolders.contains(publicRenderParameterHolder)) { publicRenderParameterHolders.add(publicRenderParameterHolder); appPublicRenderParameterHolders.put(portletAppName, publicRenderParameterHolders); } else { throw new PublicDescriptorHolderException( "The PublicRenderParameter:" + publicRenderParameterHolder.getQName() + " is already present"); } } // print information printInformation(); }
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 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; }