Thursday, June 2, 2011

SSO between MOSS2007 and Cognos 8.4

Recently I Implemented single sign-on between MOSS 2007 and Cognos 8.4. I followed the guidelines given by IBM team here
http://public.dhe.ibm.com/software/dw/dm/cognos/security/general/integrating_microsoft_sharepoint_portal_2007_or_sharepoint_services_3.0_with_c8v3.pdf

but it is not given detail steps what to do on MOSS server and cognos server in case of both software are installed on different servers.

Below are my findings and would like to share with all of you.

Note: - Here assuming that MOSS2007 and Cognos 8.4 are installed on separate servers and both softwares are working fine.

1.1 Set Virtual Directory Properties

1.1.1 CognosR3

Create virtual directory in IIS (CognosR3 name is just example given in this document). Set its properties as below

· Local path – Webcontent folder

· Read, Log visits and index this resource is checked

· Application Name – cognosR3

· Execute Permissions – None

· Application Pool - DefaultAppPool

Go to ‘Security Directory’ tab and set below properties

· Enable anonymous access - selected

1.1.2 Cgi-Bin

Create virtual directory as cgi-bin under cognosR3 directory in IIS and set its properties as below

· Local path – cgi-bin folder

· Log visits and index this resource is checked.

· Application Name – cgi-bin

· Execute Permissions – Scripts and Executables

· Application Pool - DefaultAppPool

Go to ‘Security Directory’ tab and set below properties

· Enable anonymous access - selected

1.2 Set Environment tab

In Cognos configuration, set the below properties

· Gateway URI – http:// address:port number>/cognosR3/cgi-bin/Cognos.cgi

· Allow namespace override – True

Note – Replace all ‘localhost’ with IP address in all URLs.

1.3 Set Portal Services

In Cognos configuration, open ‘Portal services’ and set below properties

· Web Content URI - http:// address>/cognosR3/cgi-bin/cognosisapi.dll/wsrp/cps4/portlets/nav?b_action=cps.wsdl&wsdl (Optional)

· Trusted Signon Namespace ID – ADS

· Shared secret – Training (Optional)

1.4 Set Namespaces

1.4.1 ADS

In Cognos configuration, create ‘ADS’ as new namespace and set its properties as below

· Type – NTLM

· Namespace ID – ADS

· NTLM domain name –

· Advanced properties – singleSignonOption (Optional)

1.4.2 CPS Trust

In Cognos configuration, create ‘CPSTrust’ as new namespace and set its properties as below

· Type – Custom Java Provider

· Namespace ID – CPSTrust

· Java class name – com.cognos.cps.auth.CPSTrustedSignon

Note: - After setting all properties in Cognos configuration, save and restart it.


2.1 Copy SharePoint folder

Copy ‘SharePoint’ folder from Cognos server location “:\Program Files\Cognos\c8\cps\SharePoint”

To SharePoint server at below location

C:\Inetpub\wwwroot\WSS\VirtualDirectories\

Note: - Please take the backup of ‘bin’ and ‘wpresources’ folders. During copying the folders, you may get a warning that you are about to overwrite existing files/folders. Select ‘Yes to all’.

2.2 Config files

2.2.1 Wss_cognostrust.config

Copy below file to location “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG”

2.2.2 Web.config

Open web.config. sample below file and make the changes in existing web.config file which are commented in // IBM COGNOS // lines

2.3 Dwp files

Open dwp files from location (“C:\Inetpub\wwwroot\WSS\virtualDirectories\\wpcatalog”) and make changes in tags below

http:// address>/cognosR3/cgi-bin/cognosisapi.dll/wsrp/cps4/portlets/nav?b_action=cps.wsdl&wsdl

Note: -Need to make changes in all .dwp files

2.4 Reset IIS

After making all changes, need to reset IIS and open SharePoint site.


2.5 Add web parts

Open SharePoint page and edit it. Add Cognos Navigator web part. It should display home page from Cognos site as below.

Sunday, March 6, 2011

Workflow in SharePoint 2010

SharePoint 2007 introduced workflow for collaborative applications and many organizations have benefited by moving manual processes into SharePoint workflow. The primary reason why we use workflow in software design is to manage long running processes. And while computer hardware is designed to complete processes as fast as possible, waiting for people to complete forms, make decisions, or share results of external actions always takes longer than the millisecond response time required to keep a CPU busy. SharePoint workflow is the ideal way to automate these manual processes which previously required paper or the use of complex software to record and monitor any long running activities.

Windows Workflow Foundation was first introduced in 2005 and was originally included in the Microsoft .NET Framework 3.0. Today, SharePoint 2010 offers many new improvements for workflow developers and builds on the popularity of workflow in SharePoint 2007. SharePoint workflow is recommended for long-running human workflows where we are often waiting for people to complete tasks. This article will introduce you to the key concepts and describe the new features available. First, I will talk about the new features in SharePoint 2010 for workflow developers and then I will walk through a couple of new user scenarios.

Workflow Model Design Tools Improvements

