SharePoint Study Notes-site definition series-4. Create the schema. xml file of list definition relatively quickly

Source: Internet
Author: User

In the previous article, we roughly analyzed the structure and content of a list definition. A key file is schema. XML. We can see that this file is complex. When using the vs2010 template, vs2010 automatically creates this file for us. Sometimes, we may need to manually create or modify the schema. XML. Is there a way to make this job easier and faster? Two methods are described here:
1. Use list template
First, manually create the list you want on your SharePoint website and complete relevant settings (eg: Various views, sitecolumns, fields, etc, go to the list operation interface on the SharePoint operation interface and save it as a template for use.

Here, to compare the differences, we will directly use the list instance we created based on list definiton in the previous article to save it as a template.

First select the list instance, and then click library settings:

Go to the settings page of library settings, and select Save document library as template.

Enter the required parameters and save the settings.

 

The system will prompt you to go to gallery to view

You can see the list template we just created in Gallery.

 

 

We can click and download this list template and save it to our specified folder. This file will be saved in. STP format.

 

Change the extension name of this file to cab, decompress it, and you can see that it is actually a manifest. xml file. Use vs2010 to open this file and view it. The basic structure of this file is as follows:

 

We can see that the content of the corresponding segment is consistent with the schema of the previous file. the XML content is very similar. Copy it to our custom shcema. XML, and then we can modify it on this basis.

 

Note that the content cannot be copied and copied. You must try and modify the content based on your needs and relevant samples.


Ii. Use site template

You can also use the site template to create schema. xml. The steps are as follows:

First, you can use siteaction to enter the site settings interface.

Select save site as template

 

Enter necessary parameters and save

 

The system will prompt you for success and whether you want to enter solution Gallery.

 

Go to solution gallery and you will see the created template. Select and download and save it.

 

Unlike list template, site template is saved in. WSP format.

 

Download the site template to the specified folder, open our vs2010, create a project, and select import into poin solution package template.

 

Select farm Mode

 

Then the system will ask you which SharePoint solution to import. Please go to the folder where you saved solution, find the solution and import it

 

Find and select the list instance you are concerned about

 

The system will prompt whether it includes other related content that it automatically detects. Select Yes

 

The system is created as follows:

 

 

Find the relevant content for copy and paste, and then create your own schema. XML based on this.

 

 

 

 

 

 

 

 

 

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.