AnsweredAssumed Answered

Cannot create PDF rendition since update from 4.0.d to 4.2.c

Question asked by sjeandroz on Jul 31, 2013
Latest reply on Aug 2, 2013 by sjeandroz
Hi,
I have opened a Jira here (https://issues.alfresco.com/jira/browse/ALF-19425) to explain my problem but I open also a Forum Topic because it's a critical problem for me



Previously I had an Alfresco 4.0.d with the following config in alfresco-global.properties

#

    External locations
    #————-
    ooo.exe=/usr/bin/soffice
    ATTENTION : si jod=enable, alors ooo.enabled=false
    ooo.enabled=false
    #img.root=./ImageMagick
    #swf.exe=/usr/local/bin/pdf2swf
    swf.exe=/usr/bin/pdf2swf
    jodconverter.officeHome=/usr/bin/soffice
    jodconverter.portNumbers=8101
    jodconverter.enabled=true

I created a script (JS) with the following code to create a PDF preview of documents:

var node = search.findNode(args.reference);
var thumbnail_result = "no error";
var def = renditionService.createRenditionDefinition("pdf","reformat");
def.parameters['mime-type'] = "application/pdf";
def.execute(node);
model.property = "OK";

There was no problem.

But when I upgrade Alfreco to 4.2.c, previews dont works. With the same configuration, I have the following in alfresco.log

11:06:08,024 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
source mimetype: application/msword
target mimetype: image/jpeg
transformers: []
11:06:08,034 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
source mimetype: application/msword
target mimetype: application/pdf
transformers: []
11:06:08,167 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 06290001 Wrapped Exception (with status template): 06290006 Failed to execute script '/permissions/getPreview.get.js (in repository store workspace://SpacesStore/Espace racine/Dictionnaire de données/Extensions de script Web)': 06290005 Transformer for 'application/msword' source mime type and 'application/pdf' target mime type was not found. Operation can't be performed


I tried the following configuration:
#

    External locations
    #————-
    ooo.exe=/usr/bin/soffice
    ATTENTION : si jod=enable, alors ooo.enabled=false
    ooo.enabled=true
    #img.root=./ImageMagick
    #swf.exe=/usr/local/bin/pdf2swf
    swf.exe=/usr/bin/pdf2swf
    jodconverter.officeHome=/usr/bin/soffice
    jodconverter.portNumbers=8101
    jodconverter.enabled=false

But I have this error:

11:08:46,130 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
source mimetype: application/msword
target mimetype: image/jpeg
transformers: []
11:08:46,146 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
source mimetype: application/msword
target mimetype: application/pdf
transformers: [ProxyContentTransformer[ average=0ms]]
11:08:46,148 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
source mimetype: application/msword
target mimetype: image/jpeg
transformers: []
11:08:46,153 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
source mimetype: application/msword
target mimetype: application/pdf
transformers: [ProxyContentTransformer[ average=0ms]]
11:08:46,153 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0 doc pdf Envoi doc client pour signature.doc 87.5 KB ContentService.transform(…)
11:08:46,153 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0 **a) transformer.OpenOffice<<Proxy>> < 10 MB 0 ms
11:08:46,154 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0.1 doc pdf Envoi doc client pour signature.doc 87.5 KB transformer.OpenOffice<<Proxy>>
11:08:47,028 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0 Finished in 880 ms

11:08:47,383 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: Node does not exist: workspace://SpacesStore/78dd28e9-1666-4380-a885-0b5bb7a5f101(Status[changeTxnId=1e380a80-bc9d-4e3c-9564-553f9c43d94d, dbTxnId=51639, deleted=true])
org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/78dd28e9-1666-4380-a885-0b5bb7a5f101(Status[changeTxnId=1e380a80-bc9d-4e3c-9564-553f9c43d94d, dbTxnId=51639, deleted=true])
….

it seems to be a bug with renditionDefinition in Javascript, because if I use ooo.enabled=true and if I change my webscript like :

var node = search.findNode(args.reference);
node.transformDocument("application/pdf");
model.property = "debug";

A pdf version of the document is correctly created, but if I use my original script to create pdf rendition of my document, I have the error:



11:08:46,153 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0 doc pdf Envoi doc client pour signature.doc 87.5 KB ContentService.transform(…)
11:08:46,153 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0 **a) transformer.OpenOffice<<Proxy>> < 10 MB 0 ms
11:08:46,154 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0.1 doc pdf Envoi doc client pour signature.doc 87.5 KB transformer.OpenOffice<<Proxy>>
11:08:47,028 DEBUG [org.alfresco.repo.content.transform.TransformerDebug] 0 Finished in 880 ms

11:08:47,383 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: Node does not exist: workspace://SpacesStore/78dd28e9-1666-4380-a885-0b5bb7a5f101(Status[changeTxnId=1e380a80-bc9d-4e3c-9564-553f9c43d94d, dbTxnId=51639, deleted=true])


Thanks for your help and sorry for my bad english…

Outcomes