Chapter 2. Basic Web Parts

Web Parts are the building blocks of a SharePoint Services site. Every Windows SharePoint Services site consists of one or more Web Parts. Individual Web Parts provide functionality ranging from document storage to complex data entry forms to discussion forums.

All the built-in Web Parts actually derive from the concept of a list. In the most basic sense, a list is a Web Part that displays a sequence of information. In the SharePoint world, the list concept covers everything from a list of hyperlinks to a discussion board. In every case, the end user views the list, adds information to the list, modifies information on the list, or removes items from the list. Because all the built-in Web Parts derive from this basic concept, the procedure for adding an issue to an issue Web Part are very similar to the procedure for adding a new document to a document library.

In this chapter, you will:

  • Learn about the common features of all the built-in Web Parts

  • Work with advanced, list-based Web Parts including issues lists, discussion boards, surveys, and custom lists

  • Learn how to use library-based lists to control documents and pictures

  • Explore advanced features of the built-in Web Parts, including access controls, custom views, and list templates

What Is a Web Part?

A Web Part is a modular and reusable component that can be placed into any SharePoint Services web page. A Web Part is generally composed of a Web Part description file (.dwp) and some external code that provides the functionality (a .NET assembly or .dll file). For most purposes, however, all you need to know is that a Web Part is a building block for a team site.

The Web Part Description

The Web Part description file is an XML file containing all the property names and settings for the Web Part. The description file also contains a reference to the Web Part assembly. In general, you will never have to look at or understand a DWP file unless you are developing your own custom Web Parts.

The Web Part Code

Each Web Part is a special type of ASP.NET application. The Web Part code is compiled into a .NET assembly and stored in the Global Assembly Cache or the bin directory. Once again, unless you are developing your own custom Web Parts, you will never need to look at the code files for a Web Part.

Basic List Functions

A SharePoint Services list is a collection of information that can be shared by team members. All SharePoint sites include a set of built-in lists that can be filled with any required team information. You can also create custom lists based on existing list formats or those that follow your own formats.

In this section, you will:

  • Learn about the types of SharePoint lists available to users

  • Learn how to work with the features common to all SharePoint lists

Types of Web Parts

SharePoint Services offers six simple list-based Web Parts, plus custom lists, discussion boards, and surveys. All of these Web Parts share similar functionality for adding, sorting, and removing items.

Basic lists

The basic list Web Parts provide standard list functions. The primary differences between these Web Parts are the different columns that are displayed in the list, and how you add data to the list. The six basic list Web Parts are:

Links

A links list is a list of hyperlinks to web pages that are useful to site users. A site administrator might create a links list for standard resources needed by the team.

Announcements

An announcements list is designed as a place to post any team-related information (for example, notifying users of a new group member). Figure 2-1 shows an announcements list. All the basic lists share similar structure and layout.

Contacts

A contacts list contains the name, address, phone number, and email address of any people whom a user may need to contact during a project. One interesting feature of the contacts list is that it can be integrated with Microsoft Outlook. In other words, you can populate a contacts list by synchronizing it with your Outlook mailbox.

Events

The events list is a list of any dates that are important to the team (for example, product launches or meetings).

Tasks

The tasks list is a to-do list for site users. Each task is presented as its own list entry.

Issues

The issues list is designed to help manage outstanding project problems. Issues can be assigned to a specific user and can be prioritized by severity. The issues list is explained in the section Section 2.3 later in this chapter.

Announcements list
Figure 2-1. Announcements list

Custom lists

If none of the basic lists meets your needs, you can create custom lists in one of three ways:

Custom lists

When you create a custom list, you define the columns and select the data types. SharePoint will automatically generate a form for filling the list with data.

Custom list in a datasheet view

If you want a list that looks like a spreadsheet, you can create a custom list in a datasheet view. This type of custom list provides a spreadsheet-like environment for convenient data entry, editing, and formatting. In order to create a datasheet view, you need a Windows SharePoint Services-compatible list datasheet control such as Microsoft Excel, and ActiveX control support.

Import a spreadsheet

If you have a SharePoint Services compatible program (for example, Excel 2003 or Internet Explorer 5.0 or greater) you can create lists from spreadsheets. SharePoint Services imports your data and displays the information as a list.

The tasks necessary for building a custom list are explained in the Section 2.3.

Other Web Parts

Although the survey and discussion board Web Parts share many features with the basic lists, these Web Parts are treated separately because they offer more complex features:

Surveys

A survey Web Part is a specialized list that combines features of the simple lists with a system for tracking answers from site users.

Discussion boards

A discussion board is essentially an improved issues list that allows interactive discussion between team members.

Both surveys and discussion boards are explained in Section 2.3.

Working with Standard Lists

All the built-in lists share similar core functionality. Regardless of the list type, you will use the same basic procedures to:

  • Create the list

  • Add information to the list

  • Edit the contents of the list

  • Delete content from the list

  • Change the name or description of a list

  • Attach files to a list

Creating a standard list

To create any of the built-in list types:

  1. Click Create in the top link bar.

  2. Select the type of list you want to create (for example, “Links”).

  3. Type a name for the list in the Name text field.

  4. Type a description of the list in the Description text field. This step is optional.

  5. If you want the list to appear in the Quick Launch bar, select the Yes radio button in the Navigation section.

  6. Click Create.

