Workflow development checklist

This checklist broadly describes the tasks that need to be completed to get a custom workflow deployed correctly from Visual Studio 2005…Create Visual Studio 2005 Project using the SharePoint Server Sequential Workflow templateDesign your workflowCode your workflow (workflow1.cs)Write feature.xmlWrite workflow.xmlEnsure a unique GUID is generatedAdd the projects publickeytoken to the xml filesAssign a strong-name key to our projectAmend to PostBuildActions.bat scriptEdit Post-Build Even script accordingly

Getting the public key of an assembly

To get the public key value of our assembly we need to open a Visual Studio 2005 Command Prompt. 
This can be found via the start menu by going Start > Program Files > Visual Studio 2005 > Visual Studio Tools > Visual Studio 2005 Command Prompt
In the command prompt type : sn -T “”path to your workflow dll”

Using SharePoint to manage Visio data

You can share documents among team members by placing them in a document library. The team can manage documents directly from the SharePoint site. Working from the SharePoint site provides the team with check-out, check-in, viewing, editing, and discussion group functionality.Uploading Files to a Document Library

You can add files to a document library several ways: For new documents, in the document library, select New and then choose the type of document or folder you want to create. If there are existing files that you want to add to a SharePoint site, select Upload and then choose Upload Document or Upload Multiple Documents to add many files at one time. (You can also add files directly from Visio. This is covered in the next section.)To investigate files in the document library

On the SharePoint site, click a document library to display the files within the library.
Notice the columns of file data (some columns are displayed by default and others can be added by the library administrator):
Type—An icon showing the type of file; for example, a Visio icon or a Word icon.
File Name
Modified—The last time the file was modified.
Modified By—The name of the user who last updated the file.
Check Out To—Who has the file checked out. (This is an optional column that can be easily displayed by modifying the default view.)
Move the pointer over a Visio drawing file. Notice that the file becomes shaded and a drop-down list box is presented.
Select the drop-down list. The following items appear:
View Properties
Edit Properties
Manage Permissions (New in Windows SharePoint Services 3.0)
Edit in Microsoft Office Visio (Choosing this option opens a drawing file in Visio. You can edit the file and, when you close it, you are prompted to save changes.)
Send To (New in Windows SharePoint Services 3.0)
Check Out
Add to My Links (New in Windows SharePoint Services 3.0)
Version History
Alert Me
Opening a drawing within Internet Explorer or in Visio does not automatically check out the file from the document library or lock it to the user who is making the change. Any team member who has write access to the document library can change files within the library. To help manage this process, Windows SharePoint Services provides a Check Out function and displays the name of the user who currently has the file checked out. This lets other team members know who is in the process of editing the file.Enforcing Check Out with Windows SharePoint Services Settings

Check Out is not required by default, but you can turn it on.To turn on Check Out

On the Settings menu, select Document Library Settings, and then select Versioning Settings.
Within Versioning Settings, set Require Check Out to Yes.
Requiring Check Out means that only one user can modify a file at a time. This reduces the possibility that changes will accidentally be overwritten by another user.To view or edit a Visio drawing from a SharePoint document library while using enforced Check Out

Click the name of a Visio drawing in a document library. A check-out dialog box appears, as shown in Figure 1. If you want only to view the drawing, you can open the file as read-only without checking out the file from the document library.
Figure 1. Checking out in the document library

To edit the drawing, select Check Out and Edit. The drawing is checked out from the SharePoint document library and opened within Visio. When the drawing is opened for editing in Visio, the File menu in Visio is modified to add a Check In command and a Discard Check Out command, as shown in Figure 2.
Figure 2. Check In and Discard Check Out commands in Visio

Modify the Visio drawing and then use Check In to check it back into the document library. The Check In dialog box appears, enabling you to save versioning comments along with this version of the drawing.
Figure 3. The Check In dialog box

Click OK to save the Visio drawing, check it back into the document library, and close the drawing file in Visio.Accessing Documents Stored on a SharePoint Site from Visio

Files stored on a SharePoint site can be accessed by the Office applications that created them, including Visio. You can use Visio to create a drawing that is saved to a SharePoint site, or you can use it to view or edit an existing drawing that someone else created and saved on the SharePoint site.
To create a drawing and save it to a SharePoint site

Create a drawing in Visio.
On the File menu, click Save As.
Navigate to the network location that is your SharePoint site. If prompted, provide a login and password.
Navigate to the document library folder where you want to save the file, and then click Save.
Go to the SharePoint site and view the information for the file that you just saved. The Modified By field contains the user name of the person who created the file.
You can also place files on a SharePoint site by using the Upload menu directly from the SharePoint site.To open, edit, or replace a document on a SharePoint site

