SharePoint Development Blog

Nick Boumans
View my LinkedIn Profile Follow me on Twitter View my Profile on FaceBook View my projects on CodePlex View my presentations on SlideShare



Recent posts

Tags

Categories

Navigation

Pages

Archive

Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

SDC 2009 Session material

At the beginning of this week I gave two sessions at the SDN Conference at Papendal (Netherlands). The content of this sessions was about

  1. Social Networking in SharePoint 2007 - Building innovative WebParts using SharePoint, AJAX and jQuery
  2. E-Commerce using SharePoint 2007 and Commerce Server 2009

Abstract Session 1: We al know: LinkedIn, Twitter, and Hyves. Since we're using SharePoint for public internetsites more and more I developed a messaging webpart for SharePoint for quick sharing messages. This uses innovative techniques as AJAX.NET, jQuery and mySites. I will use this example to explain some SharePoint development concepts for developing innovative webparts in combination with Social Messaging. Level: 200 - Intermediate.

Abstract Session 2: Did you know the Netherlands has over 20,000 WebShops? Since a lot of customers use SharePoint it's possible that some people have to build a webshop in SharePoint. Are you writing all that kind of webparts using custom code? Or do you feel more about an out of the box e-commerce site using SharePoint? On the Dutch DevDays 09 I spoke about Commerce Services 2009 for SharePoint. Since I was a last-minute speaker (I replaced a session) there is a chance you skipped my presentation. Now you've got a second chance. Level: 100 - Beginners

All attendees received a nice green bag containing a CD with all the session and demo material. For the people who lost their CD or didn't attend the SDC, you can get the presentations here (Dutch):

SDC09 IW01 Nick Boumans - Social Networking.ppt (1.72 mb)

SDC 2009 IW02 Nick Boumans - eCommerce.ppt (2.30 mb)

For Source Codes please visit: http://spmessaging.codeplex.com or http://csextensions.codeplex.com

 

Posted: Oct 22 2009, 09:02 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Commerce Server Extensions for SharePoint

In preparation to the Software Development Network (SDN) Conference, were I will give a session about Commerce Server SharePoint development (http://www.sdc.nl/tabid/91/Default.aspx?SpeakerUserName=nickboumans), I just finished a demo project for starting Commerce Server Developers. I will launch it as a Codeplex project: CSExtensions (http://csextensions.codeplex.com/) and share it with all of you! This project contains a solution for SharePoint which extens the administration functionality of Commerce Server. In future I'll trying to add more extensions. The main goal of this project is a starting project for SharePoint developers who want to start developing for Commerce Server and learn how to extend Default WebParts and "how to talk to the Commerce API".

At the moment it contains an ASP.NET AJAX SharePoint WebPart for adding products to a specific category. You can easily customize it to your own requirements. Please contact me if you have any suggestions or improvements. Below you can see some screenshots of the project.

Learning skills for developers using this solution:

  1. Set up and deploy a SharePoint WebPart
  2. Referencing Commerce DLL's
  3. Talk to the Commerce API from your SharePoint WebPart
  4. Recursively populate an ASP.NET AJAX 3.5 Treeview with Commerce Catalog Categories
  5. Using ASP.NET AJAX 3.5 in a SharePoint WebPart
  6. Adding product to the Commerce Catalog using SharePoint
  7. Loading UserControls (.ascx) in a SharePoint WebPart
  8. Using Editable properties (webpart properties) to change the catalog of the WebPart in SharePoint edit mode
  9. Etc. 

Note: The solution is a Visual Studio 2008 solution using the tool WSP Builder (also on CodePlex): http://www.codeplex.com/wspbuilder for installing the .wsp file I use SharePoint installer (http://www.codeplex.com/sharepointinstaller).

 

 

 

Posted: Oct 12 2009, 22:32 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server

Commerce Server 2009 Evaluation VPC September 2009 version is available for download

In an effort to help improve the Microsoft® Commerce Server 2009 evaluation experience, the Microsoft Commerce Server 2009 Evaluation VPC (September 2009 Update) is now available for download to partners and customers. This VPC has Commerce Server 2009 and Microsoft Office SharePoint® Server 2007 (MOSS) fully installed and configured (Core Systems, Multi-Channel Commerce Foundation, SharePoint Commerce Services), including the new Default site with the Template Pack running in SharePoint using the 30 new Web Parts.

The August VPC will expire on September 21, 2009.  The new September 2009 Update refreshes the expiration date and contains minor updates to the sales collateral.  No technological or content changes have been made to the September 2009 evaluation VPC, other than the extension of the trial license period of the evaluation software installed. The VPC is to be used only for demonstration and evaluation purposes, and is not intended for use in a development or production environment approximately every 2-3 months the VPC will be updated and reposted to Microsoft Connect. This VPC is installed with evaluation software that will expire, significantly reducing functionality of the VPC.  You must complete the survey to accept the license agreement in order to receive each new release of the VPC. You must complete the survey to accept the license agreement in order to receive each new release of the VPC.  Please see the readme for more information Finally, no e-mail notification will be sent to you following your download request.  Please check your downloads folder for a copy of the VPC in 1 - 2 business days. 
 

Register to download the latest VPC update, complete with a demonstration script, sales collateral, samples, and videos at http://go.microsoft.com/fwlink/?LinkId=164446

Posted: Sep 26 2009, 09:14 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server

Understanding Caching in Commerce Server

Recently I came to an issue using the Commerce API. I added an item to the catalogue using C# code but it was not visible directly. Reading the following article about caching in Commerce Server pointed me to the solution: http://msdn.microsoft.com/en-us/library/aa544712.aspx

public static void RefreshAllCaches()
{
    CommerceCacheCollection caches = CommerceContext.Current.Caches;
    foreach (CommerceCache cache in caches)
    {
        cache.Refresh();
    }
}
[/code]

 

Posted: Sep 24 2009, 14:03 by Nick Boumans | Comments (2) RSS comment feed |
  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server

Translation Dutch DOTNET Magazine Article Commerce Server

Special for non-Dutch people I translated the article of the Dutch .NET Magazine.

Thanks to Lewis Benge and Arlene Hall for reviewing my translation.

You can download a copy here: Dutch_NET_Magazine_Commerce_Server_by_Nick_Boumans_UK.pdf (725 kb)

If you want to put this article on your site, please contact me and send me the link of your site.

External (Public) Links to my article: 

  1. Microsoft Commerce Server Blog: http://blogs.msdn.com/commerce/archive/2009/09/17/article-e-commerce-using-microsoft-commerce-server-2009-and-sharepoint.aspx
Posted: Sep 17 2009, 10:34 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Career | Commerce Server

Giving 2 sessions at the Software Development Conference 2009

This year, on October 19 and 20th, the Software Development Network hosts the eighteenth (!) SDN Conference! When you attend the conference you can be sure that the track record of SDN guarantees a well organised conference.

Depending the session proposals, I'm selected from 135 national- and international speakers which send more than 600 proposals.

The sessions I will be giving are:
1) E-Commerce using SharePoint and Commerce Server 2009
2) Social Networking in SharePoint

