SharePoint: Customizing SharePoint Document Libraries

One of the main reasons why organizations like to use SharePoint document libraries for document storage is because SharePoint’s indexing capabilities make it easy for users to locate documents.

Brien M. Posey

It’s no secret that a lot of planning and effort typically goes into deploying SharePoint 2010. But what do you do once SharePoint is finally up and running? Although there is nothing wrong with using a default SharePoint configuration, it is usually better to make the deployment your own by configuring it in a way that addresses your own unique business needs.

There is an endless variety of ways in which SharePoint can be customized. Since space limitations prohibit me from discussing all of the ways in which SharePoint can be customized, I will focus on some of the customizations involving document libraries.

Office Web Apps

The Office Web Apps are web-based versions of the Office 2010 suite that were previously accessible only through Windows Live. The requirement for Windows Live has historically made Office Web Apps impractical for use by businesses because an administrator lacks the ability to manage individual user’s Windows Live accounts. For instance, if a user forgets their Windows Live password, the corporate IT department does not have the ability to reset it.

Of course this does not mean that the Office Web Apps could not potentially be beneficial in corporate environments. After all, the Office Web Apps give users the ability to create, view, and edit Microsoft Office documents without having to have Microsoft Office installed on their computer. This ability makes it possible for users to use Office in places where they might not normally be able to, such as from an airport Internet kiosk or possibly from a computer running a non-Windows operating system.

If your organization likes the idea of providing users with access to the Office Web Apps, but does not want the hassle of trying to manage user’s Windows Live accounts then you will be happy to know that the Office Web Apps can be hosted directly on your SharePoint server. Presently the Office Web Apps are available to Microsoft’s Volume Licensing customers and to MSDN and TechNet subscribers.

Installing Office Web Apps is a matter of running a Setup program and following a basic installation wizard that requires you to provide a product key and accept a license agreement. Anyone installing Office Web Apps with SharePoint should first check their licenseing agreement and it recommended that you read Deploy Office Web Apps (Installed on SharePoint 2010 Products) in the TechNet Library before installing.

When Setup completes, you must run the SharePoint Products Configuration Wizard. This Wizard, which may be launched directly from the Setup Wizard, registers the Office Web Apps with SharePoint. In doing so, it requires several of the underlying services (such as IIS) to be restarted.

After the wizard completes the Office Web Apps will be linked to SharePoint, but they must still be activated. You can accomplish this by going to the Site Settings page, and clicking on the Site Collection Features link. Now, locate the Office Web Apps among the list of site collection features, and click the Activate button as shown in Figure 1.

You must activate the Office Web Apps before they can be used

Figure 1 You must activate the Office Web Apps before they can be used.

Office Document Metadata

One of the main reasons why organizations like to use SharePoint document libraries for document storage (as opposed to a traditional file server) is because SharePoint’s indexing capabilities make it easy for users to locate documents through a built-in search engine. Although SharePoint does a good job of returning relevant search results, you can improve the search results by appending relevant metadata to documents.

In order to accomplish this, there are two tasks which must be performed. First, you need to determine what metadata is best suited to each type of document and then define the metadata fields. Second, you must require users to populate those fields when they check in a document.

Defining Custom Metadata Fields

The first thing that you need to understand about document metadata is that blanket metadata requirements are rarely effective. After all, the goal is to use metadata fields that enhance searchability and if you were to use a generic set of metadata fields for every type of document that the organization uses you would be unlikely to achieve that goal. For example, a Word document containing a marketing proposal might benefit from a metadata field containing the client’s name. A spreadsheet used by the accounting department would be unlikely to benefit from a Client Name field, but a Fiscal Year field might prove to be useful. My point is that regardless of what types of documents your organization uses, it is helpful to think about the types of things that an end user might search on while attempting to locate such a document and then set up your metadata fields accordingly.

The first step toward making better use of document metadata is to define some custom content types. Typically you will want to define a new content type for each type of document that your organization uses. For instance you might create content types for HR forms, marketing proposals, payroll spreadsheets, and quarterly reports.

To define a custom content type, log in as an Administrator, and go to the Site Settings page. Next, locate the Galleries section and click on the Site Content Types link.

The Site Content Types page already contains a number of predefined content types. You can easily edit any of the preexisting content types or you can create your own. To create a content type, click on the Create link.  When you do, you will be taken to a screen that asks you to provide a name and a description for the new content type. This page also contains a drop down that you can use to specify a parent content type. Normally if you are creating custom content types for your documents your best bet will be to select the parent content type from Document Content Types and to set the Parent Content Type to Basic Page, as shown in Figure 2.

You can create custom content types that match the types of documents commonly used in your organization

Figure 2 You can create custom content types that match the types of documents commonly used in your organization.