In Visio, on the File menu, click Open.
Navigate to the network location that is your SharePoint site. If prompted, provide a login and password.
Navigate to the Documents Library folder where the file that you want to open is located. Select the file, right-click, and then click Open (or double-click the file name to open the file).
If Check Out is enforced within the document library, the file is automatically checked out of the document library before it is opened for editing within Visio. When the drawing is opened for editing in Visio, the File menu in Visio is modified to add a Check In command and a Discard Check Out command.Editing Documents Stored on a SharePoint Site Offline

Windows SharePoint Services 3.0 enables you to capture data in an offline folder so that you can edit it while you are not connected to the server. Then, when reconnected, you can update your files on the server.
You can also do this with Visio drawings. In Figure 1, notice the check box Use my local drafts folder. The local drafts folder is the location for storing data when you are editing offline. To set the location of the local drafts folder, in Visio, on the Tools menu, click Options and then, on the General tab, click Service Options. The Service Options dialog box appears, as shown in Figure 4.
Figure 4. The Service Options dialog box
Viewing a SharePoint Task List as a Visio PivotDiagram

When you create a SharePoint site, several types of lists are created for you. These default lists include a discussion board and a calendar list. You can customize the default lists in many ways, or you can create custom lists with columns that you choose.
Lists can also take advantage of e-mail features, if incoming or outgoing e-mail is enabled on your site. You can set up some lists, such as calendars, announcements, blogs, and discussion boards, so that people can add content to them by sending e-mail messages. You can set up other lists, such as tasks and issue-tracking lists, to send e-mail messages to people when items are assigned to them.
Lists can include many types of data, ranging from dates or pictures to calculations based on other columns. You can import data into Visio as PivotDiagrams, from the lists created in Windows SharePoint Services. After it is in Visio, you can pivot the data on any data column. For example, you can easily pivot on the Checked Out To column to quickly understand who has files checked out, how many files are checked out, and which files are checked out.
In the following example, we display a task list created on a SharePoint site in Visio as a PivotDiagram. We then pivot the data to check the completion status of the tasks and to check who is responsible for each task.
SharePoint Server 2007 includes a command on the Actions menu of the task list to create a Visio PivotDiagram from a list of SharePoint tasks. After the data is in Visio, the full features of Visio pivoting tools are available for viewing the data.
Figure 5 shows the task data as it appears on a SharePoint site .
Figure 5. Deck building project task list from Windows SharePoint Services

To create a Visio PivotDiagram from this data, on the SharePoint site, on the Actions menu, click Create Visio Diagram. Visio is launched, if it is not already running, and a multipage PivotDiagram is created in Visio. The first page of the resulting Visio drawing is shown in Figure 6. It shows the tasks by Status: Completed, In Progress, and Not Started.
Figure 6. PivotDiagram in Visio, created from a SharePoint site

Notice the tabbed pages in the Visio window. Two additional views are automatically created: Workload Distribution and Incomplete Tasks by Assigned To. These views are shown in Figure 7 and Figure 8.
The Workload Distribution diagram, shown in Figure 7, shows the task data pivoted by Assigned To and then by Status; we can easily see the status of each worker’s tasks.
Figure 7. The Workload Distribution view

The Incomplete Tasks by Assigned To view, shown in Figure 8, is similar to the Workload Distribution view except that now we are looking at the tasks by Assigned To and then by Status, so we can identify all incomplete tasks by worker.
Figure 8. Incomplete tasks by Assigned To

A Visio diagram created from a SharePoint task list automatically presents three different views of data, but these are not the only views available to you. Diagrams are completely dynamic. You can create other views by choosing a pivot node and pivoting on a different category.Viewing a SharePoint Task List as a Visio Flow Diagram

You can quickly import and display data directly on your Visio shapes. The first step is to connect to the data source and import the data into your drawing. The second step is to link the imported data to shapes. See the articleIntegrating Visio 2007: Introduction to Integrating Visio with Other Microsoft Programs for simple examples of importing data and linking it to shapes in a Visio diagram.
In the following example, we start from a task list created on a SharePoint site. The tasks define the elements of a training course development project. An alternative view of this data that shows the logical sequence of the steps as a flow diagram would be very useful. You can accomplish this easily by importing the task data into Visio and associating that data to shapes in a Visio diagram.
Figure 9 shows a screen shot from the SharePoint site where the tasks are initially defined.
Figure 9. Task list as defined on a SharePoint site

