Hits

Jan 27, 2010

Visual Beta2 Startup Error

If you get the following message when starting Visual Studio Beta2:

The application cannot start
Then run the followng command to fix it:
devenv /resetuserdata

Jan 16, 2010

InfoPath 2010 Walkthrough - Event Registration with InfoPath 2010

Sample Administrator Deployed Solution

Agenda:
Use cases : SOW
Give a few word templates of the Word document.

Inputs:

Outputs:

The following walk-through will show you how to create and deploy an InfoPath form using managed code.
Prerequisites

This example involves programming against the Microsoft SharePoint Foundation 2010 object model. To do that, you will need to establish a reference to the Microsoft.SharePoint.dll assembly which is installed with a licensed copy of SharePoint Server 2010. Microsoft.SharePoint.Server.dll is installed in %CommonProgramFiles%\Microsoft Shared\Web Server\Extensions\14\ISAPI by default. This DLL must be included in projects where you program against the SharePoint object model.

You will need to download the Word 2007 Content Control Toolkit.

The computer you use to develop this solution also must have Microsoft .NET Framework 3.5 or later installed.

Using SharePoint to Store InfoPath Form Data in Word Documents

InfoPath is designed to enable you to collect, validate, and parse data from multiple sources. All of that data needs to be stored somewhere, and SharePoint Server 2010 provides a great interface for organizing and surfacing data into classes that reflect your business processes.

Some business processes do not lend themselves to reviewing data in a form view. The data may require some touching-up and integration into a document layout. Also, some users want local access to their data and have Microsoft Word installed, but do not have InfoPath installed. These requirements can be met by exporting form data to a Word template. The template is formatted ahead of time in Word, and the data is imported into the template when the form is submitted.

This scenario uses a form to collect registration information for training events, which is then sent to the attendees as a formatted confirmation in a Word document.

Here is an overview of the high-level steps to create this solution

  1. Create a SharePoint list of training events and add some training events.
  2. Create a form to collect training registration information.
  3. Bind the form to your list of events.
  4. Design a Word 2010 document that mirrors the form's data.
  5. Modify the Word document's schema, and then upload it to SharePoint.
  6. Write the code to convert your form data into a format that fits your Word 2010 document's schema, and create a new instance of the data as a Word document in a document library.
  7. Administrator-deploy the template.
Step 1: Create a SharePoint list and add events to it

Create a new custom list in SharePoint with columns named Title, Date, Location, and Description, make all columns except Description required, and name the list Events.
Design the event form using InfoPath:
After you create the list, click the List tab in the SharePoint ribbon, and then click the Customize Form button.

The InfoPath Designer will start, and you can customize the form, and then add the training event details by using the list form. These details will be exported from the InfoPath form and imported to the Word document.

When you have completed the design, publish the form back to SharePoint, and then add some events to the Events list.

In the next procedure, you will design a form to collect registration information that has validation and links to an external list.

Step 2: Create a form to collect registration information

Start the InfoPath 2010 designer, and then click SharePoint Document Library in the Popular Form Templates section on the New tab.

Design the form to collect: Name, Phone, E-Mail, Event, and Special Instructions.
  • Name: a required text field. To set text boxes and drop-down lists to be required, click the control, and then check the Cannot Be Blank check box on the Properties tab.
  • Phone: a required text field with a validation rule. To validate a phone number in a text box, click the text box, and then click Manage Rules in the Rules section of the control's Properties tab to display the Rules pane. Click New, click Validation, and then set the rule to fire under the Condition where the Phone field does not match the Phone number pattern.
  • E-Mail: a required text field. To validate an e-mail address, create a validation rule that is specified by using a regular expression. Follow the same steps used to create the Phone Number rule, but instead of choosing from the Standard patterns, enter a regular expression in the Custom pattern field. This an example of a regular expression for standard e-mail address: ([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])(([\w\-]+\.)+)([a-zA-Z]{2,4}))
  • Event: a required Drop-Down list that will be linked to the Events SharePoint list in the next procedure.
  • Special Instructions: an optional text field.
In the next procedure, you will link the Event drop-down list to the SharePoint list of events.

Step 4: Connect the form to the SharePoint list of events

On the Data Tab, click From SharePoint List in the Get External Data section of the ribbon.

Step through the Data Connection Wizard and select the Events list you created in the first procedure. Make sure to select the Title, Date, Description, and Location fields of the events list. You can also change the value in the Sort by drop-down list to Title.
Do not select the Store a copy of the data in the form template check box, and do select the Automatically retrieve data when form is opened check box.

