- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hello,
I know the situation : you use the embeded content into the delivery (with publishing model linked)
I just did some test, and yes, the embeded content cannot be modified with standard method (or maybe needs something more). Unfortunately you can't just use the load method, modify the xml part of content and save it : it doesn't work.
So, how the console do ?
The console use the xtk:session:Write method, and by this way, it works.
So, you need to get the xml version of your delivery, modify the content and send this xml version of your delivery to xtk:session:Write method.
Here an example :
var id = 12345;
var delivery = nms.delivery.load(id);
var deliveryXML = delivery.toXML(); //get the "XML version" of the delivery
deliveryXML.content.content.Content1.@title = "Hello world"; //Change the content part we need to change. Can remove / add blocks, iterate, remove text etc.
deliveryXML.@xtkschema = "nms:delivery"; //Add the schema, needed for xtk.session.Write
deliveryXML.@_operation = "update";
//logInfo( deliveryXML );You can check if you want
NLWS.xtkSession.Write( deliveryXML ); //Save the delivery, but not with the classic save() method, with session Write
In addition, the console render the content with the "ncm:publishing:Transform" method and put the result into the delivery.content.html.source part before saving the delivery. It's just for convinience when a user open the delivery after (to get a good preview). But it's not mandatory as the source is recalculated when sending.
Cedric
Views
Replies
Total Likes