Package lumis.service.doui.htmlsnippet
Class HtmlSnippetUtil
- java.lang.Object
-
- lumis.service.doui.htmlsnippet.HtmlSnippetUtil
-
public class HtmlSnippetUtil extends java.lang.Object
Utility class for htmlsnippet service.- Since:
- 15.0.0
- Version:
- $Revision$ $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HtmlSnippetUtil.SetHtmlDescriptionArgument
Argument of the `setHtmlDescription` callback function.
-
Constructor Summary
Constructors Constructor Description HtmlSnippetUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkEditContentPermission(IServiceInterfaceRequest request)
Checks if the current session hasServiceInstancePermissions.EDIT_SERVICE_INSTANCE_CONTENT
in the service instance specified in the request.static void
checkManageServiceInstancePermission(IServiceInterfaceRequest request)
Checks if the current session hasServiceInstancePermissions.MANAGE_SERVICE_INSTANCE
in the service instance specified in the request.static java.lang.String
generateHtmlDescription(java.lang.String htmlContent, java.lang.String title, ServiceInstanceConfig serviceInstance)
Returns the HTML description for the given HTML content.static java.util.List<HtmlTemplateProperty>
getHtmlTemplates(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String sourceId, java.lang.String fieldId, ITransaction transaction)
Returns the available HTML templates to be used in the given field of the given source of the given service instance.static com.theokanning.openai.client.OpenAiApi
getOpenAiApi()
Returns the OpenAI API.static java.lang.String
processHtml(java.lang.String htmlContent)
-
-
-
Method Detail
-
checkEditContentPermission
public static void checkEditContentPermission(IServiceInterfaceRequest request) throws PortalException
Checks if the current session hasServiceInstancePermissions.EDIT_SERVICE_INSTANCE_CONTENT
in the service instance specified in the request.- Parameters:
request
- the request to the htmlsnippet's interface.- Throws:
PortalException
- Since:
- 15.0.0
-
checkManageServiceInstancePermission
public static void checkManageServiceInstancePermission(IServiceInterfaceRequest request) throws PortalException
Checks if the current session hasServiceInstancePermissions.MANAGE_SERVICE_INSTANCE
in the service instance specified in the request.- Parameters:
request
- the request to the htmlsnippet's interface.- Throws:
PortalException
- Since:
- 15.0.0
-
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 sessionserviceInstanceId
- the service instance identifiersourceId
- the source identifierfieldId
- the field identifiertransaction
- 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 contenttitle
- HTML titleserviceInstance
- 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
-
-