This article summarizes all technical news in Litium Studio 4.7 but does not include Breaking changes. These can be found by following the link at the end of this page.
Updated to .NET framework 4.5.2
In Litium Studio 4.7 we have upgraded the .NET framework to the latest released version. Ensure your system and production system are ready to run .NET framework 4.5.2 before starting installing or upgrading. See system requirements for specifications.
Search index
The search indices are rebuilt for indexing performance improvements and reducing search-index size on disc. Before Litium Studio 4.7 all search indices were language dependent so a lot of information was duplicate. After upgrading to Litium Studio 4.7 the search indices are rebuilt to have fields for language independent and language dependent fields. All language dependent fields are stored in the search index with the field name suffix "-{culture}" (for example: document-property-brand-sv-se).
When creating the Litium.Foundation.Search.QueryRequest it's important to include the language-Id the search should be made for. Otherwise the search will throw an exception because of the lack of language information to be able to query the search index for the result.
When building advanced queries and your tag name (for example: Litium.Foundation.Modules,ProductCatalog.Search.TagNames.TypeNameTranslation) value ends with a dash (-) means that the value is language dependent. The search in Litium Studio will then automatic add the correct language from the QueryRequest during the search.
For backward compability all standard tag-names used in filtertag/rangetag/readtag are automatically parsed and the language-prefix is added when the search is executed on the Litium.Foundation.Search.QueryRequest.
Article Number on Variant Group entity
The variant group entity has a new mandatory string field called ArticleNumber. It has to be unique for all variant groups. When upgrading, this field is updated to the same as the variant group Id.
For the article number on the variant group entity there is also a new webcontrol that always writes out the variant groups article number:
<pc:VariantGroupArticleNumber runat="server" />
On the pc:ArticleNumber control a new property is added so the control itself can display the variant group's article number for variants and the article number for articles.
<pc:ArticleNumber runat="server" UseVariantGroupArticleNumberForVariant="True" />
If you wish to initialize the variant group article number to readable text, you can use the following are two scripts.
Settting the variant group article number from the variant group name
The following script sets the article number from the name of the default language. Bare in mind that the article number needs to be unique, and make sure all the names are too.
DECLARE @languageId uniqueidentifier
SELECT @languageId = LanguageID FROM Foundation_Language WHERE IsDefault = 1
UPDATE ProductCatalog_Variant
SET ArticleNumber = vn.VariantName
FROM ProductCatalog_Variant v
INNER JOIN ProductCatalog_VariantName vn ON v.VariantID = vn.VariantID
WHERE vn.LanguageID = @languageId
Setting the variant group article number from a property value
The following script updates the article number from a variant group property. Bare in mind that the article number need to be unique, and make sure all values are too.
DECLARE @fieldName nvarchar(100)
--set the following @fieldName to the property field name
-- which has the article number for the variant group.
SET @fieldName = 'VariantNumber'
DECLARE @templateFieldId uniqueidentifier
SELECT @templateFieldId = TemplateFieldID
FROM ProductCatalog_TemplateField
WHERE TemplateFieldName = @fieldName
DECLARE @languageId uniqueidentifier
SELECT @languageId = LanguageID FROM Foundation_Language WHERE IsDefault = 1
UPDATE ProductCatalog_Variant
SET ArticleNumber = vpv.ShortStringValue
FROM ProductCatalog_Variant v
INNER JOIN ProductCatalog_VariantGroupPropertyValue vpv ON v.VariantID = vpv.VariantGroupID
WHERE
(vpv.LanguageID IS NULL OR vpv.LanguageID = @languageId)
AND vpv.TemplateFieldID = @templateFieldId
External-Id string field on ArticleGroup, Assortment, ProductGroup, Product, ProductSet, File and Folder entities
A string field named "ExternalId" has been added to ArticleGroup, Assortment, ProductGroup, Product, ProductSet, File and Folder entities. The field needs to be unique, but is not mandatory. Use this field for integration purposes.
New extensibility areas
- Litium.Studio.Plugins.EmailValidation.IEmailValidator - Used to provide regular expression for e-mail validation for both code-behind and javascript. Implement your own implementation to override the default e-mail validation regular expression.
Changes in the Event Log
Litium Studio does not depend on any external logging framework but included with the installation is a logging framework for NLog. The external logging framework can easily be replaced with your own logging.
To replace the system wide logging you need to implement the Litium.Owin.Loggingt.ILog interface in your implementation and register your logging framework from a Litium.Owin.Lifecycle.IPreSetupTask with the Litium.Owin.Logging.Log.InitializeWith<YouLoggerImplementation>() method. In the Litium.Owin (namespace Litium) package there is a logging extension to make it easier to log, the pattern is based on the LoggingExtenssion.
public class LoggingExamples {
public void LoggingFromMethod() {
this.Log().Info(() => GetTextFromMethodWithBadPerformance() );
// GetTextFromMethodWithBadPerformance will only be executed if info-logging are enabled
this.Log().Debug("Simple message");
this.Log().Error("Error message", exception);
}
public static void LoggingFromStaticMethod() {
"LoggingExamples".Log().Error("Log message based on the string LoggingExamples as type name");
typeof(LoggingExamples).Log().Error("Log message as type LoggingExamples");
}
}
Log Levels - Suggested Usage
Fatal (100) - Catastrophical failure
Error (75) - Something has failed
Warning (50) - Something is amiss and might fail if not corrected
Info (25) - Information of moderate interest for the administrator
Debug (10) - Lowest priority logging that you would normally log in solutions
Trace (0) - Lowest priority and normally not used except messages from Litium Studio
Note: All previous messages from Litium Studio at debug-level have been moved to trace-level. Now the project can use the debug-level in the solutions without see ing all internal Litium Studios log messages.
New Web Log for exception error handling to provide a better error logging tool for web pages
The Litium Studio Foundation-log (the Event Log) doesn't contain enough information when debugging a site for user errors. We have added a new Web Log in the control panel using the third-party tool Stack Exchange Exceptional which provides more extensive and coherent error information.
The WebLog is found in the Control Panel under System Settings. Just click the row to see the extended information.

