通过 C# 自定义 Sharepoint 2007 表单
您好,感谢您的浏览!
背景
我正在为一个大客户构建一个商业 Web 应用程序,该客户要求我们使用他们现有的 SharePoint 许可证,因为他们已经支付了费用。
此应用程序的 SharePoint 层(在也运行 SP 的 Web 服务器上运行)是用 C# Asp.Net 2.0 编写的。除此之外,我们正在用 C# 和 Asp.net 4 编写一个 ASP.Net MVC 3 应用程序,尽管我们通常会构建一个不错的核心库、Web 前端、中间有实体的 MSSQL 后端等,但我们坚持使用 Sharepoint 2007 作为后端,最终成为 CMS。
所以——我们将 SP 作为服务层。它唯一的工作是用 JSON 对象响应数据请求,然后我们的 MVC3 应用程序通过使用现代 LINQ、Lambda 等从 JSON 构建实体来获取数据。
问题
我们发现自己必须构建数据表(其中将作为 SharePoint 列表存在于 SharePoint 中)以符合最终用户管理内容的方式。因此,从本质上讲,每个表中需要有比正常数量更多的列来保存通常基于关系的数据。是的——我知道有关查找列表的所有信息,谢谢。
在现代世界中,我们将利用多个数据表,构建实体/模型,然后从该实体呈现一个表单,最终用户可以使用该表单来更新各种数据。
在 SharePoint 世界中,不幸的趋势是构建一个巨大的表,以便从中提取的表单将模仿一个精心规划的实体。
我认为答案在于使用 SharePoint Designer 2007 创建从多个表中提取的自定义表单,并允许一点逻辑和灵活性,但我不喜欢使用此工具(我必须通过 RDC 来完成)来创建表单。我更愿意根据我在正在构建的开发工具中构建的实体自动创建这些表单。所以。 。 。
我的问题
鉴于我已经拥有强大的代码生成技术,其中包括通过 C# 代码创建 SharePoint 列表等,是否有一种方法(通过 C#)无需通过 SharePoint Designer 即可创建 SharePoint 自定义表单?
换句话说,我已经编写了代码,允许我按照 SQL 中的方式创建数据表(SharePoint 列表),然后生成数据实体模型和用于发出 JSON 响应的相应代码。现在,我只需要自动化构建自定义 SharePoint 表单的过程,将我的模型(基于多个 SharePoint 列表)与同一工作流程联系起来。我可以通过 SharePoint Designer 完成此操作,但如何在 C# 中完成此操作?
非常感谢!
马特
Hello and thanks for looking!
Background
I am building a commercial web application for a large client that requires us to use their existing SharePoint license since they have paid for it.
The SharePoint layer of this application (running on the webserver that also runs SP) is written in C# Asp.Net 2.0. Outside of that, we are writing an ASP.Net MVC 3 app in C# and Asp.net 4 and, although we would normally build a nice core library, web front-end, MSSQL backend with entities in the middle, etc, we are stuck with Sharepoint 2007 as a backend and ultimately a CMS.
So--we are making SP the service layer. It's only job is to respond to requests for data with JSON objects, then our MVC3 app takes it from there by building entities from the JSON, using modern LINQ, Lambdas, etc.
The Problem
We find ourselves having to structure the data tables (which will live in SharePoint as SharePoint Lists) to conform to the way in which the end-users will manage the content. So, in essence, this necessitates a larger-than-normal amount of columns in each table to hold data that would normally be relational based. Yes--I know all about look-up lists, thanks.
In the modern world, we would draw on multiple data tables, build an entity/model, and then render a form from that entity which the end-user could use to update the various data.
In the SharePoint world, the unfortunate tendency is to build an enormous table so that a form drawn from it will mimic a well-planned entity.
I suppose that the answer lies in using SharePoint Designer 2007 to creat custom forms that pull from multiple tables and allow for a little logic and flexibility, but I do not care to use this tool (which I must do via RDC) for form creation. I would much rather automate the creation of these forms based on the entity that I construct in a development tool I am building. So. . .
My Question
Given that I already have robust code-generation technologies, which includes the creation of SharePoint lists and such via C# code, is there a way (through C#) to create SharePoint custom forms without going through SharePoint Designer?
In other words, I have already written code that allows me to create the data tables (SharePoint Lists) the way they would be in SQL, then generate the data entity model and corresponding code for issuing a JSON response. Now I just need to automate the process of building a custom SharePoint Form that ties my model, which is based on multiple SharePoint Lists, to that same work flow. I can accomplish this through SharePoint Designer, but how do I do it in C#?
Many Thanks!
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于自定义列表表单,您可以选择开发 - 自定义呈现模板。这些是 ascx 文件,因此如果您有标准化布局等,您很可能能够在某种程度上自动生成代码。
For custom list forms you have an option of developing - Custom Rendering Templates. These are ascx files and hence if you have standardized layouts etc, you may very well be able to automate the code generation to some extent.