Class InstantPreviewDashboardService
java.lang.Object
io.camunda.optimize.service.dashboard.InstantPreviewDashboardService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstantPreviewDashboardService(DashboardService dashboardService, ReportService reportService, InstantDashboardMetadataReader instantDashboardMetadataReader, InstantDashboardMetadataWriter instantDashboardMetadataWriter, EntityImportService entityImportService, DefinitionService definitionService, ConfigurationService configurationService, HashMap<String, Long> templateChecksums) -
Method Summary
Modifier and TypeMethodDescriptioncreateInstantPreviewDashboard(String processDefinitionKey, String dashboardJsonTemplate) voidstatic voidfindAndConvertTileContent(Object node, String fieldType, InstantPreviewDashboardService.BiConsumerWithParameters<Map<String, Object>, String> transformFunction, String additionalParameterValue) This method scans recursively through all the components of a Dashboard Tile of the type "text" and performs a conversion on the target sub-component passed under fieldType.static longgetChecksumCRC32(InputStream stream, int bufferSize) static longgetChecksumCRC32(String input) getInstantPreviewDashboard(String processDefinitionKey, String dashboardJsonTemplate, String userId) void
-
Field Details
-
INSTANT_PREVIEW_DASHBOARD_TEMPLATES_PATH
- See Also:
-
EXTERNAL_STATIC_RESOURCES_SUBPATH
- See Also:
-
SRC_FIELD
- See Also:
-
ALTTEXT_FIELD
- See Also:
-
TYPE_FIELD
- See Also:
-
TYPE_IMAGE_VALUE
- See Also:
-
configurationService
-
-
Constructor Details
-
InstantPreviewDashboardService
public InstantPreviewDashboardService(DashboardService dashboardService, ReportService reportService, InstantDashboardMetadataReader instantDashboardMetadataReader, InstantDashboardMetadataWriter instantDashboardMetadataWriter, EntityImportService entityImportService, DefinitionService definitionService, ConfigurationService configurationService, HashMap<String, Long> templateChecksums)
-
-
Method Details
-
getInstantPreviewDashboard
public AuthorizedDashboardDefinitionResponseDto getInstantPreviewDashboard(String processDefinitionKey, String dashboardJsonTemplate, String userId) -
createInstantPreviewDashboard
public Optional<InstantDashboardDataDto> createInstantPreviewDashboard(String processDefinitionKey, String dashboardJsonTemplate) -
findAndConvertTileContent
public static void findAndConvertTileContent(Object node, String fieldType, InstantPreviewDashboardService.BiConsumerWithParameters<Map<String, Object>, String> transformFunction, String additionalParameterValue) This method scans recursively through all the components of a Dashboard Tile of the type "text" and performs a conversion on the target sub-component passed under fieldType. The conversion itself is accomplished by the 'converter', which is the method reference passed under transformFunction. Moreover, the additionalParameter value is also passed onto the converter.- Parameters:
node- Node with which the recursion is started, in the beginning it is the root node of the Dashboard tilefieldType- Which node type do we want to transform? E.g. "image", "text", etctransformFunction- Once a node of the type "fieldType" is found, this function performs the necessary conversionadditionalParameterValue- An additional string that is used by the converter. In the case of an image node this is e.g. the clusterId, in the case of a text node it is e.g. the locale
-
processAllImageUrlsInTiles
-
deleteInstantPreviewDashboardsAndEntitiesForChangedTemplates
@EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) public void deleteInstantPreviewDashboardsAndEntitiesForChangedTemplates() -
getCurrentFileChecksums
-
getChecksumCRC32
- Throws:
IOException
-
getChecksumCRC32
-