Extending Master Data Upload Templates

Developers can extend an existing template file to add custom fields in the template file. For example, in the itemlist_template.csv file, you can add a custom item attribute record in a new RECORDID column. You can enter additional attributes that contain details of this custom item attribute record.

About this task

To extend an entity type, you must extend the template file, Schema file, and the XSL files pertaining to the corresponding entity type.

Procedure

  1. Create a new template file (in .csv format) for the required entity type and add the existing fields and the custom fields in the new template file. You can also add the custom fields in the sample template file of the required entity type provided in the application. This sample template file is available in the template/resource/masterupload directory. Ensure that the template file is named in the <UPLOAD_TYPE_NAME>_template.csv format, where <UPLOAD_TYPE_NAME> is the name of the entity type.
  2. Create a schema file containing the definitions for the custom fields that must be handled by the Text Translator component. You can also add the definitions of the custom fields to the existing schema file. Ensure that the schema file for the required entity type is named in the <UPLOAD_TYPE_NAME>_schema.xml format, where <UPLOAD_TYPE_NAME> is the name of the entity type. The Text Translator component of the service uses the schema file, a type of XML file, to translate the records in the .csv file to an XML file. This sample template file is available in the template/resource/masterupload directory.
  3. Create an XSL file containing the XML transformations for the custom fields. You can also add the XML transformations of the custom fields to the existing XSL file. Ensure that the XSL file for the required entity type is named in the <UPLOAD_TYPE_NAME>_xsl.xsl format, where <UPLOAD_TYPE_NAME> is the name of the entity type. The XSL file is used to transform the XML provided by the CSV Parser component of the service into the input XML format applicable for that entity type. Each entity type has a specific XSL file that is used for transformation. This sample template file is available in the template/resource/masterupload directory.
  4. Place the modified template, schema, and XSL files in the <INSTALL_DIR>/extensions/global/template/resource/masterupload directory.
  5. Build and redeploy the resource.jar file.
    Note: To extend the XSL file, ensure that the yfs.xslcomponent.useTemplateLoading property is set to "true" in the customer_overrides.properties file.