Sitecore发布到webcm数据库挂起
我已经定制了sitecore内容项的发布过程,方法是确保在发布内容项时发布/sitecore/media library/目录中的相关媒体项。问题是,相关媒体项可以很好地发布到web数据库,但在发布到webcm数据库时会挂起。有什么原因吗 以下是我将内容项的相关媒体项发布到web和webcm数据库的代码:Sitecore发布到webcm数据库挂起,sitecore,sitecore6,sitecore-media-library,Sitecore,Sitecore6,Sitecore Media Library,我已经定制了sitecore内容项的发布过程,方法是确保在发布内容项时发布/sitecore/media library/目录中的相关媒体项。问题是,相关媒体项可以很好地发布到web数据库,但在发布到webcm数据库时会挂起。有什么原因吗 以下是我将内容项的相关媒体项发布到web和webcm数据库的代码: private void PublishItemAsynchronously(ref Item sourceItem, ref Item mediaItem, PublishItemC
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数据库的工作正常吗?上述两条日志记录语句都显示在我的日志文件中。禁用发布状态管理器可解决此问题。 您可以通过注释掉的内容来禁用它
/App\u Config/Include/Sitecore.SharedSource.AdvancedPublishDialog.Config
您的日志文件中有任何错误吗?您能否向发布管道中添加一个记录器,以查看它是否确实在管道中运行?这里的webcm数据库角色是什么?你是如何创建这个数据库的?如果你删除了这个代码,你就能成功地发布到webcm了吗?您是否已将所有正确的
条目添加到web.config,即web
的副本?