Adding information to a list

The steps to add information to a built-in list are very similar for each of the built-in lists—i.e., the steps to add announcements are very similar to the steps to add links or events to a list. This example outlines the steps required to add an announcement to an announcement list:

  1. Click on Documents and Lists in the top link bar. You will see a new page similar to Figure 2-2.

  2. Click Announcements in the lists section.

  3. Click New Item. Figure 2-3 shows the Announcements: New Item page that is used to create a new announcement.

  4. Type a title in the Title text field.

  5. Type the body of the announcement in the Body field.

  6. If you want the announcement to be displayed for only a certain period of time, click on the Calendar control and select an end date.

  7. Click Save and Close.

Documents and Lists page
Figure 2-2. Documents and Lists page
Add a list item page
Figure 2-3. Add a list item page

Remember that adding information to any list will follow the same basic steps. However, the data entry form will be slightly different depending on the list type.

Editing information in a list

Editing information in a list follows a set of steps similar to adding the information. Keep in mind that all lists will use similar steps; however, the actual fields may be different.

To edit information in an announcement list:

  1. Click Documents and Lists in the top link bar.

  2. Click Announcements in the list section.

  3. Point to the announcement you want to edit.

  4. Click on the down arrow and select Edit Item from the menu.

  5. Edit the information you want changed.

  6. Click Save and Close.

Deleting information from a list

To delete information in an announcement list:

  1. Click Documents and Lists in the top link bar.

  2. Click Announcements in the list section.

  3. Point to the announcement you want to delete.

  4. Click on the down arrow and select Delete Item from the menu.

  5. Click OK to delete the item.

Changing the name or description of a list

As people start adding information to a list, you may find that the purpose of the list has changed. Therefore, you may need to update the name of your list Web Part or the description.

To change the name or description of a list:

  1. Click Documents and Lists in the top link bar.

  2. Select the list you want to edit.

  3. Click “Modify settings and columns.”

    Tip

    If the page displays a survey, click “Change survey and questions.”

  4. Under General Settings, click “Change general settings.”

  5. Edit the information for Name and Description.

  6. Click OK.

Attaching files to a list item

In certain cases, you may want to attach a file to specific list items. For example, if you create a task list for new employees, you can attach a health benefits form to the step requiring each employee to sign up for insurance.

You can attach files to existing items or attach a file when you create a list item.

To attach a file to an existing item:

  1. Click Documents and Lists in the top link bar.

  2. Click on the list that you want to attach your file.

  3. Select the existing list item.

  4. Click the down arrow and select Edit Item from the menu.

  5. Click Attach File.

  6. Browse to the file you want to attach to the item and click Open.

  7. Click the OK button.

  8. Click Save and Close.

To attach a file to a list item when you create the item:

  1. Click Documents and Lists in the top link bar.

  2. Click on the list that you want to attach your file.

  3. Click New Item.

  4. Type the title and any additional required information.

  5. Click Attach File.

  6. Browse to the file you want to attach and click Open.

  7. Click OK.

  8. Click Save and Close.

Advanced Web Parts

Once you understand the basic functions of a list-based Web Part, you can start to work with any of the built-in Web Parts. However, some of the more advanced Web Parts expose additional functions that are above and beyond the basic behavior of a list. In this section, you will learn about:

  • Issues list

  • Discussion boards

  • Surveys

  • Custom lists

Each of these Web Parts builds on the basic list parts by offering advanced features designed for the specific functions of the Web Part. For example, issues lists provide a special set of columns for tracking project-related issues. Similarly, surveys are designed to collect specific information from each user and present the results.

Finally, if none of the basic lists meets your needs, you can create your own lists by defining the columns, data types, and look and feel of the list.

Issues Lists

Issues lists are designed to help you manage any outstanding problems on a project. You can assign issues to specific team members, prioritize issues, and track the progress of any issue on the project.

Each issues list displays a table with default columns specific to tracking issues in a project. Table 2-1 details the default columns of an issues list.

Table 2-1. Issues list columns

Column name

Functionality

Add related issue

Displays the Issue ID for any issues related to the specific issue.

Assigned To

Indicates which user is assigned to the issue.

Attachments

If a file is attached to the issue, the filename is displayed in this column.

Category

Organizes issues into three categories.

Comment

A brief description of the issue.

Created

The timestamp that indicates when an issue was created.

Created By

Indicates which user created the issue.

Current

Displays two checkboxes (Yes or No) to inform if an issue is still current.

Due Date

The projected date by when the issue must be resolved.

Edit

Displays the edit icon to users. If a user clicks on the edit icon, she is taken to the Edit Issue page.

Issue ID

A unique identifier that is automatically generated by SharePoint Services. The Issue ID cannot be changed.

Modified

The timestamp that indicates when the issue was last modified.

Modified By

Displays the user ID of the last person to edit the issue.

Priority

Allows a user to set the issue as a high, normal, or low priority. By setting priority, users can focus on the most important issues.

Status

Indicates if an issue is active, resolved, or closed. Users can filter lists to display only active issues so they can focus on out standing tasks.

