The Anatomy of a Content Type


The magic of SharePoint is making its various pieces fit your business situation, and nowhere is that more evident than in content types. Content types all have properties, the basic ones being the name, description, and grouping category. In addition, you have properties associated with templates, workflow, site columns, and policy management as well as settings for the document information panel. You can define and redefine these properties to fit your business situations, but to do that, you need an understanding of how to work with them. For example, you can change a content type name to reflect a change in process, but it’s important for you to make the name consistent and intuitive when you redefine it. In this section, you learn about the various content type properties and how to work with them.

Name and Description

Because the name displays on all the buttons and labels associated with the content, you should assign a clear and descriptive name. For example, users should intuitively know what name to select when they click the button for creating a new item in a document library. You should consider who will work with this content type and make sure that they understand exactly what they are creating when they select a name. This is especially critical when you work with the automated workflows, templates, and policies. For example, if your company sells multiple product lines related to aerospace and transportation, and you create a content type that contains the proposal template, approval process, and metadata related to a specific marine product line, consider using a name that clearly defines. Naming it “sales document” or “marine product documents” would not be as appropriate as “marine sales proposal.”

As with all other SharePoint content elements, a good description helps communicate the purpose and intended use of a content type. By concisely stating what the content type is, users will more easily fill in information, modify settings, or select a content type for inclusion with a list or library.

Parent Content Type

To easily change properties, you can define hierarchical relationships between two content types. In SharePoint, the parent content type defines the properties for a child content type, which, in turn, inherits all the parent’s properties. For example, going back to the marine sales proposals scenario, you can create a new content type called “Marine Documents,” which has specific site columns and metadata that you want to apply to all marine-related documents. By making Marine Documents as the parent content type for the Marine Sales Proposals content type, all content types associated with the “Marine Documents” content will automatically inherit all the parent content type’s columns. Likewise, if you later need to add a new site column to all marine content types, you simply add columns to the Marine Documents parent content type to automatically have them added to the children of the content type. Figure 6-6 shows how you assign a parent content type during the creation process. Parent content types create better consistency across all common content types as well as improve design efficiency and individual component maintenance.

image from book
Figure 6-6

Group

You can organize your various customized content types by grouping them. As you create or edit a content type, you must specify a group name - either an existing group name or a custom group. Instituting some standards for groups provides a solid base for expanding and organizing content types as you create them. For example, using the Marine Sales Proposals as an example, it may be appropriate to associate the content type with a custom group called “Marine Sales Documents” that can store all content types related to the marine product line.

Template

When you associate document templates with a content type, you can better control the quality of the data that you collect. You can base the template on a variety of file formats including Word documents, Excel spreadsheets, InfoPath forms, and custom web pages. You can either upload a custom template to the content type, or you can point to a template stored at another location. If you want to point to an existing template, be sure that all members using the content type can access the location of the template. For example, if you create a sales proposal content type and a document template for sales proposals already exists on the sales team site, make sure that the people who create content based on your newly created content type have access to that sales team site.

For Microsoft Office files, such as Word and Excel, updating or changing the document template associated with a content type has no effect on items that users have already created and that are stored in the document library. This is because of the way these files relate to a template. In Word, a document template is primarily only relevant for the initial creation of the document. However, for content types based on InfoPath or publishing templates such as page layouts, changing the template associated with the content type updates the existing documents to display the information as detailed in the template. This will become clearer when you explore those content types in greater detail later in this book.

Chapter 4 discussed how you can associate custom document templates with a document library. This association means that users can automatically generate documents based on that template by clicking the New Item button for a document library, a feature available in the previous version of SharePoint. With SharePoint 2007’s introduction of content types, you now have more than one item in the New Item menu (see Figure 6-1), which gives you a single document repository to store several different types of information and simplify how people access materials. To do this with your process, see the following Try It Out.

Try It Out-Upload a Custom Template to a Content Type

image from book

