Wss3sdk: update content type

Source: Internet
Author: User
WSS allows us to modify a content type, even if it has been deployed to a website, added to the List, or assigned to a list item. We can also ensure that these changes can be propagated to the subcontent type of the website content type.
Method for updating content types

There are two standard methods to update the content type. Before updating the content type, we need to select an optimal method as needed:

  • Method 1:Make necessary changes to the content type, and then push the changes to all subcontent types. If you need to make targeted content types in use, it is best to use discrete modifications.

    Each content type contains a reference to its parent content type. This allows Windows SharePoint Services to disseminate or push changes made to the parent content type to the Child content type. When you change the website content type, you can choose to push these changes to all children.

    For example, you need to add a column to the content type of a website. You can add a column to the content type of the website, and then use the push function to ensure that the column is added to all subcontent types. This includes other website content types based on this content type and list content types based on this type.

  • Method 2:Create a new content type, make necessary modifications, and deploy it to all the places where the previous content type appears, and then add the previous content type to the _ hidden content type group.

    This method is used when you want to replace a content type with a revision, but you also want to retain the original list items that specify this content type.

    For example, assume that you have a product specification content type namedProductspecIt has been used in the company for many years. The demand for product specifications has changed. You need to create a new content type to cover these new requirements. For historical reasons, you must keep the existingProductspecContent type, because many data items have been specified for this content type over the years. In this case, you can create a new content type,Productspec2007, Based on the existingProductspecContent type. Then you canProductspec2007Package content type into feature and writeCodeCentralized deployment and activation on the websiteProductspec2007Add content type to originalProductspecContent types are added to each site and list. Finally, you can write code settingsProductspec The hidden attribute of the content type isTrue. Now, you can chooseProductspec2007Content type;ProductspecThe content type will not appear in the new drop-down list. However,ProductspecThe content type still exists in the added site and list, and the list items that specify the content type still exist and remain unchanged.

Storage content type update

Windows SharePoint Services does not write the changes to the content type back to the definition file of the content type. On the contrary, Windows SharePoint Services stores updates in Windows SharePoint Services database entries.

All content types are stored as Windows SharePoint Services database entries. This is because when I add the website content type to the list, WSS copies the website content type to the category content type and stores it in the list.

Note:: Do not modify the content type definition file when it has been deployed and activated. WSS does not track changes in content type definition files. Therefore, there is no relevant method to push this change to the subcontent type. Update the sealed content type

The sealed content type cannot be modified through the user interface or object model. If you must update a sealed content type, you must set the sealed attribute of this content typeFalseAnd then modify it. Do not directly edit the content type definition file.

You must have the website administrator permission to set the sealed attribute of the spcontenttype object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.