【问题标题】:Sitecore publishing to webcm database hangsSitecore 发布到 webcm 数据库挂起
【发布时间】:2014-11-12 07:06:40
【问题描述】:

我自定义了站点核心内容项的发布过程,确保在发布内容项本身时发布 /sitecore/media library/ 目录中的相关媒体项。问题是,相关媒体项目可以正常发布到 web 数据库,但在发布到 webcm 数据库时会挂起。这有什么原因吗?

这是我将内容项的相关媒体项发布到 web 和 webcm 数据库的代码:

    private void PublishItemAsynchronously(ref Item sourceItem, ref Item mediaItem, PublishItemContext context)
    {
        String databaseName = "webCM";
        try
        {

            if (Sitecore.Configuration.Factory.GetDatabase(databaseName) != null)
            {
                PublishOptions options = new PublishOptions(mediaItem.Database, Factory.GetDatabase(databaseName),
                                                            PublishMode.Smart, mediaItem.Language, DateTime.Now);
                options.RootItem = mediaItem;
                options.Deep = false;
                new Publisher(options).PublishAsync();

                Sitecore.Diagnostics.Log.Info("___________  Inside PublishRelationsAction::PublishItemAsynchronously(...), just published from webCM ", this);
            }

            databaseName = "web";
            PublishOptions options2 = new PublishOptions(mediaItem.Database, Factory.GetDatabase(databaseName),
                                                         PublishMode.Smart, mediaItem.Language, DateTime.Now);
            options2.RootItem = mediaItem;
            options2.Deep = false;
            new Publisher(options2).PublishAsync();

            Sitecore.Diagnostics.Log.Info("___________  Inside PublishRelationsAction::PublishItemAsynchronously(...), just published from web ", this);
        }
        catch (Exception ex)
        {
            ....
        }
    }

知道为什么 webcm 数据库发布挂起,而所有发布到 web 数据库都可以正常工作吗?以上两个日志语句都出现在我的日志文件中。

【问题讨论】:

  • 您的日志文件中是否有任何错误?你能在发布管道中添加一个记录器来查看它是否真的通过管道运行吗?
  • 这里的webcm数据库角色是什么?你是如何创建这个数据库的?
  • 如果您删除此代码,您能否成功发布到 webcm?您是否将所有正确的 <database> 条目添加到 web.config,即 web 的副本?

标签: sitecore sitecore6 sitecore-media-library


【解决方案1】:

禁用发布状态管理器可解决此问题。 您可以通过注释掉的内容来禁用它 /App_Config/Include/Sitecore.SharedSource.AdvancedPublishDialog.config

【讨论】:

    猜你喜欢
    • 2013-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多