WSS 3.0 站点配置
有没有办法进行 WSS 3.0 站点配置? 我的客户的要求是将属性作为变量以 XML 格式定义:组织名称、徽标、地址、用户和角色信息。 客户端应该能够通过在 XML 文件中定义属性来将此 Web 应用程序安装到任何 WSS 生产服务器。
是否可以编写一个实用程序来解析定义良好的 XML 并相应地配置站点?
Is there any way to do WSS 3.0 site provisioning? My client's requirement is attributes as variables that will be defined in XML format: Organization Name, Logo, Address, User and Role information. The client should be able to install this web application to any WSS production server by just defining the attributes in the XML file.
Is it possible to to write a utility to parse that well defined XML and provision the site accordingly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
可以从对象模型配置站点,但创建完全自定义的站点超出了单个问题的范围。 首先,您应该查看 SPWebCollection.Add 以及 SPSiteCollection.Add。
要在您的 Web 应用程序之一中创建网站集和一些子网站,您可以使用如下内容:
It's possible to provision sites from the object model, but creating entirely customized sites is beyond the scope of a single question. To get you started, you should take a look at the SPWebCollection.Add as well as the SPSiteCollection.Add.
To create a site collection and some subsites into one of your web applications, you could use something like this:
是的,有不止一个。
查看位于 Windows SharePoint Services 3.0 工具:Visual Studio 2005 扩展。
您可以创建一个包含您的所有需求(页面、列表、文档库...)的网站,然后生成一个 VS 项目,该项目将使用您的所有网站创建 SharePoint 功能。 然后您可以将该功能部署到任何 WSS 生产服务器。
您可以更改 VS 项目来实现从附加 xml 文件读取属性的逻辑。
如果您的站点结构很简单或者您可以将其另存为模板,您还可以编写一个小型控制台应用程序来读取属性 xml 文件并创建站点。
Yes, there are more than one.
Take a look at SharePoint Solution Generator which is in Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions.
You may create a site with all requirements of yours (pages, lists, document libraries...) and then generate a VS project that will create a SharePoint feature with all of your site. Then you may deploy that feature to any WSS production server.
You may alter the VS project to implement the logic to read your attributes from an additional xml file.
If the structure of your site is plain or you can save it as a template you may also write a small console application that reads the attribute xml file and create the site.
创建常规解决方案,或使用上述解决方案生成器生成 .wsp 文件。 然后创建一个小型控制台应用程序,它需要您提到的变量作为参数。
使用上面列出的代码,从该解决方案配置新的网站集,并将输入的参数(公司名称等)存储在网站的列表中或 SPSite.Properties 属性包中,然后您可以从中在自定义 Web 部件中读取它们ETC..
Create a regular solution, or use the aforementioned solution generator to generate the .wsp file. Then create a small console application, that expects the variables you mentioned as parameters.
With the code listed above, provision the new sitecollection from that solution, and store the entered parameters (Company name etc.) in the site in a list, or in the SPSite.Properties propertybag, from which you can then read them in custom webparts etc..
CodePlex 上提供的 SharePoint 数据填充工具允许您使用 XML 定义站点。
The SharePoint Data Population Tool available on CodePlex allows you to define sites with XML.