Include the code sample below in your code and set the parameters after how you want to use the log.
protected void Page_Init(object sender, EventArgs e)
{
// Messages that will added to the log if error is logged
this.WebLog().Append("Init", "message");
this.WebLog().Append("Init-format", "message {0}", DateTime.Now);
this.WebLog().Append("Init-Object", Litium.Foundation.Modules.CMS.CurrentState.Current.ShoppingCart.OrderCarrier);
}
protected void Page_Load(object sender, EventArgs e)
{
// Messages that will added to the log if error is logged
this.WebLog().Append("Load", "message");
this.WebLog().Append("Load-format", "message {0}", DateTime.Now);
this.WebLog().Append("Load-Object", Litium.Foundation.Modules.CMS.CurrentState.Current.ShoppingCart.OrderCarrier);
}
protected void CreateException(object sender, EventArgs e)
{
// throws an unhandle exception, the user are redirected to the 500 error page. The exception and all above data that are appended are stored into the exceptional log
throw new NotImplementedException();
}
protected void CreateHandledException(object sender, EventArgs e)
{
// throws an handled exception, the user are still on the page and probably be showing an error messages. The exception and all above data that are appended are stored into the exceptional log
try
{
throw new NotImplementedException();
}
catch (Exception ex)
{
INoLogging marker interface for ITask implementations
Previous versions of Litium Studio makes a log entry when a scheduled task is started or stopped. To avoid messages about start and stop of a scheduled task, use the INoLogging marker interface to mark the ITask implementation.
Example:
/// <summary>
/// Manages the data import to Litium Studio.
/// </summary>
/// <remarks>
/// Information about task start and stop will not be logged to foundation log because
/// INoLogging marker interface is implemeneted.
/// </remarks>
public class ImportService : ITask, INoLogging
{
//your code. This task start and stop will not be logged to foundation log.
}
Web site texts
The number of characters in web site texts is no longer restricted.
Batch import and export of web site texts as Excel
To save time for merchants selling in multiple markets we have added the option to export and import web site texts as Excel files.
Authentication using OWIN identity from .NET 4.5.2
We have gone from ASP.NET forms authentication to use OWIN identity providers from .Net 4.5.2. That enables usage of third party login providers; for example Google, Facebook and more.
Module and system strings are removed from xml-files and read from resource files
To facilitate deployment of new versions, system and module strings are moved to resource files with fallback to the module and system string database table for project specific module and system strings.Read more about resource files >>>
Customer IP address and browser client saved on the order for tracking and fraud detection
The client IP address and browser including version number of the buying customer is saved into a new field on the order object.
Add your own Control Panel pages
You can now add your own root-grouping-node with unlimited child-nodes, for example if you have built an add-on that needs a settings page in the control panel. Previously it was only possible to add nodes in the "My settings" and "System settings" nodes. Read more about how you add your own control panel pages.
Predefined payment methods in direct pay payment provider for faster integration with ERP
There are now 10 predefined methods to the direct payment provider so projects don't need to create an own payment provider. They can then be mapped to the correct payment method in the integration to the ERP system. Read more >>>
New appsetting in default Web.config
Due to a limitation in ASP.NET the following appSetting is default from 4.7:
<add key="aspnet:MaxHttpCollectionKeys" value="10001" />
Batch import of price lists
A new batch handling for prices is built to speed up large pricelist integration. The batch methods works with creating, updating and deleting prices.
New plugin to automatically generate customer numbers for persons and organizations
There is a new plugin to automatically assign customer numbers for persons and organizations during creation, if the project/customer do not wish to use Litium Studio's default customer number. For example: the customer number needs to be created from a specific series of values because the CRM will not handle Litium Studios autogenerated customer numbers.
The ICustomerNumberFactory<T> (the T is PersonCarrier or OrganizationCarrier) needed to be implemented in the project are found in the namespace Litium.Foundation.Modules.Relations.Plugins.CustomerNumbers and will contain one Create-method that needs to be implemented.
If the assigned customer number from the customer number factory already exists on any customer (person / organization) the application will throw an exception during persistance to database.
Example implementation that has a custom string before a counter:
internal class OrganizationCustomerNumberFactory : ICustomerNumberFactory<OrganizationCarrier>, ICustomerNumberFactory<PersonCarrier>
{
private int _counter;
public string Create(OrganizationCarrier carrier)
{
return"CUSTOMER_ORGANIZATION_" + (_counter++);
}
public string Create(PersonCarrier carrier)
{
return "CUSTOMER_PERSON_" + (_counter++);
}
}
New plugin for image resizing
The internal image resizer used to resize images in Litium Studio is now a plugin. With this change you can implement your own image resizer to resize all images delivered to the website visitor.
To implement your own image resizing, create a class in your project implementing the Litium.Studio.Plugins.ImageResizer.IImageResizer interface. The interface has one resize-method that you need to implement. Litium Studio will then automatically find your plugin and use that instead of the original image resizer.
C# definitions are only run once
The setup of c# definitions for page types in the Web publising module and templates in the Product catalog and Relations modules has been changed and will only run once.This solves the problem in the Accelerator with definitions that were overwritten after IIS restart. Read more at the breaking changes page >>>