Tuesday, March 29, 2011

SharePoint 2007: Adding a Document Information Panel Step-by-Step

Introduction

In this step-by-step walkthrough, you'll be shown how to add a document information panel to a Microsoft Word document content type, on SharePoint Server 2007 Enterprise, in order to provide users a convenient method for entering document metadata.  The scenario explored here involves building a document library for retaining billing statements.  By enabling users to enter this meta data themselves, at the time they are actually working with the document, it reduces their workload in minimizing the number of steps they need to take to enter a documents into document libraries.  It reduces the workload of the SharePoint administrator or other assigned person, who otherwise would need to perform this task.  This walkthrough proceeds in four steps: 1) build the new document library; 2) build the new content type, 3) add the new content type to the new document library, and 4) test the document panel. Note: you must have InfoPath 2007 or greater installed on your system in order to interact with the document panel. However, you don't need to write a single line of code. Good luck!

Procedure

Step 1: Build the New Document Library

Open a browser and connect to your SharePoint 2007 instance.


Under View All Site Content, click Documents, and then hover your cursor over the Create button.


Click Create, and then under the Libraries tasks group, hover your cursor over Document Library.


Click Document Library.


Enter Statements for the name, a short description, and then click OK.  Note that a new library link now appears under the Document content group, at left.


Click Settings, and then select Document Library Settings.


Scroll down a bit on the Customize Statements page, and then look for the Create column link.


Click this link.  This takes you to the Create Column page.  You'll revisit this page several times: let's create four new columns (field names and types shown):
  • Customer ID | Single Line of text
  • Statement ID | Number
  • Statement Date | Date Only
  • Amount | Currency
Once you're done, and return to the Customize Statements page, and then scroll down a bit to the Columns listing, you should see something similar to that shown here:


Note: I previously created a Customers list based upon the SharePoint Contacts list, and I populated this with a few entries.  The Customer ID field that you see in the window capture above is of type Lookup, and it is lookup up the customer ID from a field in the Customers list.

Now navigate back to the Statements document library.  You'll see that it now has a number of additional columns displayed.


Let's clean this up a bit.  The view that you see here doesn't need to display all of the available fields, just a few.  Let's reduce the number of displayed fields.  Go back to the Customize Statements page again: go Settings > Document Library Settings, scroll down to the bottom of this page, and then click Create view.  The Create View: Statements page appears.


Click Standard View.


Let's call this view Default, just to be consistent with its purpose, since we want it to be the default view.  Then scroll down a bit and uncheck the following fields
  • Type
  • Modified
  • Modified By
and then click OK.




Step 2: Build the New Content Type

Go back to the site main page, and then, click the Site Actions button, at the right, to reveal its menu.