In this example, you go to the properties of an existing content type and upload a custom template. Users can then select this template using the New Item button from a document library that has the content type associated with it.

  1. From the main page of your site, select Site Actions image from book Site Settings.

  2. Under the Galleries section, select Site content types.

    Tip 

    If your content type was created on a top-level site, you need to go to the top-level site settings to edit the content type directly.

  3. Select your content type from the list. Use the Group Selection box on the right-hand side of the toolbar to display only the group of which your content type is a member. This is helpful if you have a large number of content types on your site. In this example, you select the Financial Report content type that is part of the Financial Information group. The Site Content Type page for the content appears, as shown in Figure 6-7.

    image from book
    Figure 6-7

  4. Select Advanced Settings from the Settings group.

  5. Select Upload a New Document Template, and click the Browse button to locate your custom template. Please note that it is not necessary to have your document saved as a template file (.dotx or .dot).

  6. When you have the appropriate file selected, click the Open button.

  7. Click the OK button to complete the operation.

image from book

Workflow

Creating important documents often requires the creator to follow an equally important business process. This process ensures that everyone involved in the collaboration activity is doing their part and communicating properly. When people follow processes without the aid of automated tools, they often encounter or create roadblocks because of distractions and other duties. For example, if a sales manager completes an important sales proposal and sends it to a colleague or supervisor for feedback with an email notification, that colleague may not immediately respond because of another task or emergency and as a result, the request gets buried into an inbox or lost in the shuffle. This is a common situation because many people struggle to keep up with email and daily responsibilities. Unfortunately, this means missed deadlines, frustration between team members, missed opportunities, and it may ultimately impact the overall operations of the company.

By assigning a workflow template with a content type, you can define a realistic series of tasks with built-in reminders for a specific business activity so that workers can focus on duties. For example, in the previous scenario, whenever a salesperson creates a sales proposal, he can send it to the sales team or a supervisor for feedback with tasks and deadlines automatically created so that the request for feedback is less likely to be lost. Even if the sales team supervisor does forget the task, the system will send reminder messages to the supervisor until the task is complete. This means that the salesperson doesn’t have to follow up on the task.

Depending on the parent content type you select when you define your custom content type, you may already have workflows enabled. If these workflow processes do not apply, you can remove them, but be careful not to remove a workflow that is important to the operations of a specific content type. By updating the workflow settings of a parent, you can optionally update any content types that are inherited from that content type.

Adding a custom workflow to a content type is a fairly simple process and similar to adding a workflow to a document library or list as described in Chapter 5. The advantage here, however, is that you typically have to define the process only once and it is applied to multiple document libraries that utilize that content type. If you add multiple content types to a single library, each content type can have its own unique workflow or set of processes that are independent of the others.

Try It Out-Define a Custom Workflow for a Content Type

image from book

Assigning a custom workflow with a content type is very similar to assigning a workflow to a document library. In the following example, you associate an approval workflow with an existing content type.

  1. From the main page of your site, select Site Actions image from book Site Settings.

  2. Under the Galleries section, select Site Content Types.

    Tip 

    If your content type was created on a top-level site, you need to go to the top-level site settings to edit the content type directly.

  3. Select your content type from the list. Use the Group Selection box on the right-hand side of the toolbar to filter the list to display only the group containing your content type. This is a helpful tip if you have a large number of content types on your site. In this example, use the Financial Report content type that is part of the Financial Information group. The Site Content Type window appears.

  4. Under the Settings section, select Workflow settings.

  5. Select the Add a Workflow link. The available templates for a workflow are listed in the Workflow Templates box, as shown in Figure 6-8.

    image from book
    Figure 6-8

  6. Select the Approval template.

  7. Specify a name for the workflow such as Document Approval.

  8. Because you can associate workflow processes with a tasks list to help manage the assignment information and duties, the next step is to select which task list to use. By default, a task list is suggested. However, you can specify a name for a new task list, and SharePoint will create one for you if this name hasn’t already been used. For this example, use the default value of Tasks.

  9. The workflow activities can be associated and tracked in a history list. By default, a name of “Workflow History” is selected.

  10. For Start Option, you want the workflow to launch whenever you create a new item. Select Start This Workflow When a New Item Is Created check box.

  11. Click Next to continue. Awindow similar to Figure 6-9 appears.

    image from book
    Figure 6-9

  12. In the Workflow Tasks section, select to assign tasks to one participant at a time.

  13. Click the Approvers button. The Add recipients window appears.

  14. Enter your first name, and click the magnifying glass button. Alisting of results is displayed. Select your own name from the list of results, and click the Add button.

  15. Click the OK button to close the Add recipients window.

  16. Enter 5 in the text box for number of days to complete task.

  17. In the Complete the Workflow section, unselect the Document Is Rejected check box.

  18. Click the OK button to save your changes.