Click OK, and you will be taken to a page that allows you to edit the content type that you have just created. If you look at Figure 3, you will notice that there is an area at the bottom of the screen called Columns. This section controls the metadata tags for the document type. By default the only metadata tag that is applied to the document type is Title.  However, you can add any additional metadata tags that you like. You can use the Add From Existing Site Columns to use one of the metadata columns that is predefined by SharePoint (or a column that you have previously created) or you can use the Add From New Site Column link to define a brand new metadata tag.

The Columns section defines the metadata tags that will be used by the document type

Figure 3 The Columns section defines the metadata tags that will be used by the document type.

While it’s good to be able to reuse existing columns if you can, it is easy to create new ones. If you look at Figure 4, you can get an idea of what is involved in creating a custom column. In this particular case I am creating a new column named Fiscal Year. You will notice that SharePoint allows me to define the new column as a number, set a minimum and maximum value, and even to specify a default value and the number of decimal places that should be used.

You can set parameters for columns that you create

Figure 4 You can set parameters for columns that you create.

As you will recall, our goal was to get users to use the document metadata fields that we define. If you look back at the previous figure, you will notice that the option to require the column to be populated was disabled. If you want to make a metadata column mandatory you must perform a couple of extra steps. Click OK to create the new column. It will now be listed as a column for the content type that you just created. If you click on the new column you will be taken to a page that allows you to edit a few settings. As you can see in Figure 5, there is an option to require the column to be populated. I also recommend using the option to update all content types inheriting from this type.

You can require users to populate certain metadata columns

Figure 5 You can require users to populate certain metadata columns.

Now that we have created a content type and a custom column the last step is to integrate the content type into the document library. To do so, go back to the Site Settings page, locate the Site Administration section and then click on Site Libraries and Lists. Next, click on the link to customize your document library.

When the Settings page for the document library appears, click on the Advanced Settings link and then enable the management of content types within the document library, as shown in Figure 6, and click OK.

You must allow the management of content types

Figure 6 You must allow the management of content types.

You will now be returned to the Settings page for the document library. You will notice that this page now includes a Content Types section. You can use the Add From Existing Site Content Types link to tell SharePoint which content types you want to store in the document library. For example, in Figure 7 you can see that I have added Quarterly Sales Report to the list of content types. You will also notice that the Columns section at the bottom of the page indicates that the Fiscal Year column will be used with Quarterly Sales Reports.

Quarterly Sales Report has been added to the list of content types

Figure 7 Quarterly Sales Report has been added to the list of content types.

Now when a user attempts to upload a document to the document library, they will be presented with a Content Type drop down box. The columns that are displayed vary depending on the content type that was selected. In Figure 8 for example, the Fiscal Year column is displayed because the content type was set to Quarterly Sales Report.

Columns displayed depending on the selected content type

Figure 8 Columns displayed depending on the selected content type.

Document Workflows

Another way in which you can make SharePoint document libraries more useful is to create workflows. Workflows are used primarily for document routing. Suppose for instance that your CFO wanted to review the quarterly sales reports before they were sent to the CEO. You could accomplish this by creating a workflow.

To create a workflow, go to the Site Settings page, locate the Site Administration section, and then click on the Site Libraries and Lists link. Next, click the link to customize the document library in which you want to create the workflow and then click the Workflow Settings link, followed by the Add a Workflow link.

Once you arrive on the Add a Workflow page, the first thing that you will have to do is to define the type of content that the workflow will apply to. Fortunately, we have already defined the quarterly sales reports as a unique content type, so we can select it here, as shown in Figure 9.

Select the type of content to which the workflow should be applied

Figure 9 Select the type of content to which the workflow should be applied.

The next step is to select a workflow template. Since our goal is to give the CFO a chance to review the quarterly sales reports, we will use the Approval SharePoint 2010 workflow template.

Next we have to assign a name to the workflow. For the sake of demonstration, I will simply call the workflow CFO Approval.

Now you must choose the task list and history list that you want to use. It is OK to use the defaults, but you can create new lists if you like.

Finally, you must choose under which conditions the workflow will be started. When you are done, click Next.

The contents of the next screen vary depending on the workflow template that you have chosen. In Figure 10 for example, we are given the opportunity to specify one or more approvers because we are using the Approval template. As you can see in the figure, you are also able to include a message for the people who are assigned a task. You can also assign a task duration, and you can even control what happens if the approval is rejected.

The Approval template lets you specify approvers and assign tasks

Figure 10 The Approval template lets you specify approvers and assign tasks.

Conclusion

SharePoint document libraries work well right out of the box, but there are many ways in which they can be customized so as to provide exactly the functionality that your organization needs.

Brien Posey

Brien Posey, MVP, is a freelance technical writer with thousands of articles and dozens of books to his credit. You can visit Posey’s Web site at brienposey.com.