Highlighted

Getting Attachments into a Document Form

JoshDBoyle-DVzR

19-11-2008

All



I am in need of a way to get various files into a Document Form as attachments. I have a list of documents which contains the files I want to attach and a means to convert this list to a map if necessary.



I am aware of the invokeDDX service but am unable to get it to work. Could somebody please clarify for me how to go getting these files into the Document Form as attachments?

Replies

Highlighted

JoshDBoyle-DVzR

19-11-2008

Here is the DDX I have created within my workflow:









However, invokeDDX errors out stating that the DDX "did not pass validation against the specification".

Would someone be so kind as to clarify what this means and what is wrong with the DDX above?

Test.PDF is the name of the first attachment
Remaining Bugs.txt is the name of the second attachment
SAPTransport.pdf is the name of the PDF document I want to put the above two attachments in
AfterAttachments.pdf is an arbitrary name for the resultant document.
Highlighted

Jasmin_Charbonn

20-11-2008

I believe the FileAttachments tags also requires a File node.

This is an example coming from the documentation:






What this file does





Jasmin
Highlighted

yodadobe

25-02-2013

Here is my execute script code to convert a list of attachments to a map of attachments which you can then pass to a Render step:

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import java.util.Iterator;

import com.adobe.idp.Document;

List attachmentList = patExecContext.getProcessDataListValue("/process_data/lsAttachments");

Map attachmentMap = new HashMap();

Iterator it = attachmentList.iterator();

while(it.hasNext()){

          Document attDoc = (Document) it.next();

          String name = (String) attDoc.getAttribute("name");

          attachmentMap.put(name, attDoc);

}

patExecContext.setProcessDataMapValue("/process_data/mapAttachments",attachmentMap);

attachmentList.clear();

patExecContext.setProcessDataListValue("/process_data/lsAttachments", attachmentList);

Highlighted

Don400

21-03-2013

I have an archive file with three processes that take a map of documents and converts it to a portfolio (the map keys are the document names).  One of the processes builds the DDX file from the map keys and an input variable for the portfolio name.  I don't know where to post it but send me an email and I'll attach it to my reply.

Highlighted

Don400

24-05-2013

Steve, where do you put adobe-livecycle-client.jar in you app server?  I tried putting it in LC_HOME\jboss\server\lc_turnkey\lib and get a java.lang.LinkageError.  See this discussion thread for stack traces.

Highlighted

8_BIT_PLATOON

27-05-2013

So I assume you have LC Forms then:

Then simply use the LC Forms RenderForm component (check the "ALL" properties), one of them is an attachment list/map.

You sorted

Have fun.

Luigi

Highlighted

Don400

29-05-2013

When I do that LC throws an exception the gist of which is the following:

Caused by: ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: {...} of type: java.util.HashMap to type: class com.adobe.idp.Document
Highlighted

8_BIT_PLATOON

29-05-2013

I can't remember if it is a map or list.... that is required in the input, however... you can see that...

but make sure the sub-type of the attachment/map is a "document" type.

when i get back onto workbench... i'll give full full details....