How It Works

The workflow activity you created will launch whenever a new item is created based on that content type, and a task will be created for you because you selected your own name as an approver for the serial workflow. The due date for the task will be five days from the point the document is created. If you do not complete the task by the assigned date, you will receive a reminder.

image from book

Site Columns

In Chapter 4, you learned the importance of site columns when creating standard metadata properties for lists and libraries. To recap, site columns are stored in a central gallery on each site, and any list or library can use them on the same site or any site below it. Site columns provide standardization and ease of use when you want to share important information across multiple lists, libraries, or sites.

Site columns are also very important in content types. Because content types are created and stored in a central gallery, all associated components must be centralized as well. Therefore, you can only associate site columns with a content type. When you add a content type to a library, the required site columns are automatically associated with that library for use by the content type. You can create custom views on the columns, and Web Parts, such as the content query Web Part, and you can apply advanced filtering.

Tip 

Web Parts are explained in Chapter 7.

Remember the following when working with site columns:

  • When defining metadata for a content type, you can use existing site columns or create new site columns directly from the content type Settings page. When you use existing site columns, you are redirected to a site column selection page.

  • By using the Group Selection drop-down menu, you can filter the list of site columns to a more manageable size. This is why group names are very important, and why you should make them intuitive when you create site columns (see the section “Name and Description” earlier in the chapter).

  • Once you select the site columns you want, you click the Add button to move them from the left-hand list box to the right-hand list box.

  • You can remove an item you may have added accidentally by selecting it from the box on the right and clicking the Remove button.

  • You can update all content types that inherit from the current content type with the new columns you selected. For example, if you have a content type “Human Resources Document” that is the parent to the other content types “Policies and Procedures” and “Leave Request Form,” by selecting the Yes option in the Update List and Site Content Types section, a site column for “Division” that is added to the Human Resources Document is also added to Policies and Procedures and Leave Request Form content types.

You can also create a new site column as you create a content type. Even though you’re creating the site column from the administration interface of the specific content type, SharePoint still adds it to the central gallery of the site, making it available to other content types, lists and libraries on the current site, and sites below.

Document Information Panel Settings

Whenever you associate a document with a document library or content type, columns appear when the document is first saved or checked in. This is the document information panel, which asks you to complete metadata, as shown in Figure 6-10, and which is the subject of the next Try It Out.

Tip 

For more on the Check In/Check Out process, see Chapter 3.

image from book
Figure 6-10

To manage the Document Information Panel settings of a content type, you must do the following:

  1. Select Document Information Panel Settings from the content type Administration page.

  2. You can then change the template associated with the panel or have the document information panel always display for the user whenever the document is opened or initially saved.

It’s advantageous to display the panel when a user opens the document when you consider the metadata associated with a document is critical and/or when it is subject to change throughout the lifecycle of the document - for example, project lead, percentage complete, schedule, and budget status. It is up to the document owners to maintain the relevance and accuracy of this information. By presenting users with the document information panel each time they open the document, they are far more likely to update any column values.

