Order Management SDL Tridion 2011 Custom Resolvers

I have a custom Resolver configured for SDL Tridion 2011, which is designed to prevent the publication of pages and components that use the multimedia component when the user publishes the associated multimedia component. This custom resolver replaces the old event handler, which looks like this:

private void MMCmpPublishHandler(Component source, PublishEventArgs args, EventPhases phase) { if (source.ComponentType == ComponentType.Multimedia) { args.PublishInstruction.ResolveInstruction.IncludeComponentLinks = false; } } 

An old event handler was called, which was called before resolvers was called. I configured my new resolver to start it after default by setting the Tridion.ContentManager.config file with the following extraction:

 <add itemType="Tridion.ContentManager.ContentManagement.Component"> <resolvers> <add type="Tridion.ContentManager.Publishing.Resolving.ComponentResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/> <add type="UrbanCherry.Net.SDLTridion.CustomResolvers.DynamicBinaryLinkResolver" assembly="UrbanCherry.Net.SDLTridion.CustomResolvers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e7729a00ff9574fb"/> </resolvers> </add> 

The code works fine, although it seems intuitive (in terms of performance) to place a new resolver after the default recognizer, since by default the recognizer takes time to find all the allowed elements only so that they are all deleted again.

I tried to reorder the resolvers so that a new resolver is called first, but the new resolver is never called, and the following error appears in the event log:

 Object reference not set to an instance of an object. Component: Tridion.ContentManager.Publishing Errorcode: 0 User: NT AUTHORITY\SYSTEM StackTrace Information Details: at Tridion.ContentManager.Publishing.Resolving.ResolveEngine.ResolveItems(IEnumerable`1 items, ResolveInstruction instruction, IEnumerable`1 contexts) at Tridion.ContentManager.Publishing.Resolving.ResolveEngine.ResolveItem(IdentifiableObject item, ResolveInstruction instruction, PublishContext context) at Tridion.ContentManager.Publishing.Handling.DefaultPublishTransactionHandler.HandlePublishRequest(PublishTransaction publishTransaction) at Tridion.ContentManager.Publishing.Handling.DefaultPublishTransactionHandler.ProcessPublishTransaction(PublishTransaction publishTransaction) at Tridion.ContentManager.Publishing.Publisher.QueueMessageHandler.HandleMessage() 

Does anyone know if a custom resolver can be called up to the default resolution, and if not, can you suggest an effective way to achieve the same behavior as the old event handler?

+4
source share
2 answers

We opened a request for an incident with Tridion SDL support. Below you will find the answer:

The R&D department has confirmed that the problem you discovered is a defect looking with the switch to SP1. Now it is no longer possible to place a custom resolver in front of the default resolution. The release is expected in a future release.

+5
source

Of course, you can call your resolver first, but you will need it to create an initial list of allowed items. Since this is basically what the default recognizer already does, it makes no sense to try to add your data in front of you in my mind.

So, yes, in terms of performance, it would be wiser to just have your own resolver and replace it by default. But then you really have to decompile the standard version and rewrite it with your logic. Which is a counter product, of course, given that patches and updates mean that your recognizer code may change in the future.

I found that the resolvers are actually so fast that I ignored the effect of performance on deleting several items that were deleted to me in mine. It is realistic only to add items to the list, and then you remove several of these items from the list again.

+3
source

Source: https://habr.com/ru/post/1403702/


All Articles