SharePoint 2010 provides more choices in tooling to better fit the needs of those creating and maintaining workflow models. The tools for workflow development include Visual Studio 2010, SharePoint Designer 2010 and Visio 2010.

It should be noted that SharePoint 2010 requires .NET Framework 3.5. The next version of the .NET Framework 4.0 is currently in development but product timelines meant SharePoint 2010 was not dependent on it.

Visual Studio 2010 includes many tooling improvements for SharePoint projects, specifically for workflow projects. The new SharePoint Solution (WSP) packaging helps deploy your workflows easily onto the SharePoint server, allowing you to add ASPX workflow initiation and association forms to Visual Studio 2010 workflow projects (Figure 1). In a walkthrough later in this article, I will show you how to add an initiation form.


Figure 1 The Visual Studio 2010 SharePoint Project Templates

SharePoint Designer 2010 also has a new graphical workflow designer for designing workflows and deploying them directly to SharePoint. It can also be used as a prototyping tool before workflows are further developed in Visual Studio 2010.

Another improvement in SharePoint Designer 2010 is that it now allows you to edit the out-of-the-box workflows that come with SharePoint. It will also use InfoPath forms if InfoPath is installed or the Data Form Web Part if InfoPath is not installed; previously, only ASPX forms were used by SharePoint Designer 2007. Since you can use InfoPath forms now, it makes it very easy to edit those forms later with InfoPath to improve them. If you have new columns specified in a workflow, they will automatically be added to the schema of the list that you associate with the workflow. These are known as association columns and can be used throughout the SharePoint Designer workflow. User profile data can be bound to properties in workflow, making it possible to get information about the SharePoint user profile. For example, you could look up the name of a direct manager for approvals.

SharePoint Designer 2010 includes a new task process designer that creates an activity in the workflow but allows flexibility in how you manage the approval process all within that one activity. This includes defining escalation processes, delegation, defining approval requirements and semantics of what happens if the underlying document is changed during the approval.

Workflow models can be created in Visio 2010 for further editing in SharePoint Designer 2010. Visio 2010 supports Business Process Modeling Notation. It also supports sub-processes and containers to break up the diagram and validation to analyze a diagram to ensure it is properly constructed.

New Workflow Models in SharePoint 2010

Site Workflows

Site workflows release workflow developers from requiring a list item or document item to run workflows against. This is useful for when the process that the workflow is implementing does not start as a result of a list item or document. This is such a common scenario that developers will create dummy lists and items in order to just to add workflows. In Visual Studio 2010, you simply pick Site Workflow when creating the workflow project item, as shown in Figure 2.


Figure 2 The Site/List Workflow Dialog Page

You can get to the activated site workflows by choosing Site Workflows from the Site Actions menu in SharePoint. It shows you new workflows you can start, any running site workflows and completed workflows. Since site workflows don’t have a list item or document to start from, they must be started manually through the SharePoint user interface or via the SharePoint API.

Reusable Declarative Workflows

In SharePoint Designer 2010, you can create reusable declarative workflows. In SharePoint 2007, a workflow model created in SharePoint Designer could only be associated with one list. These reusable workflows do not rely on a specific list but can be associated with any list. The workflow design can be reused and associated with multiple lists. Also, the Save as Template command can be used to create a WSP file containing a reusable workflow which can be moved to another SharePoint server or to Visual Studio 2010. In SharePoint Designer, this means you don’t have access to the list fields to access data since no specific list structure is connected.

Runtime and Hosting Improvements

High Privilege Workflows

In SharePoint 2007, workflows ran as the identity of the logged on user. In SharePoint 2010, with high privilege workflows you can specify an account to run a workflow as to give it additional needed permissions (see Figure 3). When creating a workflow in SharePoint Designer 2010, individual steps can be added that enable it to run as the author of the workflow instead of the logged on user.


Figure 3 The SharePoint Designer Workflow Showing a High Privilege Impersonation Step

SPTimer Location

SharePoint executes workflow instances in one of two places depending on the last action. If the last action in the workflow was waiting on a user input, the workflow continues to execute on the Web front end where the user completed that input. If the workflow is continued from a delay timer or from an event being received elsewhere, it executes within the SPTimer service. Using a new option in SharePoint Central Administration, you can now set the preferred server where the SPTimer service runs. To do this, click in the Manage Content Databases menu of the Application Management section of SharePoint Central Administration. Then click on your content database and scroll down to the setting for Preferred Server for Timer Jobs (as shown in Figure 4). You can also manually stop the SPTimer service on any servers you don’t want it to run on.


Figure 4 Setting of Preferred Server for Workflow Timer Jobs

Workflow Messaging Improvements

SharePoint 2010 adds four new workflow Event Receivers for list based workflows. The four workflow event receivers available are Starting, Started, Postponed and Completed (as shown in Figure 5). These are similar to other SharePoint event receivers and they execute code on the server in response to the event. To make development easier, Visual Studio 2010 includes event receiver project types to make using these events fairly simple. The new events attach to a specific list and fire whenever the event occurs on workflow instances associated with that list, which means that these event receivers can’t fire on site workflows. Event receivers also require a list.


