SlideShare a Scribd company logo
1 of 3
Download to read offline
Web



                       E-Commerce using
                       Commerce Server 2009
                       Developing wiDely usable e- commerce solutions using sharepoint

                       Nick Boumans


                       At the time of writing, the Netherlands has more than 20,000 online stores, a
                       number which is continually expanding. Since SharePoint has become more
                       widely deployed as an Internet solution, a requirement to have a SharePoint
                       based e-Commerce-solution is now available. Previously the only option was
                       to build a custom SharePoint solution, but now Microsoft Commerce Server
                       2009 can also be used for building a SharePoint based e-Commerce solution.


Commerce Server 2009                           is a Microsoft pro-
duct for building E-Commerce systems, using .NET based web
services and an abstract business layer, known as the Commerce
Server Foundation. The first release of this product was in the
year 1996, known as Site Server. The last release of Site Server
was in 1998. In 2000 when they released it they renamed it to
Commerce Server. The current version (2009) was released last
March. The SharePoint Commerce Services are responsible for
the integration between SharePoint and Commerce Server. The
platform is also a fully Service Orientated (SOA) enabled plat-      The SharePoint Default Site is a complete sample site inside Sha-
form including BizTalk adapters.                                     rePoint, using the Commerce Server Features. It’s possible to
                                                                     build your own E-commerce-solution in only a few steps, by defi-
Advantages of Commerce Server 2009                                   ning your own catalogue and connecting it to the Default Site.
will be noticed after running the SharePoint Commerce Services       The available tools (Image 2), which connect using Web Services,
wizard. Users have the ability to use some SharePoint Web Parts      are very helpful for tasks like defining your catalogue. By using
and the Default Site (Image 1). These Web Parts vary from a          the “Catalogue and Inventory Schema Manager” tool it is possible
Shopping basket Web Part to a “my Account” Web Part. A lot of        to make schema definitions for categories and products. Once de-
these Web Parts are customizable by XSLT. Also shipped is the        fined you can then setup the properties for products and catego-
CommerceSharePointExtensibilityKit which contains the sources        ries within the catalogue. After this step a catalogue can be built
of these Web Parts and User Controls, which could be very useful     and filled using the “Catalogue Manager” (Image 3).
for customizations.




                                                                     Original Article: Dutch .NET magazine | september 2009
Customizing the Commerce Server SharePoint Site is possible            Adding a product to the catalogue could be seen as a “Hello
by customizing the master page and CSS. A lot of Web Parts are         World”-development example for Commerce Server. As I menti-
using a template which uses XSL. These templates could be              oned earlier in this article, the first step is getting access to the
found in the Document Library “Commerce Server Templates”.             Commerce Context and using this context for modifying the cata-
So it is also possible to put your custom templates into this libra-   logue. In Code sample 1 you can see how it’s possible to add a
ry for use in the Web Parts. Using this method the most com-           product to the catalogue. The last code line is may be the most
mon customizations could be made. You can think about the              important one since changes will not be saved by forgetting the
order of the columns in the Shopping Basket Web Part.                  item.Save() procedure.
                                                                        // You have to add a reference to the Microsoft.CommerceServer.Ca-
                                                                        talog.dll //(CommerceSharePointExtensibilityKit) and the
Development using the Commerce Server API makes it possible,            // Microsoft.CommerceServer.Runtime.dll
by using .NET code, to customize e.g. the Default Site. By refer-       BaseCatalog baseCatalog = (BaseCatalog)CommerceContext.Current.Ca-

ring some dll’s in your Visual Studio Project it will be possible to    talogSystem.CatalogContext.GetCatalog(“Adventure Works Catalog”);
                                                                        Product item = baseCatalog.CreateProduct(“Tents”, “Iglo”, 30m,
use these API’s. Commonly used dll’s are:                               “Tents”);
 Microsoft.CommerceServer.Runtime.dll                                   item.DisplayName = “Iglo”;
 Microsoft.CommerceServer.Catalog.dll                                   item[“Description”] = “3mm Tent”;
 Microsoft.Commerce.Portal.Common.dll                                   item.Save();


                                                                       CODESAMPLE 1: ADDING A PRODUCT TO A CATEGORY IN A CATALOGUE

