We are publishing an xml file from our CMS. We have to add some additional information in that xml file before it get deployed. I want to edit it in the storage extension. How can we achieve this?
In the XML file I want to add some xml nodes.
We are publishing an xml file from our CMS. We have to add some additional information in that xml file before it get deployed. I want to edit it in the storage extension. How can we achieve this?
In the XML file I want to add some xml nodes.
Once you have added the "additional information" using Engine.PublishContext.RenderedItem.AddMetadata
, you can use a Deployer Extension. Here is an example (framework) to deal with Deployer Extensions:
Custom Deployer Extensions Framework
On a side note, if what you need to do is to add more nodes to your xml, you can do it in the template as well, not necessarily using the .AddMetadata
method but modifying the Output
instead. If this is something you need strictly to happen at deployment time, using the framework above, you can write your own CustomAction
which gets the page output (there's utils methods to access the pages.xml
within the deployment package) and modify the xml (add more nodes) based on your requirements and then saves it back to the original xml file.
You can add metadata to the rendered item, try the Engine.PublishContext.RenderedItem.AddMetadata
method. all the metadata you add there can be accessed in the Storage Layer or Deployer Extension.