Working with document libraries involves tasks like the following:
Adding a document to the library
Checking out a document so you can edit it
Checking the edited document back into the library
Managing versioning for documents stored in the library
Using permissions to control what users can do with versions
Marking documents as final when you're finished working with them
This section will examine how to perform these various tasks.
Before you can work with documents stored in a SharePoint document library, you first need to open the library. Do this, follow these steps:
Log on to the SharePoint site where the document library you want to work with is located.
If the document library you want to open is listed under Documents in the quick launch section, click the link to the library to open its page. If the document library is not listed under Documents, continue with the next step in this procedure.
Click the Documents link in the quick launch section to display a page showing all the document libraries on the site.
Click the link for the specific document library you want to open.
You can also click View All Site Content for any SharePoint site to display all libraries, lists, discussion boards, and other types of information available on the site.
Once you've opened a document library you can perform various actions on the documents stored in the library. Note that most of the commands you can use to work with documents in a library are available only through the All Documents view, which is the default view applied when you open a document library.
Once you've opened the specific library you want to work with, you can add documents to the library using several different methods:
Using the upload commands
Using Explorer View
There are several ways available to you to add documents to a library. The two most common methods used are the Upload Document and Upload Multiple Documents options, which are available from the main Upload menu, as shown in Figure 9-2.
Figure 9-2: Uploading commands
The Upload Document command allows you to upload a single file at a time and, if you have versioning turned on, to add a version comment to the file. This page recognizes any custom columns created on the document library and will present the user with a data entry form to populate any required values.
Selecting the Upload Multiple Documents command opens the Upload Document page with an embedded tree view control that allows you to upload multiple files from the same folder and appears as shown in Figure 9-3. A limitation of the control is that it does not support uploading entire folders or uploading files from multiple folders. This page makes use of the Microsoft Office Multiple Upload Control (STSUPLD.DLL), an ActiveX control that is installed with the Microsoft Office system. Therefore, the command will not normally be available if you are using the Web browser on a machine that does not have Microsoft Office 2003 or the 2007 Microsoft Office system installed.
Figure 9-3: Upload Multiple Documents command
Internet Explorer security settings can also affect the behavior of this control. If the Script ActiveX Controls Marked Safe For Scripting option (found under Tools\Internet Options\Custom Level) is set to Disable, SharePoint removes the command from the Upload menu of the document library because it would not be able to load on the page displayed to the user. One disadvantage of this ActiveX control is that it is not aware of custom columns in SharePoint libraries, and as a result it will not prompt you to fill in these values during the upload. The columns will either be populated with default values or remain blank. You will have to go back to the library after the documents are uploaded and retroactively update the metadata.
If you have custom columns that are marked as "required," warn users about using any of the multiple document upload techniques because they will not be prompted to enter the required data during upload.
The Explorer View, shown in Figure 9-4, is available from the View menu on the right side of the document library and provides another way of uploading documents to the library. In Explorer View, users can drag files from the file system on their local computer and drop them into the library. Explorer View requires that the client computer has installed Internet Explorer 5.0 or later and Web Folders, which are installed by default on Windows XP Professional and all versions of Microsoft Office beginning with Microsoft Office 2000.
Figure 9-4: Explorer View
The Explorer View also supports many drag-and-drop features, allowing users to move and copy documents between folders as they would in Windows Explorer. To fully use these features, the security settings in Internet Explorer must be modified and the Launching Programs And Files In An IFRAME option must be set to Enable.
One consideration in selecting which technique to use for uploading large numbers of files would be how the interface responds to copy errors. The Multiple Upload ActiveX control will stop uploading the moment it encounters an error, and there is not a mechanism to automatically resume where the upload left off. You will usually have to attempt to determine the last file uploaded and start the upload from that point or start the upload from the beginning. When using the Explorer View or WebDAV link, you will get a pop-up error message for each document that fails to copy, and the upload will pause until you click the OK button to continue. The upload will then skip the problem file and continue on.
Another consideration is the relative performance of the upload process. Uploading files through the Explorer View or WebDAV interfaces will support an upload rate of 1 MB per second and sometimes more. Using the Upload Multiple control results in an upload rate only slightly slower on average. However, uploading individual files with the Upload Document command may take 50 percent longer than the other methods. The actual performance you can expect will depend on the server workload and available network bandwidth.
The Windows Explorer also provides a built-in method for connecting to SharePoint libraries through the WebDAV (Web Distributed Authoring and Versioning) protocol. This is the same protocol used by the Explorer View. WebDAV is natively supported by SharePoint Server 2007 and allows you to view and work with the documents in the library as if they were folders on the file system.
The easiest way to invoke a WebDAV connection is to select the Open With Windows Explorer command from the Actions menu of the document library. The window that appears will look much like the Explorer View window, but it is no longer embedded inside the Internet Explorer browser.
One of the features integrating SharePoint Server 2007 and Windows is that you will usually find, after accessing a document library through either Explorer View or the Open With Windows Explorer commands, that a shortcut to that library has been created for you under My Network Places. If you want to create a shortcut manually, follow these steps:
Open Windows Explorer, and click My Network Places.
Double-click Add Network Place.
Select the Choose Another Network Location option, and click Next.
Type the URL to the document library in SharePoint Server 2007 (for example, http://contoso.msft/projects/documents), and click Next. (You might be prompted for a user name and password.)
Type in a name for the connection, and click Next.
In addition to creating a shortcut under My Network Places, you can also use WebDAV to map a network drive to a library. This is particularly useful for allowing document imaging and processing software to write to a target drive that deposits the files directly into SharePoint. To map a network drive to a document library, follow these steps:
Open Windows Explorer.
Click Tools, and then click Map Network Drive.
Select a drive letter from the drop-down list.
In the Folder box, type the path to the site and document library in the following format:
A new window opens that displays the contents of the document library.
It is highly possible that your users will end up working in many different document libraries throughout the life of your deployment. Because of this, we recommend that you consider implementing a naming convention for your document libraries.
The Web folder client's name is built using the following convention: <document_library_name> on <site_name>. If your users regularly use the default "Shared Documents" library, then they can expect to have duplicate iterations of "Shared Documents on <site_name>" in their My Network Places, which really doesn't help them know, intuitively, which Shared Documents library they are trying to connect to.
Because the Web folder client name is built off of the document library's object name, changing the display name in the properties of the document library will not solve the problem of users having duplicate Web folder client names.
Best practice, then, is to ensure that your site templates don't create document libraries called "Shared Documents" and that users are forced to create new document libraries based on a naming convention that makes sense for your organization. This way, the Web folder client names will not only make sense, you'll have very little, if any, duplication.
Once you've added documents to the library, you can work with them in various ways including:
Checking them out to edit them
Checking them back into the library
Managing versioning and permissions
Marking documents final
Document libraries support two modes of file locking: explicit and implicit. Explicit locking occurs when you select the Check Out command from the document drop-down list, as displayed in Figure 9-5. The icon next to the file in the library changes to display a green arrow, and no other user can edit the document until it is checked in. Implicit locking occurs when you open a document for editing by selecting the Edit In [program] command from the document menu without explicitly checking out the file. The file will automatically be locked by SharePoint, thus preventing others from saving changes to the file. Although both forms of locking prevent other users from saving changes while the document is open, explicit check out has the following advantages:
Identification The Checked Out To column of the library can be used to see which documents are currently locked by another user and who to contact if the documents need to be unlocked.
Privacy While a document is explicitly checked out, changes made to the document, and new versions of it uploaded to the server, will not be seen by other users until the document is checked in again.
Offline Sandbox Checking out a document puts a copy of it in the SharePoint Drafts folder in the user's My Documents directory. Changes made to the document are saved to the local file until it is checked into SharePoint again, at which point the changes are copied to the server and the draft is deleted. The location for files to be cached to can be changed by opening the 2007 Microsoft Office system application Options dialog box and selecting the Save tab. The folder location can be edited in the Server Drafts Location box.
Figure 9-5: The Check Out option
When you have completed modifying a document and uploading it to the document library, you need to use the Check In command to remove the exclusive lock on the file and allow others to see your changes. Some programs, such as Microsoft Office Word 2007, prompt you to check in your document when you close the application after saving the document to the library. If a user leaves a document checked out, any user with the Override Check Out list right can either force the document to be checked in or discard the check out. By default, the permission levels that have this right are Full Control, Design, Approve, and Manage Hierarchy. Discarding the check out will cause any changes that have been saved to the file in the document library since the last check in to be lost.
Because explicit check out is such a valuable feature of SharePoint, there is an option to force an explicit check out any time a user edits or updates a document. This option is found on the Versioning Settings page of the Document Library Settings, and it applies to all changes to the file regardless of how it is accessed. Any time a user attempts to open a document, he will be prompted to choose between Read Only and Check Out And Edit. (See Figure 9-5.) If the user chooses Read Only, most edit commands available in the document are disabled and the document cannot be saved back to the document library.
When the document is open, the user will see an option on the Document Actions bar to check out the document for editing, if it isn't already checked out. If the Require Check Out option is not enabled, SharePoint will place an implicit lock on the document that is exclusive to the user who opens the document. Other users will not be able to overwrite the document while it is locked, but there will be no indication in SharePoint that the document is locked until another user tries to open it.
SharePoint Server 2007 offers several options for versioning, as displayed in Figure 9-6. These settings can be controlled separately for each document library and are located on the Versioning Settings page under Document Library Settings. A best practice is to configure the site templates for your organization to have predefined document libraries with the versioning setting already set according to your organization policies.
Figure 9-6: Versioning settings
Major and minor versioning was part of the workspace in SharePoint Portal Server 2001. Microsoft removed this feature in Windows SharePoint Services 2.0 but has brought it back as part of the collaboration feature set in Windows SharePoint Services 3.0. Major versions are intended to be "published" versions, while minor versions are intended to be "in draft" versions. You can have a major version published, such as version 2.0, and be working on a new draft for the next published version. New drafts for the next published version are incremented as 2.1, 2.2, and so forth. The following settings are found on the Version Settings page:
None No previous versions of the document are saved. When a new copy of a document is uploaded or saved to the server, it overwrites the existing copy of the document. This option is useful for conserving space on the server, as only one copy of the document is saved. When other versioning options are used, a copy of the entire document will be saved with each new version, increasing the storage requirements of the SQL Server database.
Major Versions Only All versions are saved with a simple numbering scheme (for example, 1, 2, 3, and so on). No distinction is made between draft versions and published versions, so every time a new version of a document is saved to the server it is viewable by all site users. To conserve space, you can set a limit on the maximum number of versions that will be saved on the server.
Major And Minor Versions Versions of documents are numbered using a decimal notation scheme (for example, 1.0, 1.1, 1.2, 2.0, 2.1, and so on). Versions ending with .0 are major versions, and all others are draft versions. When the Major And Minor Versions option is selected, all users with Read permissions can access major versions of documents and you control which categories of users can view the minor versions-either those with Read permissions, those with Edit permissions, or only those with Approve permissions.
You can use the versioning feature of SharePoint Server 2007 to preserve the change history of a document as it moves through its life cycle of edits and revisions. To view previous versions of a document, select Version History from the document drop-down menu. From the Version History page, you can view and delete individual past versions of documents. You can also use the Restore command to roll back to a previous version of the document by making a copy of it and setting it as the current version.
It is important to realize that SharePoint stores a complete binary copy of every version of your document in the SQL Server database. To illustrate, if you have a document that is 250 KB in size and you create three past versions of it along with the current version, a total of 1000 KB will be stored in the database along with appropriate metadata for each version. This formula applies equally to both major and minor versions.
If the Require Check Out option is not enabled and a user forgets to check out the document first, a new version will be created every time a user saves the document to the server. This can lead to hundreds of versions of a document over time.
If the document is checked out before it is edited, all changes will be saved to the same checked-out version. To conserve the amount of space used by the content database, it might be a good idea to restrict the number of versions that will be saved over time. You can specify how many major and minor versions will be retained in a document library as users make changes to documents. The setting for minor versions does not limit the number of drafts that will be kept for each major version; it limits the number of major versions that will retain their draft copies. That is, if you have minor versioning enabled, an unlimited number of minor versions will be retained for each major version, but you can limit how many major versions will retain the draft copies with them.
While working with the current version of a document, you might want to know how it compares with a previous version of the same document. Word 2007 has been enhanced to include an integrated comparison tool to allow you to quickly view the differences between documents. The comparison feature uses the document's connection to the SharePoint document library to retrieve information about previous versions so that users don't have to browse to the file location. By default, the comparison appears in a new document with the original and revised documents displayed in side windows and the changes identified by formatting marks. There are five comparison options:
Compare With Most Recent Major Version This option provides a quick comparison between the current document and the last major (published) version on the server.
Compare With Most Recent Version This option provides a comparison with the last minor (draft) version on the server.
Compare With A Specific Version This option allows the user to select which previous version to compare with the current version.
Compare Two Versions Of A Document (Legal Blackline) This option is an all-purpose comparison that allows the user to view a comparison between two different documents.
Combine Revisions From Multiple Authors This option takes changes from multiple documents and merges them into one document.
To begin comparing documents, complete the following steps:
Open the document that you want to compare with another version.
Click the Review tab in Word 2007.
Click Compare. If the document you have open has a connection to a SharePoint document library, you will see all five comparison options. Otherwise, you will see only the last two.
Choose the comparison method you want to use.
Select the Comparison settings you want to use. These settings allow you to specify exactly which types of changes you want to compare, such as Comments, Formatting, Case Changes, and so on.
Select the Show Changes settings you want to use. These settings define whether the comparison will be performed at the word or character level and whether the resulting comparison will appear in the original document, the revised document, or a new document.
The document approval process built into libraries allows you to place all documents into a Pending status until they are approved by a user with the Approver permissions. When content approval is enabled, any changes made to documents are considered to be in a draft state and are not visible to users who have only Read permissions. When an Approver approves the changes, all users can view the approved version. The approval process can be used without document versioning, but when combined, they create a powerful mechanism to formalize document change management in your organization. The Versioning settings, described in the following list, control how the approval process works:
No Versioning SharePoint makes a copy of the document when changes are saved so that users with Read permissions can still access it, and the document is marked as Pending. When the new version of the document is approved, the old version of the document is discarded and all users can view the approved version.
Major Versioning Only When a document is edited and saved to the server, it is placed in a Pending state and only the previous version is available to users with Read permission. When the document is approved, the current version becomes available and the previous version is retained.
Major And Minor Versioning Under this model, all changes to documents are automatically saved as draft (minor) versions with an incrementing decimal in the version number. To start the approval process, you must select the Publish A Major Version command from the document drop-down menu. Only the most recent minor version can be promoted to a major version. An Approver can then approve the major version, making it available to all users.
By default, all users with Read permissions for a document library can view all versions of a document, both major and minor. The Draft Item Security setting on the Versioning Settings page under Document Library Settings allows you to restrict the view of versions so that only users with Edit permissions can view minor versions. Users with only Read permissions are then automatically shown the most recent major version of a document when they open it. If Content Approval is enabled in the document library, a third option becomes available that allows you to restrict viewing of drafts to only the author and those with Approve permission.
When you have completed all edits, revisions, and approvals of a document and it has reached its final version, you can use a new Word 2007 feature-designating a document as Final-to indicate to other users that you are finished with it. When you mark a document as Final, it becomes read-only and all the edit commands are disabled. Additionally, all revision marks stored when Track Changes is enabled are removed. This setting is a property of the document that is designed to help users avoid accidentally modifying a document that has already been finalized. The Final status can be removed by any user with Edit permissions, so it will not function as a form of security. To mark a document as Final, perform these steps:
Open the document in Word 2007.
From the File menu, select Prepare, and then click Mark As Final.
Click OK to make the change.
Two site templates in SharePoint Server 2007 are specifically designed with document management in mind.
A site template designed to allow users quick and easy access to large numbers of documents
A site template designed to be used for team editing of a single document
The Document Center template is new to SharePoint Server 2007, and it provides users with a more document-centered layout. The site includes only three default lists (Documents, Announcements, and Tasks), and the default navigation is set to Tree View mode for faster navigation. The site includes an instance of the new Relevant Documents Web Part, which displays, by default, all documents that you have created, checked out, or were the last one to modify. The Document Center site has been preconfigured to take advantage of the new features of SharePoint 2007. By default, the document library list has the Require Check Out feature turned on and versioning is set to track both major and minor versions.
The Document Workspace site template creates a site much like a standard Team Site but with a unique built-in publishing feature. Although the Document Workspace can be used in place of a Team Site, it is typically created as a subsite under a parent project or Team Site by selecting Send To, Create Document Workspace on the drop-down menu of a document in the parent site's document library. This command creates a new subsite with the name of the document as its title and URL, and it copies the document into the new site for further editing. When editing is complete on the copy of the document, you can select Send To, Publish To Source Location from the drop-down menu of the document in the Document Workspace site to copy the document back to the parent site. Caution should be used when publishing the document, as this will overwrite the document in the parent site.