Clone Shadow Assets (Data Source Record Set) Workaround


(Josh Hilditch) #1

**Matrix Version: v5.5.6.4

How can I clone a shadow asset (Data Source Record Set asset)? Or alternatively use a trigger to create a new asset that contains the values from the Data Source Record Set asset?

We are using an XML Data Source asset for displaying alerts on the front end as part of an alerts system, when new alerts are added/removed from the XML feed the corresponding child Data Source Record Set shadow asset is added/removed.

We want to create an archive of all previous alerts which means creating a permanent asset in an Archive folder everytime a new item is added to the XML feed.

However I’ve found that simply cloning a shadow asset is impossible which makes sense as they don’t have their own asset id.

Is there a simple or clever way to create a clone (or equivalent new asset) when a new item is added to the xml feed?

I’ve been looking into a few solutions

  • use triggers to create a new asset and populate its metadata with the xml values (I’m not sure this is even possible)

  • use javascript and a frontend asset builder to check for new alerts and build a corresponding asset in an Archive folder (this just seems like a bad way to go about it)

I’m hoping someone has had similar experience with needing to create a clone or a copy of shadow assets and can offer some guidance?

Thanks


(Nic Hubbard) #2

If I were you, I would move the logic outside of Matrix and create another XML feed in your alerts system that creates an XML of the archived alerts.


(Josh Hilditch) #3

Thank for the response Nic, I think your right, was just hoping there was an existing workaround for this sort of thing, but sourcing an alternate xml feed of all alerts is definitely the most efficient way of managing this.
Thanks.