2

I have a use case where I need to add custom page metadata on publish (preferably via a TBB) as per point 2 of Dom's answer here: https://tridion.stackexchange.com/a/3917/159. In essence, this is a perfect for the use of the Tridion.ContentManager.Publishing.Rendering.AddMetadata method on the RenderedItem (see "SDL Tridion 2013 SP1 TOM.NET API.chm").

The API states:

There is no possibility to remove or change the metadataXml once it is added.

What does this mean exactly?

  1. Does it mean that once it gets written into the Broker's tables, you can't change it upon subsequent republishes?
  2. Or does it mean that once its in the Broker, you can't change the meta keys, but can still change the meta values associated?
  3. Or some other reason?
4
  • 1
    I suspect this may end up as a "What have you tried?". Write some code: become the world's top expert!! Jun 25, 2014 at 20:42
  • 3
    I am pretty sure the AddMetadata method doesnt add metadata in the sense of custom metadata which gets written into the broker, I think its just metadata which is available somewhere in the transport package, but its not actually written to the broker DB, unless you create some extension to do it
    – Will Price
    Jun 25, 2014 at 20:43
  • Yeah Will - someone recently told me that, but I was sure I remembered using this API in the obvious way. Now I'm going to have to write code..... Jun 25, 2014 at 21:32
  • As far as I can tell, I was correct to think I'd used AddMetadata without having to customise CD. The only trouble is that this was the AddMetadata in the old TOM, and not the one in TOM.NET - so apparently the "new" version has a bug. Jun 26, 2014 at 18:58

1 Answer 1

4

Calling RenderedItem.AddMetaData() during publishing just adds custom XML into the transport package for that item. It's available for use on the deployer side, but it's not written into the content data store like an item's actual metadata.

See http://yatb.mitza.net/2012/10/rendereditem-metadata-and-instruction.html for a little more info.

I'm currently using RenderedItem metadata to push the publishing user's information to the content delivery for use in a deployer extension. I believe the metadata is available as a string via the getRenderAddedMetaData() methods on the com.tridion.transport.transportpackage.Page and com.tridion.transport.transportpackage.ComponentPresentation objects.

I think that "There is no possibility to remove or change the metadataXml once it is added" just means that you can set some custom XML for the RenderedItem, but you cannot access it in the TOM.Net API once set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.