自动创建 SharePoint 列表,无需编写任何代码
作为产品配置的一部分(安装后),我需要在用户指定的 SharePoint 站点上创建一些 Sharepoint 列表。
仔细研究一下,我似乎需要编写自定义代码来执行此操作,可以使用服务器端 API,如 http://sarangasl.blogspot.com/2009/11/create-sharepoint-list-programmatically.html,或使用 SharePoint 列表 Web 服务。但在这两种情况下,我都需要编写代码来执行此操作。
有没有什么开箱即用的方法可以做到这一点,而无需编写任何代码?我理想的解决方案是创建一个具有适当定义的 XML 文件,然后运行 something (传入 SharePoint 网站 url),然后创建列表,并返回指示成功的状态代码或失败。这样的理想解决方案可能吗?
如果没有,最好/最简单的解决方案是什么?以上两者之一,还是其他?
As part of the configuration of my product (after installation), I need to create a few Sharepoint lists on the SharePoint site specified by the user.
Digging around, it seems that i need to write custom code to do this, either using the server-side API as described at http://sarangasl.blogspot.com/2009/11/create-sharepoint-list-programmatically.html, or using the SharePoint List web services. But in both cases, I need to write code to do this.
Is there any out-of-box way to do this, without writing any code? My ideal solution would be to create an XML file which has the appropriate definition, and then run something (passing in the SharePoint site url), which would then create the list, and return a status code indicating success or failure. Is such an ideal solution possible?
If not, what is the best/easiest solution to do this? One of the two above, or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个指定ListInstance的功能,当您激活该功能时,将创建列表:
http://msdn.microsoft.com/en-us/library/ms476062.aspx
Create a feature specifying a ListInstance, when you activate the feature, the list will be created:
http://msdn.microsoft.com/en-us/library/ms476062.aspx
正如弗拉迪所说,我会选择这个功能。
但您也可以安装 Gary Lapointe 的 STSADM 扩展。它包含一个创建列表的命令。然后,您可以编写一个批处理文件来一次性创建所有列表。
I'd go with the feature as Vladi said.
But you can also install the STSADM extensions from Gary Lapointe. It includes a command to create a list. You can then write a batch file that creates all the lists in 1 go.