For dynamically create a DDX, see here : http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.html?content=000967.html#15 51956
For portfolio DDX, some example are here : http://blogs.adobe.com/livecycledocs/2009/01/using_assembler_to_create_pdf.html
The attached ES2 .lca does dynamic document assembly using a custom script. You can drop any number of flattened PDFs into the watched folder to assemble a PDF.
The process is depicted below.
1) Process includes logic to calculate elapsed Assembler processing time, which may or may not be useful.
2) As you are probably aware PDFs have to be flattened for assembly. The process does not flatten PDFs.