Guide - 7.9 Product Migration

1 Introduction

In Intershop 7.9 some old product attributes (image, thumbnail) got removed:

  • In Intershop 7.0 a new Image Framework was introduced.
  • It replaced the old image attributes stored directly in the tables PRODUCT and DERIVEDPRODUCT.
  • Hence, the image and thumbnail tag was removed from the product import/export XML format.
  • Use getImageContainerBO().getImageBO() to retrieve images via new Image Framework!

A migration is only needed if your IS 7.8 installation still contains image and thumbnail attributes stored in tables PRODUCT and DERIVEDPRODUCT.

Note

Since Intershop 7.0 we strongly recommended to use the Image Framework for storing images. It is far more flexible and can also point to external image servers as an image source.

A DBMigrate script to version 7.9 exists to remove image and thumbnail attributes from tables PRODUCT and DERIVEDPRODUCT.

1.1 References

2 Effort | Complexity | Priority

Effort (Low, Medium, High):

Medium

Complexity (Low, Medium, High):

Medium

Priority (Low, Medium, High):

High

3 New import and export XML format

A majority of Intershop customers uses a PIM system (Product Information Management). The exported XML needs to be adapted to the new schema %IS_SHARE%/system/impex/schema/catalog.xsd. The changes in the schema from Intershop 7.8 to Intershop 7.9 are:

ProductComment

<xsd:element name="image" type="simpleType.Generic.String.256" minOccurs="0" maxOccurs="1" />

the former optional parameter image was removed and is no longer supported

<xsd:element name="thumbnail" type="simpleType.Generic.String.256" minOccurs="0" maxOccurs="1" />

the former optional parameter thumbnail was removed and is no longer supported

4 Migration

  1. To migrate 'old' image and thumbnail attributes stored in tables PRODUCT and DERIVEDPRODUCT image types/views and sets must be created either in the Commerce Management application or via DBInit.
  2. The old "image" and "thumbnail" product attributes must be stored as image reference for a predefined Image Type and Image View.

4.1 Create Image Type, View and Set

Use the Concept - Image Framework (valid to 7.4) for details on how to do that.

Example for how to create Image Type, Image View and Image Set via DBInit.

dbinit.properties
# Prepare image types/views/sets for example application
Class59 = com.intershop.beehive.core.dbinit.preparer.impex.ImportPreparer \
          com.intershop.demo.responsive.dbinit.data.image.ImportImageMetadata \
          ProcessImageMetadataImport-DBInit \
          DBInit-ImageMetadataImport.properties

Extraction of XML file content

ImportImageMetadata.xml
<image-view id="front" primary-view="true">        
		<name xml:lang="en-US">Front View</name>
        <image-type-assignments>
            <image-type-assignment image-type="L" />
            <image-type-assignment image-type="M" />
            <image-type-assignment image-type="S" />
            <image-type-assignment image-type="Thumbnail" />
        </image-type-assignments>
</image-view>
<image-type id="Thumbnail" source="Internal">
        <name xml:lang="en-US">Thumbnail</name>
        <prefix>inSPIRED:/</prefix>
        <width>50</width>
        <height>50</height>
        <fallback-image>inSPIRED:/not_available.png</fallback-image>
        <custom-attributes>
            <custom-attribute name="name" dt:dt="string" xml:lang="en-US">Thumbnail</custom-attribute>
        </custom-attributes>
</image-type>

4.2 Create Image for Product

Example for product import XML file content:

Example for product import XML
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.1/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intershop.com/xml/ns/enfinity/7.1/xcs/impex" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt" major="6" minor="1" family="enfinity" branch="enterprise" build="build">
<product sku="8004569">
<sku>8004569</sku>
<long-description
 xml:lang="de-DE">Mit dem richtigen Netzteil können Sie die 