Select Site Settings (some may note that this site doesn't have the publishing infrastructure enabled yet).


Under the Galleries group of action links, look for the Site content types link.  Click this link.


Look for the Create button, just above the list of content types.  Click this button.



Enter the following and leave all other fields default:
  • Name: Statements
  • Description: billing statement document template
  • New Group: Statements
Click OK.  You're taken to the Site Content Type: Statements page.  Here, you can make configuration changes to the new content type.


Click Advanced settings under the Settings group of action links.


Select the option, Upload a new document template.  Then navigate to the Microsoft Word document that you want to use.  For this walkthrough, I used a billing statement template available through Microsoft Office 2010: Billing Statement, provided by Campbell's Plumbing and Construction.


Leave all other settings at their default, and then click OK.


That's it.  You've added a new site content type.  This content type will now be available throughout the site.

Step 3: Add the New Content Type to the New Document Library

Navigate back to the Statements document library Customize Statements page: go Statements > Settings > Document Library Settings > Advanced Settings.  This takes you to the Document Library Advanced Settings: Statements page.


Select the Yes option under Allow management of content types? setting.  Click OK.  This will take you back to the Customize Settings: Statements page.  Note the new group that now appears on this page: Content Types.


Click that link, Add from existing site content types that you see just below the Content Types section.


From the Select site content types from: drop down list box, select the Statements group.  Just one item will be shown for this group.  Move this item over into the Content types to add box.


Click OK.  This takes you back to the Customize Settings: Statements page.  Note that now you see two content types listed under the Content Types group.


When my users navigate to the Statements document library, and the click the New button, I don't want to confuse them with inappropriate choices.  I want to make things as clear and direct for my users in order to minimize problems.  Right now, when users click the New button, they'll be presented with two choices:
  • Document
  • Statements
Let's eliminate the Document choice and leave just the Statements choice.  On the Customize Settings: Statements page, look down to the Content Types list and then click the Document content type item.


On the List Content Type: Document page, look for the Settings group of action links, and then click the link Delete this content type.  This will take you back to the Customize Settings: Statements page.  Note that now only one item is listed under the Content Types group.


Now for just a bit of cleanup.  On the Customize Settings: Statements page, click the Advanced Settings link.  This takes you to the Document Library Advanced Settings: Statements page.  Scroll down this page until you see the Folders group.  In this group, for the option Display "New Folder" command on the New menu?, select No.


Now click OK.  Navigate back to the Statements document library, and then click on the down arrow next to the New button.  Note that now only one option is displayed.


That's it.  You're done.  You've added the new content type to the new document library you created earlier.  Now let's test things to make sure they integrate correctly.

Step 4: Test the Document Panel

On the Statements document library page, click the New button. 


Click OK.  Microsoft Word will launch, displaying the Billing Statement document template, complete with document panel.


Note that the document panel fields are type-sensitive.  Thus, for example, a data field will display a popup calendar option.  Lookup types will automatically lookup the available field list, at the time that Word launches, and then provide you with a listing of all appropriate choices.  For example, the Customer ID lookup pulls customer IDs from the Customers list, at the moment that a user clicks the New button to create a new instance of the document.


Once you've completed entering data into the document panel, and updated the document itself, just click the Save button in Microsoft Word, and your document will automatically be saved to the originating document library, in this case the Statements document library.


This completes this step-by-step walkthrough showing you how to add a document information panel to a SharePoint 2007 content type in order to provide users a convenient method for entering document meta data.  Happy computing!

References
  1. Microsoft Office SharePoint Server 2007: Create a site content type
  2. MSDN: Office 2007: Document Information Panel Overview
  3. MSDN Magazine: Designing Form Templates With The New Features Of InfoPath
  4. Jan Tielens' Bloggings: YASR: SharePoint 2007 Site Columns
  5. SharePoint Administration & Development + InfoPath: InfoPath SharePoint: Submit InfoPath form to SharePoint List or Library using Content Type
Notes
  • You could add meta data fields to this site content type at the time that you created it, and these meta data fields would be introduced into each document library that you added this document to.
  • You must have InfoPath 2007 or greater installed on your system in order to interact with the document panel.
  • If you want to edit the document panel, such as for example adding company logo, other graphics, or change the panel UI in other ways, you will need to use InfoPath to do this.

Sunday, March 27, 2011

SharePoint 2007: How to Integrate Virtual Earth with Lists

Introduction

In this procedure, you'll explore step-by-step how to integrate the Microsoft Virtual Earth map control with a contact list in SharePoint Server 2007 Enterprise in order to present a map to the user of a particular contact clicked on in the Contact list.  Much of the information has already been presented [1] and updated [2].  This procedure enhances these discussions by providing step-by-step directions along with screen captures involved with successfully implementing this control.  Refer to the Virtual Earth SDK links for additional detail on map control functionality.  Tools that you'll need for this procedure include SharePoint Designer 2007 and designer access to the SharePoint instance you want to work with.  You'll also be working with the data view web part.  This procedure is divided into three phases: 1) building the web part, 2) adding the XSL, and 3) associating the XSL with the data view.  Good luck!

Procedure

Phase 1: Build the Data View Web Part

To being this procedure, I have created a small contact list of McDonalds locations in the Arlington Virginia area.  The addresses of these locations are real. However, the contact names, titles, and email addresses are entirely fictional.


Open SharePoint Designer 2007, and then connect to the website you want to work with.


In the Folder List pane, open up Lists > Contacts and then select DispForm.aspx.  This is the display form for the Contacts list.


Double-click this object to expose its designer and code-behind pages.  This page currently contains the list view web part.  You'll place the data view web part below this one.


In the Data Source Library task pane, at right, drag the Contacts list and drop it below the list for web part on the Designer page. After a few moments, you'll see a new list appear displaying the first few lines of the Contacts list.



A Common Data View Tasks menu also appears, listing the various tasks you can do with the currently selected web part.  On this menu, click Filter.


On this dialog, select Field Name ID, Comparison Equals, and then select Value Create New Parameter.  Another dialog appears.



 Change Param1 to ContactID, and then select Parameter Source Query String.  For the Query String Variable, enter ID; and for its Default Value, enter 1.  Click OK.


Note that the Value is now ContactID.  Click OK again.


Phase 2: Add the XSL.

Download the file available here:
LiveMaps.xsl
In SharePoint Designer, from the File menu, point to Import and then select File.  Navigate to the file you just downloaded, and then click OK.  Move this file into the Contacts folder, given that this XSL will only be used in association with the Contacts list.  For additional details on the Virtual Earth mapping functions used in this XSL, consult references [3], [4], and [5] below.

Phase 3: Associate the XSL with the Data View Web Part

Right-click anywhere on the data view web part.


From the context menu, select Web Part Properties.


Open up the Miscellaneous group.


Click in the XSL Link box in order to put the cursor there.  Then click on the button that appear to the right of this text box after you do this.


Navigate to the Contacts list, and then select the XSL object you recently place there.  Then click OK.


Note that the Designer page has changed.  Now click the Save button in the SharePoint Designer toolbar.  You'll be presented with some warnings regarding making changes to this page.  Click OK through these.  Next in your SharePoint collection navigate to the Contacts list and then click on any name listed.


You'll see the usual display form.  But then if you scroll down a bit you'll see the map.


If you hover your cursor over the pushpin, a popup will appear displaying what information was provided to it, in this case just the last name.  Review [3] to learn how to add additional information to this pushpin, including full name, a photo, address, etc.  Happy computing!

References
  1. How to Integrate Virtual Earth Maps with a SharePoint List
  2. Virtual Earth API 6.2 with SharePoint
  3. MSDN: VEPushpin Constructor
  4. MSDN: VEMap.Find Method
  5. MSDN: VEMap.LoadMap Method
  6. Virtual Earth Maps on SharePoint
  7. Windows SharePoint Services Document: Application Templates for Windows SharePoint Services 3.0 – Under the Hood
Notes
  • none

SharePoint 2007: Configuring Alternate Access Mapping Step-by-Step

Introduction

In this procedure, you will learn how to configure and alternate access mapping to your SharePoint Server 2007 Enterprise instance step-by-step.  Specifically, we'll be adding the fully qualified domain name of the a new SharePoint collection to enable users to use this URL in order to access this collection.

Procedure

Start SharePoint Central Administration.


Select the Operations tab.


Under the Global Configuration group of links, click Alternate access mappings.


On the Alternate Access Mapping Collection dropdown list box, at right, you'll see the Show All section displayed.  Click it to open the list, and then select your new collection from this list.  For this procedure, the collection selected is http://2003k1/.  This will update the list of mappings to display just the one you want to edit.


Click Edit Public URLs just above the Internal URL column of the list.


Now add the FQDN to the Intranet mapping.


Click Save.  The list of Alternate Access Mappings for your selected collection will be updated.


Now open a browser and enter the new mapping you just created.  For this procedure, this would be: http://2003k1.corp.local/.





References
  1. Configure alternate access mapping
  2. Plan alternate access mappings (Office SharePoint Server)
  3. Alternate Access Mapping in SharePoint
  4. Microsoft SharePoint Blogs: How to configure Alternate Access Mappings (AAM) successfully
  5. Technet Forums: SharePoint 2010: Configuring AAM in SharePoint 2010
Notes
  • This alternate mapping will work for all users on the domain you configured this for.  It will not work on alternate domains or in peer-to-peer environments - there you will need to use the hostname.
  • There's no need to change DNS settings in order to implement alternate mapping changes, as discussed in [3].