Wiki ページをある SharePoint サイトから別のサイトに複製する際に問題があります。CSOM (クライアント側オブジェクト モデル) と次の (簡略化された) コードを使用しています。
var fileCreationInformation = new SP.FileCreationInformation();
string page = EXTRACTED VALUE OF THE SOURCE FIELD "wikiField" (string)
byte[] bytes = new byte[page.Length * sizeof(char)];
System.Buffer.BlockCopy(page.ToCharArray(), 0, bytes, 0, bytes.Length);
fileCreationInformation.Content = bytes;
fileCreationInformation.Overwrite = true;
fileCreationInformation.Url = EXTRACTED VALUE OF THE SOURCE FIELD "FileLeafRef" (string)
Microsoft.SharePoint.Client.File uploadFile = oList.RootFolder.Files.Add(fileCreationInformation);
clientContext.Load(uploadFile);
clientContext.ExecuteQuery();
私の問題はコピー後です。新しい wiki ページが作成され、コンテンツは完全に表示されますが、クイック起動とリボンはありません。表示されるのは私の生のコンテンツ(xmlページのみのXMLなど)だけで、ちょっと醜いです:)
どうすればこの問題を解決できますか? 私は何かを見逃していますか、それとも間違った方法で問題に取り組んでいますか?
前もって感謝します!
ニコラス