Cannot re-import default PDF templates

Description

When trying to re-import a zip file of a previously exported default template, an error occurs because the 'type' within the JSON template data is not set to 'CustomizableTemplate'

Stacktrace:

1 2 3 4 5 6 7 8 9 2016-10-14 09:57:42,954 ERROR [http-nio-1990-exec-7] [web.rest.resource.TemplateResource] doAndCatch Error while importing template with location: scroll_file_upload_4951795221610956131.zip java.lang.IllegalArgumentException: Could not store TextTemplate 'TEST-0A4603690157C2325CA67F9E4A231F0B' in space 'Space{key='TEST'}' because it is of type 'com.k15t.scroll.text.model.template.DefaultTextTemplate'. at com.k15t.scroll.text.services.template.impl.DefaultTextTemplateManager.createOrUpdateTextTemplate(DefaultTextTemplateManager.java:222) at com.k15t.scroll.text.web.rest.resource.TemplateResource.doImportTemplate(TemplateResource.java:512) at com.k15t.scroll.text.web.rest.resource.TemplateResource.access$900(TemplateResource.java:74) at com.k15t.scroll.text.web.rest.resource.TemplateResource$8.doAndCatch(TemplateResource.java:430) at com.k15t.scroll.confluence.web.rest.WrappedRuntimeExceptionTemplate.execute(WrappedRuntimeExceptionTemplate.java:14) at com.k15t.scroll.text.web.rest.resource.TemplateResource.importTemplate(TemplateResource.java:423) ...

Workaround

  1. Unzip the JSON file

  2. In template.json change the type field from 'PluginModuleTemplate' to 'CustomizableTemplate'.

  3. Zip the file again

Environment

None

Status

Assignee

Unassigned

Reporter

Jens Rutschmann (K15t)

Labels

None

Participants

None

Deployment

None

Components

Sprint

None

Fix versions

Priority

Major
Configure