Try It Out-Create a Custom Document Information Panel

image from book

A custom document information panel is useful when you need to attract attention to specific elements or add custom text to guide users in the completion of important metadata related to an item. You can customize the document information panel directly from the content type administration area using InfoPath. Although InfoPath is covered in greater detail in Chapter 10, the following walk-through does not require a great deal of familiarity with the tool.

Tip 

These steps require that you download the logo.jpg file from www.wrox.com.

  1. From the main page of your site, select Site Actions image from book Site Settings.

  2. Under the Galleries section, select Site Content Types.

    Tip 

    If your content type was created on a top-level site, you need to go to the top-level site settings to edit the content type directly.

  3. Select your Financial Report content type from the list. Use the Group Selection box on the right-hand side of the toolbar to filter the list to display only the Financial Information group. This is helpful if you have a large number of content types on your site. ASite Content Type window appears, as previously shown in Figure 6-7.

  4. Select Document Information Panel Settings.

  5. From the Document Information Panel Template Settings section, select Create a New Custom Template.

  6. The InfoPath client application opens on your system and displays a Data Source Wizard, as shown in Figure 6-11. Click the Finish button. An InfoPath form appears in Design view, as shown in Figure 6-12.

    image from book
    Figure 6-11

    image from book
    Figure 6-12

  7. Click on the words Horizontal Region to select each entire form field.

  8. Right-click and select Borders and Shading (shown in Figure 6-14).

    image from book
    Figure 6-14

  9. Select the Shading tab, and select the color yellow from the list.

  10. Click the OK button.

  11. After you have adjusted the background color for each form field, you should add a line break below the form fields. To do this, select the words Horizontal Region for the last field, press the right arrow button on your keyboard and then press Return. From the menu, select Insert image from book Picture image from book From File.

  12. From the resources folder for this chapter that you downloaded from the Wrox website, select logo.jpg and click the Insert button. Your image should now display within your custom panel as shown in Figure 6-13.

    image from book
    Figure 6-13

  13. Select your image and click the right-hand justification icon to align your image.

  14. Click the Save button.

  15. You may receive a reminder message telling you to publish the form when you finish your edits. Click the OK button to continue.

  16. Save your custom template to a location either on your computer or within your network.

  17. Click File, and then Publish. The Publishing Wizard appears, as shown in Figure 6-14, with the document information panel item selected by default.

  18. Click the Next button. All the required settings will be automatically detected by the wizard.

  19. Afinal screen displays with the URL of the site and content type name. Click the Publish button to complete the process.

  20. Click the Close button on the publishing window and close the InfoPath application. You can click the Go Back to the Document Information Panel Settings Page link to return to your settings page.

  21. Select the check box for Always Show Document Information Panel on Document Open and Initial Save for This Content Type.

  22. Click the OK button to save your changes.

How It Works

In the previous example, you created a custom information panel for your content type that displays a unique color background and custom logo. While it may not be considered best practice to implement bright colors into your user interface, his example demonstrated how easy it is to use InfoPath to customize your organization’s document information panels. Once you create a single custom panel, you can reuse it for other content types by pointing to it from the Document Information Panel settings of your other content types. You would do this by selecting Use Existing Custom Template (URL, UNC, or URN) from the Document Information Panel settings instead of creating a new template as you did previously.

You enabled a check box in Step 21 on your content type so that the document information panel always appears whenever your content type is opened within a Microsoft Office application such as Word or Excel. By displaying the panel whenever the document is opened, users treat the panel as a form that they must update before closing the document. If an item is required, it will have to be completed or added before the document is closed. However, if a required column is already specified but outdated, having the values front and center while someone is working on the document should help reduce the probability of them closing the document without updating the latest information. There is no way to force someone to update a column if a value already exists, so communicating the importance of keeping information up-to-date to your team is still important.

image from book

Policy Management

