我有一个自定义解析器,适用于 Publication , StructureGroup , Page 和 Component 类型的项目>。代码按预期运行,但我不清楚代码何时被调用。 我的 Tridion.ContentManager.config 文件包含以下摘录:
<resolving>
<mappings>
<clear/>
<add itemType="Tridion.ContentManager.CommunicationManagement.Page">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.PageResolver" 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>
<add itemType="Tridion.ContentManager.CommunicationManagement.PageTemplate">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.PageTemplateResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
</resolvers>
</add>
<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>
<add itemType="Tridion.ContentManager.CommunicationManagement.ComponentTemplate">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.ComponentTemplateResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.CommunicationManagement.Publication">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.PublicationResolver" 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>
<add itemType="Tridion.ContentManager.CommunicationManagement.StructureGroup">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.StructureGroupResolver" 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>
<add itemType="Tridion.ContentManager.ContentManagement.Category">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.CategoryResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
</resolvers>
</add>
</mappings>
</resolving>
当我发布 Publication , StructureGroup 或 Page 时,我的自定义解析器会被调用一次(这是我所期望的),但是当我发布了一个组件( Schema ,它链接到一个组件模板,它生成动态组件演示)自定义解析器被调用两次。
这是预期的行为吗?如果没有,有人可以建议为什么我的Resolver第二次被召唤?
答案 0 :(得分:5)
为Component调用一次Resolver,为与Component的Schema关联的每个Component Template调用一次。为该Schema添加额外的CT会将调用次数增加到三次。
目前尚不清楚这是一个错误还是设计错误,但解释了通话次数。有趣的是自定义解析器仅在取消发布组件时调用一次
答案 1 :(得分:1)
我观察到为每个发布目标调用了一个自定义解析器,该目标是当前发布操作的“范围内”。