2.7 Migration Guide

In this document, we will see the major steps to migrate from 2.6 to 2.7.

Please check the change log for detailed list of fixes, changes and improvements introduced in 2.7.

Database migration

Migration scripts are available there.

Removal of TemplatePrintModel.template Field

This is a major change requiring manual migration steps.

The field TemplatePrintModel.template has been removed.

Migration Process

  1. Identify files to remove from file system

    Run the following SQL script on your database:

    COPY (
      SELECT mf.file_path
      FROM template_template_print_model model
      JOIN meta_file mf ON model.template = mf.id
    ) TO STDOUT;
  2. Save the output to a file named /tmp/template-files-to-delete.txt on the server storing the uploaded files.

  3. Delete the files using the migration script provided in the migration scripts folder.

Service Method Relocations

The following methods have been moved to different services:

Method From To

computeTemplatePrintModelDomainIds

TemplatePrintService

TemplatePrintModelDomainService

generateTemplate

TemplatePrintService

TemplatePrintGenerateDocService.generateDocument

download

PrintRequestService

PrintRequestServiceDownloadService

downloadDocument

PrintRequestService

PrintRequestServiceDownloadService

checkTemplateFormat

TemplatePrintModelService

TemplatePrintModelOutputService

exportTemplatePrintModel

TemplatePrintModelService

TemplatePrintModelExportService

checkCondition

TemplatePrintModelService

TemplatePrintModelChecker

computeMap

TemplateSettingsService

PrintDataBuilderService

getFile

WebUtilsService

TemplateApiService.download

getTemplateTenantUuid

WebUtilsService

TemplateTenantService

getHttpClient

WebUtilsService

WebClientHelper

Method Signature Changes

Class Old Signature New Signature

TemplatePrintService

generateTemplate(TemplatePrintModel, Long, String, OkHttpClient)

generateTemplate(TemplatePrintModel, Long, String)

AbstractDocParser

getTemplateSettingTags(MetaFile)

getTemplateSettingTags(File)

TemplateSettingAutoConfigService

computeTemplateSettings(TemplateSettings, MetaFile)

computeTemplateSettings(TemplateSettings, File)

TemplatePrintModelService

uploadOrUpdateTemplate(TemplatePrintModel)

uploadOrUpdateTemplate(TemplatePrintModel, File)

FileTools

getExtension(MetaFile)

getExtension(File)

FileTools

getExtensionType(MetaFile)

getExtensionType(File)

Class Renames

Old Name New Name

WebUtilsService

CreateRequestService

Method Renames

Class Old Name New Name

PrintRequestService

downloadDocumentFromPrintRequest

downloadDocument

Field Renames

Model Old Field New Field

AppTemplate

baseUrl

callbackUrl

Removed Classes and Methods

The following have been removed:

  • LibraryTemplateTemplateService.saveLibraryTemplate

  • FileExportTools (deprecated helper)

  • OutputFormatDto class

  • ConsumptionService.getDocumentCountByMonth (deprecated)

  • TemplatePrintModelService.checkTemplateFormat

  • TemplatePrintModelController.checkTemplateFormatSupport

Removed Authentication Types

Support for multiple authentication types has been removed. The module now relies exclusively on JWT authentication.

The following have been removed:

  • Enumeration ApiAuthConfig

  • ApiLicenseConfig.AUTH and ApiLicenseConfig.TENANT_UUID

  • ApiLocalConfig.AUTH and ApiLocalConfig.TENANT_UUID

  • AppTemplateService.getApiAuthConfig and AppTemplateService.getApiTenantUuid

  • AppTemplateController.configFileAuthApi

  • Fields AppTemplate.apiAuth and AppTemplate.apiTenantUuid

Removed PrintRequestService Methods

The following methods have been replaced:

Removed Replaced By

updateRequestStatus(TemplatePrintModel, List<Long>)

updateEnqueued(), updateEnqueued(List<Long>), updateEnqueued(TemplatePrintGroup), updateEnqueued(TemplatePrintModel)

downloadGenerated(TemplatePrintModel, List<Long>)

downloadGenerated(), downloadGenerated(List<Long>), downloadGenerated(TemplatePrintGroup), downloadGenerated(TemplatePrintModel)