GetConfiguration
This method is called in case you would like some up front knowledge of what kind of data you can expect to get from EC when you start querying for products, categories and sites. Which fields will you get? Are Related Products configured (and likely therefore in use) etc. etc. An ECommerce System like Sana can utilize that information to configure itself according to the received data enabling the user to pick which fields you want to make available for full text-search, show on product detail pages or use as facets in lists.
The response from EC contains a lot of information on Mappings, Settings and Languages from each of channels fitting the criteria. In addition, if a mapping is from a feature name (see section Creating your first mappings), you will get information on that feature.
It may happen that you do not need to call this method at all, and if you do, it is highly likely that you will only use a small subset of all the information in there.
GetConfiguration | |||
Parameters | Name | Mandatory | Description |
Channel | Yes | Name of the channel which configuration you want to have. It is allowed to supply multiple names. | |
ECommerceSystem | No | Name of the ECommerceSystem you want returned channels to have. It is allowed to supply multiple names of ECommerceSystems. | |
Sample request | <Execute method="GetConfiguration" refreshconfiguration="true">
<Parameter id="Channel" value="My Channel" />
</Execute> | ||
Sample result | <Response>
<Result>
<Channel name="My Channel">
<!--Mappings-->
<Category>
<Mappings>
<Mapping>
<From>@id</From>
<To>CatId</To>
<OutputKind>KeyField</OutputKind>
<ExpressionType>Attribute</ExpressionType>
<Type>String</Type>
</Mapping>
<!-- More mappings would go here -->
</Mappings>
</Category>
<Site>
<!-- Mappings on Entity Site goes here -->
</Site>
<Product>
<!-- Mapping on Entity Product goes here -->
</Product>
<Variant>
<!-- Mapping on Entity Variant goes here -->
</Variant>
</Channel>
<!--Groups-->
<Groups>
<Group type="InformationGroup">
<Id>73660834-eea8-4d67-8e84-b38e2742706a</Id>
<Order>0</Order>
<Captions>
<Caption culture="de-DE">Alle</Caption>
<Caption culture="en-US">All</Caption>
</Captions>
</Group>
<!-- More groups would go here -->
</Groups>
<!--Languages-->
<Languages>
<Language>
<PerfionLanguageName>EN</PerfionLanguageName>
<ECommerceCultureId>en-US</ECommerceCultureId>
</Language>
<!-- More languages would go here -->
</Languages>
<!--Settings-->
<Settings>
<Setting>
<Name>ImageServiceUrl</Name>
<Value>http://192.168.20.106:8080/perfion/image.aspx</Value>
</Setting>
<!-- More settings would go here -->
</Settings>
</Result>
</Response> |
Table 18: GetConfiguration-method.
Mappings
As you see from the sample result in Table 18, you will for each channel and entity get all mappings, except for the mappings that does not provide any output (Context-mapping being one of them).
As a minimum, you will always get the following element for a mapping:
From: The “From”-value in the mapping. Usually the value of a feature, but it can also be a literal or an attribute.
To: The name written in the “ECommerce To”-column. This is the name of the output created regardless of whether it is a field, image, relatedproduct or.
OutputKind: Here the OutputKind-selected is output.
Note: In case the OutputKind has parameters (“Image” and “Attachment” have parameters) these will be output as well as child-elements as shown in the example for an Image-mapping in Table 19, where BinaryOutputKind-parameter is output as “url”. From version 4.10.3 we have for OutputKind “Attribute” introduced the AttributeName mapped to.
ExpressionType: Here EC puts the deducted expression type, that is, whether “From” contains a FeatureName, an Attribute or a Literal.
Example 1: Mapping a Feature
Now the CatId-mapping in Table 18 is mapping from an attribute in Perfion (The id). If a mapping instead is mapped from a feature, it will have a Feature-element in the Configuration having a lot of child-elements describing the feature.
An example of that is seen below in where the mapping for the feature Image is output.
Mapping as seen in Perfion |
|
Resulting mapping as part of the GetConfiguration-result |
<Mapping>
<From>Image</From>
<To>Main Image</To>
<OutputKind>Image</OutputKind>
<ImageParameters>
<BinaryOutputKind>url</BinaryOutputKind>
</ImageParameters>
<ExpressionType>FeatureName</ExpressionType>
<Type>Image</Type>
<Feature>
<Id>105</Id>
<Name>Image</Name>
<Type>Image</Type>
<Inheritable>true</Inheritable>
<Localizable>false</Localizable>
<Selectable>false</Selectable>
<MultiValue>false</MultiValue>
<Hierarchical>false</Hierarchical>
<Captions>
<Caption culture="de-DE">Bild</Caption>
<Caption culture="en-US">Image</Caption>
</Captions>
<Groups>
<InformationGroupId>73660834-eea8-4d67-8e84-b38e2742706a</InformationGroupId>
<TopViewGroupId>06e66d90-3c7a-4841-8756-863d699f9452</TopViewGroupId>
</Groups>
</Feature>
</Mapping> |
Table 1: Mapping of Image-feature.
The child-elements of feature are:
Id: Contains the (internal) id of the Feature. This id is unique for all features.
Name: Contains the unique name of the feature.
Type: Contains the feature-type.
Inheritable: Contains true if feature is inheritable, otherwise false. Note: Introduced in Perfion 4.5 2018 R2.
Localizable: Contains true if feature is localizable, otherwise false.
Selectable: Contains true if feature is selectable, otherwise false.
MultiValue: Contains true if feature is multi value, i.e. may hold multiple values for a single entity, otherwise false.
Hierarchical: Contains true if feature is hierarchical, otherwise false.
Captions: Contains the localized captions of the feature.
CaptionAlternatives: Contains the localized alternative captions of the feature (not shown in the example)
Units: Contains the localized units of the feature (not shown in the example)
Abbreviations: From version 2022 R2 SR3 this element will contain the localized abbreviations of the feature (not shown in the example)
HelpTexts: From version 2022 R2 SR3 this element will contain the localized help texts of the feature (not shown in the example)
Groups: This element contains at most 3 ids of all the groups it belongs to. These Ids all points to a group as described in section Groups.
Example 2: A mapping from a Feature with OutputKind “Attribute”
Consider the two mappings shown below:
Mapping as seen in Perfion |
|
One of the mappings map the value of the feature VolumeL to a field named Volume. This follows the same pattern as we saw in Example 1. The other maps an attribute named unit (in From-field) on the VolumeL-feature and it maps its value to an attribute of the Volume-field also named unit (in To-Field). In GetConfiguration these two mappings look like this:
Resulting mappings as part of the GetConfiguration-result |
|
Table 2: Two mappings with OutputKind Field and Attribute, respectively.
The first mapping is the mapping of VolumeL-feature to the Volume-Field. The next mapping is with OutputKind Attribute. A new element appeared for exactly OutputKind Attribute in version 4.10.3. It is the AttributeName-element and it tells the caller, that the Volume-field (named in the To-part of the mapping) can have an attribute by the name “unit” (also named in the “To”-part).
You cannot only map attribute-values as attributes (i.e. using OutputKind Attribute). You can also map features and literals using the OutputKind Attribute. In Table 3 we have switched the second mapping with one that maps a simple literal and shows the corresponding output coming from GetConfiguration:
Mapping as seen in Perfion |
|
Resulting mappings as part of the GetConfiguration-result |
|
Table 3: Two mappings of OutputKind Field and Attribute, respectively.
As seen in Table 3 here the AttributeName is named isdetail and again its name is picked up from the To-part of the mapping.
You can read more on OutputKind attribute in Section Attritbute.
Groups
The Groups-element contain all the groups that all these feature exists in. All groups will be supplied with their type (InformationGroup, TopViewGroup and ViewGroup), their order and their captions.
These groups can be used to group features as set up in Perfion.
Languages
The Languages-element contains all languages being exchanged on the channel. Each element has two child elements:
PerfionLanguageName: Contains the Perfion Name for the language.
ECommerceCultureId: Contains the mapped to Culture Id for the language.
How to setup languages in EC is described in section Languages.