Title

Displays the title for an issue.

The issues list offers the same core functionality as other simple lists. You can add or delete issues lists in the same fashion as any other built-in lists. You can add, edit, delete, or attach a file to an item in any issues list. You can also alert a user when any assigned issue changes.

Issues list specific features

An issues list allows you to perform several tasks that are not available in other built-in lists. These tasks include:

Adding or removing a related issue

This feature lets you assign or remove issues to an existing user. Any added issue will be displayed in the list of issues on the user’s home page. Conversely, any removed issues are deleted from the user’s issue list.

Assigning an issue to a user

Assigning an issue to a user links the user to the issue, puts the issue on the home page for that user, and sets up an alert to notify the user that the issue has been assigned.

Viewing issue history

A user can easily view the history of any project issue, including changes in status, comments, any users that modified the issue, and the current status of the issue.

Viewing related issues

A user has the option to view any existing issues that are related to the current issue. For example, if a user is assigned to an issue that relates to a specific customer, the list can be configured to allow the user to view any other issues that relate to that customer.

Resolving, closing, or reactivating an existing issue

Users can change the status of any issue in the issues list. If a user has proper permissions, he can close or reactivate an issue. An Issues list can be sorted to display all issues, or to display only specific types of issues.

Turning on/off email notification

When the email notification is turned on, a user will receive an email anytime a new issue is assigned, or when the status of an existing issue changes.

Viewing issues list reports

SharePoint Services issue lists can be configured to create easy-to-read issue reports. An issues list report can list all of a project’s issues, the status of each issue, and what user is assigned to the issue.

Discussion Boards

Discussion boards are used as a forum to discuss any topics that interest users on your team site. Most sites use discussion boards to pose questions to team members or plan activities. For example, if you have an issue with a block of code, you can post a question to all your team members on the discussion board.

Discussion boards include the buttons and functionality for users to start new discussions, reply to existing discussions, and sort and filter any existing discussions. Users can also switch the design and view of the discussion board. Figure 2-4 shows a standard discussion board Web Part.

Discussion board
Figure 2-4. Discussion board

You can set up the discussion board to alert users when the discussion board is changed and to display the discussions in threaded or flat views. A threaded view sorts all comments by conversation. All comments from a single discussion are listed in the order they were created. A flat view displays all comments in the order they were created, regardless of the associated discussion. Although you can set a default view, each user can choose to switch to any other established view.

Creating a discussion board

Creating a discussion board is slightly more involved than creating any of the simple list Web Parts. To create a discussion board:

  1. Click Create in the top link bar.

  2. Click Discussion Board on the Create page.

  3. Type a name in the Name text field.

  4. Type a description in the Description text field. This step is optional.

  5. If you want the discussion board to appear in the Quick Launch bar, select the Yes radio button in the Navigation section.

  6. Click Create.

Start a discussion

Once the board is created, any authorized user can start a new discussion. To start a discussion:

  1. Click Documents and Lists on the top link bar.

  2. Click the name of the desired discussion board.

  3. Click New Discussion.

  4. Type the discussion title in the Subject text field.

  5. Type your comment in the Text text field.

  6. Click Save and Close.

Reply to an existing comment

If you want to reply to a comment in an existing discussion:

  1. Click Documents and Lists on the top link bar.

  2. Click the name of the desired discussion board.

  3. Navigate to the comment to which you want to post a reply.

  4. In the Subject column, click the down arrow, and select Reply from the menu list. This will launch the General Discussion: New Item page (Figure 2-5).

  5. Type your reply in the Text field.

  6. Click Save and Close.

Figure 2-5 displays the New Item page for discussion board Web Parts.

Replying to an existing discussion
Figure 2-5. Replying to an existing discussion

Edit comments

A site administrator can configure a discussion board such that a user can edit any previously posted comments. The option to edit all comments or just the user’s own comments must be configured by the site owner.

To edit an existing comment:

  1. Click Documents and Lists on the top link bar.

  2. Click the name of the desired discussion board.

  3. Navigate to the comment you want to edit.

  4. In the Subject column, click the down arrow, and select Edit Item from the menu list.

  5. Edit the existing text.

  6. Click Save and Close.

Tip

Depending on your permission level, you may not be allowed to edit any comments, you may be allowed to edit only your own comments, or you may be allowed to edit any comments. If you are a site owner, you can control this setting using the steps in the section Section 2.5.3.

Delete a discussion comment

To delete a discussion item:

  1. Click Documents and Lists on the top link bar.

  2. Click the name of the desired discussion board

  3. Navigate to the comment you want to delete.

  4. In the Subject column, click the down arrow and select Delete Item from the menu list.

  5. Click OK.

Once again, permission to delete comments is controlled by the owner of the site. You might not be allowed to delete any comments, you might be allowed to delete only your own comments, or you might be allowed to delete all comments.

Content approval

The site owner can also configure a discussion board to ensure that inappropriate content is not posted. By requiring content approval, the site owner forces all new comments to enter an approval process before being publicly displayed.

Site administrators and users with the manage lists permission can:

  • Accept or reject content

  • Include comments as to why the specific content was rejected

  • Add content without having it approved

