Stefan Goßner

Senior Escalation Engineer for SharePoint (WSS, SPS, MOSS, SP2010) and MCMS

Blogs

MCMS tip of the day - recovering deleted resources

  • Comments 8
  • Likes

Ever had the problem that you needed to do housekeeping on your MCMS database? Lots of space is often used by resources in resource galleries. So a good idea is to ensure that only used resource gallery items keep stored in the database. MCMS does not provide a public API to identify which resources are used in which posting. But here is a tool that can gathers this information:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=70b4c5bc-ac3f-4885-8af2-bf283edb9159

Using this tool will help to identify which resources are not currently used and which are still used.

But what if you already deleted a resource gallery item that was still used by a posting? You will experience ugly effects like broken images, unwanted authentication prompts and problems during save of the postings. The best would be to just undelete the accidently deleted resource gallery item - but such a function is not included in MCMS out of the box.

The good thing is: Microsoft now provides a solution for this. See here for more details:

http://blogs.technet.com/stefan_gossner/archive/2005/02/23/378718.aspx

Comments
  • Hi Stefan,

    I use an XML placeholder to store our main content and have an html placeholder where I mirror the resources currently on the page(both local and gallery).

    I wanted to know if it would cause strange effects if I were to prevent the mirroring of the resource gallery items.  I mean when the MCMS background job runs.

    I ask because right now it seems that when a user is editing a page and tries to save it after having deleted a resource gallery item that is mirrored on our html placeholder, they are getting the normal "Save Placeholder Failed" error.  They only have access to the xml placeholder content so we end up having to go in manually and removing the bad html placeholder mirrored links to the deleted resource.

    Any thoughts?

  • Hi Brian,

    what do you mean by mirroring? You are not allowed to use references to local attachments or images on a different page.

    So this mirroring would have to be on the same posting.

    the behaviour you see is by design. Deleted resources are not really deleted but moved to the "Archive Folder" where only administrators have rights. That's why you get the error when a non-Admin tries to save the item.

    You need to remove the references to deleted resource gallery items before saving - or better before deleting.

    Cheers,

    Stefan

  • Hi Stefan,

    When I say mirroring, I mean we have 2 placeholders on the same posting. One holds our custom xml that we use to render the content and the other is an html placeholder that holds links to our resources on the page.

    When the user adds a resource to the xml for the posting, we add an html link to the other placeholder so when the MCMS background process runs it can read the resources from the html placeholder as our xml placeholder does not contain normal links.  It contains custom nodes for our images and other resources.  I am told that the background process only knows how to read the links from the html placeholder.

    I am aware of the fact that the resources are still available to admins, but I wanted to know if I can remove that mirroring of resource gallery resources to our html placeholder without causing adverse background process effects that may delete the resources from the gallery causing broken links/images when we still link to it from our xml placeholder.  It appears we only mirror it for when the background process runs to prevent the resource from getting deleted, but it appears that maybe that job does not delete a resource gallery resource when it does not contain a link on any posting html placeholders.  Only when the user deletes it from the gallery.

    Thanks

  • Hi Brian,

    this will lead to inconsistancies!

    First of all: background processing will also look at XML placeholders. But only(!) if the link in the XML placeholder is within quotes.

    So this URL will not be found:

    <myLink>/NR/GUID/0/image.jpg</myLink>

    But these links will be found:

    <myLink>"/NR/GUID/0/image.jpg"</myLink>

    <myLink url="/NR/GUID/0/image.jpg" />

    You should avoid links to resource gallery items without quotes.

    Cheers,

    Stefan

  • Hi Stefan,

    When we create a new posting and click on save, we get a popup which asks us to enter name and display name of the posting.

    Is it possible to disable this?

    I have provided a textbox in the posting page property control whose value will be the name and display name of the posting.

    Regards,

    Ramana

  • Hi Ramana,

    yes this is possible.

    Please send me a mail to webmaster@stefan-gossner.de and I will send you sample code for this.

    Cheers,

    Stefan

  • The first link in this tip has been moved to the MSDN Code gallery, but I can't find it.  Can you direct me?

    I'm having problems with resources deleted using Resource Manager on my authoring server not being deleted on my production server.

    Thanks, John

  • Hi Ramana,

    here is the link:

    http://code.msdn.microsoft.com/Tooltogetdependencyr

    Cheers,

    Stefan

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
Raw Html Fix