protected void collectSupportedPublicRenderParameters(
      ServiceReference<Portlet> serviceReference, com.liferay.portal.model.Portlet portletModel) {

    Set<PublicRenderParameter> publicRenderParameters = new HashSet<>();

    PortletApp portletApp = portletModel.getPortletApp();

    List<String> supportedPublicRenderParameters =
        StringPlus.asList(
            serviceReference.getProperty("javax.portlet.supported-public-render-parameter"));

    for (String supportedPublicRenderParameter : supportedPublicRenderParameters) {

      String name = supportedPublicRenderParameter;
      String qname = null;

      String[] parts = StringUtil.split(supportedPublicRenderParameter, StringPool.SEMICOLON);

      if (parts.length == 2) {
        name = parts[0];
        qname = parts[1];
      }

      QName qName = getQName(name, qname, portletApp.getDefaultNamespace());

      PublicRenderParameter publicRenderParameter =
          new PublicRenderParameterImpl(name, qName, portletApp);

      publicRenderParameters.add(publicRenderParameter);
    }

    portletModel.setPublicRenderParameters(publicRenderParameters);
  }
  protected void collectSupportedPublishingEvents(
      ServiceReference<Portlet> serviceReference, com.liferay.portal.model.Portlet portletModel) {

    Set<QName> publishingEvents = new HashSet<>();

    PortletApp portletApp = portletModel.getPortletApp();

    List<String> supportedPublishingEvents =
        StringPlus.asList(serviceReference.getProperty("javax.portlet.supported-publishing-event"));

    for (String supportedPublishingEvent : supportedPublishingEvents) {
      String name = supportedPublishingEvent;
      String qname = null;

      String[] parts = StringUtil.split(supportedPublishingEvent, StringPool.SEMICOLON);

      if (parts.length == 2) {
        name = parts[0];
        qname = parts[1];
      }

      QName qName = getQName(name, qname, portletApp.getDefaultNamespace());

      publishingEvents.add(qName);
    }

    portletModel.setPublishingEvents(publishingEvents);
  }
  protected void collectSupportedProcessingEvents(
      ServiceReference<Portlet> serviceReference, com.liferay.portal.model.Portlet portletModel) {

    Set<QName> processingEvents = new HashSet<>();

    PortletApp portletApp = portletModel.getPortletApp();

    List<String> supportedProcessingEvents =
        StringPlus.asList(serviceReference.getProperty("javax.portlet.supported-processing-event"));

    for (String supportedProcessingEvent : supportedProcessingEvents) {
      String name = supportedProcessingEvent;
      String qname = null;

      String[] parts = StringUtil.split(supportedProcessingEvent, StringPool.SEMICOLON);

      if (parts.length == 2) {
        name = parts[0];
        qname = parts[1];
      }

      QName qName = getQName(name, qname, portletApp.getDefaultNamespace());

      processingEvents.add(qName);

      Set<EventDefinition> eventDefinitions = portletApp.getEventDefinitions();

      for (EventDefinition eventDefinition : eventDefinitions) {
        Set<QName> qNames = eventDefinition.getQNames();

        if (qNames.contains(qName)) {
          processingEvents.addAll(qNames);
        }
      }
    }

    portletModel.setProcessingEvents(processingEvents);
  }