Exporting the attribute collection

To cleanse the product information data, you must export the attribute collections that are created in Product Master in a format that IBM® InfoSphere® DataStage® can use.

Before you begin

Before you can export the attribute collection, you must:

About this task

You can use the Java™ classes and methods in the com.ibm.pim.interfaces.IISIntegration interface to use the export capability. The attribute collection information is exported in the XSD format. Product Master metadata properties, which cannot be mapped to XML schema format are represented as annotation tags.

Interface methods to perform metadata export are:
/**
	 * This method takes an Collection of String representing the Attribute
	 * Collection names as input parameter and exports the metadata(of
	 * Attribute Collection) in XML Schema format in a XSD file and uploads the
	 * file to the docstore for each Attrribute Collection.
	 * 
	 * @param attrCollNames
	 *          Collection of  AttributeCollection names
	 * @return List containing the Attribute Collection names which were not
	 *         exported due to some error.
	 * 
	 * @throws PIMInternalException when internal error occurs
	 * @throws IllegalArgumentException when the Collection of
   * AttributeCollection Name is null
	 */
	public List<String> exportAttributeCollectionMetadata(Collection<String> attrCollNames);

	/**
	 * This method returns Metadata information in a String having XML Schema
	 * format, for given AttributeCollection name .
	 * 
	 * @param attrCollName
	 *            Attribute Collection name to be exported for Metadata
	 *            Information
	 * @return String XML Schema content as a string
	 * @throws PIMInternalException  when internal error occurs
	 * @throws IllegalArgumentException  when the AttributeCollection name is null
	 */
	public String getAttributeCollectionMetadata(String attrCollName);

The following table provides a mapping between node rules and XSD representation.

Table 1. Properties to XSD mapping
Node rule XSD representation
Max occurrence Schema element maxOccurs value
Min occurrence Schema element minOccurs value
Type Schema element type
Date only Schema element type (date or dateTime)
Default value Element default
Max length Schema simple type maxLength facet
Min length Schema simple type minLength facet
Pattern Schema simple type pattern facet
Precision Schema simple type fractionDigits facet
Number enumeration Schema simple type enumeration facet
String enumeration Schema simple type enumeration facet

The following table provides the mapping between metadata type and the XML schema.

Table 2. XSD representation of the metadata
Type XML schema
binary, image, thumbnail anyURI (URL)
currency decimal
date date or dateType. Date Only attribute on node is true then you want date, else dateType.
flag boolean
URL, image URL, thumbnail URL anyURI
integer integer
lookup table string (key into Lookup Table)
number decimal
number enumeration decimal (enumeration)
password string
relationship anyURI (item reference)
sequence integer
string string
string enumeration string (enumeration)
timezone string
group a grouping node is represented as a complex type with a sequence that contains all of the attributes with in that group.

Annotation tags are not used to represent some Product Master metadata properties, which cannot be captured in XML schema format.

Table 3. Metadata properties represented as annotation tags
Node property Description
Type Original product type field.
Attribute name Original attribute name storage field.
Attribute path The product attribute path. This property can be used while you import data from IBM InfoSphere Information Server to the product.
Primary key Unique identifier for Item.
Lookup table Lookup table for lookup-type.
Unique Creates a requirement for the node to be unique in the catalog. If you attempt to enter duplicate value, an error occurs. This option is only available in primary specs.
Non-persistent Ability to make a non-constant. The value is derived using a script.
Localized Set attribute for localization. The company must be set with the wanted locales.
Link Defines a node as the "source attribute" or "foreign key" to the master catalog. Option only available in primary specs.
Indexed Product supports searching on this field.

Procedure

  1. Identify by name the attribute collections that you want to export.
  2. Write a client application using the Java API interfaces that are exposed with the IISIntegration interface, and then run the program to export the metadata.
    The Java program can run the same way other Java API programs are run.