Hello,
I have problems to get content of delivery from AEM. I am using the AEM integration package function from JS library nms:amcIntegration.js
/**
* Get the current content value from AEM
* {DOMDocument} elDelivery The delivery
* {DOMDocument} The node containing the content parts
*/
function nms_delivery_aemGetContent(elDelivery)
{
var result = <content/>;
var iCMSAccountId = elDelivery.@["cmsAccount-id"];
But any type of delivery object I provide it will always fail on the line
var iCMSAccountId = elDelivery.@["cmsAccount-id"];
I tried NLWS.nmsDelivery.load(), queryDef with JXON (have not tried with XML). Can somebody give me some hints? Any help would be appreciated.
Solved! Go to Solution.
Views
Replies
Total Likes
Hey @Ishan I took the function and changed the delivery argument to be of object coming from NLWS.nmsDelivery.load(id) and it worked.
No idea still what version of delivery object the original function wants
What error do you get at this line? In my understanding this should be the external account ID used to connect to your AEM instance. Can you check if the configuration of that external account is correct?
Thanks,
Ishan
Views
Replies
Total Likes
I am getting:
17/03/2022 16:02:05 js JST-310000 Error while compiling script 'nms:amcIntegration.js' line 1731: invalid XML name.
Its the line where the external account is requested. If you check the data the external account is there. Just somehow i am passing that delivery argument in wrong format. Eventhough the type I am passing is domdocument its throwing this error
Views
Replies
Total Likes
Did you try to print the value of
elDelivery.@["cmsAccount-id"]
before the line where it is referenced?
Does it also have values set for
elDelivery.@contentEditingMode
and
elDelivery.remoteContent.@remotePath?
If it is the OOTB implementation, these would be the minimum required configurations to fetch data from AEM? Is the template initially synced from AEM, or you are trying to call this in a JavaScript somewhere?
Thanks,
Ishan
Views
Replies
Total Likes
Hey @Ishan I took the function and changed the delivery argument to be of object coming from NLWS.nmsDelivery.load(id) and it worked.
No idea still what version of delivery object the original function wants
Views
Likes
Replies