AnsweredAssumed Answered

How to execute a transformation to PDF with versioning

Question asked by ragnaroek-hh on Mar 8, 2010
I need for versioning PDFs created by transformation.
This does not work via the jscript API funktion  node.transformDocument("application/pdf"). It  does not over-write existing PDFs. Even with versioning enabled, the function dies NOT over-write.

Running an action "transform and copy content to a sepcific space" from explorer does support versions on the PDFs created. Thats why i try to call this action:


var transform = actions.create("transform");
transform.parameters["mime-type"]    = "application/pdf";
transform.parameters["destination-folder"]   = userhome;
transform.parameters["assoc-type"]    = "cm:content";
transform.parameters["assoc-name"]    = "cm:contains";
transform.parameters["overwrite-copy"]   = false;

transform.execute(document);

This unfortunately causes alfresco 3.2r2 to fly into:
    Caused by: java.lang.NullPointerException
       at org.alfresco.repo.copy.CopyServiceImpl.recursiveCopy(CopyServiceImpl.java:503)
       at org.alfresco.repo.copy.CopyServiceImpl.copyImpl(CopyServiceImpl.java:428)
       at org.alfresco.repo.copy.CopyServiceImpl.copy(CopyServiceImpl.java:245)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
       at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
       at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
Any idea for other parameters (or may be for a smarter solution)? Help appreciated!

Outcomes