Note that rejecting content does not mean users cannot view their pending content. Users can always view any of their own pending items. To prevent users from viewing pending items, a site administrator or a user with “manage list” permissions must manually delete the content.

Surveys

The SharePoint Services survey Web Part provides you with an easy tool to poll site users. You can create a survey by adding questions and requiring team members to respond. Figure 2-6 shows a standard survey Web Part. The survey Web Part allows you to easily compile survey results and view the results in a graphical summary view.

Survey Web Part
Figure 2-6. Survey Web Part

Create a survey

Survey creation is usually a site administrator task. Therefore, you may not have permission to create new surveys. If you are the site administrator, or you have the “manage lists” permission, you can create new surveys on a site.

To create a survey:

  1. Click Create in the top bar link.

  2. Click Survey.

  3. Type a name for your survey in the Name text box.

  4. Type a description that explains the purpose of the survey in the Description text field. This step is optional.

  5. If you want the survey to appear in the Quick Launch bar, select the Yes radio button in the Navigation section.

  6. If you want the respondent’s name to be visible to all users, select the Yes radio button in the Show user names in the survey results section.

  7. If you want users to be able to reply to the survey more than once, select the Yes radio button in the Allow multiple responses section.

  8. Click Next.

Adding a question to a survey

Once again, only site administrators and users with the correct permissions can add questions to a survey. To add a question to your survey:

  1. Navigate to the Add Questions page.

  2. Type your question in the Question text box.

  3. The Survey Web Part includes functionality for you to determine the format for the answers to questions. You can specify the type of information for an answer in the Optional settings for your question section.

  4. To add more questions, click Next Question and repeat steps 2 and 3.

  5. Click Finish to save your survey.

Figure 2-7 shows the Add Question page, which is used to add new questions to surveys on your team site.

Adding a question to a survey
Figure 2-7. Adding a question to a survey

Responding to a survey

The SharePoint Services survey Web Part displays a survey as a simple form that users complete. Every user can respond to a survey.

To respond to a survey:

  1. Click Documents and Lists in the top link bar.

  2. In the Surveys section, click on the survey you want to complete.

  3. Click “Respond to this survey.”

  4. Complete the survey.

  5. Click Save and Close.

To see the results of a survey

SharePoint Services compiles all survey results and displays the results in a graphical summary. To view the graphical summary:

  1. Click Documents and Lists in the top link bar.

  2. In the Surveys section, click on the survey whose results you want to view.

  3. Click Graphical Summary under the Select a View section.

To see how specific users responded to a survey

Depending on how the site administrator configured the survey, you may be able to see either generic results or user-specific results to the survey (see Figure 2-8). If the site administrator indicated that the respondent’s name should be visible, a username will be included with each set of survey results.

Survey results screen
Figure 2-8. Survey results screen

To see how other users responded:

  1. Click Documents and Lists in the top link bar.

  2. In the Surveys section, click on the survey whose results you want to view.

  3. Click All Responses under the Select a View section.

  4. Click View Response #n.

Figure 2-8 shows a typical survey results screen.

Custom Lists

If none of the built-in lists matches your desired functionality, you can create custom lists that will display your own columns and your own data. For example, you could build a custom list that shows the hours each employee worked per week. Figure 2-9 displays a custom list that shows how many hours overtime each employee worked, and how much overtime pay each employee is owed. The list uses a formula column to determine both the number of overtime hours worked and the amount of overtime pay each employee is owed. The amount owed field also uses a lookup column to search the site for each employee’s hourly wage.

Custom list
Figure 2-9. Custom list

As you might expect, creating a custom list is much more involved than creating an ordinary list.

Create a custom list

To create a custom list:

  1. Click Create in the top link bar.

  2. Click “Custom list.”

  3. Type a name in the Name text field.

  4. Type a description in the Description field.

  5. If you want your custom list to appear in the Quick Launcher bar, select the Yes radio button in the Navigation section.

  6. Click Create.

Adding columns to a custom list

Completing the preceding steps creates a blank custom list. To add columns to your custom list:

  1. Navigate to the page that displays your custom list.

  2. Click “Modify settings and columns.”

  3. Click “Add a new column” in the Columns section. This will bring up the Custom List: Add Column page (Figure 2-10).

  4. In the Name and Type section, type a name for the column and select the type of information you want to display.

  5. Specify the appropriate settings in the Optional Settings for Column section.

  6. Click OK.

  7. Repeat the preceding steps for each column.

Adding a column to a custom list page
Figure 2-10. Adding a column to a custom list page

Each column in a list can display single or multiple lines of text, numbers, currency, the date, yes/no fields, hyperlinks, or pictures. SharePoint Services also has several custom information types:

Choice

A choice type forces users to select from pre-existing values, similar to a drop-down list. You can add a choice field to a custom list by selecting the choice radio button from the Name and Type list. In the Optional Settings for Column section you can add the choices you want displayed in the list. You can also choose how the choices are displayed in the list (for example, drop-down menu, radio buttons, or checkboxes), and whether you want users to be able to fill in any other choices.

Lookup

