IContentLifecycleManager vs ILifecycleManager

Posted by Community Admin on 04-Aug-2018 15:07

IContentLifecycleManager vs ILifecycleManager

All Replies

Posted by Community Admin on 18-Jan-2013 00:00

Not really sure how to start.  

I have a custom module with two content types (two data models) both implementing Lifecycle.

I am trying to use one manager to handle both content types.  I can implement IContentLifecycleManager  for both types in one manager and it the manager to handle check in/check out of each content type separately. But...

IContentLifecycleManager  is deprecated.  And we are supposed to use the LifecycleDecorator right?  But how can only one LifecycleDecorator  be used for two different content types??  In the example below a content type needs to be supplied:

public ILifecycleDecorator Lifecycle
   
        get
       
            return LifecycleFactory.CreateLifecycle<ContentType#1>(this, new Action<Content, Content>(this.Copy));
       
   

So how do you supply two decorators?





Posted by Community Admin on 22-Jan-2013 00:00

Hello Victor,

If you want to have artificial relation between two content types (for example when you create Type1 item you need to automatically create Type 2 item and when you delete one - to delete the other automatically) you may write a custom decorator that inherits the LifecycleDecorator for the creation and handle Provider_Executing event of DynamicModuleManager on ApplicationStart for the deletion. On the other hand from 5.1 we had hierarchical types which support cascade delete (when you delete the parent the child is deleted as well).

Furthermore, the following KB article might be useful.

Kind regards,
Stefani Tacheva
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 26-Jan-2013 00:00

Just curious, in what situations you need to create custom module with two content types?
In your custom module project you have 2 view-models, 2 services, 2 definitions, right?

Posted by Community Admin on 28-Jan-2013 00:00

One example would be a gym.  They might have multiple locations (one content type), each location might offer different classes (another content type), each class might be taught by different instructors (again, another content type).

There are also a number of relationships involved.  It gets pretty complicated having multiple view models, multiple services (which sometimes overlap due to the relationships).

So up to now its been easier to create all the content types using module builder and then manually customizing all the config files and custom fields, but this approach makes installing the same module on different sites a bit of a challenge, so I was looking for something to make the installation a little easier, so I thought I'd package the whole thing into a custom module.

Posted by Community Admin on 30-Jan-2013 00:00

Good thinking. As far as I understand, in first message you tried to understand if it is possible to do in module that built manually (like Products from SDK). And as workaround, so far, you are using Module Builder with manual configuration adjustments. Right?

BTW did you ever play with custom membership providers? Would you mind to send me your email here info@webbywell.com? So we could have additional way to communicate besides this Forum. Good advice will save TONS of time, especially when the documentation is so-so :).  Thanks! Denis.

Posted by Community Admin on 30-Jan-2013 00:00

Denis, I sent you an email with my contact info.

This thread is closed