Posted: Jul 10 2009, 09:00 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Career | Commerce Server | SDN

Adding a product to a catalog using code

You can add a product to a Commerce Server Catalog using the next code. Notice that you have to add a reference to the Microsoft.CommerceServer.Catalog.dll (CommerceSharePointExtensibilityKit) and the Microsoft.CommerceServer.Runtime.dll

BaseCatalog baseCatalog = (BaseCatalog)CommerceContext.Current.CatalogSystem.CatalogContext.GetCatalog("Adventure Works Catalog");
//baseCatalog.CreateProduct(string defintionName, string productId, decimal listPrice, string parentCategoryName);
Product item = baseCatalog.CreateProduct("Tents", "Iglo", 30m, "Tents");
item.DisplayName = "Iglo";
item["Description"] = "Very nice tent";
item.Save();

Posted: Jun 25 2009, 15:35 by Nick Boumans | Comments (1) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server | Web Parts

Adding extended WebPart to Commerce Server 2009

If you’re planning to develop your own SharePoint WebParts for Commerce Server 2009 this article could help you with a lot of troubles.Wink


First problem there is not a lot of info about extending or writing your own WebParts on the internet. Some issues are covered on the Commerce Forum: http://social.msdn.microsoft.com/Forums/en-US/commserver2009/threads

Before you start developing WebParts for Commerce Server 2009 take a close look to the CommerceSharePointExtensibilityKit. This Kit are the sources of the defaultSite WebParts, UserControls etc. You can find it in a zip at the following location: C:\Program Files\Microsoft Commerce Server 2007\Microsoft Commerce Server 2009\Sdk\Samples\CommerceSharePointExtensibilityKit.zip

Trying to unzip the CommerceSharePointExtensibilityKit, I was prompted for a password (some files are password protected). I canceled the extracting process and copied the whole zip to my desktop. Extracting it there didn't prompt me for a password and all files were successfully extracted.

After extracting you can load the solution in Visual Studio 2008. You can build it (try this and take a look to the bin folder).
You will notice some references in the examples. One reference is the reference to: Microsoft.Commerce.Portal.Common. This is a Commerce dll which is in your GAC (c:\windows\assembly). If you read some articles on the internet you have to sign this assembly before using it. This is covered in the next article: Adding Extended Web Parts. In my solution I added a copy of the GAC assembly as a reference to my Visual Studio SharePoint WebPart project. In this case it was not necessary to re-sign all references of my Commerce Site with my public key (because I use the default). Notice that this is NOT! a best practice since you'r using the runtime environment, It's better to use your own key and delay signing. Because I only use it in a demo environment VPC this way is quicker that edit all public keys, and have the risc to break my whole site since I'm using the out of the box SharePoint Commerce Server 2009 Default Site. In this article you can find out how you can get a copy of a GAC assembly: http://blog.sharepointdevelopment.nl/post/Copy-a-DLL-from-the-Global-Assembly-Cache-GAC.aspx

