Setup the standard file transfer service

Install the file transfer service

Follow these four steps to install the file transfer zip:

  1. Extract all files to optional folder on your local machine.
  2. Open the deploy\bin folder of your Litium Studio installation and copy all files into the SharedLibs folder of Litium Studio Integration.
  3. Make sure  the Litium Studio license.xml file has been copied into into the SharedLibs folder of Litium Studio Integration.
  4. Click the Litium.Studio.Integration.File.Transfer.sln file to open the project in Visual Studio.

Integration import files

The DefaultFileImportBase.cs file is Litium Studio specific and should not be altered in order to avoid future upgrade problems.
If you want to add methods common for all import cs-files they should be added in the FileImportBase.cs which all Import cs-files inherit from.

General:

  • Corresponding folders are automatically generated in Litium Studio when importing Articles, Price lists etc.
  • Folders “Error”, “Archive” and “Ignore” are created automatically as needed.
  • All import files are imported in chronological order.
  • All successfully imported files are saved in the Archive folder (except for media files which are saved in Litium Studio Media Archive)
  • All incomplete files are sent to the “Error” folder
  • All unknown files (for instance price list files that does not have the same name as the price list) are sent to the “Ignore” folder

Standard integrations (red border in the images below) found in the package are media (files and images), price list (prices) as plain text, stockbalance as plain text and product data that handles (product data processor in yellow border) article group, article, price list, warehouse and variant group in a combined xml format.

IntegrationKit-Importer-2.png

 Example files are included in the package:

IntegrationKit-Sample-2.png

Product data import

The standard product data xml file has a structured format to handle the article group, article, variant group, price and warehouse information. All information is in a single structure to correctly handle the import and that the price list integration is not run before the article integration has been executed. That could cause the information to mis-match between the systems, for example if trying to import prices before the article has been created.
 
If you add or delete any element in this file you also need to update the corresponding validation file: ProductDataImport.xsd. The XSD file validates that the xml file is correct when importing. If a file cannot be validated it is sent to the “Error” folder.
 
<?xml version="1.0" encoding="utf-8" ?>
<productData>
  <!--article Updates-->
  <article>
<!-- external id for the article group, the article group will be created if it not exists.
if the article group external id is omitted the top article group ar used. -->
<articleGroupExternalId>import-Shirts</articleGroupExternalId>
<!-- article number for the article -->
<articleNumber>023712_small_red</articleNumber>
<!-- stock keeping unit code -->
<stockKeepingUnit>st</stockKeepingUnit>
<!-- template name -->
<templateName>Accelerator variant</templateName>
<!-- variant group article number, the variant group will be created if it not exists.
if the variant group article number is omitted the article will not be part of any variant groups -->
<variantGroupArticleNumber>import-shirts</variantGroupArticleNumber>
<urlNames>
   <!-- url name for the culture that the article should be connected to -->
   <urlName culture="sv-SE">skjorta-shirt_small_red</urlName>
   <urlName culture="en-US">shirt-shirt_small_red</urlName>
</urlNames>
<fields>
   <!-- field for the article - if the field not exists in the template it will be ignored -->
   <field name="Color">Red</field>
   <field name="Name" culture="en-US">Red small shirt</field>
   <field name="Name" culture="sv-SE">Röd liten skjorta</field>
</fields>
  </article>

  <!--Variant group updates-->
  <variantGroup>
<!-- external id for the article group
- the article group will be created if it not exists.
- if the article group external id is omitted the top article group ar used. -->
<articleGroupExternalId>import-Shirts</articleGroupExternalId>
<!-- article number for the article -->
<articleNumber>import-shirts</articleNumber>
<!-- template name -->
<templateName>Accelerator variant</templateName>
<names>
   <!-- name for the culture that the variant group should be connected to -->
   <name culture="en-US">Skjorta</name>
   <name culture="sv-SE">Skjorta</name>
</names>
<fields>
   <!-- field for the variant group - if the field not exists in the template it will be ignored -->
   <field name="Brand">Adrian Hammond</field>
   <field name="Description" culture="sv-SE">Skjorta av den bästa sorten. Kom och köp!</field>
</fields>
  </variantGroup>
  <!--article group updates-->
  <articleGroup>
<!-- external id for the article group -->
<externalId>import-Shirts</externalId>
<!-- external id for the parent article group, if omitted the article group will be created below the top article group-->
<parentExternalId>ImportNode</parentExternalId>
<names>
   <!-- name article group -->
   <name culture="en-US">Skjorta</name>
   <name culture="sv-SE">Skjorta</name>
</names>
  </articleGroup>
  <!--priceList updates-->
  <priceList>