Figure 5 The Event Receivers That Can Be Built in Visual Studio 2010

SharePoint 2007 made it easy to involve people in workflows, but it was difficult to send and receive messages with external systems. The recommended approach was to use task items to send a message to the external system using a Web service and have the external system update the task to return the result.

SharePoint 2010 adds support for pluggable workflow services. These will be familiar to Windows Workflow Foundation (WF) developers and are defined by creating an interface containing methods and events. This interface is connected to a pair of activities called CallExternalMethod and HandleExternalEvent. A tool comes with WF in the .NET Framework called WCA.exe to generate strongly-typed activities for sending and receiving based on the interface. These generated activities can be used in SharePoint workflow also. They do not require the interface to be set as properties and instead can be dragged directly from the toolbox to the workflow design surface.

The service code that integrates with SharePoint workflow is loaded into the GAC for access by the workflow. It needs to inherit from the SPWorkflowService base class and it needs to be referenced in the web.config.

Using these new activities, you can send asynchronous messages to an external system right from within the SharePoint workflow. I will investigate creating and using these activities later in this article in the second walkthrough.

Walkthrough of Building a Simple Workflow in Visual Studio 2010

The key thing in SharePoint workflow is to interact with people, so the simplest thing to do is assign a task to someone and wait for their response. The following shows how the new Visual Studio 2010 SharePoint tools make that task assignment really easy to build.

Step 1 - Create a new SharePoint Sequential Workflow project

Creating a new SharePoint workflow project is easy. Choose sequential workflow on the new project template selector as shown previously in Figure 1. This can also be done with the state machine workflow style.

The new workflow project wizard has four pages. The first is a page that all SharePoint tools project templates have in common, where you identify the URL of the local SharePoint site you want to use to deploy and debug your solution, as shown in Figure 6.


Figure 6 First Page of the New Workflow Project Wizard

The second is a page where you supply the name of the workflow and choose whether to associate it with a list or as a site. This page is shown earlier in Figure 2.

The third page is where you decide if Visual Studio will automatically associate the workflow for you or if you can do it manually after it has been deployed. If you choose to leave the box checked, it has selections for the list to associate with (if you previously chose a list-based workflow), the workflow history list to use and the task list to use (see Figure 7). Typically, the history and task list will not need changing.


Figure 7 Third Page of the New Workflow Project Wizard

The fourth and final page is where you select how the workflow can be started (see Figure 8). You should not unselect all three of these or your workflow will be very difficult to start. For a site workflow, you can only choose manually starting the workflow. For a list-based workflow, you can also choose to start the workflow instance when a document is created or to start when a document is changed.


Figure 8 Fourth Page of the New Workflow Project Wizard

The new blank workflow model looks like Figure 9 in the design surface in Visual Studio 2010. The workflow activated activity is derived from the HandleExternalEvent activity and provides initialization data from SharePoint to the workflow instance. I will cover more of the HandleExternalEvent activity later.


Figure 9 The Default Blank Workflow Showing the WorkflowActivated Activity

Step 2 – Add an initiation form to the workflow

An initiation form can be shown to the user when they start the workflow. It allows the workflow to gather parameters before it gets started. This can be added in Visual Studio 2010 easily by right clicking on the workflow item in Solution Explorer and choosing Add then New Item, as shown in Figure 10. Select the Workflow Initiation Form template and the new form is automatically associated with the workflow. It is an ASPX form that you edit in HTML (see Figure 11).


Figure 10 Adding a Workflow Initiation Form

One method called GetInitiationData needs editing in the code behind the ASPX file. This method only returns a string; if there are multiple values, it is recommended you serialize them into an XML fragment before returning them. Once the workflow instance is running, it is easy to get to this string just by referencing workflowProperties.InitiationData. The multiple values will need to be de-serialized from the XML fragment if they were serialized in GetInitiationData.


Figure 11 The Default Workflow ASPX Initiation Form

For the initiation form, a single text field will be added and then that field will be returned from the GetInitiationData method. The tags in the following code are added inside the first asp:Content tag, like so:

 

The GetInitiationData method already exists and just needs to have code added to return the MyID.Text property. The following code shows the updated method code:

private string GetInitiationData()
{
// TODO: Return a string that contains the initiation data that will be passed to the workflow. Typically , this is in XML format.
return MyID.Text;
}

Step 3 – Add a workflow log activity

The LogToHistoryList activity is extremely easy to use. Each workflow instance created has a history list that can display in the SharePoint user interface. The activity takes a single string parameter and adds an item to that list. It can be used for reporting the status of workflow instances to users in production. Simply drag the LogToHistoryList activity from the toolbox to the workflow design and set the description property (see Figure 12).


Figure 12 The Visual Studio Toolbox Showing SharePoint Workflow Activities