After clicking Finish in the Data Connection Wizard, right click the Event drop-down list on the form, and then click Drop-Down List Box Properties.
On the Data tab, select Get choices from an external data source in the List box choices section of the dialog box.
Make sure that Events is selected in the Data source drop-down list box, and then click the Select XPath button next to the Entries text box.
Expand SharePointListItem_RW under dataFields, and select the Title field, and then click OK on both dialog boxes.

On the Home tab, click Preview to preview the form and confirm that the Event drop-down list is connected to the Title column of the Events SharePoint list.

In the next procedure, you will create a Word 2010 document that uses the Plain Text Content Control to create a template that will contain the data gathered using the InfoPath form.

Step 5: Design a Word document that mirrors the form's data

Start Word 2010, click the File tab, and then click Options.

Click Customize Ribbon, select the Developer check box in the Main Tabs list on the right side of the dialog box, and then click OK. This will add the Developer tab to the ribbon.

Use the Plain Text Content Control in the Controls section of the Developer tab to create a template for your form data.

Set the Title and Tag properties of each Plain Text Content Control to make them easy to identify when you map the InfoPath form's schema to the schema of the Word document you are creating.

The Word template for this sample solution should look like the following example.

<>
In the next procedure, you will modify the Word document's schema and upload it to SharePoint. This is a key step to increasing the readability and ease of use of your code. This will create a schema in the document to represent the controls that you placed in the document by using the Word 2007 Content Control Toolkit. The Word 2007 Content Control Toolkit is pretty straightforward, but if you are interested in a tutorial, the tutorial posted on http://dbe.codeplex.com (from Andrew Coates) offers a detailed walkthrough of how to use the tool. Briefly the steps for using the Toolkit are as follows.

Start the Word 2007 Content Control Toolkit, and then click Open on the File menu.

Open the Word template that you designed.

Click the Edit View tab.

Click the Create a new Custom XML Part link at the bottom of the screen, and leave the Namespace drop-down list setting at its default.

Step 6: Modify the Word document's schema and upload it to SharePoint

Step 1

Step 2

Jan 15, 2010

Windows 7 God Mode

Create a folder anywhere and rename to GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
It will change to a control panel type folder and clicking it will allow you to have a single unified view of system features.





Jan 13, 2010

How to Manage Personal Content

This post serves as a guide on how to create and manage your personal content without losing control of it.


Background
Think about the enormous amount of information a person generates in their lifetime. You could be taking pictures, creating presentations, blog posts, creditcard purchases (which come as statements), etc. In spite of all the techonological innovations available, there does not exist a single current solution to encapsulate all of that disparate information and present it in a uniform and, more importantly, secure way.

I started looking into uniform, secure storage after nearly losing some photos in a laptop in a harddisk that crashed and after some personal experiences with certain photo sharing sites that refused to release (delete) my content.

Structure
I wanted the following:
  1. My content to be located in a safe, secure location 
  2. My content to have 99.9999 % availability
  3. Flexibility to interact with the content (via custom API that conforms to standards)
  4. Being able to uniquely identify the content
