Class HtmlSnippetUtil


  • public class HtmlSnippetUtil
    extends java.lang.Object
    Utility class for htmlsnippet service.
    Since:
    15.0.0
    Version:
    $Revision$ $Date$
    • Constructor Detail

      • HtmlSnippetUtil

        public HtmlSnippetUtil()
    • Method Detail

      • processHtml

        public static java.lang.String processHtml​(java.lang.String htmlContent)
      • getHtmlTemplates

        public static java.util.List<HtmlTemplateProperty> getHtmlTemplates​(SessionConfig sessionConfig,
                                                                            java.lang.String serviceInstanceId,
                                                                            java.lang.String sourceId,
                                                                            java.lang.String fieldId,
                                                                            ITransaction transaction)
                                                                     throws PortalException
        Returns the available HTML templates to be used in the given field of the given source of the given service instance.
        Parameters:
        sessionConfig - the user's session
        serviceInstanceId - the service instance identifier
        sourceId - the source identifier
        fieldId - the field identifier
        transaction - the transaction
        Returns:
        the available templates
        Throws:
        PortalException
        Since:
        17.0.0
      • generateHtmlDescription

        public static java.lang.String generateHtmlDescription​(java.lang.String htmlContent,
                                                               java.lang.String title,
                                                               ServiceInstanceConfig serviceInstance)
                                                        throws PortalException
        Returns the HTML description for the given HTML content.
        Parameters:
        htmlContent - HTML content
        title - HTML title
        serviceInstance - service instance
        Returns:
        the HTML description
        Throws:
        PortalException
        Since:
        17.0.0
      • getOpenAiApi

        public static com.theokanning.openai.client.OpenAiApi getOpenAiApi()
        Returns the OpenAI API.
        Returns:
        the OpenAI API
        Since:
        17.0.0