在SharePoint列表中表示父子关系

时间:2023-02-04 08:19:08

I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data. Each parent record will represent a "submission" and each child record will be a "submission item." There's a 1-to-n relationship between submissions and submission items. Is this practical to do in SharePoint? The only types of list relationships I've done so far are lookup columns, but this seems a bit different. Also, once such a list relationship is established, then what's the best way to create views on this kind of data. I'm almost convinced that it'd be easier just to write this stuff to an external database, but I'd like to give SharePoint a shot in order to take advantage of the automated search capabilities.

我需要在我们的SharePoint应用程序中创建一些功能,这些功能使用一些简单的分层数据填充列表或列表。每个父记录将代表“提交”,每个子记录将是“提交项目”。提交和提交项目之间存在一对一的关系。这在SharePoint中是否可行?到目前为止,我所做的唯一类型的列表关系是查找列,但这看起来有点不同。此外,一旦建立了这样的列表关系,那么在这种数据上创建视图的最佳方法是什么。我几乎确信将这些内容写入外部数据库会更容易,但我想给SharePoint一个机会,以便利用自动搜索功能。

8 个解决方案

#1


7  

Proper Parent/Child in Sharepoint is near impossible without developing it yourself. There is one approach to that here: Simulate Parent / Child relationship in SharePoint 2007 with Folders & Content Types

如果没有自己开发,Sharepoint中的正确父/子几乎是不可能的。这里有一种方法:使用文件夹和内容类型模拟SharePoint 2007中的父/子关系

(Note: This concerns SharePoint 2007. In 2010, Joins make this much easier)

(注意:这涉及SharePoint 2007.在2010年,联接使这更容易)

#2


3  

Do it in a separate database, create a page(s) with controls that surfaces the data and run search over that. Loses quite a bit of the SharePoint features though.

在单独的数据库中执行此操作,创建一个页面,其中包含用于显示数据的控件并对其进行搜索。虽然丢失了相当多的SharePoint功能。

Otherwise it may be okay to create a custom field control that will allow you to lookup the data in the other list. The custom field control can be the one to "view" the related data. I know we have done it for parent child relationships between pages on the same list. Not 1-to-N though.

否则,可以创建自定义字段控件,以允许您查找其他列表中的数据。自定义字段控件可以是“查看”相关数据的控件。我知道我们已经为同一列表中的页面之间的父子关系做了这个。虽然不是1对N.

Tough choice either way.

两种方式都很难选择。

#3


2  

My vote is "to write this stuff to an external database"

我的投票是“把这些东西写到外部数据库”

You miss a lot of things in Sharepoint things like transaction support, referential integrity, easy way of updating (compare SQL), reporting (using Reporting Services and a SQL database)... see sharepoint as a way to store documents and simple lists.....

您在Sharepoint中遗漏了许多内容,例如事务支持,参照完整性,简单的更新方式(比较SQL),报告(使用Reporting Services和SQL数据库)...请参阅sharepoint作为存储文档和简单列表的方法。 ....

The argument for Sharepoint is if it is a small application, no requirements on support for transactions, no need to import external data etc...

Sharepoint的论点是,如果它是一个小应用程序,没有支持事务的要求,不需要导入外部数据等...

When people say Sharepoint is a development plattform there is a need to define whjat they think a development plattform is.

当人们说Sharepoint是一个开发平台时,需要定义他们认为开发平台的whjat。

The latest rumours about Sharepoint 2010 tells us that there will be support for SQL server based lists in next version ..... which I think will at least move Sharepoint in the right direction ....

有关Sharepoint 2010的最新传言告诉我们,下一版本将支持基于SQL服务器的列表.....我认为至少会将Sharepoint推向正确的方向......

#4


2  

Take a look at SLAM, SharePoint List Association Manager, an open source project my company created and actively supports. SLAM allows you to synchronize SharePoint data to SQL, including any relationships between lists. SLAM, in addition to being very useful on its own, is really a framework intended to allow developers to create their own complex data associations using what we call SLAM type profiles. We have one out-of-the-box type profile which is part of the open source project which actually allows you to make a SharePoint list hierarchical using the nested set model. For more information, see this page on our codeplex site.

看看我的公司创建并积极支持的SLAM,SharePoint List Association Manager,这是一个开源项目。 SLAM允许您将SharePoint数据同步到SQL,包括列表之间的任何关系。 SLAM除了本身非常有用之外,实际上是一个框架,旨在允许开发人员使用我们称之为SLAM类型的配置文件来创建自己的复杂数据关联。我们有一个开箱即用的类型配置文件,它是开源项目的一部分,它实际上允许您使用嵌套集模型使SharePoint列表分层。有关更多信息,请参阅我们的codeplex网站上的此页面。