<!-- external id for the pricelist-->
<externalId>B2B-import</externalId>
<!-- currecy, mandatory to be able to create the pricelist if not exists-->
<currency>SEK</currency>
<prices>
   <!-- add prices -->
   <add articleNumber="football-2008" price="100" vatPercentage="0.25" minQuantity="0" />
   <add articleNumber="football-2008" price="95" vatPercentage="0.25" minQuantity="5" />
   <add articleNumber="football-2008" price="90" vatPercentage="0.25" minQuantity="10" />
   <!-- remove prices, if the minQuantity are omitted all prices for the article are removed-->
   <remove articleNumber="023712_small_red" />
   <remove articleNumber="023712_small_green" minQuantity="10" />
</prices>
  </priceList>
  <!--warehouse-->
  <warehouse>
<!-- warehouse external id -->
<externalId>Import-Warehouse</externalId>
<!-- warehouse name -->
<name>Import Warehouse</name>
<!-- flag to tell the system if this is the default warehous to use -->
<isDefault>false</isDefault>
<stockBalances>
   <!-- add stock balances -->
   <add articleNumber="023712_small_red" quantity="15"/>
   <add articleNumber="023712_small_green" quantity="25" inventoryDate="2009-08-07T12:09"/>
   <add articleNumber="football-2008" quantity="50" status="6"/>
   <add articleNumber="football-01" quantity="50" status="6"/>
   <!-- remove stock balances -->
   <remove articleNumber="football-01"/>
</stockBalances>
  </warehouse>
</productData>
 

If you wish to map media files and articles the media filename must contain article identification. Best practice is to use the article number as identifier. See examples in the ProductData.xml file in the package.

Media import

Media files are not saved in the repository but imported into Litium Studio Media Archive where a folder named “Import” is automatically created. The catalog name can be altered in the MediaImport.cs file if needed.

If you wish to map media files and articles the media filename must contain article identification. Best practice is to use the article number as identifier. See examples in the ProductData.xml file in the package.

For automatic mapping against articles or variant groups the Litium studio add-on “Product Media Mapper” must be installed.

Pricelist import

The first step, prior to importing pricelists, is to set them up in Litium Studio. If a pricelist has not been created in Litium Studio before importing files it will NOT be created automatically, in the absence of currency and group/product group permissions. Any imported files will then be sent to the “Ignore” folder. Note! The pricelist name must be the same as the filename (excluding extension).

Pricelists are imported as tab-separated text files: Article number (tab) Price (tab) VAT (tab) minQuantity

The example file Pricelist.txt is found in the package.

Stock balance import

The first step, prior to importing stock balance, is to set it up in Litium Studio. If a warehouse has not been created in Litium Studio before importing files it will NOT be created automatically and the files will be sent to the “Ignore” folder.  Note! The warehouse name must be the same as the stock balance filename (excluding extension).

Pricelists are imported as tab-separated text files: Article number (tab) Quantity

The example file Stockbalance.txt is found in the package.

App.Config file settings

Check all of below settings in the App.Config file and make the changes needed.

In AppSettings\value, set the path to the Litium studio Integration Kit folder on your server:

    <appSettings>         <add key="IntegrationDirectory" value=" " />

The ConnectionString should be the same as for your Litium Studio installation:

<connectionStrings>         <add name="FoundationConnectionString" connectionString="Pooling=;User Id=;Password=;Database=;Server="

In In Log4net\file, set the path to where logs should be written during execution of the service.

<log4net>         <file value=" "/>              The SystemUser\password should be the same as for your Litium Studio installation:

<foundation>                 <systemUser password=" " enabled="true"/> The filesDirectory should NOT use the same directory as Litium Studio in IIS to avoid file conflicts:

<general>                 <filesDirectory value=" "/> The storageDirectory should be the same as for your Litium Studio installation:

<storageDirectory value=" " />

The Integration service covers four default important tasks:

Product data import - Litium.Integration.Implementation.Imports.ProductDataImport. MediaArchive import - Litium.Integration.Implementation.Imports.MediaImport Price list import - Litium.Integration.Implementation.Imports.PriceListImport, Stock balance import - Litium.Integration.Implementation.Imports.StockBalanceImport

Where:

type – full type name for the task responsible for the integration process parameters – not mandatory, can be used to transfer additional data into the task startTime - time to start executing the integration task from service start interval – interval between executing the task

All default integration values can be changed:

Default values

Build the integration service

By rightclicking the Litium.Studio.Integration.Service you build the file transfer service. Correct any errors and if necessary rebuild.

The integration service is now installed.

How to install as a Windows service

If you want to you can set it up as a Windows service running in the background on your server.

How to build custom implementation tasks

The windows service integration kit allows integration process to run for custom import implementation.

           

Is this page helpful?
Thank you for your feedback!