Another great feature of content types is how they define certain policies and behaviors around how they are managed. Because content of a specific type quite often has the same requirements for retention and management, it is beneficial to define a set of policies around a content type and have those inherited by all documents that are created from it.

You can configure the items in relation to a content type’s information policies:

Open table as spreadsheet

Policy Item

Description

Administrative Description

Provide some background information to users who are responsible for managing the policies related to the content type.

Policy Statement

A customizable message that appears when users open documents associated with the content type. A message bar appears at the top of the document in an Information Management Policy box. Users can click a Details button to view all the details related to the policy message. By using a policy statement, content type owners can ensure that users have all the information they need concerning the important policies related to specific content.

Labels

Ensures that important properties or messages are printed with documents related to a specific content type, such as confidential or a specific non-calculated document property. Content type owners can customize the presentation of the label by choosing font formatting and size.

Auditing

By enabling auditing on a content type, the following activities related to documents associated with the content type are tracked:

  • Opening or downloading documents, viewing items in lists, or viewing item properties

  • Editing items

  • Checking out or checking in items

  • Moving or copying items to another location in the site

  • Deleting or restoring items

Expiration

Allows you to control the life span of specific types of content. You can configure content types to automatically be deleted after a certain time period based on a document property. Alternatively, you can launch a workflow that gives the user a final chance to review the document before it is archived or deleted. This method is recommended in situations where you have no formal requirement for deleting content automatically because it provides the greatest level of flexibility.

Barcodes

This automatically inserts an auto-generated barcode into documents of a specific content type. You can also prompt users to insert barcodes when they use specific Microsoft Office client applications.

Try It Out-Configure an Expiration Policy on a Content Type

image from book

Configuring a policy is a fairly intuitive process as you will see in the following example, where you create an Expiration policy. You can only have a single expiration policy per individual content type. Once you complete your configuration, individual documents that are created related to that content type will expire two years after their last modification date. If someone modifies the document, the timer resets, and the document has another two years before it expires.

  1. From the main page of your site, select Site Actions image from book Site Settings.

  2. Under the Galleries section, select Site Content Types.

    Tip 

    If your content type was created on a top-level site, you need to go to the to- level site settings to edit the content type directly.

  3. Select your content type from the list.

  4. Select the Workflow Settings link. Alisting of all workflow templates associated with the content type displays. The Change Workflow Settings window appears, as shown in Figure 6-15.

    image from book
    Figure 6-15

  5. If the Disposition approval workflow is not listed, select Add a Workflow. Select the disposition approval workflow from the template list; enter Disposition Approval for the unique workflow name. Scroll to bottom of page and click the OK button.

  6. Select Site Content Type from the navigation trail over the title of the page (see Figure 6-15) to return to the Site Content Type window, shown in Figure 6-16.

    image from book
    Figure 6-16

  7. Under the Settings section, select Information Management Policy Settings.

  8. Select Define a Policy and click the OK button. The Edit Policy window appears, as shown in Figure 6-17.

    image from book
    Figure 6-17

  9. Select the check box for Enable Expiration.

  10. Select the option for the retention period being a time period based on the item’s properties.

  11. Select modified from the field drop-down box and enter 2 into the text field for years.

  12. Select the Start This Workflow action and select the Disposition Approval workflow.

  13. Click the OK button to complete the configuration of expiration settings.

How It Works

When a document reaches the time period for content expiration, you may not want your documents to be automatically deleted. Instead, for this example, you created a rule that triggers a workflow process. When you specify that a workflow process should start, you must reference a configured workflow activity. Because there was no content expiration type workflow associated with the content type already, you configured a disposition approval workflow on the content type before you started configuring the expiration policy. Only workflow activities that you have associated with the current content type display in the list of available templates when you are configuring an expiration rule.

image from book




Beginning SharePoint 2007. Building Team Solutions with MOSS 2007
Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 (Programmer to Programmer)
ISBN: 0470124490
EAN: 2147483647
Year: 2007
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net