Expand my Community achievements bar.

SOLVED

XDP Forms and relative XDP Fragments in AEM Forms OSGI

Avatar

Level 4

Hi,

We are migrating a load of XDP forms from LIvecycle to AEM. There are many Common Fragment XDPs for items like headers, footers, field types etc which are referenced relatively in AEM Designer and currently rendered through LCServer perfectly.

 

When we load all the XDP files (Fragments and Forms) in the same folder structure as on local disk the Forms fail to pull in the Fragments. The fragments are pulled into the form using subform and usehref such as

<subform x="0in" y="0in" usehref="..\..\..\fragments\headers\main-header.xdp"/>

If I edit the 'original' file rendition in CRXDE and another level the form renders correctly

<subform x="0in" y="0in" usehref="..\..\..\..\fragments\headers\main-header.xdp"/>

I wondering if this is because the file node in AEM contains a jcr:content node which is where the sling:resourceType is defined.

I would assume that this has come up many times as people have migrated from LC to AEM but I cannot find any documentation to address this. Interestingly the fd-service that creates the nodes correctly adds all the full repository file references in to the references Path array property in the metadata node.

IainClucas_0-1679755164789.png

 

We have a workaround workflow that adds another ..\ to each of the relative references when they are uploaded to the system. But we are not happy with this approach.

 

Grateful for any guidance and suggestions.

 

Thanks

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Thanks workflowuser - your post pointed me to https://experienceleague.adobe.com/docs/experience-manager-learn/forms/document-services/using-fragm...

From where I found a couple of zip files with Local and repository files.

 

Like so often the solution to my problem was so simple. When I created the folder system in AEM it didn't always created the folder the same way as the local (eg all letters were moved to lowercase and dots were replaced with dashes) 7.0 became 7-0. So the renderer simply could not find the resource.

 

When I faithfully recreated the AEM folder structure the same as local everything work fine.

 

I am now going into the forest and see if I can find some wood.

View solution in original post

3 Replies

Avatar

Employee Advisor

In this article we will use output service to generate pdf files using xdp fragments. The main xdp and the fragments reside in the crx repository. It is important to mimic the file system folder structure in AEM. For example if you are using a fragment in fragments folder in your xdp you must create a folder called fragmentsunder your base folder in AEM. The base folder will contain your base xdp template. For example if you have the following structure on your file system

  • c:\xdptemplates - This will contain your base xdp template
  • c:\xdptemplates\fragments - This folder will contain fragments and the main template will reference the fragment as shown below
     

     

Avatar

Level 4

This is how we have it - if we Preview as HTML form1.xdp in AEM id does not pull in the fragments unless we modify the original rendition to add a 4th parent reference ..\..\..\..\common-fragments

 

IainClucas_0-1679768103737.png

 

Avatar

Correct answer by
Level 4

Thanks workflowuser - your post pointed me to https://experienceleague.adobe.com/docs/experience-manager-learn/forms/document-services/using-fragm...

From where I found a couple of zip files with Local and repository files.

 

Like so often the solution to my problem was so simple. When I created the folder system in AEM it didn't always created the folder the same way as the local (eg all letters were moved to lowercase and dots were replaced with dashes) 7.0 became 7-0. So the renderer simply could not find the resource.

 

When I faithfully recreated the AEM folder structure the same as local everything work fine.

 

I am now going into the forest and see if I can find some wood.