Skip to content
This repository

Simple and time-saving Microsoft/Ascentium Commerce Server task automation. Have an easy life!

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 assets
Octocat-spinner-32 nuget
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE.md
Octocat-spinner-32 README.md
Octocat-spinner-32 build.bat
Octocat-spinner-32 build.fsx
README.md

CsTasks

Simple and time-saving Commerce Server task automation library. Do things like deleting, purging and importing promotions. CsTasks provides a consistent .NET API around existing tools and APIs.

Important: This project is in the early CTP phase. Use it at your own risk.

Aims

  • Collect useful Commerce Server tools in a single Nuget package (licenses permitting).
    • Consistent, single location makes it easier to share scripts.
    • No need to add tools to source control (as can use Nuget package restore).
    • Get new features and fixes without effort!
  • Provide common administration tasks via a simple, easy to use .NET API.
    • Probably safer than hacking command line scripts.
    • Enable script sharing and re-use.
  • Support scripting from F# and Powershell.
    • Integrate tasks into build and environment scripts.

Authors

Get your name here too. Fork and contribute!

Features

  • Import discounts, promotion codes and global expressions.
  • Delete discounts, direct mail and advertisment campaign items.
  • Purge marketing data, baskets, purchase orders and catalog data.

Example - Delete, Purge and Import Discounts

This example does the following:

  • Exports existing discounts to the Temp folder.
  • Deletes all the discounts.
  • Purges the deleted discounts.
  • Deletes all the expressions.
  • Reseeds expression and campaign item ids.
  • Imports discounts, expressions and promo codes from XML.

The code is written as an F# script:

open CsTasks
open System.IO

//Setup our site environment.
let siteName = "StarterSite"
let marketingWebServiceUrl = @"""http://localhost/MarketingWebService/MarketingWebService.asmx""" 
let tempPath = Path.GetTempPath()
let purgeTool = PurgeCommerceDataTool(siteName)
let marketingDataStore = MarketingDataStore(siteName)

//Do a safety export to Temp (using an CsTasks F# function).
ExportDiscounts (fun defaultArgs ->
    { defaultArgs with
        DiscountExportArgs.MarketingWebServiceUrl = marketingWebServiceUrl
        ExportDirectoryPath = tempPath })

//Delete all campaign items.
marketingDataStore.DeleteAllCampaignItems()

//Purge marketing data (so we can delete expressions)
let retCode = purgeTool.PurgeAllMarketingData()

//Delete expressions.
marketingDataStore.DeleteAllExpressions()

//Reseed all Ids so our imported discounts get the same IDs each time.
marketingDataStore.ReseedCampaignItemIds(0)
marketingDataStore.ReseedExpressionIds(0)

//Do the discount import.
ImportDiscounts (fun defaultArgs -> { defaultArgs with DiscountImportArgs.MarketingWebServiceUrl = marketingWebServiceUrl})

Pre-Requisites

  • Microsoft Commerce Server 2007 or Microsoft/Ascentium Commerce Server 2009.

Installation

To install CsTasks from Nuget.org run the following command in the Nuget Package Manager Console.

PM> install-package CsTasks

Documentation

CsTasks is written in F# and we use it from .fsx build scripts. However, it is a normal .NET assembly so you can use it from any .NET language.

More documentation to come. We are in pre-release mode so you'll have to find your own way.

Additional Information

CsTasks uses the following tools and APIs.

Known Issues

None. Raise one.

Release Notes

0.3.0

  • Add support for i_SearchResultsLimit so that ALL campaign items are deleted, even when paged.
  • Addition of very basic test discount generator (used for volume testing).

0.1.7

  • New: DeleteAllPromoCodeDefinitions added to MarketingDataStore.

0.1.6

  • Removed CTP extension. No longer a PRE package.
  • Added ReseedCampaignIds to MarketingDataSource.

0.1.5

  • Breaking change: Rolled marketing functions into MarketingDataStore class. Should be easier to use for most.
  • New: Added reseeding for expressions and campaign items.

0.1.4

  • Removed dependency on FAKE.
  • Breaking: Replaced PurgeCommerceDataTool functions with PurgeCommerceDataTool class.

License

MIT

Something went wrong with that request. Please try again.