To create a Visio flow diagram from this task list, we must first capture the data in the Visio environment:
In Visio, on the File menu, click New, select Flowchart, and then select Cross Functional Flowchart.
After the drawing window is established, on the Data menu, click Link Data to Shapes. The Data Selector dialog box appears, as shown in Figure 10.
Figure 10. The Data Selector dialog box

Select Microsoft Windows SharePoint Services list, and then follow the prompts to identify the SharePoint task list shown in Figure 9.
The data from the list is added to the Visio External Data window, as shown in Figure 11. Initially, all of the fields of data associated with these tasks are displayed in the External Data window.
Figure 11. The Visio External Data window

You can control which fields appear and the order in which they appear. Right-click within the External Data window, and then click Column Settings. The Columns Settings dialog box appears, as shown in Figure 12. Choose the columns to be displayed and the desired order, and then click OK to close the dialog box.
Figure 12. The Column Settings dialog box

Now that the data is in Visio, you can complete the flow diagram by completing the following steps:
Add Swimlane shapes and set text into the shapes.
Add a Process shape to the drawing.
Select a row of data in the External Data window, and then drag data from this row onto the shape. This associates the row of data with this shape.
Repeat adding shapes and associating rows of data until all of the desired data is associated with shapes in the drawing. (You do not need to associate all the rows of data.)
Add connectors.
At this point, the basic drawing is complete and the data is associated with diagram shapes. Now, suppose that the data is updated on the SharePoint site and you want to update the drawing. This is a one-step process! In Visio, right-click within the External Data window, and then select Refresh Data. The data in the External Data window is updated and the drawing is updated because the shapes are associated; they are updated at the same time.
To dress up the drawing a bit, add a theme to format the shapes and add associated data graphics to the shapes to display the task Title field and %Complete field as data on the shapes.
The final result is shown in Figure 13.
Figure 13. Final drawing showing Visio data connected to tasks imported from a SharePoint site
Viewing a SharePoint Calendar List as a Visio Diagram

In another example, data created as a SharePoint calendar list is linked to a Visio drawing and the calendar items are displayed as a timeline. Within a SharePoint site, you can change views on the calendar data. There is the normal calendar view, but in the calendar view it is difficult to see items spread over a long period of time. Figure 14 shows an image from a SharePoint list of calendar items in a datasheet view. Now we can see all of the items easily, but a graphical representation would enable you to more easily see the amount of time that exists between each item.
Figure 14. Calendar data in SharePoint datasheet view

To understand how to link to the SharePoint calendar data in Visio, we explore in greater detail the tools available in Visio for matching external data to Visio shapes. Sometimes the names of the Shape Data fields in Visio shapes do not match perfectly the data being imported. This example shows how to make that association without reprogramming the shapes.
The objective of this example is to link to SharePoint calendar data from Visio and integrate the calendar data into a Visio timeline drawing by using existing Visio timeline shapes. This example requires no programming. However, you need to make some adjustments to the data column header names that contain the SharePoint calendar data to match them with the shape data fields in the Visio timeline shapes. The milestone timeline shapes have predefined Shape Data fields: Task Name and Start. When the Task Name is set, its data is automatically displayed as text on the shape. The Shape Data for Start is used to automatically position the shape along a cylindrical timeline.
To force matches between the data fields

Start by creating a Visio timeline drawing. In Visio, on the File menu, click New, select Schedule, and then select Timeline.
Next bring the SharePoint data into the Visio drawing environment. On the Data menu, click Link Data to Shapes. The Data Selector Wizard appears.
Figure 15. The Data Selector Wizard in Visio

In the Data Selector Wizard, select Microsoft Windows SharePoint Services List. The Data Selector dialog box, as shown in Figure 15, appears. Select or type the path to the SharePoint site containing calendar data. Click Next, select Calendar, and then click Finish. The data is imported into the Visio External Data window, as shown in Figure 16.
Figure 16. Data imported into the Visio External Data window

From the Timeline Shapes stencil, add a Cylindrical timeline shape to the drawing page. The Configure Timeline dialog box appears, as shown in Figure 17. Configure the start and end dates based on the data being linked to.
Figure 17. Configure the start and end dates for the timeline shape

