Export - Data types

What are export data types? Why do I need export data types? How can I add a new data type?

This article applies to the Heiler Product Manager in versions 7.0 and above.

Export data types

Where do I encounter export data types?

  • (Main) Data type of data providers

  • Sub-data types of data providers

  • Data types for data provider parameters resp. export post step parameters

  • Data types for variables

    • qualify data fields

    • configure data type filters

    • specify export parameter values

Which kind of export data types exist?

  • Data types representing a repository root entity

  • Data types representing a repository sub-entity

  • Data types representing several repository sub-entities

  • Data types representing a repository enumeration

  • Special data types

How can I use a data type programmatically?

... as data type of a data provider parameter

Example: boolean parameter of a data provider
ValueDescriptor updateAssortmentParameter = new ValueDescriptor()
{
// ...
 
@Override
public DataType getDataType()
{
return DataTypeFactory.getInstance()
.getDataType( DataTypeBoolean.IDENTIFIER );
}
 
// ...
};

... as main data type of a data provider

Example: main data type of a data provider
public class StructureDataProvider extends ReportListModelQueryDataProviderBaseImpl
{
// ...
@Override
public DataType getDataType()
{
return DataTypeFactory.getInstance()
.getDataType( DataTypeStructure.IDENTIFIER );
}
 
// ...
}

... as sub-data type of a data provider

Example: add a sub-data type to a data provider
public class StructureDataProvider extends ReportListModelQueryDataProviderBaseImpl
{
// ...
@Override
public List getSubDataTypes()
{
List subDataTypes = new ArrayList();
 
// ...
 DataTypeUtils.addSubDatatype( subDataTypes, DataTypeStructureAttributes.IDENTIFIER );
// ...
 
return subDataTypes;
}
// ...
}

Customizing possibilities

Repository

Provide a new data type representing a repository enumeration

If there's a (new) repository enumeration you want to provide as export variable data type you just have to add a new enum param with the "useForExportDatatype" key and the "true" value:

images/download/attachments/513739028/EnableEnum_en.png

Now you can use the new data type:

images/download/attachments/513739028/NewEnumDatatypeAvailable.png

Provide a new data type representing a repository sub-entity

If there's a (new) repository sub-entity you want to export as it is, you only have to set the export purpose of this sub-entity to "1".

images/download/attachments/513739028/EnableEntity_en.png

Now there's a new sub-data type, the data of this entity are ready to be exported:

images/download/attachments/513739028/RepositoryDatatypeAvailable.JPG

Qualifying a data field: which variable matches?

If you want to qualify an export data field you can specify a dedicated value, or - if the corresponding logical key represents a date or an enumeration and if there's an export data type representing this enumeration - you can use a variable.

Example:

  • There're two variables defined

    • "Language" with data type "Language" representing the repository enumeration "Language"

    • "Language_incl_langIndependent" with data type "Languages (Including language independent)" representing the repository enumeration "Languages (Including language independent)"

      images/download/attachments/513739028/1_datatypes_defining_languageVariables.png

      images/download/attachments/513739028/4_datatypes_language_values.png

      images/download/attachments/513739028/4_datatypes_languageInclLangIndep_values.png

  • Adding the "Items.Short description" field requires qualification with a language.

    You can choose a language value directly, or you can use a variable that provides valid values for the corresponding logical key.
    The "Language" variable matches because it represents exactly the list of languages the logical key's enumeration defines.

    images/download/attachments/513739028/2_datatypes_qualifying_shortDescription_langList.png

    images/download/attachments/513739028/2_datatypes_qualifying_shortDescription.png

    images/download/attachments/513739028/2_datatypes_qualifying_shortDescription_usingVariable.png

  • Adding the "Items.Attribute value" field requires qualification with a language, too.

    Here, you can use a specific value or a variable that provides valid values for the corresponding logical key.
    Both - "Language" and "Language_incl_langIndependent" - variables match, because

    • "Language_incl_langIndependent" variable represents exactly the list of languages the logical key's enumeration defines

    • "Language" variable represents a sub-list of the allowed languages

      images/download/attachments/513739028/3_datatypes_qualifying_attributeValue_langList.png

      images/download/attachments/513739028/3_datatypes_qualifying_attributeValue.png

      images/download/attachments/513739028/3_datatypes_qualifying_attributeValue_usingVariable.png

Special export sub data types

File attachments of items, products, structure groups

Many export data sources provide a sub data type for file attachments. All these sub data types provide the same list of data fields, and use the same algorithm to retrieve data to be exported.

Available fields

The file attachments data types provide all fields...

  • that are enabled for export (export purpose is not 0)

  • that are fields of MediaAsset, MediaAssetLang, MediaAssetDocument, MediaAssetDocumentAttributes repository entities. These fields don't have to be qualified.

Data type filter

You can use all logical keys of the MediaAsset sub entities as data type filters: language, quality, type.

These data types provide an additional filter "Mandatory fields", that can prevent output of inconsistent data rows.

Load and prepare data

The following algorithm is used to create the file attachments list model:

Determine the list of media assets to be exported

The data providers list of items, products, or structure groups is used to get the mapped media assets. The resulting report of media assets is used by the next steps.

Get a listmodel for each of the sub entities

The requested data fields are splitted by its entities, a listmodel is retrieved for each sub entity:

  • MediaAssetDocumentAttributes - if any fields are requested for this entity

  • MediaAssetDocument - always

  • MediaAssetLang - if any fields are requested for this entity

  • MediaAsset - always

Merge the list models

The listmodels are merged in this order and with this rules:

  1. MediaAssetDocument and MediaAssetDocumentAttributes: merge by MediaAssetDocumentId with MediaAssetDocument as master, result: MediaAssetDocument

  2. MediaAssetDocument and MediaAssetLang: full merge by MediaAssetId and LanguageId, result: MediaAssetDocument

  3. MediaAsset and MediaAssetDocument: left outer merge by MediaAssetId with MediaAsset as master

Post-prepare the listmodel

Last step is to validate and sort the listmodel.

Support of "language independent" document language

Often media asset documents are not language dependent. That's why the file attachment sub data types support a substitute language for documents, see substitute language.

The merge algorithm of MediaAssetDocument and MediaAssetLang listmodels determines matching entries by MediaAssetId and LanguageId. If no suitable MediaAssetDocument entry is found for a MediaAssetLang entry, an entry with same MediaAssetId and LanguageId = "substitute language" is used instead. That means the media asset document entry of the substitute language is assigned to a media asset description if there's no document with description's language.

Examples

The following export template is used for all examples:

images/download/attachments/513739028/ExportFileAttachments_ExportTemplate.png

Example 1: Consistent data

There're descriptions and documents for german and english language.

images/download/attachments/513739028/ExportFileAttachments_Example1.JPG

Example 2: No documents

There're descriptions, but no documents.

images/download/attachments/513739028/ExportFileAttachments_Example2.JPG

Example 3: No descriptions

There're documents but no media asset descriptions.

images/download/attachments/513739028/ExportFileAttachments_Example3.JPG