These dll’s could be found in the Web Part Extensibility Kit
(CommerceSharePointExtensibilityKit). To make these dll’s avai-        A Category definition describes the category in the catalogue.
lable, you have to build the sample project from the Web Part Ex-      This is a collection of properties which specify how information
tensibility Kit at the first time, after signing it with your own      has to be saved into a category. At the creation of a category defi-
strong name key. The first step of development is the “Commerce        nition, this definition will be added to the catalogue schema.
Context”-class which could be found in the CommerceServer.             To build a category definition:
Runtime.dll. This class makes it possible to manage catalogues.
For the best performance you only have to create one instance of       1. Create a category definition by using the CreateDefintion me-
this object and reuse it during the lifetime of the application.       thod of the CatalogContext object.
                                                                       2. Create properties using the AddProperty method of the Cata-
Development using the catalogue is one of the most common de-          logDefinition object.
velopment questions. In practice this will result in requirements      3. CatalogDefinition.Save() to save the definition.
as: a Web Part inside SharePoint to show or manage products
and categories. Beside the fact that this is possible using the Com-   Code sample 2 creates a catalogue definition “Movie Category” by
merce Server Tools or a Silverlight Web Part available from the        creating a CatalogDefinition object.
Microsoft Site, in most situations this solution doesn’t meet the       public static void CreateCategoryDefinition(CatalogContext con-
                                                                        text)
requirements of the customer.                                           {
                                                                             // Create a category definition for categories in a DVD cata-
                                                                        log.
                                                                             CatalogDefinition categoryDefinition = context.
                                                                        CreateDefinition(“Movie Category”, CatalogDefinitionType.Category-
                                                                        Definition);
                                                                             categoryDefinition.Description = “Categories for DVDs”;


No time for installing and
                                                                             // Create a description property for this category.
                                                                             CatalogProperty description = context.
                                                                        CreateProperty(“Description”, CatalogDataType.String, 500);

configuring? You can download the                                            // Add the property to the category definition.
                                                                             categoryDefinition.AddProperty(description.Name, Definition-

Microsoft Commerce Server 2009
                                                                        PropertyType.NormalProperty);
                                                                             // Save the definition.
                                                                             categoryDefinition.Save();

VPC and start today!                                                    }


                                                                       CODESAMPLE 2: BUILDING A CATEGORY DEFINITION



                                                                       Adding and deleting categories is the logical next step after crea-
                                                                       ting a category definition. The catalogue has two methods: Crea-
                                                                       teCategory and DeleteCategory. By adding a category you have to
                                                                       define a category definition. Code sample 3 and 4 shows how a
                                                                       category could be added and deleted by using the Catalog API.
                                                                       After deleting a category the method “PurgeDeletedItems” is res-
                                                                       ponsible for actual deleting items of the Catalog Database.




          Original Article: Dutch .NET magazine | september 2009
BaseCatalog baseCatalog = (BaseCatalog)CommerceContext.Current.Ca-
 talogSystem.CatalogContext.GetCatalog(“Movie Catalog”);
 // Add a category
 Category category = baseCatalog.CreateCategory(“MovieCategory”,
 “Adventure”);
 category.DisplayName = “Adventure”;
 category[“Description”] = “Adventure Movies”;
 category.Save();


CODESAMPLE 3: ADDING A CATEGORY


 ProductCatalog productCatalog = (ProductCatalog)CommerceContext.
 Current.CatalogSystem.CatalogContext.GetCatalog(“Movie Catalog”);


 // Delete the category
 productCatalog.DeleteCategory(“MovieCategory”);
 // Remove the deleted items from the catalog database
 productCatalog.PurgeDeletedItems();


CODESAMPLE 4: DELETING A CATEGORY


Newbie using Commerce Server 2009?
Maybe as a SharePoint developer you have not yet dived into
Commerce Server; however, it is really worth a try. If you don’t
want to spend any time on the installation and configuration be-
fore you can exercise, as you can download a Microsoft Com-
merce Server VPC from the Microsoft Connect site.


Links
Blog Nick Boumans: http://www.sharepointdevelopment.nl
Commerce Server 2009 VPC: https://connect.microsoft.com/Downloads/Download-
 Details.aspx?SiteID=643&DownloadID=16926
MSDN Commerce Server 2009 Forum: http://social.msdn.microsoft.com/Forums/
 en-US/commserver2009/threads
