以编程方式编辑 Sharepoint Wiki 内容 [英] Programmatically editing Sharepoint Wiki content

查看:60
本文介绍了以编程方式编辑 Sharepoint Wiki 内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式编辑我的 Sharepoint Wiki 内容.优势之一是自动向 Wiki 环境添加索引.

I'd like to edit my Sharepoint Wiki content programmatically. One of the advantages would be to add indexes to the Wiki environment automatically.

有没有人能做到这一点?语言无关紧要,但要寻找脚本解决方案.

Has anyone been able to do this? Language doesn't matter, but looking for scripting solution.

推荐答案

SharePoint wiki 只是一种特殊类型的文档库.在尝试这样做时,我遇到了一些奇怪的事情.

A SharePoint wiki is just a special type of document library. There's just a few oddities I've run into when trying to do this.

SharePoint Wiki 页面由模板文件和列表项组成.查看页面时,列表项中的字段将插入到模板文件中.因此,要更新 wiki 页面,您只需更新列表项中的正确字段.(顺便说一句,这也意味着您无法像获取普通文档库中的文件一样获取原始模板.到目前为止,我发现获取模板本身的唯一方法是通过 SharePoint Designer 下载它.)

A SharePoint wiki page consists of a template file and a list item. When you view the page, fields from the list item are inserted into the template file. So to update a wiki page, you just have to update the correct fields in the list item. (Incidentally, that also means you can't get at the original template like you could a file in a normal document library. So far, the only way I've found to get the template itself is to download it through SharePoint Designer.)

此外,当您以编程方式访问列表项时,SharePoint 会自动呈现 Wiki 内容.因此,我永远无法获得包含[[我的链接名称]]"的内容,例如——SharePoint 将始终返回呈现的 HTML,例如:

Also, SharePoint automatically renders the wiki content when you access the list item programmatically. So, I was never able to get the content that contained "[[My Link Name]]," for example--SharePoint would always return the rendered HTML instead, like:

<A class=ms-wikilink href="/MyWikiLibrary/MyLinkName.aspx">My Link Name</A>

不过,通过一些正则表达式工作,您应该能够将其转换回原始 wiki 内容.

With a little regex work you should be able to convert this back to the original wiki content, though.

这篇关于以编程方式编辑 Sharepoint Wiki 内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