Expand my Community achievements bar.

Insert fragments dynamically

Avatar

Level 3

We are integration a Java application with ALC for generating correpondence. Wa are using ALC ES3 with Output and Forms Module. Document is a static one. Values are passed via XML from the external Java application.

I have a situation where User is given 5 questions (5 drop down menu's) with possible options A, B, C, D, E on the user interface of the Java application.

If user selects A, appropriate paragraph (out of 25 paragraphs or subforms) should be shown on the document.

If the user selects value A for all the 5 questions then approrpiate paragraph needs to be shown 5 times.

I was wondering if I can create 25 fragments and each time user chooses A value then appropriate fragments should be referenced dynamically during rendering process.

Not sure If I was able to explain the question clearly but let me know whatever questions you have to make my situation clear.

7 Replies

Avatar

Level 2

I cannot see your design, so I have to guess a bit, but you have 2 options, I think

If your 5 subforms are following each other in the document without any other content in between, you could help yourself with the instanceManager().

But most likely not, and then I would indeed make your subform a fragment and include it in 5 locations in your form.  You would indeed show/hide them according to the user's selection.  That would be the easiest solution, but not the most elegant one.

Another thing you have to take a look at, is the insertion points.  You can dynamically add a fragment in an insertion point when rendering the form.  That would be an elegant way, if you can manage the insertion based on a user's selection.  You must look into that, I'm not sure as I don't see your form.

But yes, 25 fragments in total is certainly a first step.  Whatever solution you pick.

Avatar

Level 3

Thanks for taking out time to reply!!

5 subforms are not following each other.

I think placing the subform at 5 places and making them show or hide is the ideal solution but thought of trying if there is any other solution as there are some more documents which need similar kind of solution but they have like 25 to 40 subforms and i dont want to place these 25 subforms at 5 times for a one page document output.

Insertion point looks interesting but it requires assembler service. Is that included along with forms or output?

And how exactly do i refer a subform to a particular fragment? I am not using workbench at all.

Avatar

Level 2

Correct me if I'm wrong afterwards, but yes, assembler service is available with output/forms.  It's not a module by itself and I think it gets installed always like the foundation.  Honestly, I can't think of a server where it was not available and I've been a LC consultant for the last 8 years.

You make an insertion point in Designer, but you need Workbench to tell what should happen when rendering your final document.  This is not part of something you can do solely in Designer.

Avatar

Level 3

I thought so. Due to some code compatibility with the external java application we arent using workbench for this project. I was trying to do something solely in designer. I think copying the subforms at various places is the only solution.

Avatar

Level 2

Wait wait.  You are not using Workbench because you don't want server processes in LC ?  Or you are just allowed to give a PDF to the external application ?

Even if you don't want server side processes, you can use the server by calling it through Java APIs.  I guess you must be using something to render the form, APIs ?  What not call assembler through the API then ?

Avatar

Level 3

We arent using workbench as the external application calls adobe api and then just have to provide the application with the pdf document.

Avatar

Level 2

Like I said.  They should extend the application to call other APIs or you do it the none elegant way by adding too much fragments.  You will increase the size of your PDF, but the result would be the same from a functionality point of view.