Import of characteristic values

Import mapping example

Given is a CSV file which, as a table, would look like the following one.

itemId

recordKey

parentRecordKey

characteristic

language

order

value

item1

10

8

myCharacteristic

eng

42

myValue

...

...

...

...

...

...

...

Some values are fixed ones:

  • If a characteristic is a root characteristic the column parentRecordKey has to have the value root.

  • If a value is not language-specific the column language has to contain the value -1.

  • Boolean characteristics contain the values true and false only.

  • The value for order can be omitted.

Import of MIME values

Since P360 version 8.1.0.01 a characteristic value of the type MIME can be imported. Therefor the import files should be like the following:

  • one or several data sources (e.g. CSV, XML file) containing the MIME characteristic values as a reference to the corresponding MIME files

  • one or several additional data sources of type "MIME Zip", which are zip file(s) having an extension of "mime.zip" and containing the corresponding MIME file

An input file could for example look like this:

<CharacteristicValue>
<Characteristic>root_MIME_SingleRecord_LangIndep_SingleValue</Characteristic>
<ParentRecordKey>root</ParentRecordKey>
<RecordKey>root_001</RecordKey>
<Order>1</Order>
<LanguageIndependentValue>myFolder/myFile.jpg</LanguageIndependentValue>
</CharacteristicValue>

Only a MIME Characteristic value with correct format can be imported:

  • If the corresponding MIME file was not found in any data source (i.e. "mime.zip" files), the MIME characteristic value will not be imported.

  • the MIME Characteristic value to be imported must be a relative file path.

  • the MIME Characteristic value to be imported should not start with a slash or back slash.

A MIME file will be imported with the following rules:

  • a MIME file will be imported if there is at least one reference (MIME characteristic value pointing to this MIME file) in any input file of an import project.

  • a MIME file is imported only once, even if several MIME characteristic values are pointing to the same MIME file within one import project.

MIME file import files are typically large archive files. These files keep stored on the P360 server till the corresponding import job gets removed. Please ensure to have the matching clean up job defined to prevent disk space issues.

It is possible to define multiple mime zip files as data source of an import mapping profile.

In case a characteristic value refers to a file that is contained in both of the mime zip files, it is non-deterministic which of the files is used for the actual import of the value.

It is recommended to take care that such scenarios are prevented.

Hotfolder Configuration for importing Characteristic MIME Values

In order to import characteristic MIME values it is necessary to have an import mapping profile containing at least one MIME zip datasource as described above.

images/download/attachments/133530350/CharacteristicsMime_SampleMappingProfile.png

Importing the data via hotfolder is only possible with a hotfolder group. When creating a hotfolder group it must have the following configuration:

General setup

  • Group type "Multi-file import, wait for all files (one mapping, multiple files)"

  • File sorter arbitrary

Hotfolder configurations

  • Create a hotfolder configuration for each datasource contained in the import mapping.

  • Ensure that the file patterns match correctly - especially when using a postfix sorter as file sorter of the hotfolder group. So if there is a mapping with two MIME zips, the patterns for those configurations may look like "first*.mime.zip" and "second*.mime.zip".

  • Assign each hotfolder configuration to the created hotfolder group. The sequence of the configurations must match the order of the datasources in the used import mapping. E.g. if you have a csv file as first datasource and two MIME zip datasources following, the sequence for the csv hotfolder configuration must be 1 and the sequence 2 and 3 for the other two the MIME zip configurations.

images/download/attachments/133530350/CharacteristicsMime_SampleHotfolderConfiguration.png

Import Characteristic MIME Values via Supplier Portal

The supplier portal does also support the import of Characteristic MIME values, for this the corresponding import mapping should be defined with the "Supplier portal" purpose in Desktop as general, and then assigned to the desired supplier in Supplier Portal. Additional the following points should be also considered:

  • all in mime zip files contained files should be accepted as allowed mime types in Supplier Portal, otherwise the corresponding mime zip files can not be uploaded with an error information. The list of accepted mime types is defined as the property "content.filter.accepted.mime.types" in the config file "upload-content-filter-default.properties".

  • the maximum size for each mime zip file is limited to 2 GB.

Supplier Portal scans the uploaded zip archives and the contained files. Please note that it might be necessary to increase the available memory for Tomcat, if big files are part of the uploaded archive. You will find a OutOfMemory exception in Tomcat's catalina log file, if more memory is needed.

Performance

To improve the performance of the import it is possible to deactivate the presorting of the rows contained in a file. This is done when a new import is created. When adding a source file a settings dialog for the file is presented after the respective file has been selected. in this dialog click on "Advanced settings" and deactivate the "Presort rows" option.

images/download/attachments/133530350/image2017-11-16_11_18_13.png

This setting applies to import configurations that are used in hotfolders as well.

Presorted data

Please not that if you want to utilize this option the data of different items must not be mixed up but order by item.