The lists and libraries for a particular site definition are defined in two places: ONET.XML and the LISTS folder. ONET.XML provides the hooks for lists, whereas the content within the LISTS folder provides the list definition. Because we have already explored ONET.XML in Chapter 2, we will focus our attention on the LISTS folder. The LISTS folder is shown in Figure 3.1. Each subfolder defines the functionality of a particular list type. ANNOUNCE defines announcements, DOCLIB defines document libraries, and WEBTEMP defines custom site templates. SharePoint's list definitions are more fully described in Table 3.1. Figure 3.1. LISTS folder for the STS site definition.
The commonality between lists and libraries is that each definition has one SCHEMA.XML file and many other supporting files. SCHEMA.XML defines the initial views, forms, toolbar, and special fields. The other files support the SharePoint web user interface and dialogs that appear in Microsoft Office applications. The DOCLIB folder files, which include SCHEMA.XML, are shown in Figure 3.2. Figure 3.2. DOCLIB folder for the STS site definition.In the case of a document library, these other files drive the web user interface. The ASPX files listed in Figure 3.2 are copied to the virtual Forms folder shown in Figure 3.3. These ASPX files provide the SharePoint web user interface for the document library. The templated.doc file was copied to the Forms folder through the Document-Templates section of ONET.XML. Figure 3.3. Document library virtual Forms folder.One of the publicized drawbacks of site definition templates when compared to custom templates is that lists and libraries cannot be prepopulated with content. However, that is not completely true. As you can see in Figure 3.3, the Forms folder was prepopulated with several files. The process that copied those files to the Forms folder can be amended to copy additional files to any location within the document library. The drawback is that all these files appear hidden within all views of the document library except the Explorer view. The only files we have yet to discuss are EDITDLG.HTM and FILEDLG.HTM. Microsoft Office applications use these files to assist in the file saving process when the repository is a document library. FILEDLG.HTM rendered through Microsoft Word is shown in Figure 3.4. EDITDLG.HTM rendered through Microsoft Word is shown in Figure 3.5. Figure 3.4. Document library FILEDLG.HTM.EDITDLG.HTM is displayed only when there are library fields (columns) that must be filled out. Thus, we need to create a required column in our document library for Figure 3.5 to render. Figure 3.5. Document library EDITDLG.HTM.FILEDLG.HTM and EDITDLG.HTM are not directly browsable as the ASPX pages were. Because they were designed to be accessed exclusively from Microsoft Office, SharePoint obfuscates access to them. EDITDLG.HTM is accessible through /MySite/_vti_bin/owssvr.dll?location=MyDocLib/MyDoc.doc&dialogview=SaveForm, while FILEDLG.HTM is accessible through /MySite/_vti_bin/owssvr.dll?location=MyDocLib&dialogview=FileSave. It should be noted that the FILEDLG.HTM in the Layouts folderwhich is a different file from the one in our list definitionis rendered when no location parameter is specified. This is shown in Figure 3.6. Figure 3.6. FILEDLG.HTM from the Layouts folder. |