Vulnerability in EPiServer.Forms
When a new media is added we need to identify if this media item is part of a page assets folder and if it is we would like to get the content ID of this page.
We hook onto the PublishedContent-event to identify when a media file is added and form this we can probably find the assets folder by recursively calling ParentLink, but we have not found any way to identify which page this folder belongs to.
How can I find the page ID for a page folder?
Is there a better way of getting the page assets folder for a media file other than the recursive calls for ParentLink?
I think that ContentAssetFolder.ContentOwnerID should contain reference to page or block to which it's "binded" (attached).
Thanks Valdis, that seemed to do the trick!
ContentOwnerID seems to return an content guid. I used PermanentLinkMapStore.Find(Guid guid) as PermanentContentLinkMap to get the ContentReference to the page
Permanent link map always remind me of some *low* level stuff I have to deal :)
What about content resolver?
var resolver = ServiceLocator.Current.GetInstance<IContentResolver>();
var ref = resolver.ResolveContent(guid);
Aah, even better! :) Thanks again, Valdis!