Changing the DOR for the Using API to generate Document of Record in AEM Forms | Community
Skip to main content
Level 2
April 26, 2022

Changing the DOR for the Using API to generate Document of Record in AEM Forms

  • April 26, 2022
  • 4 replies
  • 2252 views

Hello,

 

I have implemented the sample and it works but I am not sure how to point this to my real DOR.

Any help would be great.

Noelle

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Adobe Employee
April 26, 2022

Can you please give some more details of the use case?

Level 2
April 26, 2022

Hi,

 

The sample form has a button that uses the API to produce a "preview" of the DOR with the content of the adaptive form.  When I implemented the button on my form it still uses the DOR of the sample form.

Below is the function as you can see the DOR for the sample is hardcoded.

/**
* Get pdf
* @2007960 {OPTIONS} drop down options
*/
function getPdf()
{
console.log("in view pdf");
window.guideBridge.getDataXML(
{
success: function(result) {
var formData = new FormData();
formData.append("dataXml",result.data);
console.log("got data"+result.data);
var settings ={
"async": true,
"url": "/content/AemFormsSamples/getdor.html",
"method": "POST",
data:{'data':result.data},
}
$.ajax(settings).done(function(response)
{
console.log("got response");
window.open(JSON.parse(response).filePath,'_blank');
})

},
error:function(guideResultObject) {console.log("got error"); },
guideState : null,
boundData : true});

}

Adobe Employee
April 26, 2022

Do you have a specific template that you want to merge the data with?

 

Level 2
April 26, 2022

Yes, It is attached my form.  What I don't understand is why the sample hard codes the DOR to the sample and doesn't reference the form that it is being called from.

Adobe Employee
April 26, 2022

Send me a private message we can do a web session after 10 am PST 

Mayank_Gandhi
Adobe Employee
Adobe Employee
May 2, 2022

@noellesmith81 The dor in the sample takes the dor xdp node path from the jsp, you can update the ajax call and send a parameter in the function on the button click that has the form path. you can get this parameter in JSP just like data and that's it.

 

 

in form

const='some path'

 getPdf(const)

 

update ajax

 

function getPdf(formPath)
{

 

 

update the jsp as well.

Level 2
May 31, 2022

Hi

 

So I have jumped back on to this after dealing with a major system crash.  When I do a console review it is telling me.
https://cfondevwvasd046.istc-inf.local/content/AemFormsSamples/getdor.html 404 (Not Found)

 

It was working before but I was on an OSGI server where the new one is J2EE.

 

@mayank_gandhi You mentioned updating the jsp file. Where would I find this?

 

Thanks

Noelle

 

Noelle

Mayank_Gandhi
Adobe Employee
Adobe Employee
June 1, 2022

@noellesmith81 Did you deployed the pkg again on jee?

Level 2
June 1, 2022

Hi

I did but it seems my install location isn't the norm and maybe causing my initial issue.  I have it setup https://xxxxxxxxxxxxxx.xxx/lc/

 

Do I need to make changes to any of the code for it to look in the right folder?

 

Noelle