Properties in workflows are called dependency properties. These are bound at runtime to another activities dependency property, such as a field, a property or a method. This process is often called wiring up and it is what allows activities to work together in a workflow even though they don’t have specific type information for each other at compile time. Each property in the property window in Visual Studio is wired to a class field or class property in the workflow class. Fields are the simplest to create and the dialog that comes up when wiring up the workflow property allows for creating new fields, creating new properties or wiring to existing ones.


Figure 13 Dependency Property Binding to a Created Field

Figure 13 shows adding a new field with the default name. The following shows the added code to the MethodInvoking event handler for the activity to set the property to the workflow initiation data:


public String logToHistoryListActivity1_HistoryDescription1 = default(System.String);

private void logToHistoryListActivity1_MethodInvoking(object sender, EventArgs e)
{
logToHistoryListActivity1_HistoryDescription1 = workflowProperties.InitiationData;
}

You can actually set the HistoryDescription property directly in code since this property doesn’t connect between activities, but it is a good simple activity in order to learn a little about dependency properties.

Step 4 – Add a CreateTask activity

This next step is the main part of human workflow interaction known as the SharePoint task item. Create a task, assign it to a person and then wait for the person to make changes to that task. The CreateTask activity has to be dragged onto the workflow design surface and then configured with all the required properties. Figure 14 shows the CreateTask properties window just after the activity is dragged on to it.


Figure 14 The Properties Pane Showing the CreateTask Activity

The first thing needed here is a correlation token for the task. A correlation token is used for message correlation in workflow. It provides a unique identifier that enables a mapping between a task object in a specific workflow instance and the workflow runtime in SharePoint. This is used so that when SharePoint receives a message for the workflow instance it can locate the correct task within the correct workflow instance. The CorrelationToken property must be configured and it’s not recommended to use the WorkflowToken for tasks, although this isn’t prevented in the tool. Enter the new name for the correlation token as TaskToken and press enter. Then expand the (+) symbol which appears and click the drop down to the right of OwnerActivityName and choose the workflow.

The TaskId must be configured and a new GUID specified for the task id. This is done by selecting the TaskId property and clicking the […] ellipsis to bring up the property editor. Click the Bind to a new member tab, choose Create Field, and then click OK. The same must be done for the TaskProperties property by again selecting the property, clicking on the ellipsis and adding a new field. Next, double click on the new CreateTask activity on the workflow design surface to bring up the createTask1_MethodInvoking handler code and set the properties in code.

The new task must be given a title, and for good measure I will set the task description to the string I got from the initiation form. Once all those properties have been set, this is the added code:

public Guid createTask1_TaskId1 = default(System.Guid);
public SPWorkflowTaskProperties createTask1_TaskProperties1 = new
Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties();

private void createTask1_MethodInvoking(object sender, EventArgs e)
{
createTask1_TaskId1 = Guid.NewGuid();
createTask1_TaskProperties1.Title = "Hello";
createTask1_TaskProperties1.Description = workflowProperties.InitiationData;
}

Step 5 – Add the OnTaskChanged and CompleteTask activities

Use the While activity to wait for multiple changes to the task until you see the changes you want. The While activity must contain another activity, such as the OnTaskChanged activity. The Listen activity can also be used to listen for multiple events at one time by adding a Listen activity with actual event receiver activities inside the Listen branches. Alternatively, you can just wait until the task is deleted with the OnTaskDeleted activity.

A common requirement is to escalate or timeout waiting for an event. This is done by using a Listen activity to listen for both the task changed message and a timer message by using a Delay activity. The first message to be received by either contained activity resumes the workflow and the other activity stops waiting. The Delay activity is sent a message when the timeout occurs.

There are lots of options described above but the simplest is to use OnTaskChanged which will wait for any change to the task item and then continue on. To configure the OnTaskChanged, you need to wire up the CorrelationToken and the TaskId properties to the same fields as the CreateTask.

Last, add a CompleteTask activity and again set the CorrelationToken and TaskId properties. As shown in Figure 15, the activities that wait for a message are green while activities that send a message are blue. This is consistent throughout SharePoint workflow.


Figure 15 The Completed Simple Task Workflow Model

Step 6 – Deploy and Test the Workflow

Now the workflow is almost complete, so press F5 and wait for the deployment. Pressing F5 will compile the workflow, package the workflow into a WSP, deploy that WSP to SharePoint, activate the SharePoint features, attach the Visual Studio 2010 debugger to SharePoint and start Internet Explorer with the SharePoint site.

Once the SharePoint site appears, choose Site Workflows from the Site Actions menu. You will see all of the site workflows and you can click on yours to start it. Once it is selected, you will see your workflow initiation form, as shown in Figure 16.


Figure 16 The Workflow Initiation Form

Other improvements can be added to this basic starter workflow model, such as using a content type to define the task you assign to a person, using email to notify the user they have been assigned a task, and even using InfoPath forms to create more complex forms for users to complete in email or online.

Walkthrough of Building a Pluggable Workflow Service

New in SharePoint 2010 is the ability to add pluggable workflow services to SharePoint. This has always been possible in Windows Workflow Foundation, but the SharePoint-hosted workflow runtime was locked down and previously didn’t allow this. Primarily pluggable workflow services are designed for sending and receiving messages out of a workflow instance. But they are also valuable for any long-running system operation such as a long-running calculation.

This is the mechanism which the workflow runtime uses to manage long-running work as a generalization of messaging. It simply executes the short-running work within activities and suspends the workflow until long-running actions have completed or a message is received to indicate a person completed a task. So while waiting for a person to respond, the workflow instance is dehydrated and does not take up CPU or RAM resources on the server it is executing on. (Dehydrated simply means the state of the workflow instance is written to a database record in such a way that it can be rehydrated back and continue on later.)

All types of long-running work are handled the same way by workflow. First, it starts the long-running work or sends a message and then it suspends the workflow until the long-running work is finished or the response is received. The correlation token is used to ensure the correct workflow instance is resumed when a response is received.

As an example, consider two common examples of long-running work. One example is a synchronous Web service request where the caller is blocked until a response is received on the channel. This is not suited to run within a workflow activity. The workflow service needs to wait for the Web service call to complete and then to send a message back to the workflow instance with the response. Another example is a CPU intensive work item that needs to run but because it may take longer than a second it needs to run outside of the workflow activity. Again, you can use a workflow service and create a thread in the workflow service to execute the CPU intensive work item. The new thread can send a message back once it is finished.

Both of these examples are implemented with the same pattern. The following walkthrough shows how to create a new SharePoint Sequential Workflow and call a pluggable workflow service that factors prime numbers to identify how many prime numbers there are under 100,000,000. This work takes too long to execute within the main line of an activity.

Step 1 – Create a Pluggable Workflow Service

To create a pluggable workflow service in Visual Studio 2010, you need to implement the service as an interface and class in your project. Figure 17 shows an example of a pluggable workflow service which can be added to your project in a new class file called MyService.cs. In the code, the interface definition is in IMyService, the interface implementation in class MyService and the MessageOut method runs most of the logic through an anonymous method delegate on a separate thread. In the separate thread, the call to RaiseEvent will send the message back to the waiting HandleExternalMessage activity.

Figure 17 The Pluggable Workflow Service

// Interface declaration
[ExternalDataExchange]
public interface IMyService
{
event EventHandler MessageIn;
void MessageOut(string msg);
}

// Arguments for event handler
[Serializable]
public class MyEventArgs : ExternalDataEventArgs
{
public MyEventArgs(Guid id) : base(id) { }
public string sAnswer;
}

// Class for state
class FactoringState
{
public SPWeb web;
public Guid instanceId;
public FactoringState(Guid instanceId, SPWeb web)
{
this.instanceId = instanceId;
this.web = web;
}
}