In my case it was required to build a SharePoint WebPart with the content of an anonymous basket (the basket of a user which has no login, eg a visitor). Problem with the GetBasket method is that you have to put in a userid (GUID), see the next sample. Normally you can get the userID by using a method like: CommerceContext.Current.UserId. This didn’t work for me (maybe because I'm extending my SharePoint Site?). I discovered that if u use another basket object (from another .dll reference) you can get the current userID (that’s the reason for working with two basket  objects in my sample). Possibly you have a better solution for me. Feel free to drop a comment about some improvements. For now I’m happy with my first working Commerce WebPart.

[code:c#]
// Get the lineitems in a basket of an anonymous user (visitor)
private Microsoft.CommerceServer.Runtime.Orders.Basket basket;

protected override void CreateChildControls()
{
  try
  {
    ShoppingController shoppingController;

    // Load Basket to set SubTotal/Number of Items in cookie
    shoppingController = new ShoppingController(true, false, false, false, false, false);

    shoppingController.AddBasketQueryRequest(ShoppingController.DefaultBasketName);
    shoppingController.ExecuteBrokerRequests();

    Microsoft.Commerce.Portal.Common.Basket b =
 shoppingController.GetBasket(ShoppingController.DefaultBasketName);
    basket = CommerceContext.Current.OrderSystem.GetBasket(new Guid(b.UserId), "default");

   //Normally we get a userId like
   // Get the current CommerceContext and current user.
   //CommerceContext csContext = CommerceContext.Current;
   //String userId = csContext.UserID;
  }
  catch (Exception ex)
  {
            
  }
}

protected override void Render(HtmlTextWriter writer)
{
  try
  {                        
    foreach (OrderForm orderForm in basket.OrderForms)
    {
      foreach (Microsoft.CommerceServer.Runtime.Orders.LineItem lineItem in
  orderForm.LineItems)
      {                      
 // Write product displaynames and quantity of basket
 Writer.WriteLine(lineItem.DisplayName.ToString() + " (" +
   lineItem.Quantity.ToString() + "x) ";                   
      }
    }
  }
}

 

Posted: Jun 18 2009, 13:34 by Nick Boumans | Comments (1) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server

Code blocks are not allowed in this file - Hiding controls in SharePoint Masterpage

If you want to hide some controls in your SharePoint masterpage if you're not logged in, you can use the next code (I use it in my Commerce Server 2009 CSDefaultSite masterpage):

<% if (Page.User.Identity.IsAuthenticated){ %>
  <Commerce:SPMiniCartWebPart id="miniCart" runat="server" XslTemplateUri="[Templates]/MiniCart/DefaultSite_MiniCart.xslt" __WebPartId="{B9D043A2-47E5-496F-A388-51E109FCD387}"/>
<%} %>

Using this code, I hide the Commerce Server "miniCart" control. After testing the page you will receive te error: Code Blocks are not allowed in this file! 

SharePoint disables the ability to create server-side script by default, you have to turn it on. You do that in the web.config file, in the configuration/SharePoint/PageParserPaths configuration section:

<PageParserPaths>
 <PageParserPath VirtualPath="/_catalogs/masterpage/CSDefaultSite.master" CompilationMode="Always" AllowServerSideScript="true" /> 
</PageParserPaths>


Now your codeblock works and the control will only be shown after login. This example uses Commerce Server 2009 but it also works for other controls and if you're not using Commerce Server! Just change the italic part to your own control.

Posted: Jun 10 2009, 11:11 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Microsoft Commerce Server 2009 code name R2 - June 2009 Community Technical Preview

Microsoft Commerce Server 2009 code name "R2" - June 2009 CTP is the first pre-release of the next version of Commerce Server. Please note that this pre-release version is not feature complete.

Download: http://www.microsoft.com/downloads/details.aspx?FamilyID=dfaca6d6-6e1a-4067-8857-61ff1300bf6b&displaylang=en

System Requirements

  • Supported Operating Systems: Windows Server 2008
Single-server deployments are supported, which consists of running all the Commerce Server 2009 components and software requirements (including Microsoft Windows and Microsoft SQL Server) on a single computer. The single-server deployment uses the following software products:
  • Microsoft Windows Server 2008 (64-bit) or Microsoft Windows Server 2008 R2 (64-bit) and Microsoft Windows critical updates
  • IIS 7.0 with Microsoft Windows Server 2008
  • Microsoft SQL Server 2008 Standard and Enterprise (64-bit)
  • Microsoft .NET Framework 3.5 with SP1
  • Microsoft Windows SharePoint Services 3.0 (WSS) SP1 or Microsoft Office SharePoint Server 2007 (MOSS) SP1

If using WSS:
If using MOSS:
Posted: Jun 08 2009, 17:07 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server