我在Multimedia项目上使用DD4T,并在存储配置中使用以下配置,以便将二进制文件(在本例中是任何存储在多媒体组件中的二进制文件)发布到文件系统,但将页面保存在内容传递数据库中。
我发现,随着所需二进制文件(例如客户希望提供Adobe文件供下载)的需求发生变化,我需要通过更改配置和重新启动部署程序来向列表中添加更多类型,这并不理想。
<ItemTypes defaultStorageId="defaultdb" cached="false">
<Item typeMapping="Page" cached="false" storageId="defaultFile"/>
<Publication Id="9" defaultStorageId="defaultdb" cached="true">
<Item typeMapping="Binary" itemExtension=".jpg" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".gif" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".pdf" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".doc" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".docx" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".xls" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".xlsx" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".xlsm" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".jpeg" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".png" storageId="defaultFile" cached="true"/>
<Item typeMapping="Binary" itemExtension=".ico" storageId="defaultFile" cached="true"/>
</Publication>
</ItemTypes>有人能告诉我,是否有一种方法可以改变上面的内容,使所有多媒体组件的内容,为给定的发布到文件系统?我似乎在文档中找不到这个。
发布于 2013-01-27 23:43:26
据我所知,指定的越少,过滤的就越少。您试过完全省略itemExtension属性吗?我希望这适用于任何延期。
发布于 2013-01-27 23:51:15
我们在配置中使用了以下内容,并在不需要更改存储配置的情况下获取我们添加的任何新的二进制文件类型:
<Item typeMapping="Binary" storageId="defaultStaticFile" cached="false"/>您只需要更新才能使用您的存储端点和所需的缓存设置:
<Item typeMapping="Binary" storageId="defaultFile" cached="true"/>发布于 2013-01-27 23:44:36
只要去掉itemExtension节点,它就会将所有二进制文件部署到该存储id中。扩展实际上只适用于例外情况。
https://serverfault.com/questions/472884
复制相似问题