Approach
  1. I started off by registering my domain name (http://www.sukul.org/)
  2.  I then signed up for a free DNS service (http://www.zoneedit.com/)
  3. I signed up for the Amazon S3 storage account (paid) (http://aws.amazon.com/s3)
  4. I created the top level "buckets" to organize my information




  5. I registered CNAME entries on my DNS to map to those buckets:


  6. Although not 100% perfect, I am the stage where I do not have to rely on third party sites to share my content like photos. The URI also makes sense when referring to a particular piece of content; for ex:
    http://pictures.sukul.org/blog/shailen/cname_alias.png. I can also stream videos and audios from my storage location on demand. Note: Amazon S3 is charged on bandwidth served, so think about your audience and charges before streaming large files
  7. I can control security from a bucket to a folder and even an item level. It gives me a great degree of control over who can access my data
  8. Futures: I intend to finish off a personal project that will allow users to subscribe and securely store their content using the store above. Extending that, I could build a CRM system for individuals to manage personal finances and have enterprise level reporting and trending of their spend. Just wish I could devote more time to this...

Jan 7, 2010

Enterprise Content Types and Managed Taxonomies in Sharepoint 2010

Content Type Syndication - How it works
Content Type Syndication
 
Term: a word or a phrase that can be associated with an item in SharePoint Server 2010.
Term Set: is a collection of related terms. You can specify that a Microsoft SharePoint Server column must contain a term from a specific term set.

Terms can be divided into two types:
Managed terms: are usually pre-defined, can only be created by users with the appropriate permissions, and are often organized into a hierarchy.

Enterprise keywords: are simply words or phrases that have been added to SharePoint Server 2010 items. All enterprise keywords are part of a single, non-hierarchical term set called the keyword set.

Term Store Management Tool: tool used to create and manage terms and term sets. If you have the appropriate permissions you can use the Term Store Management Tool to:
• Create or delete a term set.
• Add, modify, or delete terms.
• Arrange managed terms within a term set into a hierarchy.
• Define synonyms.
• Import terms.
• Make enterprise keywords into managed terms by moving them into a term set.

Managed Metadata Column: Is a new column type. When you create a managed metadata column, you specify the term set from which the column's value must come. When you want users to provide information for list items (including documents), and the valid values for the information are contained in a term set, use a managed metadata column.

Managed Metadata Service: publishes a term store and, optionally, content types.

Managed Metadata Connection: consumes terms from the Managed Metadata Service

Term Set Roles

Role                    Allowed actions

Contributor          • Create, rename, copy, reuse, move, and delete term sets.
                           • Modify a term set’s description, owner, contact, stakeholders, submission
                           policy, and whether the term set is available for tagging.
                          • Create, rename, copy, reuse, merge, deprecate, move, and delete terms.
                          • Modify a term’s description, labels, default label, and whether the term is available for
                          tagging.
Group manager  • Perform all actions of the contributor role.
                          • Import a term set.
                          • Assign users to the contributor role or remove users from the contributor role.

Term store         • Perform all actions of the group manager role.
administrator      • Create and delete term groups.
                          • Assign users to the group manager role or remove users from the group manager role.
                          • Modify the working languages for the term store.

Farm administrator • Create a new term store.
                          • Connect to an existing term store.
                           • Assign users to the term store administrator role or remove users from the term store
                          administrator role.

Managed metadata services
When you enable managed metadata in your SharePoint Server 2010 application, a managed metadata
service and connection are created. The service identifies the database to be used as the term store, and the
connection provides access to the service. When you create new managed terms, or when users add
enterprise keywords, these terms are stored in the database that is specified in the managed metadata
service. When you publish a managed metadata service, a URL to the service is created. If you provide the
URL to the administrator of another Web application, the administrator can create a connection to your
service.

In addition to sharing metadata, you can also use the managed metadata service to share content types. By
creating a new managed metadata service and specifying a site collection as the content type hub, you can
share all content types in the site collection’s content type gallery.

You can create multiple managed metadata services, and share multiple term stores and content types from
multiple site collections. However, each managed metadata service must specify a different term store.

When you specify a nonexistent database for the term store, a new database is created.

Managed metadata connections
To use managed metadata, a Web application must have a connection to a managed metadata service. A
Web application can have connections to multiple services, and the services can be local to the Web
application or remote. When you create a managed metadata service, a connection to the service is created
automatically in the same Web application as the service.

After you create a connection to a managed metadata service, you can configure the following four options:

Default keyword location: Whether to store new enterprise keywords in the keyword set in
the term store associated with this managed metadata service.

Default term set location: Whether to store the term sets that are created when you create
new managed metadata site columns in this managed metadata service’s term store.

Use content types: Whether to make the content types that are associated with this managed
metadata service (if any) available to users of sites in this Web application. This option is available only if the service has a hub defined to share content types.

Push-down Content Type Publishing: updates from the Content Type Gallery to subsites
and lists using the content type: Whether to update existing instances of the changed content types in sub-sites and libraries.

Opening Sharepoint Docs in Office 2010

If you get an error message when trying to open Sharepoint 2007 documents in Office 2010 clients like the following:
"Could not open x…"

Here is how to resolve it:
In Internet Explorer, Go to Tools -> Options -> Connections -> LAN Settings and uncheck automatically detect settings.

Jan 5, 2010

Sharepoint 2010 Resources

Collation of materials on Sharepoint 2010


Redistributable Components

This is a redistributable package of the Microsoft Silverlight and Microsoft .NET managed client object models in Microsoft SharePoint Foundation 2010, intended for use by developers.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b4579045-b183-4ed4-bf61-dc2f0deabe47



Web Content Management

Routing

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ed922306-0d35-4764-8c2c-a378b54e90e1

Environment Setup

Authentication Guide
http://technet.microsoft.com/en-us/library/ee731989(office.14).aspx

Operational Guide
http://technet.microsoft.com/en-us/library/cc262289(office.14).aspx

Deployment Guide
http://technet.microsoft.com/en-us/library/cc262957(office.14).aspx

Guideline Links


Microsoft Documents

Hands on Labs [Pdf]

Source: Microsoft.com

Architectural Diagrams

Source: Microsoft.com

Whitepapers


http://technet.microsoft.com/en-us/library/cc263513.aspx

http://technet.microsoft.com/en-us/library/cc263199.aspx
http://blogs.msdn.com/sharepoint/archive/2007/04/09/investing-in-logical-architecture-design-samples.aspx

Unit Testing