簡體   English   中英

將來自不同CMS的內容導入episerver數據庫

[英]Import content from different CMS into episerver database

我正在努力將舊版CMS遷移到EPiServer CMS上。 我想將內容從舊CMS移到EPiServer的數據庫中。 有人碰到這樣的場景嗎? 我在world.episerver.com上關注他們的文件,但不是很清楚。 它說要在Admin部分的config選項卡下配置EPiServer站點來定義Content Channel。 但他們並沒有詳細討論使用什么API以及不同字段如何在數據庫中映射到EpiServer的數據庫。 任何幫助將非常感激。

您不應該直接復制到數據庫中,因為要正確地完成它是非常困難的。 您需要首先在項目中構建內容類型,然后我認為導入內容的最簡單方法是構建計划任務或使用導入頁面擴展管理界面。 因為您是唯一知道舊CMS中的內容應該在EPiServer中的內容的人,因此您可以自己進行映射。

如果您不熟悉EPiServer,這不是一件容易的事,我認為這可能是聯系專家服務的最快捷方式,然后他們會幫助您最終指導您。

祝好運!!

您可以使用EpiServer的IContenntRepository和IContentTypeRepositoiry以編程方式添加頁面,如下所示:

using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using EPiServer.ServiceLocation;

PageReference parent = PageReference.RootPage;

IContentRepository contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
IContentTypeRepository contentTypeRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentTypeRepository>();

PageData myPage = contentRepository.GetDefault<PageData>(parent, contentTypeRepository.Load("StandardPage").ID);

StandardPage standardPage = contentRepository.GetDefault<StandardPage>(parent);

myPage.Property["PageName"].Value = "Name";
myPage.Property["MainBody"].Value = "My Page";
myPage.Property["PageTypeName"].Value = "Standard Page";
myPage.Property["PagePendingPublish"].Value = true;

myPage.URLSegment = EPiServer.Web.UrlSegment.CreateUrlSegment(myPage);                    

contentRepository.Save(myPage, EPiServer.DataAccess.SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM