将内容类型添加到所有文档库

编程入门 行业动态 更新时间:2024-10-12 20:22:35
本文介绍了将内容类型添加到所有文档库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们有数百个文档库,分布在MOSS 2007 SharePoint网站的各个网站集中.

We have hundreds of document libraries, spread all throughout various site collections in a MOSS 2007 SharePoint site.

问题是,除了新文档"和新文件夹"内容类型之外,我还想添加内容类型:链接到文档"内容类型(0x01010A).这种新的内容类型应该适用于所有现有和新的文档库.

The problem is, that I want to add Content Type to show up in addition to the "New Document" and "New Folder" content types: the "Link to a Document" content type (0x01010A). This new content type should should up for all existing and new document libraries.

我尝试过的事情:

我认为我可以将以下内容添加到<ContentTypes></ContentTypes>节点内部的schema.xml中:

I thought that I would be able to add the following to a schema.xml somewhere inside the <ContentTypes></ContentTypes> node:

<!-- Link to Document Content Type --> <ContentTypeRef ID="0x01010A" />

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\Publishing\Pages\schema.xml

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\DocumentLibrary\DocLib\schema.xml

这似乎已将内容类型添加到库中,确定,但是它并未显示在新建"菜单下(仍然仅显示文档"和文件夹"内容类型).如果我设置为允许管理内容类型?"设置为是",它就会显示出来.

This seems to have added the content type to the libraries OK, but it doesn't show up under the New menu (still just displays the "Document" and "Folder" content types). If I set "Allow management of content types?" to "Yes" then it shows up.

tl;博士

问::如何将链接到文档"内容类型添加到所有文档库中,并将其显示在新建"菜单中?

Q: How do I add the "Link to a Document" content type to all document libraries and have it show up in the New menu?

推荐答案

进行更多调查后,我发现通过更改..\12\TEMPLATE\FEATURES\DocumentLibrary\DocLib\schema.xml可以将链接到文档"内容类型添加到所有新文档库中.更改schema.xml,然后执行IISRESET不会更改现有的库.

After doing some more investigation, I found out that by changing ..\12\TEMPLATE\FEATURES\DocumentLibrary\DocLib\schema.xml I could add the Link to a Document content type to all NEW document libraries. Changing the schema.xml and then doing an IISRESET did not change existing libraries.

为此,我的schema.xml的开始看起来像这样:

In order to do this, the beginning of my schema.xml looked something like this:

<?xml version="1.0" encoding="utf-8"?> <List xmlns:ows="Microsoft SharePoint" Title="$Resources:shareddocuments_Title;" Direction="$Resources:Direction;" Url="Shared Documents" BaseType="1" EnableContentTypes="TRUE"> <!-- Link to Document Content Type - Added EnableContentTypes="TRUE" --> <MetaData> <ContentTypes> <ContentTypeRef ID="0x0101"> <Folder TargetName="Forms/Document" /> </ContentTypeRef> <ContentTypeRef ID="0x0120" /> <!-- Link to Document Content Type --> <ContentTypeRef ID="0x01010A" /> </ContentTypes>

由于这不会更改现有文档库,因此我需要编写一个控制台应用程序,该应用程序使用其他两个答案中指定的代码来更新每个库.

Since this didn't change existing document libraries, I will need to write a console application that uses the code specified in the other two answers to update each library.

更多推荐

将内容类型添加到所有文档库

本文发布于:2023-11-28 12:13:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642353.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类型   文档   内容

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!