Inline property editor webpart: http://www.microsoft.com/downloads/details.
 aspx?FamilyID=fce87672-90cf-4ead-b100-6bbc24d96f66&displaylang=en




Nick Boumans, is SharePoint specialist and Microsoft Certified Trainer in the Nether-
lands.
Blog: http://www.SharePointDevelopment.nl.




                                                                                        Original Article: Dutch .NET magazine | september 2009

More Related Content

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

2009 9 Dutch Net Magazine Commerce Server By Nick Boumans Uk

  • 1. Web E-Commerce using Commerce Server 2009 Developing wiDely usable e- commerce solutions using sharepoint Nick Boumans At the time of writing, the Netherlands has more than 20,000 online stores, a number which is continually expanding. Since SharePoint has become more widely deployed as an Internet solution, a requirement to have a SharePoint based e-Commerce-solution is now available. Previously the only option was to build a custom SharePoint solution, but now Microsoft Commerce Server 2009 can also be used for building a SharePoint based e-Commerce solution. Commerce Server 2009 is a Microsoft pro- duct for building E-Commerce systems, using .NET based web services and an abstract business layer, known as the Commerce Server Foundation. The first release of this product was in the year 1996, known as Site Server. The last release of Site Server was in 1998. In 2000 when they released it they renamed it to Commerce Server. The current version (2009) was released last March. The SharePoint Commerce Services are responsible for the integration between SharePoint and Commerce Server. The platform is also a fully Service Orientated (SOA) enabled plat- The SharePoint Default Site is a complete sample site inside Sha- form including BizTalk adapters. rePoint, using the Commerce Server Features. It’s possible to build your own E-commerce-solution in only a few steps, by defi- Advantages of Commerce Server 2009 ning your own catalogue and connecting it to the Default Site. will be noticed after running the SharePoint Commerce Services The available tools (Image 2), which connect using Web Services, wizard. Users have the ability to use some SharePoint Web Parts are very helpful for tasks like defining your catalogue. By using and the Default Site (Image 1). These Web Parts vary from a the “Catalogue and Inventory Schema Manager” tool it is possible Shopping basket Web Part to a “my Account” Web Part. A lot of to make schema definitions for categories and products. Once de- these Web Parts are customizable by XSLT. Also shipped is the fined you can then setup the properties for products and catego- CommerceSharePointExtensibilityKit which contains the sources ries within the catalogue. After this step a catalogue can be built of these Web Parts and User Controls, which could be very useful and filled using the “Catalogue Manager” (Image 3). for customizations. Original Article: Dutch .NET magazine | september 2009
  • 2. Customizing the Commerce Server SharePoint Site is possible Adding a product to the catalogue could be seen as a “Hello by customizing the master page and CSS. A lot of Web Parts are World”-development example for Commerce Server. As I menti- using a template which uses XSL. These templates could be oned earlier in this article, the first step is getting access to the found in the Document Library “Commerce Server Templates”. Commerce Context and using this context for modifying the cata- So it is also possible to put your custom templates into this libra- logue. In Code sample 1 you can see how it’s possible to add a ry for use in the Web Parts. Using this method the most com- product to the catalogue. The last code line is may be the most mon customizations could be made. You can think about the important one since changes will not be saved by forgetting the order of the columns in the Shopping Basket Web Part. item.Save() procedure. // You have to add a reference to the Microsoft.CommerceServer.Ca- talog.dll //(CommerceSharePointExtensibilityKit) and the Development using the Commerce Server API makes it possible, // Microsoft.CommerceServer.Runtime.dll by using .NET code, to customize e.g. the Default Site. By refer- BaseCatalog baseCatalog = (BaseCatalog)CommerceContext.Current.Ca- ring some dll’s in your Visual Studio Project it will be possible to talogSystem.CatalogContext.GetCatalog(“Adventure Works Catalog”); Product item = baseCatalog.CreateProduct(“Tents”, “Iglo”, 30m, use these API’s. Commonly used dll’s are: “Tents”); Microsoft.CommerceServer.Runtime.dll item.DisplayName = “Iglo”; Microsoft.CommerceServer.Catalog.dll item[“Description”] = “3mm Tent”; Microsoft.Commerce.Portal.Common.dll item.Save(); CODESAMPLE 1: ADDING A PRODUCT TO A CATEGORY IN A CATALOGUE These dll’s could be found in the Web Part Extensibility Kit (CommerceSharePointExtensibilityKit). To make these dll’s avai- A Category definition describes the category in the catalogue. lable, you have to build the sample project from the Web Part Ex- This is a collection of properties which specify how information tensibility Kit at the first time, after signing it with your own has to be saved into a category. At the creation of a category defi- strong name key. The first step of development is the “Commerce nition, this definition will be added to the catalogue schema. Context”-class which could be found in the CommerceServer. To build a category definition: Runtime.dll. This class makes it possible to manage catalogues. For the best performance you only have to create one instance of 1. Create a category definition by using the CreateDefintion me- this object and reuse it during the lifetime of the application. thod of the CatalogContext object. 2. Create properties using the AddProperty method of the Cata- Development using the catalogue is one of the most common de- logDefinition object. velopment questions. In practice this will result in requirements 3. CatalogDefinition.Save() to save the definition. as: a Web Part inside SharePoint to show or manage products and categories. Beside the fact that this is possible using the Com- Code sample 2 creates a catalogue definition “Movie Category” by merce Server Tools or a Silverlight Web Part available from the creating a CatalogDefinition object. Microsoft Site, in most situations this solution doesn’t meet the public static void CreateCategoryDefinition(CatalogContext con- text) requirements of the customer. { // Create a category definition for categories in a DVD cata- log. CatalogDefinition categoryDefinition = context. CreateDefinition(“Movie Category”, CatalogDefinitionType.Category- Definition); categoryDefinition.Description = “Categories for DVDs”; No time for installing and // Create a description property for this category. CatalogProperty description = context. CreateProperty(“Description”, CatalogDataType.String, 500); configuring? You can download the // Add the property to the category definition. categoryDefinition.AddProperty(description.Name, Definition- Microsoft Commerce Server 2009 PropertyType.NormalProperty); // Save the definition. categoryDefinition.Save(); VPC and start today! } CODESAMPLE 2: BUILDING A CATEGORY DEFINITION Adding and deleting categories is the logical next step after crea- ting a category definition. The catalogue has two methods: Crea- teCategory and DeleteCategory. By adding a category you have to define a category definition. Code sample 3 and 4 shows how a category could be added and deleted by using the Catalog API. After deleting a category the method “PurgeDeletedItems” is res- ponsible for actual deleting items of the Catalog Database. Original Article: Dutch .NET magazine | september 2009
  • 3. BaseCatalog baseCatalog = (BaseCatalog)CommerceContext.Current.Ca- talogSystem.CatalogContext.GetCatalog(“Movie Catalog”); // Add a category Category category = baseCatalog.CreateCategory(“MovieCategory”, “Adventure”); category.DisplayName = “Adventure”; category[“Description”] = “Adventure Movies”; category.Save(); CODESAMPLE 3: ADDING A CATEGORY ProductCatalog productCatalog = (ProductCatalog)CommerceContext. Current.CatalogSystem.CatalogContext.GetCatalog(“Movie Catalog”); // Delete the category productCatalog.DeleteCategory(“MovieCategory”); // Remove the deleted items from the catalog database productCatalog.PurgeDeletedItems(); CODESAMPLE 4: DELETING A CATEGORY Newbie using Commerce Server 2009? Maybe as a SharePoint developer you have not yet dived into Commerce Server; however, it is really worth a try. If you don’t want to spend any time on the installation and configuration be- fore you can exercise, as you can download a Microsoft Com- merce Server VPC from the Microsoft Connect site. Links Blog Nick Boumans: http://www.sharepointdevelopment.nl Commerce Server 2009 VPC: https://connect.microsoft.com/Downloads/Download- Details.aspx?SiteID=643&DownloadID=16926 MSDN Commerce Server 2009 Forum: http://social.msdn.microsoft.com/Forums/ en-US/commserver2009/threads Inline property editor webpart: http://www.microsoft.com/downloads/details. aspx?FamilyID=fce87672-90cf-4ead-b100-6bbc24d96f66&displaylang=en Nick Boumans, is SharePoint specialist and Microsoft Certified Trainer in the Nether- lands. Blog: http://www.SharePointDevelopment.nl. Original Article: Dutch .NET magazine | september 2009