The next steps involve adding milestone shapes to the Visio drawing and linking the rows of data to the shapes.
Drag a Cylindrical milestone shape into the drawing. Notice that it automatically displays a date and text. The values are taken from the Shape Data fields Start and Task Name. Verify this by displaying the Shape Data window, selecting the shape, and experimenting with changing the values in these Shape Data fields.
The key to displaying the start date and the description from the SharePoint list item on the milestone shape is to have the SharePoint data take over the values in the milestone shape’s Shape Data fields.
Whenever data is linked to a Visio shape, new Shape Data fields are added to the shape for each field within the data—unless a Shape Data field of the same name already exists. You can easily force a match with the milestone shape’s Shape Data fields by changing the column headings in the Visio External Data window to exactly match the names in the Shape Data window.
In the Visio External Data window:
Right-click within the window, and then click Column Settings.
Select the column Start Time, and then click Rename. Change the name to Start.
Select the column Title, and then click Rename. Change the name to Task Name.
Figure 18 is a view of the External Data window after these changes have been made.
Figure 18. The External Data window after modifications to the column names

You can turn off the display of unnecessary columns by removing the check mark from the column name.To link all rows in the External Data window to shapes in the Visio drawing

In the Timeline Shapes stencil, select the Cylindrical milestone shape.
In the External Data window, select all of the rows, and then drag the selection from the External Data window into the Visio drawing. Because the Cylindrical milestone shape is the current selection in the stencil window, an instance of the Cylindrical milestone shape is added for each row of data.
The final result is shown in Figure 19. We have added a background page and a drawing title to dress up the drawing a bit.
Figure 19. Final linked drawing

Notice the Shape Data window for the selected shape. It shows the same data that is displayed in the External Data window for Start and Task Name, and this same data is shown as text on the shape in the drawing.
You can link to existing Visio shapes, even if they already contain text fields for displaying Shape Data. Some investigating might be necessary to determine what information is displayed on the shape. In this case, we modified the SharePoint Start Time data to be named Start. This allowed the existing Visio Cylindrical milestone shape to display the proper date without modification. Similarly, we changed the SharePoint Title field to Task Name

Attach a file to a SharePoint list record item

Attach a file to an existing list itemOn the top link bar, click Documents and Lists.Click the list in which you want to attach a file.Point to the existing list item, click the down arrow that appears, and then click Edit Item.Click Attach File.Click Browse to locate the file you want to attach to the list item, and then click Open.Click OK.Click Save and Close.

Note  If the site you’re using is a Meeting Workspace site, ignore step 1. For step 2, click the list title in the Web Part.

Create a new list item and attach a fileOn the top link bar, click Documents and Lists.Click the list in which you want to attach a file.Click New Item to add a new list item.In the fields provided, type the title of the list item and any other information that is required.Click Attach File.Click Browse to locate the file you want to attach to the list item, and then click Open.Click OK.Click Save and Close.

Issues with repeated SharePoint feature installation

Having recently encountered issues with features not being installed correctly when you are trying to deploy an updated version, I think I have stumbled upon the secret recipie to success:

Deactivate the feature at the appropriate level

Run uninstall.bat to uninstall the feature from any sites where it has been installed.

Copy the new wsp file to your deployment folder

Run install.bat to install the feature to any sites

Wait for a minute, as elements of the site will have been restarted during 4 and rushing causes problems

Reactivate the feature

Clear your browser cache

Shift-refresh the page with the feature on it to be sure of the latest version

This process seems to fix the problems of new items in elements.xml not being made available to site collections where the old version of the feature had previously been deployed.

Creating a KPI list based on a SharePoint list

SharePoint as a business tool can be utilized for displaying data for the end users. And not just displaying the data, but displaying it in brief so that the users get to know the overall scenario without getting down to the basics. For these reasons, I have always liked SharePoint.
Key Performance Indicator (KPI) is financial and non-financial metrics used to help an organization define and measure progress toward organizational goals. KPIs can be delivered through Business Intelligence techniques to assess the present state of the business and to assist in prescribing a course of action.

