Setup

Setup

Parameters

Name

Mandatory

Description

ResourceMode

No

The resource mode you want EC to run in. See available options in Section ResourceMode.

Default value is current ResourceMode.

LogMode

No

The log mode you want EC to run in see Section LogMode.

Default value is current LogMode.

WorkFolder

No

The root-folder in which either Engine or Log-files are stored in.

Default value is current WorkFolder.

WriteEngineFiles

No

When true, the engine files (xml- and xsl-files) will be written to disk. Note: This will overwrite any same-named files already written.

Default value is false.

Sample request

<Execute method="Setup">   <Parameter id="ResourceMode" value="ResourcesInFiles" />   <Parameter id="LogMode" value="EnableLogging" />   <Parameter id="WorkFolder" value="c:\temp\ECommerceAPI_Workfolder" />   <Parameter id="WriteEngineFiles" value="true" /> </Execute>

Sample result

<Response>   <Result>     <Settings>       <Setting>         <Name>ResourceMode</Name>         <Value>ResourcesInFiles</Value>       </Setting>       <Setting>         <Name>LogMode</Name>         <Value>EnableLogging</Value>       </Setting>       <Setting>         <Name>WorkFolder</Name>         <Value>c:\temp\ECommerceAPI_Workfolder</Value>       </Setting>       <Setting>         <Name>WriteEngineFiles</Name>         <Value>true</Value>       </Setting>     </Settings>   </Result> </Response>

Table 1: The Setup-method.

The folders used by the engine in EC

The Setup-method example shown in Table 36, having both a work folder supplied and having set “WriteEngineFiles” to true will add the Engine-folders and files to the folder c:\temp\ECommerceAPI_Workfolder.

Figure 1: The engine-folders written when WriteEngineFiles set to true

Engine-folder: This folder contains most engine files. These are xml-files containing Perfion Query-templates and Xsl-transformations making the results into EC Output.

Utility-folder: This folder contains some supporting xsl-sheets used by the Engine-xsl files.

Settings-folder: This folder contains a “snapshot” of the current configuration spread out in various xml-files. These files contains features, mappings, settings etc. as read from the configuration in Perfion. The engine uses these files when generating its output.

Custom-folder: If you want to customize the behavior of your EC, you can take a copy of the files you want to modify and put them in this folder. When resource mode is ResourcesInFiles, EC will always look for engine-files first in this folder and afterwards, if unsuccessful, uses the Engine-folder. Note that the Custom-folder will not be emptied when you do a Setup-request with WriteEngineFiles-set to true. That way it is a safer way to have your customizations here instead of simply modifying the files in the engine-folder directly.

The Logging done by EC

When LogMode is set to EnableLogging, every request will log all intermediate steps and results carrying from the initial EC API request ending up in the final response. If EC does not give you the responds you expect it can be an idea to enable logging (and specify) a log folder and (re-) do some request that does not return the expected result.

By inspecting each step and the result of each step, you might be able to figure out what is causing the problem. It may turn out to be a configuration issue or, worse, a bug in the EC API. Even if it is a bug, you might be able to correct it by fixing the erroneous xml- or xsl-file and copy the fixed versions to the Custom-folder. Remember always to let us at Perfion know about the problem, so we can fix it in an upcoming release.

NOTE: In order to understand the debug-files, you will need to be fairly acquainted with the Perfion API output format, xml and xsl. If you are not skilled in these technologies, it would still be helpful for us at Perfion to have these files accompanied by any error description.

The log files you will find in the _Debug-subfolder to the Engine folder shown in Figure 27.

In Figure 28 below, you will find the resulting debug-files for the GetProducts-request here:

<Execute method="GetProducts">   <Parameter id="Channel" value="My Channel" /> </Execute>
Figure 2: The resulting debug-files after a GetProducts-method

Please note the following when you do debugging:

  • The above GetProducts-request does not have the “refreshconfiguration”-attribute set to true. This is to avoid all the debug-files coming from indeed reading and processing the configuration.

  • Using numbers as part of the filenames the files will appear in logical order when sorted by name,

  • The “same” request may or may not result in the same number of files. A GetProducts finding variants will use and hereby output more files when compared to a GetProducts not finding any variants.