#5


0  

I do this a lot just using sharepoint, using a framework called AAA (Activity,Assignment,Artifact), which allows you to use lookup columns to link an assignment or artifact to a parent Activity. You then build a web part page with connected web parts that allow you to filter all assignments and artifacts by activity. For example, click next to a submission in the submission web part, and all of the submission items attached to that submission will show up. Works great.

我只是使用sharepoint,使用一个名为AAA(Activity,Assignment,Artifact)的框架,它允许您使用查找列将赋值或工件链接到父Activity。然后,您构建一个Web部件页面,其中包含已连接的Web部件,允许您按活动筛选所有分配和工件。例如,单击提交Web部件中提交的旁边,将显示附加到该提交的所有提交项。效果很好。

#6


0  

The other approach that you can look at using is persisting XML with a field in the item. This is the approach used by the Podcasting Kit (on CodePlex) to store things like ratings.

您可以使用的另一种方法是使用项目中的字段来持久化XML。这是Podcasting Kit(在CodePlex上)用于存储评级等内容的方法。

#7


0  

One possible method is to create a submission content type based on the folder content type and a submission-item based on item content type. Then you can store data hierarchically like in file system and also will work default views and search functionality.

一种可能的方法是基于文件夹内容类型和基于项目内容类型的提交项目来创建提交内容类型。然后,您可以像在文件系统中一样分层存储数据,还可以使用默认视图和搜索功能。

Other way is to create lookup field that points to same list (list=”self”). This field will be used like reference to parent item and you will get list that contains recursively related data. To use this data programmatically will be ok but using views functionality will be little bit complex.

其他方法是创建指向相同列表的查找字段(list =“self”)。此字段将用作对父项的引用,您将获得包含递归相关数据的列表。以编程方式使用此数据将是正常的,但使用视图功能将有点复杂。

#8


0  

It's easy to do using a connected web part.

使用连接的Web部件很容易。

Create two lists:

创建两个列表:

Parent (Id, Title) Child (Id, Title, ParentId)

父(Id,Title)子(Id,Title,ParentId)

Create a new sharepoint page, add DataFormWebPart (displaying Parent) and another one for Child, set both of them to filter based on a QueryString parameter (use that Parameter to filter Parent.Id, and Child.ParentId) voila, you can display parent-child relationships. Now, adding children is more difficult, and that's the part I haven't worked out yet.

创建一个新的sharepoint页面,添加DataFormWebPart(显示Parent)和另一个用于Child,根据QueryString参数设置它们进行过滤(使用该参数过滤Parent.Id和Child.ParentId)瞧,你可以显示父 - 孩子的关系。现在,添加孩子更加困难,这是我尚未解决的问题。

#1


7  

Proper Parent/Child in Sharepoint is near impossible without developing it yourself. There is one approach to that here: Simulate Parent / Child relationship in SharePoint 2007 with Folders & Content Types

如果没有自己开发,Sharepoint中的正确父/子几乎是不可能的。这里有一种方法:使用文件夹和内容类型模拟SharePoint 2007中的父/子关系

(Note: This concerns SharePoint 2007. In 2010, Joins make this much easier)

(注意:这涉及SharePoint 2007.在2010年,联接使这更容易)

#2


3  

Do it in a separate database, create a page(s) with controls that surfaces the data and run search over that. Loses quite a bit of the SharePoint features though.

在单独的数据库中执行此操作,创建一个页面,其中包含用于显示数据的控件并对其进行搜索。虽然丢失了相当多的SharePoint功能。

Otherwise it may be okay to create a custom field control that will allow you to lookup the data in the other list. The custom field control can be the one to "view" the related data. I know we have done it for parent child relationships between pages on the same list. Not 1-to-N though.

否则,可以创建自定义字段控件,以允许您查找其他列表中的数据。自定义字段控件可以是“查看”相关数据的控件。我知道我们已经为同一列表中的页面之间的父子关系做了这个。虽然不是1对N.

Tough choice either way.

两种方式都很难选择。

#3


2  

My vote is "to write this stuff to an external database"

我的投票是“把这些东西写到外部数据库”

You miss a lot of things in Sharepoint things like transaction support, referential integrity, easy way of updating (compare SQL), reporting (using Reporting Services and a SQL database)... see sharepoint as a way to store documents and simple lists.....

您在Sharepoint中遗漏了许多内容,例如事务支持,参照完整性,简单的更新方式(比较SQL),报告(使用Reporting Services和SQL数据库)...请参阅sharepoint作为存储文档和简单列表的方法。 ....

The argument for Sharepoint is if it is a small application, no requirements on support for transactions, no need to import external data etc...

Sharepoint的论点是,如果它是一个小应用程序,没有支持事务的要求,不需要导入外部数据等...

When people say Sharepoint is a development plattform there is a need to define whjat they think a development plattform is.

当人们说Sharepoint是一个开发平台时,需要定义他们认为开发平台的whjat。

The latest rumours about Sharepoint 2010 tells us that there will be support for SQL server based lists in next version ..... which I think will at least move Sharepoint in the right direction ....

有关Sharepoint 2010的最新传言告诉我们,下一版本将支持基于SQL服务器的列表.....我认为至少会将Sharepoint推向正确的方向......

#4


2  

Take a look at SLAM, SharePoint List Association Manager, an open source project my company created and actively supports. SLAM allows you to synchronize SharePoint data to SQL, including any relationships between lists. SLAM, in addition to being very useful on its own, is really a framework intended to allow developers to create their own complex data associations using what we call SLAM type profiles. We have one out-of-the-box type profile which is part of the open source project which actually allows you to make a SharePoint list hierarchical using the nested set model. For more information, see this page on our codeplex site.

看看我的公司创建并积极支持的SLAM,SharePoint List Association Manager,这是一个开源项目。 SLAM允许您将SharePoint数据同步到SQL,包括列表之间的任何关系。 SLAM除了本身非常有用之外,实际上是一个框架,旨在允许开发人员使用我们称之为SLAM类型的配置文件来创建自己的复杂数据关联。我们有一个开箱即用的类型配置文件,它是开源项目的一部分,它实际上允许您使用嵌套集模型使SharePoint列表分层。有关更多信息,请参阅我们的codeplex网站上的此页面。

#5


0  

I do this a lot just using sharepoint, using a framework called AAA (Activity,Assignment,Artifact), which allows you to use lookup columns to link an assignment or artifact to a parent Activity. You then build a web part page with connected web parts that allow you to filter all assignments and artifacts by activity. For example, click next to a submission in the submission web part, and all of the submission items attached to that submission will show up. Works great.

我只是使用sharepoint,使用一个名为AAA(Activity,Assignment,Artifact)的框架,它允许您使用查找列将赋值或工件链接到父Activity。然后,您构建一个Web部件页面,其中包含已连接的Web部件,允许您按活动筛选所有分配和工件。例如,单击提交Web部件中提交的旁边,将显示附加到该提交的所有提交项。效果很好。

#6


0  

The other approach that you can look at using is persisting XML with a field in the item. This is the approach used by the Podcasting Kit (on CodePlex) to store things like ratings.

您可以使用的另一种方法是使用项目中的字段来持久化XML。这是Podcasting Kit(在CodePlex上)用于存储评级等内容的方法。

#7


0  

One possible method is to create a submission content type based on the folder content type and a submission-item based on item content type. Then you can store data hierarchically like in file system and also will work default views and search functionality.

一种可能的方法是基于文件夹内容类型和基于项目内容类型的提交项目来创建提交内容类型。然后,您可以像在文件系统中一样分层存储数据,还可以使用默认视图和搜索功能。

Other way is to create lookup field that points to same list (list=”self”). This field will be used like reference to parent item and you will get list that contains recursively related data. To use this data programmatically will be ok but using views functionality will be little bit complex.

其他方法是创建指向相同列表的查找字段(list =“self”)。此字段将用作对父项的引用,您将获得包含递归相关数据的列表。以编程方式使用此数据将是正常的,但使用视图功能将有点复杂。

#8


0  

It's easy to do using a connected web part.

使用连接的Web部件很容易。

Create two lists:

创建两个列表:

Parent (Id, Title) Child (Id, Title, ParentId)

父(Id,Title)子(Id,Title,ParentId)

Create a new sharepoint page, add DataFormWebPart (displaying Parent) and another one for Child, set both of them to filter based on a QueryString parameter (use that Parameter to filter Parent.Id, and Child.ParentId) voila, you can display parent-child relationships. Now, adding children is more difficult, and that's the part I haven't worked out yet.

创建一个新的sharepoint页面,添加DataFormWebPart(显示Parent)和另一个用于Child,根据QueryString参数设置它们进行过滤(使用该参数过滤Parent.Id和Child.ParentId)瞧,你可以显示父 - 孩子的关系。现在,添加孩子更加困难,这是我尚未解决的问题。