A lookup information type retrieves a value from an existing list or library and displays the value. You can add a lookup field to a custom list by selecting the lookup radio button from the Name and Type list. The Optional Settings for Column section lists all existing lists and libraries for your site. To add a lookup field, you must select a list or library and the associated field you want to display.

Calculated

A calculated information type displays values that are derived from a formula. Formulas can use dates, numbers, or existing list and column values. When you create a custom list, you can add a formula column by selecting the calculated radio button from the Name and Type list. In the optional settings section, you can create a formula by entering information in the formula text area. A formula can be a combination of existing columns, operators, and constants.

Create a custom list in datasheet view

In order to create or use a list in datasheet view, your computer must have certain software installed. Specifically, you will need Microsoft Office Professional Edition 2003. More specifically, you need the Microsoft Office List Datasheet Component, which is an ActiveX control bundled into the Office 2003 installation. If you have this component, and you are using Internet Explorer 5.01 (SP2) or higher, and have ActiveX controls enabled for your SharePoint site, you can create a list in datasheet view.

To create the list:

  1. Click Create in the top link bar.

  2. Click Create Custom List in Datasheet View.

  3. Type a name in the Name text field.

  4. Type a description in the Description field.

  5. If you want your custom list to appear in the Quick Launch bar, select the Yes radio button in the Navigation section.

  6. Click Create.

Once the list has been created, you can define the columns and add data just as if you were using Microsoft Excel.

Create a custom list by importing a spreadsheet

You can import an existing Microsoft Excel spreadsheet as a custom list. To create the list:

  1. Click Create in the top link bar.

  2. Click Import Spreadsheet.

  3. Type a name in the Name text field.

  4. Type a description in the Description field.

  5. Click the Browse button and navigate to your spreadsheet. The spreadsheet must be in Microsoft Excel format.

  6. Click Import. This will open up a new wizard that will help you determine what you wish to import.

Library Web Parts

Quite often you will want to add a Web Part to share documents between the members of the site. The library Web Parts are enhanced lists specifically designed for storing, controlling, and maintaining various types of documents. A SharePoint Services library displays all the files stored in the library. The library also lists the properties for each file and provides a hyperlink to open the file. Using the library Web Parts, a site administrator can also implement version control on the items in the library. That is, an end user will have to specifically “check out” a document before editing it. When the editing is complete, the user can “check in” the document, incrementing the version number. Any user can see all the versions of the document and compare changes between versions.

In this section, you will learn about:

  • The views associated with library Web Parts

  • The specific features of a document library

  • The specific features of a picture library

  • Version control

The Home Page

Every library Web Part presents a home page view that includes the links necessary to work with the library and one of several views of the content in the library. From the library home page, you can:

  • Add files and folders to the library

  • Sort and filter files contained in the library

  • Switch the library view

  • Change the design of the library

  • Create alerts so users are notified of any changes in the library or specific files within a library

When you add or remove files from the library, the associated hyperlinks are automatically updated.

Document Libraries

Document libraries are collections of files that allow a team to share files. A document library is basically a file repository for any documents that you want to share with your team. You can upload documents to the library, as well as edit existing documents in a controlled versioning environment. Document libraries allow you to create and save documents in standard templates. One possible use of a document library is to store all customer invoices. Figure 2-11 shows a standard document library.

A document library (all documents view)
Figure 2-11. A document library (all documents view)

The all documents view

The default view displays all documents in the library in a simple table. You can either work with each document in this view or click the Edit in Datasheet link if you need to make mass changes to the library. The datasheet view provides you with an Excel-like interface with improved features for copying, pasting, mass selecting, and deleting library components.

The explorer view

All libraries include an explorer view that mirrors the functionality of the Microsoft Windows Explorer. The explorer view lets you delete, rename, or copy and paste files and folders. Figure 2-12 shows a standard document library in explorer view.

Library in explorer view
Figure 2-12. Library in explorer view

Within the explorer view you can drag and drop files from a regular Windows Explorer instance into your SharePoint site. However, your site administrator may have set up permissions that restrict the use of this view.

Creating a document library

To create a document library:

  1. Click Create on the top link bar.

  2. Click “Document library” on the Create Page page.

  3. In the Name text field, type a name for the library.

  4. On the Description text field, type a brief description for the library. The description field is not required.

  5. If you want the document library to appear in the Quick Launch bar, select the Yes radio button in the Navigation section.

  6. If you want to create a backup or new version each time the file is edited, selected the Yes radio button in the document Versions section. Site users can access either the latest version or any previous version. See the Section 2.4.4 for more details on what this setting means.

  7. Select a default document template from the document template dropdown menu. The default document template determines the format of any new file created in the document library.

  8. Click Create.

Figure 2-13 shows the New Document Library page that is used to create new document libraries on your team site.

Create a document library
Figure 2-13. Create a document library

Your document library will be added to your site. You can now add files to the library using either the upload button or the explorer view.

Document templates

To enforce consistency for your document library, you can specify a template to be used anytime a new document is created. You can create templates for any SharePoint Services-compatible program. To use a template, the template must be stored in the site template gallery.

For example, you can attach a Microsoft Word template to a document library. Whenever a user creates a new Microsoft Word document within the library, he will automatically be forced to use the attached template. If you have a Microsoft PowerPoint template for slides, you could attach it to the document library so that all Microsoft PowerPoint presentations will automatically have the same look and feel.

