gpt4 book ai didi

sharepoint-2007 - 如何在 SharePoint 2007 的网站定义中将文件添加到文档库?

转载 作者:行者123 更新时间:2023-12-04 06:55:39 25 4
gpt4 key购买 nike

我正在为 SharePoint 2007 进行站点定义。创建站点时,还会创建一个名为“Folder2”的文档库。现在,我需要将一些文档添加到此文档库中,并在文档库标准 View 中显示为项目。

我的代码是:

<Lists>
<List FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101" Type="101" Title="Folder2" Url="Folder2">
<Data>
<Rows>
<Row>
<Field Name="Name">MyFile.txt</Field>
<Field Name="Title">MyFile.txt</Field>
<Field Name="FileLeafRef">MyFile.txt</Field>
</Row>
</Rows>
</Data>
</List>
</Lists>

当我看到文档库的项目时,有一个标题为“1_”的元素。有人知道如何在站点定义中添加文件吗?

我使用的 onet.xml 与空白站点相同。

谢谢!!!

最佳答案

对于文档库,而不是数据/行/行,使用模块:

<Lists>  
<List FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101" Type="101" Title="Folder2" Url="Folder2" />
</Lists>
<Modules>
<Module Name="Documents" />
</Modules>

然后在 onet.xml 底部的 Modules 中,您可以按如下方式定义您的 Module:
<Module Name="Documents" Url="Folder2" Path="">
<File Url="MyFile.txt" Name="MyFile.txt" Type="GhostableInLibrary">
<Property Name="Title" Value="MyFile.txt" />
</File>
</Module>

关于sharepoint-2007 - 如何在 SharePoint 2007 的网站定义中将文件添加到文档库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2593905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com