Lebensdauer und Zuverlässigkeit Ihres Computers beeinflussen. ... Die 
tatsächliche Lastanzeige kann bei abweichender Raumtemperatur anders 
ausfallen.</long-description>
<name xml:lang="de-DE">A-DATA HM-750</name>
<short-description xml:lang="de-DE">Netzteil 750W HM-Serie</short-description>
<long-description
 xml:lang="en-US">State of the Art and Neat Design The load status 
display of the intelligent tri-color (Green, Blue, Red) LED fan is 
resulted from testing in the normal temperature of 25 °C. ... The actual
 load display may vary by the room temperature where in 
use.</long-description>
<name xml:lang="en-US">A-DATA HM-750</name>
<short-description xml:lang="en-US">750W HM Series Power Supply</short-description>
<category-links>
<category-link name="963" domain="inSPIRED-Computers" default = "1" hotdeal = "0"/>
</category-links>

    <images>
        <image-ref image-view="front" image-type="Thumbnail" image-base-name="Thumbnail/8004569_2476.jpg" />

        <image-ref image-view="front" image-type="M" image-base-name="M/8004569-9395.jpg" />
    </images>

<product-list-prices>
<product-list-price currency="USD" net-price="1">129.99</product-list-price>
<product-list-price currency="EUR" net-price="1">96.81</product-list-price>
</product-list-prices>
<tax-class id = "FullTax"/>
<product-type name = "Basic" domain = "system"/>
<template>product/GeneralProductInformationInclude</template>
<online>1</online>
<available>1</available>
<availability-status>1</availability-status>
<supplier>
<supplier-name>IQ</supplier-name>
<supplier-sku>8004569</supplier-sku>
</supplier>
<manufacturer>
<manufacturer-name>A-DATA</manufacturer-name>
<manufacturer-sku>AHM750-BZ-CEU</manufacturer-sku>
</manufacturer>
<custom-attributes>
<custom-attribute name="AvailabilityStatus" dt:dt="int">1</custom-attribute>
<custom-attribute name="GiftWrappable" dt:dt="boolean">true</custom-attribute>
<custom-attribute name="Weight" dt:dt="quantity" xml:lang="en-US">3060 g</custom-attribute>
</custom-attributes>
</product>
</enfinity>

5 How to Access an Image

5.1 In Java

5.1.1 Via Business Object Layer

  1. Access the product image via image framework (BO layer).

    productBO.getExtension("Image").getImageContainerBO().getImageBO("S","front").getEffectiveUrl();
    productBO.getExtension("Image").getImageContainerBO().PrimaryImageBO("Thumbnail").getEffectiveUrl();

5.1.2 Via Persistent Object Layer

  1. Access product image via image framework (PO layer).
    Using the BO layer is an easier way to get images related to a product

    Iterator<ImageReference> theImageReferenceIter = product.createImageReferencesIterator();
    ImageReference aImageRef = theImageReferenceIter.next();
    // compare image type(e.g.: 'S') and image view(e.g.: 'front') of imageReference to get the right one
    aImageRef.getImageBaseName();
    // 'getImageBaseName()' doesn't return the same result as '.getEffectiveUrl()'
    // - depends on internal or external image source type
    
    

5.2 In ISML-Templates

<img src="<isprint value="#ProductBO:Extension("Image"):ImageContainerBO:ImageBO("S","front"):EffectiveUrl#>">
or
<isinclude template="modules/common/Modules">
...
<isImage imagecontainer="#ProductBO:Extension("Image"):ImageContainerBO#" imagetypeid="Thumbnail" imageview="front">
or
<isinclude template="modules/Modules">
...
<ISProductImage ProductBO="#ProductBO#" ImageType="M" ImageView="back">
<ISProductImage ProductBO="#ProductBO#" ImageType="Thumbnail">
for category images
<ISCategoryImage category="#CategoryBO#" imagetypeid="M">

5.3 In Pipelines

ProductBO:Extension("Image"):ImageContainerBO:ImageBO("S","front"):EffectiveUrl
ProductBO:Extension("Image"):ImageContainerBO:PrimaryImageBO("S"):EffectiveUrl

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets