Thursday, May 17, 2012

SharePoint 15: what to expect in Spring 2013

Speculation is running rampant, and Microsoft has yet to confirm anything, but expect the next version of SharePoint  – dubbed SharePoint 15 – to be released by Spring 2013. We do know for certain, however, that MS has put significant money into redesigning the user interface – the look-and-feel –by a factor of four. Count on a major redesign of the My Sites / My Profiles.

Additionally, we also know that SP15 will have better cloud support and functionality, when compared to the current SharePoint Online offering, better mobile support, and web development support. We can also expect general improvements to all the social tools, such as blogs and wikis (which in previous versions, leave a lot to be desired).

Here’s a summary of the suggested, forthcoming improvements to SharePoint: 

  • Improved design interface for social networking
  • Better suited for cloud environment
  • A new SharePoint app marketplace
  • Improved mobile support
  • Simplified development and integration
  • Overhauled Client Object Model (COM)
  • Enable workflow looping in SharePoint Designer, eliminating the need for the Visual Studio
  • Cross-platform authentication 

Monday, May 14, 2012

Setup claims authentication through PowerShell

Following script updates the web application to use Claims based authentication:

$webApplicationUrl = "http://intranet"
$webapp= Get-SPWebApplication $webApplicationUrl
$webapp.UseClaimsAuthentication
$webapp.UseClaimsAuthentication=$True
$webapp.Update()
$webapp.ProvisionGl

Workflow Event handlers in SharePoint 2010

In SharePoint 2010, we now have new receivers and one of them is workflow event receivers. We can handle different events with respect to the workflows that triggers in SharePoint.

You can handle multiple events with regards to the workflow. These are:

1)    When workflow is starting
2)    When workflow is started
3)    When workflow is completed
4)    When workflow is postponed

As name suggests you can trap different events of the workflow.

These come handy if you have requirement to start series of workflow based on completion criteria from one workflow to another. If one workflow completes and then you want to start another workflow in chain, that can be done now by trapping these events.

This is only for list or library workflows and not for the site workflow.

Here is an example with code.

///
    /// List Workflow Events
    ///
    public class EventReceiver1 : SPWorkflowEventReceiver
    {
       ///
       /// A workflow is starting.
       ///
       public override void WorkflowStarting(SPWorkflowEventProperties properties)
       {
           SPWeb Web = properties.ActivationProperties.List.ParentWeb;     
           SPList lstTracking = Web.Lists["Track Different Events"];       
           SPListItem item = lstTracking.Items.Add();
           item["Title"] = "Starting the workflow";
           item.Update();      
       }
       ///
       /// A workflow was started.
       ///
       public override void WorkflowStarted(SPWorkflowEventProperties properties)
       {
           using (SPSite site = new SPSite(properties.WebUrl))
           {
               using (SPWeb Web = site.OpenWeb())
               {
                   SPList lstTracking = Web.Lists["Track Different Events"];            
                  SPListItem item = lstTracking.Items.Add();
                   item["Title"] = "workflow has been started";
                   item.Update();
               }
           }
       
       }
       ///
       /// A workflow was completed.
       ///
       public override void WorkflowCompleted(SPWorkflowEventProperties properties)
       {
            using (SPSite site = new SPSite(properties.WebUrl))
            {
                using (SPWeb Web = site.OpenWeb())
                {
                    SPList lstTracking = Web.Lists["Track Different Events"];                

                    SPListItem item = lstTracking.Items.Add();

                    item["Title"] = "workflow has been completed";

                    item.Update();
                 
                }
            }            

       }
    }

You can also handle several completion type enumerations in WorkflowCompleted method that helps you to execute certain code based on the completion criteria.

You can also check completion type enumerations in WorkflowCompleted method.