Adding documents to a document library

To add a document to a document library:

  1. Click Documents and Lists in the top bar link.

  2. Click on the document library in which you want to add the document.

  3. Click “Upload document.”

  4. In the Upload document page, click the Browse button and navigate to the file you want to upload.

  5. If a document with the same name already exists in the document library and you want to overwrite the file each time a new version is saved, click the “Overwrite existing file(s)?” checkbox.

As an alternative, you can use the explorer view and drag and drop, or copy and paste your files from a Windows Explorer instance into the document library (or vice versa).

File formats in a document library

When you create a document library, you can save your files in binary format or in a web-based format. Both options have advantages and disadvantages. If you use a program-specific format (for example, .doc, .or .xls) you retain the runtime features of the program, but users must have the appropriate program installed to view the files.

If you use a web-based format, team members aren’t required to have the appropriate program installed, but some runtime functionality might be lost.

Picture Libraries

Picture libraries provide the functionality for you to share and organize images in a corporate server environment. Picture libraries mirror the functionality of document libraries. Both types of libraries allow users to edit, copy, and delete files from the repository.

Picture libraries display photos in three different styles. A picture can be displayed as a thumbnail (a small version of the picture), filmstrip (displays both a smaller version of the picture and a larger, more detailed version of the picture) or as picture details (the actual picture is not displayed, just the associated picture information).

For example, several picture libraries could be used to store all the photos taken by photographers at a newspaper. By creating a picture library for each photographer, any reporter working on a story related to the pictures could access the picture library without having to search for the correct files. Figure 2-14 shows a standard picture library.

Standard picture library
Figure 2-14. Standard picture library

Although pictures can be stored in other types of SharePoint lists, using a picture library lets users:

  • Look at pictures in different views (All pictures, Selected pictures, and Explorer)

  • Share pictures using slide shows

  • Send pictures directly to Microsoft Office 2003 programs

  • Download pictures directly to your computer

  • Edit pictures with a Windows SharePoint Services-compatible image editor

Creating a picture library

To create a picture library:

  1. Click Create on the top link bar.

  2. Click “Picture library.”

  3. Type the name of the picture library in the Name text field.

  4. Type a brief description of the picture library in the Description text field. This step is optional.

  5. If you want the picture library to be visible in the Quick Launch bar, select the Yes radio button in the Navigation section.

  6. If you want to create a backup of a picture every time it is checked into the picture library, select the Yes radio button in the picture Versions section. See the Section 2.4.4 for more details on what this setting means.

  7. Click Create.

Figure 2-15 shows the New Picture Library page that is used to create new picture libraries on your team site.

Create a picture library page
Figure 2-15. Create a picture library page

Adding pictures to a picture library

To add a picture to a picture library:

  1. Click Documents and Lists in the top link bar.

  2. Click the name of the specific picture library.

At this point, you can upload a single picture or multiple pictures.

Adding a single picture

To add a single picture to a picture library:

  1. Click “Add picture” in the picture library.

  2. Click Browse and navigate to the picture you want to add to the library.

  3. Click Open.

  4. If a file with the same name already exists in the library, you must decide if you want to overwrite the existing file.

  5. Click Save and Close.

Adding multiple pictures

To add multiple pictures to a picture library:

  1. Click “Add picture” in the picture library.

  2. Click Add Multiple Files.

  3. Select the pictures you want to add.

  4. Click Upload and Close to add the pictures in their original size.

Tip

If you want to add pictures with smaller file sizes, click “Send pictures optimized for viewing on the Web.” By reducing the file size, pictures will load faster in a web browser.

Download a picture from a picture library

To download a picture to your computer:

  1. Click Documents and Lists in the top link bar.

  2. Select a picture library.

  3. Select the checkbox next to the pictures you want to download.

  4. You must decide if you want to download the photos with the default picture settings or if you want to download the pictures with customized settings (for example, setting the width and height properties).

  5. Click Download.

  6. If you want to download the pictures to a specific location (as opposed to the default location), click Browse and navigate to the location where you want to store the files.

Version Control

Implementing version control allows you to save multiple versions of a document on your server. When you enable document versioning for a document library, a backup copy of your file is saved each time the file is saved to the library. This feature is useful in case you have to revert to an older copy of the file or you want to keep a history of any changes that are made to the document. If you have documents that need to be edited by several users, saving the original version of the file is very helpful to keep track of each user’s modifications.

By turning on versioning, you can:

  • View previous versions of the file

  • Restore a file to a previous version

  • Delete all previous versions of a file

  • Restore deleted files

  • Force document check-in

Versioning can be applied to all files except HTML. In order to version web documents, you must use the MHTML format.

Implementing version control

If you are the site administrator and did not enable version control when you created your library, you can turn it on later by adjusting the settings for your library.

To enable version control:

  1. Navigate to your library.

  2. Click on the Modify Settings and Columns link.

  3. In the General Settings section, click on the Change General Settings link.

  4. In the Document Versions section, select the Yes radio button.

  5. Click OK to apply the changes.

Viewing a previous version of a file

