gpt4 book ai didi

tridion - 控制 SDL Tridion 2011 自定义解析器的顺序

转载 作者:行者123 更新时间:2023-12-04 23:27:43 24 4
gpt4 key购买 nike

我有一个为 SDL Tridion 2011 配置的自定义解析器,旨在防止在用户发布链接的多媒体组件时发布使用多媒体组件的页面和组件。这个自定义解析器正在替换一个旧的事件处理程序,它看起来像这样:

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

过去在调用解析器之前调用旧的事件处理程序。通过使用以下摘录配置我的 Tridion.ContentManager.config 文件,我已将我的新解析器配置为在默认解析器之后触发:
<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>

代码工作正常,尽管将新解析器放在默认解析器之后似乎违反直觉(从性能角度来看),因为默认解析器需要时间来找到所有已解析的项目,只是为了再次将它们全部删除。

我尝试更改解析器的顺序,以便首先调用新的解析器,但从未调用过新的解析器,并且事件日志中出现以下错误:
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()

有谁知道是否可以在默认解析器之前调用自定义解析器,如果不能,您能否提出一种有效的方法来实现与旧事件处理程序相同的行为?

最佳答案

我们已向 Tridion SDL 支持部门提出事件请求。请在下面找到他们的答案:

R&D department have confirmed that the issue you have found is a defect staring with the migration to SP1. It is now no longer possible to place a custom resolver before the default resolver.The issue is expected to be handled in a future release.

关于tridion - 控制 SDL Tridion 2011 自定义解析器的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9892998/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com