Sample KPI list
Consider the following scenario:
You have a company where the performance is based on Surveys that the users provide for the product/company. The Company Director would like the survey data targets to be displayed on the home page of a report site on the SharePoint web application. Now, there are four parameters that need to be displayed on the KPI list.Top Area [Overall survey points including all the parameters. The total point are 10 and if the user give a overall survey of equal to or greater than 8 points, then that would be considered under this parameter]Bottom Area [This is opposite of Top Area. Now if the end user give a overall score of equal to or less than 4 points, then that would be considered under this parameter]Product Quality [This is the individual rating the end user gives about the product that they are using. This is also a score out of 10 points. If the user gives a score of equal to or greater than 8 points then that would be counted positive under this category or else for any value less than 8, it would be considered as negative]Engineer Knowledge [This is the individual rating the end user gives based on what they think about the support engineer/executive/customer service agent that they has a talk with. This is also a score out of 10 points. If the user gives a score of equal to or greater than 8 points then that would be counted positive under this category or else for any value less than 8, it would be considered as negative]
The above scenario is just an example so that we can develop out KPI list. The scenario may depend on the company requirement.
e.g. A sales company may want to display the sales that are done for different products in different areas. As per the definition of KPI, it is not necessary that we display only financial data. We can display any data where target is in picture. E.g. if a department want to meet 75% of total product sales in a specific region, we can create a KPI list that can show the current status of the sales as per the data that is present in a SharePoint list / database / external source like XML. In this tutorial, we will first continue with using another SharePoint lists as the data source for generating the KPI list.
So, now that we have an understanding of the scenario, let us get started with the actual work.I have created a collaboration portal site which by default creates a “Reports” sub site under the top level site. We can even use a team site or a blank site template to start with. But there might be features that are required for a specific web part to function properly. For these reasons, I tend to start off with a publishing site template and then test it with other templates.Browse to the “Reports” site and click on “View All Site Content” in the quick launch bar. Select the Create button in the Actions menu bar.
Create Site Content
Create a list. I am using the Custom List, so that I can have the columns as per the report requirements.
Creating Custom List
Enter the description of the custom list and click on “Create” button.
Survey Data – Custom List Details
Now to add the custom columns, we need to click on “Settings” button in the Actions menu bar of the list and go to “List Settings”.
Survey Data – List Settings
Under the columns section, select “Create Column” and create the following columns in the list.
Survey Data – Columns

The Engineer column is a lookup column that is pulling out data from other list [which contains the engineer details. This concept in SharePoint is called re-usability, where a list can contain general data and that can be used in multiple locations. Thus the end-user does not have to always feed in the data for the individual items. The list automatically pulls out the data that is present and the user just have to select the item from the list.]
 Once we have the above columns created, we will add some items in the “Surveys” list. This data will be used for getting the KPI on out site. After filling in some items, the list should look somewhat like this.
Survey Data – List Items
Now that we have the data filled in the list, we need to create a KPI list in the site. So, once again , we will browse to the “View All Site Content” of the Reports Site and select the “Create” Option. This time, select the “KPI list” under the custom list section and fill in the details to create a KPI list. Now, we have already been through the process of creating a list, so I am keeping it short this time.Once the list is created, it should look like this.
Survey KPI – Blank List
Select, New -> Indicator using data in SharePoint list
Creating a new KPI item
Put the following settings for the KPI item
Name : Top Area
Description :This KPI displays the performance indicator for the top area.
List Url : Select the “Survey Data” list from the list locator. The url should be
/Reports/Lists/Survey Data/AllItems.aspx
         Under the “Value Calculation” section, Keep the option – “Percentage of list items in the view where” selected as we are going to show the data in percentage format on the KPI.
         Select the “Overall” column -> is greater than or equal to -> 8 [Here, “8” is the value which defines the limit. If the Overall score of the survey is greater than “8” then the survey data will be counted under the Top Area parameter.]
Moving on to the next section [Status Icon], select the following settings:
         Better values are : greater
         Display when has met or exceeded goal           70
         Display when has met or exceeded warning     65
         Display otherwise
 Leave the other settings as default and click on “OK” button.
Now, this was an example for the “Top Area” KPI parameter. Similarly, I have created 3 more KPI items for the bottom area, engineer knowledge and product quality. Now all these items have their own logic as the one above. Depending on the scenario, you can create your own KPI items.
Once the KPI items are created, the KPI list should look like this.
Final Survey KPI list view

Now, you have your KPI list ready and working. The only thing that might be missing is to display the list on your home page of the Report site. For that you need to browse to the home page of the Report Site -> Site Actions -> Edit Page -> Click on “Add a web part” on a zone of your choice.
Add the “Key Performance Indicators” web part on the page.
KPI Web Part

Configure the KPI web part and specify the “Survey KPI” list as the source for the KPI web part and there you are.… KPI on your Report site.

App Offline – Nice feature to bring down Microsoft SharePoint based sites

the “”App_Offline.htm”” feature in ASP.NET 2.0 provides a super convenient way to bring down an ASP.NET application while you make changes to it (for example: updating a lot of content or making big changes to the site where you want to ensure that no users are accessing the application until all changes are done).
The way app_offline.htm works is that you place this file in the root of the application.  When ASP.NET sees it, it will shut-down the app-domain for the application (and not restart it for requests) and instead send back the contents of the app_offline.htm file in response to all new dynamic requests for the application.  When you are done updating the site, just delete the file and it will come back online.