A user can view previous versions of any document in the document library. Figure 2-16 shows the Versions saved page that contains all versioning information for a specific document. To view a previous version of a file:

  1. Point to the file in your library.

  2. Click the triangle that appears.

  3. Click Version History.

  4. In the Modified column, click your desired version.

Version history for the test.doc document
Figure 2-16. Version history for the test.doc document

Restore a file to a previous version

In certain cases, you may want to revert to a previous version of a file. For example, if a user makes unacceptable edits or overwrites important changes, you may need to return to the previous version of the file. To restore a previous version:

  1. Point to the file in your document library.

  2. Click on the triangle that appears.

  3. Click Version History.

  4. In the Modified column, point to the version you wish to restore.

  5. Click the triangle that appears.

  6. Click Restore in the menu that appears.

  7. Click OK when asked if you want to replace the file.

Delete previous versions of a file

If you have permission, you can delete one version or all of the previous versions of a file. Previous versions take up space on the hosting server, so although you may want to save previous versions, documents that undergo numerous changes over an extended life cycle can take up large amounts of space. To delete a previous version of a file:

  1. Point to the file in your document library.

  2. Click on the triangle that appears.

  3. Click Version History.

  4. In the Modified column, point to the version you want to delete.

  5. Click the triangle that appears.

  6. Click Delete in the menu that appears.

  7. Click OK to confirm that you want to delete the file.

Tip

If you delete the file directly, you will also delete all saved versions. The above procedure lets you selectively delete old versions of a file without deleting all of the file history.

Advanced Web Part Features

With all of the Web Parts described in this chapter, a site administrator can configure advanced features, including creating list templates, creating list views, and adjusting the security for accessing a Web Part.

List Templates

When you create a list, you must select a list template that renders the content in a predetermined format. SharePoint Services includes several list templates. Any template can be customized and saved as a new template. Administrators can import new templates to the site and make the new templates available to all users.

By definition, a list template contains all the design information for a list. A template does not contain any security information or general list information. A list template also contains server information (URLs and user account names), so it is crucial that only trusted users are given access to the site list template gallery.

Creating a list template

To create a list template, you must have “manage list” permissions. To save a list as a template:

  1. Navigate to the list you want to save as a template.

  2. Click “Modify settings and columns” on the Actions page.

  3. Click “Save list as template” under the General Settings section of the Customize:<List_Name> page.

  4. Type the filename in the File Name text field.

  5. Type the title of the template in the Template Title text box.

  6. Type a description for the template in the Template Description text field.

  7. Select the “Include content” checkbox if you want to include the existing content.

  8. Click OK.

Add a template to the site template gallery

In order to add a template to the site template gallery, you must have “add item” permission for the site template gallery. To add a template to the gallery:

  1. Click Site Settings on the top-level web site.

  2. Click Site Administration in the Administration section.

  3. Click “Manage site template gallery” in the Site Collection Galleries section.

  4. Click “Upload template gallery” on the Site Template Gallery page.

  5. Click Browse and navigate to the template you want to add to the gallery.

  6. Click “Save and Close.”

Delete a template from the site gallery

To delete a template from the site template gallery, you must have “Add Item” permission for the site template gallery. To delete a template gallery:

  1. Click Site Settings on the top-level web site.

  2. Click Site Administration in the Administration section.

  3. Click “Manage site template gallery” in the Site Collection Galleries section.

  4. Click the Edit icon next to the template name.

  5. Click Delete.

Managing Views

Views make it quick and easy to see list information in a variety of ways. You can use views in lists, libraries, surveys, and discussion boards. You may notice that certain parts have additional built-in views. For example, a discussion board has a flat view and a threaded view. Similarly, a document library has the all documents view and the explorer view.

You may want to create your own custom views to control the appearance of a Web Part. For example, you may want a view on a contacts list that sorts the contacts by company rather than first name.

Once a view is created, a hyperlink is added to the Quick Launch bar that allows you to view information in a specific view. You can create the following types of views:

Standard view

The standard view displays the default columns of the list in a simple table format.

Datasheet view

This view creates an editable spreadsheet format that is good for bulk editing.

Calendar view

This view displays data in a calendar format.

Figure 2-17 shows an announcements list in a datasheet view.

A list in datasheet view
Figure 2-17. A list in datasheet view

Creating a calendar list view

To create a calendar list view:

  1. Open the List of Invoices list.

  2. Click “Modify settings and columns.”

  3. In the Views section, click “Create a view.”

  4. Choose Calendar View.

  5. Type a view name in the Name text field.

  6. Select an audience for your view. If you want your view to be seen by groups of people, you must select the Create a Public View radio button.

  7. Select a column to base the calendar view (for example, modified or created).

  8. Select a calendar setting to determine if your calendar list view will appear in month view, week view, or day view.

  9. If you want to filter your calendar list view, select up to two columns and conditions (for example, setting Created by ID to be greater than 10) to filter your list.

  10. Click OK.

After completing the preceding steps, you can view the List of Invoices list in a calendar view.

Creating a datasheet view

