1
在生產環境中,我想從內容交付服務器發佈用戶生成的內容。我無法直接訪問主數據庫。如何以編程方式從Content Delivery Sever在SiteCore 8.0中發佈項目?
我可以使用Item Web API創建項目,但我無法找到關於如何發佈項目的任何示例。
感謝
在生產環境中,我想從內容交付服務器發佈用戶生成的內容。我無法直接訪問主數據庫。如何以編程方式從Content Delivery Sever在SiteCore 8.0中發佈項目?
我可以使用Item Web API創建項目,但我無法找到關於如何發佈項目的任何示例。
感謝
雖然不建議它從主內容移動到網絡CD服務器上,但你可以做以下。
您需要使用sitecore.services.client api。在客戶端API的更多信息,https://sdn.sitecore.net/upload/sitecore7/75/developer's_guide_to_sitecore.services.client_sc75-a4.pdf
找到打開檢索項目的HttpRequest
的「http:/// Sitecore的/ API/SSC /項目/路徑= {}路徑數據庫&語言&版本& includeStandardTemplateFields & includeMetadata &領域
獲取內容的主數據庫,然後對Web數據庫是這樣的更新。
Database web = Sitecore.Configuration.Factory.GetDatabase("web");
Database[] databases = new Database[1] { db };
Sitecore.Handle publishHandle = Sitecore.Publishing.PublishManager.PublishItem(item, databases, db.Languages, true, false);
您需要修復語法,它只是方向。
所以簡而言之,你想從CD發佈到CM(網頁到主) –