// Interface implementation
class MyService : Microsoft.SharePoint.Workflow.SPWorkflowExternalDataExchangeService,
IMyService
{
public event EventHandler MessageIn;
public void MessageOut(string msg)
{
ThreadPool.QueueUserWorkItem(delegate(object state)
{
FactoringState factState = state as FactoringState;
DateTime start = DateTime.Now;
int topNumber = 100000000;
BitArray numbers = new System.Collections.BitArray(topNumber, true);

for (int i = 2; i < topNumber; i++)
{ if (numbers[i]) { for (int j = i * 2; j < topNumber; j += i)
numbers[j] = false; } }
int primes = 0; for (int i = 2; i < topNumber; i++)
{ if (numbers[i]) primes++; }

string sAnswer = "Found " + primes + " in " +
Math.Round(DateTime.Now.Subtract(start).TotalSeconds, 0) + " seconds";

// Send event back through CallEventHandler
RaiseEvent(factState.web, factState.instanceId, typeof(IMyService),
"MessageIn", new object[] { sAnswer });
}, new FactoringState(WorkflowEnvironment.WorkflowInstanceId,
this.CurrentWorkflow.ParentWeb));
}

// Plumbing that routes the event handler
public override void CallEventHandler(Type eventType, string eventName,
object[] eventData, SPWorkflow workflow, string identity,
System.Workflow.Runtime.IPendingWork workHandler, object workItem)
{
var msg = new MyEventArgs(workflow.InstanceId);
msg.sAnswer = eventData[0].ToString();
msg.WorkHandler = workHandler;
msg.WorkItem = workItem;
msg.Identity = identity;
// If more than one event - you'd need to switch based on parameters
this.MessageIn(null, msg);
}
public override void CreateSubscription(MessageEventSubscription subscription)
{ throw new NotImplementedException(); }
public override void DeleteSubscription(Guid subscriptionId)
{ throw new NotImplementedException(); }

Step 2 – Update the web.config

Once the pluggable workflow service is constructed, it needs to be registered with the workflow runtime that runs in SharePoint. This is done by editing the web.config section for workflow services. The web.config editing required should be done using a feature receiver that calls SPWebApplication.WebConfigModifications.Add. The following code shows the additional configuration entry to be added:


The assembly name and public key information can be obtained using GACUTIL.EXE /l.

Step 3 – Create the workflow model

The rest of the work is easy. Add Call External Method and Handle External Event activities to the workflow and configure them to point to this service, as shown in Figure 18. The Call External Method activity will call MessageOut in the service and the Handle External Event activity will wait for the event MessageIn. This involves setting the InterfaceType and EventName properties in each of the two activities.


Figure 18 The Completed Workflow Using Pluggable Workflow Services


Figure 19 Completed Prime Calculating Pluggable Workflow Service

Step 4 – Run the workflow

When this workflow is run, it will start a separate thread in the pluggable workflow service to do the prime number calculations. After 10-15 seconds of running, a workflow history item appears as shown in Figure 19. It shows that there are 5,761,455 prime numbers under 100,000,000.

As shown, there is some code to write for pluggable workflow services and more code to write for each system you connect to. There are two options for reducing the amount of code required to communicate with external services. One is by interfacing with BizTalk Server and making use of the BizTalk adapter library for connecting other systems. The other is using the business connectivity services in SharePoint 2010 which provide a way to expose data from another system through external lists.

Easy and Successful

The new tools in Visual Studio 2010, SharePoint Designer 2010 and Visio 2010 make workflow in SharePoint 2010 much easier for developers to get started with and to be successful. The new features in the SharePoint 2010 workflow host make SharePoint both more robust and applicable to solving a wider variety of workflow problems in software.

Workflows are now easy to build and deploy to SharePoint using the standard SharePoint WSP file packaging tools that come with Visual Studio 2010. Being able to deploy to standard SharePoint sites that are common in many large companies means workflows can be adopted more easily. Workflows in SharePoint make it easy to build long-running processes that communicate with people through tasks and e-mails. Workflows in SharePoint also now make it easier to communicate with systems through pluggable workflow services, business connectivity services and with BizTalk Server.

Thursday, March 3, 2011

Indicative SharePoint 2010 Licensing Costs

SharePoint licensing is a complex subject. As well as there being multiple product configuration options, license prices often depend on a number of factors such as the type of organisation, the relationship with Microsoft and/or licensing retailer etc. It is useful, however, to have a rough indication of how much a product will cost when planning a project. For example if you are interested in giving all internal users access to FAST search you are looking at roughly twice the licensing costs of an installation using the standard features1.

SharePoint 2010 Licensing Overview

Before getting to the numbers there are a few things to understand. I’ve covered the basics here but head to the official Licensing Q&A page for full details.

For the full version of SharePoint Server 2010 there are two licensing models:

  • Server + CAL licenses for internal users – for internal users you need to license each server running SharePoint 2010. You also need a Client Access License (CAL) for each person (or optionally each device) accessing a SharePoint Server. All users will need a standard CAL and to access enterprise features users will need both the standard and the enterprise CAL. The difference in Standard vs Enterprise features is covered below.
  • Internet sites server licenses for external users – you need a server license for each server running SharePoint 2010. CALs are not required if all content is accessible to external users. If some content is for internal use only then CALs are required for users accessing this content. As well as a difference in features the Internet Sites Standard license only allows sites running on a single domain. As stated in the Microsoft Licensing Product Use Rights “The [SharePoint 2010 Internet Sites Standard] software may only be used to create and host a single site at a time resolved from a single domain name (e.g., contoso.com) and its subdomains (e.g. support.contoso.com).” It comes in at almost a third of the cost of the enterprise license, however, so opens up public SharePoint hosting to companies with smaller budgets.

FAST Search Licensing

FAST Search is licensed separately so to take advantage of all the enterprise search features you will need additional server licenses for servers running the FAST Search software.

It is also possible to use a single server for any of the above server licenses. For example if you wanted to run an Intranet and a public Internet website on the same server you could apply the SharePoint 2010 Server license as well as the SharePoint 2010 Internet Sites license to a single server. A FAST license can also be applied to a SharePoint 2010 server if required (saving hardware costs but still requiring SharePoint Server and FAST licenses).

Indicative SharePoint 2010 License Costs

The table below gives some indicative prices for SharePoint 2010 in the UK based on information from Microsoft. Note these are only intended to provide ballpark estimates only and you will need to contact a Microsoft Licensing Specialist to obtain accurate costs. These figures do not include software assurance. Additionally there are other license costs you will need to take into account such as Windows Server and SQL.

License Price
SharePoint 2010 Server ~£3100
SharePoint 2010 Standard CAL ~£60
SharePoint 2010 Enterprise CAL* ~£53
SharePoint 2010 Internet Sites Standard ~£7,500
SharePoint 2010 Internet Sites Enterprise ~£27,000
FAST Search Server ~£14,000

* Note the enterprise CAL is additive i.e. this requires each user to also have a standard CAL

Here are a few examples to give you an idea of how it works:

Small, Standard License, Internal Only Environment

3 server farm – 2 x WFE/Application servers and SQL, SharePoint 2010 running on two servers, 1,000 standard users

License costs would be 2 x £3,100 (SharePoint 2010 Server) + 1,000 users x £60 (Standard CAL) = £66,200

If you wanted to add FAST search you would need to add at least one server at £14,000 and add enterprise CALs (an additional £53 per user) for users accessing these features. The total with FAST would be £66,200 + £14,000 + 1000 x £53 = £133,200 for all users. An alternative would be to only give certain users access to the enterprise features. This can be done through the use of Feature Packs (a.k.a Sets) which allow you to target features so they can only be activated on certain sites. This is useful both for hosted scenarios (e.g. it allows the hoster to restrict enterprise features to site collections that are subscribed to an enterprise plan), and internal scenarios (e.g. only allowing a management site access to enterprise features to reduce license costs).

SharePoint 2010 for a public facing internet site

3 server farm – 2 x WFE/Application servers and SQL, SharePoint running on two servers, content authors editing content that ends up being publicly available (i.e. no internal only content) on a single domain

License costs would be 2 x £7,500 = £15,000

If you wanted to add FAST you would need the Internet Sites Enterprise license to make the search features available and add a license for a FAST Search Server (although this could run on one of the WFE’s to save hardware costs). This would then be 2x £27,000 + £14,000 = £68,000.

Enterprise vs Standard SharePoint 2010 features

So what do you get for an enterprise license? The official Microsoft SharePoint site has a detailed comparison of features in each of the editions but at a high level the additional features provided in the enterprise license are:

  • Access Services
  • FAST search enhancements (note these also require a FAST server license)
    • Sorting by any managed property
    • Contextual search results (i.e. user or audience targeted)
    • Refinement filter counts
    • Similar results
    • Thumbnails and previews
    • Visual best bets
    • Scale and other search platform enhancements
  • Business Intelligence
    • KPI’s
    • Chart Web Parts
    • Dashboards
    • Data Connection Library
    • Excel Services
    • PowerPivot for SharePoint
    • PerformancePoint Services
    • Visio Services
  • InfoPath Services
  • Web Analytics [update 21/06/10 - corrected - this is in standard]

Related products

  • SharePoint Foundation 2010 – this is free with Windows Server
  • Office SharePoint Designer – free download from Microsoft
  • Office Web Apps – free for each user with a licensed version of Microsoft Office
  • SharePoint Workspace – included with Office Professional Plus or available separately for approx. £85

List of SharePoint 2010 Web Parts

Following is a comprehensive list of all SharePoint 2010 out-of-box web parts, with a couple of screen shots thrown in there! The groups are just the built-in groupings in the UI.

Lists & Libraries

· These are list view web parts for the lists & libraries on the site

Authoring

· Content Editor - Foundation

· Image Viewer – Foundation

· Media Web Part

· Page Viewer - Foundation

· Silverlight Web Part - Foundation

Business Data

· Business Data Actions

· Business Data Catalog Filter

· Business Data Item

· Business Data Item Builder

· Business Data List

· Business Data Related List

· Key Performance Indicators

· KPI Details

· Visio Graphics Service

Content Rollup

· Chart Viewer

· Content Query

· HTML Form Web Part - Foundation

· iView

· Picture Library Slideshow Web Part - Foundation

clip_image002

· RSS Viewer

· What’s Popular – pick from content, search queries, or search results;
clip_image004 clip_image006

· XML Viewer - Foundation

Documents

· Document ID Lookup

· Document Set Contents

· Document Set Properties

· Relevant Documents - Foundation

Filters

· Choice Filter

· Current User Filter

· Date Filter

· Filter Actions

· Page Field Filter

· Query String (URL) Filter

· SharePoint List Filter

· SQL Server Analysis Services Filter

· Text Filter

My Information

· My Calendar

· My Contacts

· My Inbox

· My Mail Folder

· My Tasks

Navigation

· Categories

· Site Aggregator

· Sites in Category

· Summary Links

· Table of Contents

· Tag Cloud
clip_image008

Office Client Applications

· Excel Web Access

· InfoPath Form Web Part
clip_image010

· WSRP Viewer

People

· Contact Details

· Profile Browser

· Site Users - Foundation

· User Tasks - Foundation

PerformancePoint

· PerformancePoint Filter

· PerformancePoint Report

· PerformancePoint Scorecard

· PerformancePoint Stack Selector

Search

· Advanced Search Box

· Dual Chinese Search

· Featured Content

· Federated Results

· People Refinement Panel

· People Search Box

· People Search Core Results

· Refinement Panel

· Related Queries

· Search Action Links

· Search Best Bets

· Search Box

· Search Core Results

· Search Paging

· Search Statistics

· Search Summary

· Top Federated Results

Miscellaneous

· Chart Web Part

Monday, February 28, 2011

SharePoint size and limits

on Thursday, December 3, 2009

Entity Max Permissible Size
Site Name 128 characters
Site URL 255 characters
Display name 128 characters
Connection string 384 characters
Email address 128 characters
Version numbers 064 characters
Virtual Server Friendly Name 064 characters
SQL Database Name 123 characters
SQL Database Column 128 characters
SQL Database Table Name 128 characters
SQL Role Name 128 characters
Server Name 128 characters
Windows User Name 300 characters
Windows Password 300 characters
Dependencies per object 032 objects
Zone enumeration value 004 zones
Default SQL command timeout 300 seconds
Number of simultaneous workflows that can be run 015


Site object

Guidelines for acceptable performance Notes Scope of impact when performance degrades
Site collection 50,000 per Web application Total farm throughput degrades as the number of site collections increases. Farm
Web site 250,000 per site collection You can create a very large total number of Web sites by nesting the subsites. For example, 100 sites, each with 1000 subsites, is 100,000 Web sites. The maximum recommended number of sites and subsites is 125 sites with 2,000 subsites each, for a total of 250,000 sites. Site collection
Subsite 2,000 per Web site The interface for enumerating subsites of a given Web site does not perform well as the number of subsites surpasses 2,000. Site view
Document 5 million per library You can create very large document libraries by nesting folders, using standard views and site hierarchy. This value may vary depending on how documents and folders are organized, and by the type and size of documents stored. Library
Item 2,000 per view Testing indicates a reduction in performance beyond two thousand items. Using indexing on a flat folder view can improve performance. List view
Document file size 50MB (2GB max*) File save performance is proportional to the size of the file. The default maximum is 50 MB. This maximum is enforced by the system, but you can change it to any value up to 2 GB. Library, file save performance
List 2,000 per Web site Testing indicates a reduction in list view performance beyond two thousand entries. List view
Field type 256 per list This is not a hard limit, but you might experience list view performance degradation as the number of field types in a list increases. List view
Column 2,000 per document library4,096 per list This is not a hard limit, but you might experience library and list view performance degradation as the number of columns in a document library or list increases. Library and list view
Web Part 50 per page This figure is an estimate based on simple Web Parts. The complexity of the Web Parts dictates how many Web Parts can be used on a page before performance is affected. Page

The following table lists the recommended guidelines for people objects.


People object

Guidelines for acceptable performance Notes
Users in groups 2 million per Web site You can add millions of people to your Web site by using Microsoft Windows security groups to manage security instead of using individual users.
User profile 5 million per farm This number represents the number of profiles which can be imported from a directory service, such as Active Directory, into the people profile store.
Security principal 2,000 per Web site The size of the access control list is limited to a few thousand security principals (users and groups in the Web site).

The following table lists the recommended guidelines for search objects.


Search object

Guidelines for acceptable performance Notes
Search indexes One per SSPMaximum of 20 per farm Office SharePoint Server 2007 supports one content index per SSP. Given that we recommend a maximum of 20 SSPs per farm, a maximum of 20 content indexes is supported. Note that an SSP can be associated with only one index server and one content index. However, an index server can be associated with multiple SSPs and have a content index for each SSP.
Indexed documents 50,000,000 per content index Office SharePoint Server 2007 supports 50 million documents per index server. This could be divided up into multiple content indexes based on the number of SSPs associated with an index server.
Content sources 500 per SSP* This is a hard limit enforced by the system.
Start Addresses 500 per content source* This is a hard limit enforced by the system.
Alerts 1,000,000 per SSP This is the tested limit.
Scopes 200 per site This is a recommended limit per site. We recommend a maximum of 100 scope rules per scope.
Display groups 25 per site These are used for a grouped display of scopes through the user interface.
Crawl rules 10,000 per SSP We recommend a maximum 10,000 crawl rules irrespective of type.
Keywords 15,000 per site We recommend a maximum of 10 Best Bets and five synonyms per keyword.
Crawled properties 500,000 per SSP These are properties that are discovered during a crawl.
Managed properties 100,000 per SSP These are properties used by the search system in queries. Crawled properties are mapped to managed properties. We recommend a maximum of 100 mappings per managed property.
Authoritative pages 200 per relevance level This is the maximum number of sites in each of the four relevance levels.
Results removal 100 This is the maximum recommended number of URLs that should be removed from the system in one operation.
Crawl logs 50,000,000 Number of individual log entries in the crawl log.

The following table lists the recommended guidelines for logical architecture objects.


Logical architecture object

Guidelines for acceptable performance Notes
Shared Services Provider (SSP) 3 per farm (20 per farm maximum)
Zone 5* per farm The number of zones defined for a farm is hard coded to 5.
Web application 99 per SSP This limit includes the number of Web applications on child farms consuming resources on this SSP.
Internet Information Services (IIS) application pool 8 per Web server Maximum number is determined by hardware capabilities.
Site collection 50,000 per Web application
Content database 100 per Web application
Site collection 50,000 per database

The following table lists the recommended guidelines for physical objects.


Physical object

Guidelines for acceptable performance Notes
Index servers 1 per SSP*
Application servers running Excel Calculation Services No limit
Query servers No limit Because 100 content databases are supported for each query server, the number of query servers required per farm is based on the number of content databases in the farm. For example, if there are 500 content databases in your farm, you will need at least 5 query servers.
Web server/database server ratio 8 Web servers per database server The scale out factor is dependent upon the mix of operations.
Web server/domain controller ratio 3 Web servers per domain controller Depending on how much authentication traffic is generated, your environment may support a greater number of Web servers per domain controller.