PDF transformation failed using content transformation services.

Options
JitenK
edited July 20, 2015 in Documentum #1

Hello All,

I am facing an issue while doing transformation of content into PDF using content transformation services from JMS server (auto activity)

" Could not check in document cts_submission_-512167467_optimizePDF_adts

Source Object Id must be set before using Transformation"

Same code is working fine using plain DFC class. Please find the attached log for the issue details.

The environment details:

Content Server v6.7 Sp1 Patch 10

ADTS Server v6.7 Sp1 Patch 10

Thank you!!

-JitenK

Comments

  • Alvaro_de_Andres
    edited May 7, 2013 #2
    Options

    are you using custom code to generate the request? could you post that code? It looks like you could be missing some parameter.

  • JitenK
    edited May 7, 2013 #3
    Options

    I have done coding as mentioned in the Documentum-Content-Transformation-Services-Version-6.7-Development-Guide.

    Please find the attached code.

    Thank you!!

  • Alvaro_de_Andres
    edited May 7, 2013 #4
    Options

    Try with this code: (this takes a doc document, converts it to pdf, and versions the object so the PDF is the primary content with setVersionUp)


                String strOid="09...";
                DfId oid=new DfId(strOid);

                IDfSysObject obj=(IDfSysObject)session.getObject(oid);

                IMediaProfile[] profiles = null;
                IProfileService profService=(IProfileService)client.newService(IProfileService.class.getName(), manager);
                profiles = profService.getProfiles(session,"msw8",oid.toString(), null); 
                IMediaProfile supportedTransformation =null;

                for(int i = 0; i < profiles.length && supportedTransformation == null; i++) {  
                    if(profiles[i].getObjectName().equals("custom_document_to_pdf")) {  
                        supportedTransformation = profiles[i]; 
                    } 
                } 

                ICTSService ctsService=(ICTSService)client.newService(ICTSService.class.getName(), manager);
               
                if(ctsService.isCTSServiceAvailable(session)) {
                    ICTSRequest request = (ICTSRequest)ctsService.getNewTransformRequest(session);
       
                    request.setSourceObjectId(oid.toString()); 
                    request.setSourceFormat("msw8");           
                    request.setPriority(1);               
                    request.setParameters(supportedTransformation.getParameters()); 
                    request.setMediaProfileName("custom_document_to_pdf"); 
                    request.setMediaProfileLabel("Convert to pdf");  
                    request.setTargetFormat("pdf");  
                    request.setTargetPage(0);  
                    request.setTargetPageModifier("");  
                    request.setSourcePage(0); 
                    request.setSourcePageModifier("");  
                    request.setMediaProfileId(supportedTransformation.getObjectId().getId()); 
                    request.setTitle("TestDocPDF");  
                    request.setLocale(Locale.getDefault());  
                    request.setVersionUp(true);  
                    request.save();
                   
                    System.out.println("\nTransform Request " + request.getObjectId());
                    System.out.println("Is transform request valid? " + request.isValid());
                   
                    boolean notifyUser = false;
                    boolean synchronizeCmd =false;
                    boolean deleteOnCompletion = true;
                   
                    System.out.println("Submitting request for transformation...");
                    ctsService.submitRequest(session, request, notifyUser, synchronizeCmd, deleteOnCompletion);
                    System.out.println("Submitted request for rendition");

  • JitenK
    edited May 7, 2013 #5
    Options

    Thank you for the source code.

    Just for the understanding, Is there any issue with the my source code? This code is working fine on one environment from JMS and working fine when I am executing from through command prompt as java utility from both the environment.

    There is one difference between your code i.e. the request is getting save prior to submit request call.

    Thank you!!

  • JitenK
    edited May 13, 2013 #6
    Options

    Hello Experts,

    This problem is still not resolved. I am facing same issue where same code is working fine using DFC utility classes but failed execute from Java method server.

    Thanks in advance!!!

    -JitenK

  • Daniel.Gutierrez.Rodriguez
    Options

    Hello,

    I am having the same problem with Media Transformation Service 6.7 SP2. Any ideas so far? If I use DFS and the transformation service, it works perfectly.

    Best regards

    Daniel.

  • SedletskiyV
    edited July 20, 2015 #8
    Options

    Of course, answer is outdated, but could be helpful for others.

    There are some complex nuances in TransformRequest.save() method related to self checkout+checkin+resave stuff.

    The problem is that you are using wrong factory for TransformRequest object. Instead of ICTSAddJobService.getNewCTSRequest(String docbase) (who creates an object in a new session and releases it immediately) you should use ICTSService.getTransformationRequest(IDfSession session).