Template API : Template Controller

The Template APIs are used to create and maintain the template files used to import new data into EnterWorks and export existing data out in a variety of different file types. Using these APIs, you can also set the mappings between the templates and the repositories, manage style maps, and track the variables used when exporting.

In addition, you can use the Template APIs to:

  • Maintain template and style map folders

  • Move templates to a different folder

  • Set the available file formats

  • Generate sample files for Exchange templates

  • Manage import and export nodes

  • Retrieve the attribute list

For more detailed information, see the Template API Endpoints section below or the EnterWorks Swagger pages.

Template API Endpoints

GET /api/exportImportTemplatesMappings/{importConfigId}:

  • Exports the Import Template Mapping to OutStream.

GET /api/exportStyleMap:

  • Retrieves the export style map.

POST /api/exportStyleMap:

  • Creates an export style map.

DELETE /api/exportStyleMap/{styleMapId}:

  • Deletes the specified export style map (styleMapId).

GET /api/exportStyleMap/{styleMapId}:

  • Retrieves the specified export style map (styleMapId).

PATCH /api/exportStyleMap/{styleMapId}:

  • Patches the specified export style map (styleMapId).

GET /api/exportStyleMapGroups:

  • Retrieves a list of export style folders.

POST /api/exportStyleMapGroups:

  • Creates a new export style group.

DELETE /api/exportStyleMapGroups/{styleMapGroupId}:

  • Deletes the specified export style group (styleMapGroupId).

GET /api/exportStyleMapGroups/{styleMapGroupId}:

  • Retrieves the specified export styleMap folder (styleMapGroupId).

PATCH /api/exportStyleMapGroups/{styleMapGroupId}:

  • Patches the specified export style group (StyleMapGroup).

GET /api/exportTemplateGroups:

  • Retrieves a list of export template folders.

POST /api/exportTemplateGroups:

  • Creates a new export template group.

DELETE /api/exportTemplateGroups/{exportTemplateGroupId}:

  • Deletes the specified export template group (exportTemplateGroupId).

PATCH /api/exportTemplateGroups/{exportTemplateGroupId}:

  • Patches the specified export template group (exportTemplateGroupId).

GET /api/exportTemplateGroups/{pubContextGroupId}:

  • Retrieves the specified export template group (pubContextGroupId).

GET /api/exportTemplates:

  • Retrieves the export template list.

POST /api/exportTemplates:

  • Creates an export template.

  • Use the following APIs to gather the information needed to create an export template using this API call:

    • Export file types

      Template -> /api/{pubContextGroupType}/fileTypes

    • File Alias Format Type

      Template -> /api/outputFileAliasFormatType

    • CRUD calls on Export template groups/folders

      Template(CRUD) -> /api/exportTemplateGroups

    • Image information for context, type, and priority

      Template -> /api/imageContextTypePriority

    • File split

      Repository -> /api/splitFileControl

    • Validation level

      System -> api/config/properties

    • Advanced callout functions

      System -> api/config/properties

POST /api/exportTemplates/binaryImport:

  • Creates a new export template by importing from a local server-side .xls file for the specified template name, description, group id, and optional file info.

POST /api/exportTemplates/import:

  • Creates a new export template by importing from a local or server-side .csv/.xls file for the specified template name, description, group id, and optional file info.

GET /api/exportTemplates/{exportTemplateGroupType}/fileTypes:

  • Retrieves a list of export template file types for the specified export group type (exportTemplateGroupType).

DELETE /api/exportTemplates/{templateId}:

  • Deletes the specified export template (templateId).

GET /api/exportTemplates/{templateId}:

  • Retrieves the specified export template (templateId).

PUT /api/exportTemplates/{templateId}:

  • Updates the specified export template (templateId).

GET /api/exportTemplates/{templateId}/attributes:

  • Retrieves the export attributes for the specified template (templateId).

POST /api/exportTemplates/{templateId}/export:

  • Exports the specified export template (templateId) in the specified file format (fileType).

POST /api/exportTemplates/{templateId}/exportTemplateMappingDetailsToOS:

  • Retrieves the specified export template mapping (templateId).

GET /api/exportTemplates/{templateId}/exportTemplateToOS:

  • Exports the specified export template (templateId) to OutStream.

GET /api/exportTemplates/{templateId}/fileLayout:

  • Retrieves the specified export template (templateId) layout.

PATCH /api/exportTemplates/{templateId}/fileLayout:

  • Updates the specified export template (templateId) layout.

    Note: The list (exportFileLayoutList) passed can be a partial list and any column that's not passed in the list will remain unchanged. However, each object in the list must be a full object as any missing fields will be changed to "null".

POST /api/exportTemplates/{templateId}/importMappingDetailNamesFromBinary:

  • Imports the export template mapping detail display names from a local server-side .xls file for the specified template (templateId).

  • If the file contains the display name of an already existing mapping detail, that display name will not be added and the existing mapping detail will remain unchanged.

    Note: For a newly added display name, the Required Indicator and Mapping fields will be empty.

POST /api/exportTemplates/{templateId}/importTemplateMappingDetailsFromBinary:

  • Imports the export template mapping details from a local server-side .xls file for the specified template (templateId).

  • If the file contains name of an already existing mapping detail, that existing mapping detail will get updated, but the rest of the existing mapping details will remain unchanged.

POST /api/exportTemplates/{templateId}/mappingSearch:

  • Retrieves the export template mapping list for the specified code value (codeValue).

GET /api/exportTemplates/{templateId}/mappings:

  • Retrieves the mapping list for a specified template (templateId).

POST /api/exportTemplates/{templateId}/mappings:

  • Creates a mapping list for the specified export template (templateId).

DELETE /api/exportTemplates/{templateId}/mappings/{mappingId}:

  • Deletes the specified mapping (mappingId) from an export template (templateId).

GET /api/exportTemplates/{templateId}/mappings/{mappingId}:

  • Retrieves the specified mapping (mappingId) from an export template (templateId).

PUT /api/exportTemplates/{templateId}/mappings/{mappingId}:

  • Updates the specified mapping (mappingId) in an export template (templateId).

    Note: Mapping detail list must be a full list. Any mapping detail that is not passed in the list will be removed.

GET /api/exportTemplates/{templateId}/nodes:

  • Retrieves nodes for the specified export template (templateId).

    Note: Same as GET /api/exportTemplates/{templateId}/attributes.

PUT /api/exportTemplates/{templateId}/nodes:

  • Updates nodes for the specified export template (templateId).

POST /api/exportTemplates/{templateId}/preview:

  • Posts the variable list for the mapping preview of the specified export template (templateId).

GET /api/exportTemplates/{templateId}/previewVariables:

  • Retrieves the variable list for the mapping preview of the specified export template (templateId).

GET /api/exportTemplates/{templateId}/sampleFile:

  • Generates a sample export file from the specified export template (templateId).

    Note: This call only supports Exchange XML templates (type code "23").

GET /api/exportTemplatesWithSecurityLogin:

  • Retrieves a specified export template or a full list of available export templates.

GET /api/imageContextTypePriority:

  • Retrieves the image context, priority, and type for the specified export template (templateId).

    Note: Image context, type, and priority are drawn from Damlink and DamVariant repository information.

GET /api/importTemplates:

  • Retrieves a specified import template or a full list of available import templates.

POST /api/importTemplates:

  • Creates a new import template for the specified repository (repositoryId).

POST /api/importTemplates/import:

  • Imports the template with specified name, description, and .xml file.

DELETE /api/importTemplates/{templateId}:

  • Deletes the specified import template (templateId).

GET /api/importTemplates/{templateId}:

  • Retrieves the specified import template (templateId).

PUT /api/importTemplates/{templateId}:

  • Updates the specified import template (templateId).

POST /api/importTemplates/{templateId}/export:

  • Exports the specified import template (templateId).

GET /api/importTemplates/{templateId}/nodes:

  • Retrieves nodes for the specified import template (templateId).

PUT /api/importTemplates/{templateId}/nodes:

  • Updates nodes for the specified import template (templateId).

    Note: This call can pass a full node tree or only the user selected nodes. Any node that is not set as "selected" will be ignored.

PUT /api/moveExportTemplates/{templateId}/pubContextGroupId/{pubContextGroupId}:

  • Moves the specified export template (templateId) to a different folder.

GET /api/outputFileAliasFormatType:

  • Retrieves the alias types for the export template output file.

POST /api/templates/file/generate:

  • Generates a sample export file based on the preferences of the specified user (userPrefId).

    Note: The sample file generated will be located in the directory defined by the "export.output.path" value in the sharedConfig.properties file.

GET /api/vtlAttrList:

  • Retrieves the attribute list for the VTL builder in the specified repository (repositoryId).

GET /api/{pubContextGroupType}/fileTypes:

  • Retrieves a list of file types for the export templates in the specified export group type (pubContextGroupType).