Deleting data after module remove

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/1/2011 8:37:59 PM
Gravatar
Total Posts 52

Deleting data after module remove

Hello,

I've been developing a component for mojoPortal and have achieved mostly all my goals and seems to be working correctly. In the final development process I was willing to remove the module data if a module is removed. Searching in the mojoPortal code I have concluded that this can be done by adding to the module config file, in the featureDefinition section a line like:

deleteProvider="GiftListContentDeleteHandler"

And then defining a class like:

namespace clemkey.Web
{
    public class GiftListContentDeleteHandler : ContentDeleteHandlerProvider
    {
        public GiftListContentDeleteHandler()
        { }
        public override void DeleteContent(int moduleId, Guid moduleGuid)
        {
             GiftList.DeleteByModule(moduleGuid);
        }
    }
}

And the last step is to add a file giftlistdeletehandler.config in the path Setup\ProviderConfig\contentdeletehandlers with this data:

<?xml version="1.0" encoding="utf-8" ?>
<ContentDeleteProviders>
<providers>
  <add name="GiftListContentDeleteHandler"
    type="clemkey.Web.GiftContentDeleteHandler, clemkey.Web.UI"
    description="Deletes related content when a module is deleted" />
</providers>
</ContentDeleteProviders>

Nice try, but it does nothing, It never calls the DeleteContent procedure. I've been searching for information about the deleteProvider in the web but I can not find anything about it. What I am missing?

Thanks,

Carlos

9/5/2011 6:13:17 AM
Gravatar
Total Posts 52

Re: Deleting data after module remove

Solved, sorry for the question. The delete handler name was incorrect in the giftlistdeletehandler.config file. It should be:

<?xml version="1.0" encoding="utf-8" ?>
<ContentDeleteProviders>
<providers>
  <add name="GiftListContentDeleteHandler"
    type="clemkey.Web.GiftListContentDeleteHandler, clemkey.Web.UI"
    description="Deletes related content when a module is deleted" />
</providers>
</ContentDeleteProviders>

You must sign in to post in the forums. This thread is closed to new posts.