The datasheet view provides you with an easy way to edit information. To create a datasheet list view:

  1. Open the List of Invoices list.

  2. Click “Modify settings and columns.”

  3. In the Views section, click “Create a view.”

  4. Choose Datasheet View.

  5. Type a view name in the Name text field.

  6. Select an audience for your view. If you want your view to be seen by groups of people, you must select the Create a Public View radio button.

  7. Select the columns you want to appear in the list view, and choose the order in which they will be displayed.

  8. If you want to sort your datasheet list view, select up to two columns to determine the order that the items in your list are displayed.

  9. If you want to filter your datasheet list view, select up to two columns and conditions (for example, setting User ID to be greater than 10) to filter your list.

  10. If required, select an items limit, and select whether you want to display the total number of attachments of items in the list.

  11. Click OK.

After completing the preceding steps, you can view the List of Invoices list in a datasheet view.

Controlling Access

It is important for a site administrator to control who has access to the information in a list. By controlling access to lists, you can ensure that secure material cannot be viewed by users without the proper permissions. Similarly, you can prevent unauthorized users from adding new documents, deleting existing documents, or modifying documents.

SharePoint Services gives you the ability to control permissions on lists and libraries. Setting permission on lists and libraries ensures only authenticated users can access secure information. For example, your company may only want members of the human resources group to have access to salary information. You can grant users the following access:

  • View items

  • View items; edit, delete items

  • View items; edit, delete items; change list settings

  • View items; edit, delete items; change list settings; change security

You can grant or revoke permissions by user, groups of users, or by site group. Any user with “manage lists” or “Full Control” rights can change the permissions of a list or library.

You can set advanced permissions for specific users or groups. These advanced permissions are:

  • Manage lists

  • Manage list permissions

  • Cancel check-out

  • Manage personal views

  • Add list items, edit list items, and delete list items

  • View list items

Any user with “manage lists” permissions can edit the existing permissions for the specific list or library. Users with this permission can view permissions for a list, change the permissions for a specific site group, assign or remove permissions to a specific user or group, reset permissions to the default settings, and enable anonymous access for the list.

Tip

The steps on how to modify permissions for lists and libraries are the same. Therefore, the following procedures show only the steps to change permissions for an example list named “List of Invoices.”

View permissions for a Web Part

To view the permissions on the List of Invoices list:

  1. Navigate to the List of Invoices list.

  2. Click “Modify setting and columns” in the Action pane.

  3. Click “Change permissions for this list” in the General Settings section of the Customize list of Invoices page.

  4. The Change Permission: List of Invoices page displays the users and groups that can access the list and their assigned permissions.

Change permissions for a site group

A site group is a group of similar users who share a common set of permissions. To change the permissions of a list for a specific site group:

  1. Navigate to the List of Invoices list.

  2. Click “Modify setting and columns” in the Action pane.

  3. Click “Change permissions for this list” in the General Settings section of the Customize list of Invoices page.

  4. Select the site group you want to change.

  5. Click Edit Permissions of Selected Users.

  6. Select the level of permissions you want to allow the group and click OK.

Selectively assign permissions to a specific user or user group

You can selectively assign permissions to a specific SharePoint user, or to a Windows group. Unlike site groups, Windows users and groups are controlled by your system administrator.

To assign user- or group-specific permissions:

  1. Navigate to the List of Invoices list.

  2. Click “Modify setting and columns” in the Action pane.

  3. Click “Change permissions for this list” in the General Settings section of the Customize list of Invoices page.

  4. Click Add Users on the list toolbar.

  5. In the Step 1: Choose Users section, type the email address or domain name and account name for the group or user you want to assign permissions in the Users area.

  6. In the Step 2: Choose Permissions section, select the level of permissions you want to assign and click Next.

  7. In the Step 3: Confirm Users section, verify that the email address, user name, and display name are correct.

  8. If you want to send an email to a user when you change permissions, select “Send the following email” to let these users know they’ve been added checkbox in the Step 4: Send Email section, and then add the body text you want sent in the email.

  9. Click Finish.

Remove permissions from a user, group, or site group

To remove permissions from a user, group, or site group:

  1. Navigate to the List of Invoices list.

  2. Click “Modify settings and columns” in the Action pane.

  3. Click “Change permissions for this list” in the General Settings section of the Customize list of Invoices page.

  4. Select the site group you want to change.

  5. Click Remove Selected Users.

  6. Click OK.

Restore default permissions

You can restore the default permissions to a list. To return to the default settings:

  1. Navigate to the List of Invoices list.

  2. Click “Modify settings and columns” in the Action pane.

  3. Click “Change permissions for this list” in the General Settings section of the Customize list of Invoices page.

  4. Click “Inherit permissions from the parent web site.”

  5. Click OK.

Grant anonymous access

If your web site is configured to grant access to anonymous users (through IIS), you can grant anonymous users access to a list or library:

  1. Verify that your web site grants anonymous access.

  2. Navigate to the “List of Invoices” list.

  3. Click “Modify settings and columns” in the Action pane.

  4. Click “Change permissions for this list” in the General Settings section of the Customize list of Invoices page.

  5. Click “Change anonymous access” in the Action pane.

  6. Select the checkbox that corresponds to the level of permissions that you want to grant to anonymous users.

    Tip

    If IIS is not configured to allow anonymous users, the checkboxes will not be visible.

  7. Click OK.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset