This section explains how images (and files) are exported from InRiver and Imported into Litium.
According to inRiver recomended practise, the file data type in inRiver should only be used with inRiver resource entity types. Therefore, for all other entity types, the File data type should not be used. The images and files for a entity are connected resource entities through appropriate link types.
InRiver resources and link types
All resources must have the entity type id "Resource" and should be represented by a Link type id, whose target entity type is a "Resource". The link types are used to identify and map the resource in inRiver to the appropriate field in Litium.
Images are imported into Litium Media Archive, under a folder called "InRiverResources".
Image Import
Images are automatically imported into the "inRiverResources" folder in Litium Media. A field template called inRiverResources is created and used automatically for it.
Image Permissions
The permssions to images are controlled by the "InriverResourcesGroup" created in the Customers area. By default this group is created with Anonymous (Everyone) access. You may alter these permissions from Litium back-office. The changes to permissions will not be over-written by inRiver connector.
Image/file field mappings
Display images
in Litium, display images are a special field definition type with id "_images". To define display images, set the following attributes in the Litium.AddOns.InRiver.dll.config
- categoryDisplayImageLinkTypeId
- baseProductDisplayImageLinkTypeId
- variantDisplayImageLinkTypeId
Other images and resources
in Litium, images that are not display images (and resources) are represented as a seperate field for each image.
For example, if you have a link type in inRiver called ItemExtraImage where source entity is a Item and Target entity is a Resource, the resources attached to this link will be transfered to Litium variant as seperate fields named ItemExtraImage0, ItemExtraImage1, ItemExtraImage2, and so on.
The number of fields created (thus the number of images transfered), how to name the fields in Litium, to which field groups they belong to, and whether it should be a image link or a file link in Litium can all be configured in the Litium.AddOns.InRiver.dll.config as shown below.
Following example will be used to explain the settings in Litium.AddOns.InRiver.dll.config.
Example:
In inRiver, there are two resource link types, called ItemExtraImages (source entity type is Item - a variant in Litium, and target entity type is Resource.)and ChannelNodeExtraImages (source entity type is ChannelNode, target entity type is Resource).
No of images created:
Continuing above example, suppose there will be maximum 7 images in ItemExtraImages and 3 in ChannelNodeExtraImages. This will be configured in Litium.AddOns.InRiver.dll.config, "noOfImagesInResourceLinkTypeId" attribute.
noOfImagesInResourceLinkTypeId="ItemExtraImages:7, ChannelNodeExtraImages:3"
Resource field definitions in Litium
Continuing above example, suppose the fields created in Litium, (in Category template and product template) should be named as image1, image2, image3, then change the resourceFieldDefinitionIds attribute as:
resourceFieldDefinitionIds="ItemExtraImages:image, ChannelNodeExtraImages:image"
and set
useZeroBasedIndexForImageFieldDefinitionIds = false
if instead., the generated fields should start with zero, such as image0, image1, image2,.., then set
useZeroBasedIndexForImageFieldDefinitionIds = true
Field group in Litium
Continuing above example, suppose the fields created in Litium should be placed into a seperate field group called "ExtraImages", then
change resourceFieldGroupIds as
resourceFieldGroupIds= "ItemExtraImages:ExtraImages, ChannelNodeExtraImages:ExtraImages"
If it does not exists, the field groups will be created in Litium, you can use \InRiverLitiumIntegration\Model\FieldTypeSettings.xml file to add translations to the field groups that will be automatically created this way.
File resources in Litium
Litium uses a seperate field defnition type called MediaPointerFile for resources which are not images, and they will be rendered in the public website as links, rather than images.
To set resources in a link type to use MediaPointerFile, use the fileResouceLinkTypeIds attribute in Litium.AddOns.InRiver.dll.config.
following example, causes the resources to be treated as files, continuing from above example.
fileResouceLinkTypeIds="ItemExtraImages, ChannelNodeExtraImages"
Using Image Magic to resize inRiver images
You may use external plugins such as Image magic to resize and rescale inRiver images. Check the inRiver documentation in inRiver wiki on how to configure image magic and similar software for rescaling and resizing.
When you do this, you will be using a inRiver server setting called "resourceConfiguration".
You need to specify this also in the Litium.AddOns.InRiver.dll.config file attribute resourceConfiguration
e.g.
defaultResourceConfiguration="Original"
When you have multiple resource configurations for the same inRiver resource, to pick the correct resource configuration you want, set the resourceConfiguration setting.
Format "<File extension>:<resource configuration name>, <File extension>:<resource configuration name>"
Example:
resourceConfiguration = ".jpg:StudioCustom, .pdf:Original"
Above example setting will make the connector to export all resources with .pdf extension using the original resource configuration, and all resources with .jpg extension to use the StudioCustom resource configuration.