The task is used to export file metadata into an executable Ant build script. The build script that is created by contains a fully formatted globalFileMetadata task that can be run on the same EWM® system as a backup mechanism to restore file metadata or on a different EWM system as a mechanism to transfer file metadata from one system to another.

The task is used to generate an export script for all components, projects, and files in a workspace. All components in the workspace are included in the file search process by default, but exclude and include attributes can be specified to customize which components to use and thereby control which files will be processed.

Attributes

The task supports Team Build Attributes, Build Extensions Debugging Attributes, Build Extensions General Attributes, as well as, its own task specific attributes. Click on a link for more information on the common attributes.

The following table describes the task specific attributes for the task:

Task Specific Attributes
Attribute Description Required
exclude A list of component names to exclude from the process. By default, all components in the workspace are included. This list is used to identify components that are defined to the workspace, but that should not be included when searching for files to process. The exclude attribute is optional. Both the exclude and include attributes can be specified on a build to identify which components to process when searching for files. Multiple components may be specified as a comma separated list. No
exportAsis Specify true to export property values in their current, internal format. Specify false to export property values in their resolved format. The default is false.

The value for any property that represents an EWM item is normally that item’s UUID. When exporting and importing to the same system, using the UUID is more efficient, but less readable. When exporting on one system and importing on another, the UUID will not be usable and the value must be converted to a textual name of the item.

No
exportClean Specify true to clear the property table for each file to start "fresh". Specify false to use the property table asis for each file. The default is false. No
exportFile The name of the export file. This is the file where the Ant script with exported file metadata is written. Since the export file is also an Ant build script, the file extension typically used for this file would be "xml". Yes
exportFolder The name of the export file folder. This is the location for the export file. A fully qualified path is required. Yes
exportFormat This option controls whether or not the resulting export file, and the XML it contains, is formatted for human consumption. Specify true to have the XML formatted into a more readable form. Specify false to create a standard, compact XML file. The default is true. No
exportLog This option controls whether or not the resulting export file is written to the console as well as the file. Specify true to write the XML to the console, or build log, in addition to the file. Specify false to write the XML only to the export file. The default is false. No
exportProject Specify true to include the projectName attribute on Rule elements in the export file. Specify false to skip the projectName attribute on rule elements in the export file. The default is false. No
exportType This option controls whether or not the resulting export file includes lineDelimiter and contentType attributes for the files. Specify true to include line delimiter and content type information in the export file. The default is false. No
importAsis Specify true to bypass property value translation. Valid values are true and false. The default is false. This attribute is the complimentary attribute to the exportAsis attribute. When the exportAsis attribute is set to true, property values are exported in their internal format. When the importAsis attribute is set to true, property values are imported using their internal format. If property values were exported in their internal format, they must be imported in their internal format.

The value for any property that represents an EWM item is normally that item’s UUID. When exporting and importing to the same system, using the UUID is more efficient, but less readable. When exporting on one system and importing on another, the UUID will not be usable and the value must be converted to a textual name of the item. The default behavior of an export is to translate the UUID property value into the textual name of the item. If that behavior is overridden, the importAsis attribute must be set to true to correctly import the value.

No
include A list of component names to include in the process. By default, all components in the workspace are included. This list is used to identify specific components that are defined to the workspace, that should be included when searching for files to process. The include attribute is optional. Both the exclude and include attributes can be specified on a build to identify which components to process when searching for files. Multiple components may be specified as a comma separated list. No
preview Specify true to preview what file metadata would be processed. The default is false; when a file is found, the file metadata will be processed. No
projectArea The name of the EWM project area where Enterprise Extensions system definitions are defined. System definition data is required to translate any property value that references an Enterprise Extensions system definition, for instance, a language definition associated with a source file.

Note: The projectArea attribute is required if neither of these conditions are true:

  • One of the workspace default accept target, current accept target, default deliver target, or current deliver target is a stream defined in the same project area as the Enterprise Extensions system definitions.
  • The Enterprise Extensions System Definition Toolkit <init> task has been run prior to the task.
No
workspaceName Specify the name of the workspace that contains the files to be processed. This workspace must be loaded in the Eclipse® environment running .

Note: A workspace must be specified by the workspaceName attribute, the workspaceUUID attribute, or the team.scm.workspaceUUID build property. If a workspace is not identified by one of these three methods, the build will fail.

No
workspaceUUID Specify the UUID of the workspace that contains the files to be processed. This workspace must be loaded in the Eclipse® environment running . The default value for this attribute is the value of the team.scm.workspaceUUID build property.

Note: A workspace must be specified by the workspaceName attribute, the workspaceUUID attribute, or the team.scm.workspaceUUID build property. If a workspace is not identified by one of these three methods, the build will fail.

No
zOSsrc Specify true to limit the files processed to Enterprise Extensions file items; the zFiles residing in zFolders in the zOSsrc directory. Specify false to process all files in all project directories. The default is true. No

GlobalFileMetadataExportRule Element

The GlobalFileMetadataExportRule element is specified within the element. Each GlobalFileMetadataExportRule element identifies a file to process and a property to export. At least one GlobalFileMetadataExportRule element is required. The following table describes the valid GlobalFileMetadataExportRule attribute values:

GlobalFileMetadataExportRule Element Attributes
Attribute Description Required
match Specify a regular expression for the file name that is the target of this rule. This expression is used to match the file path string "zOSsrc/zFolder/zFile" when zOSsrc is true and "projectName/path/file" when zOSsrc is false.

A simple form of the regular expression path string is supported for each zOSsrc setting. When zOSsrc is true, the simple form uses a file path string omitting zOSsrc: "zFolder/zFile". When zOSsrc is false, the simple form uses a file path string omitting the project name: "path/file".

For example, when zOSsrc is true, you would code one of the following:

Regex form: Value to specify:
Simple COBOL/MYCOBOL\.cbl
Simple qualified ^COBOL/MYCOBOL\.cbl$
Standard zOSsrc/COBOL/MYCOBOL\.cbl
Standard qualified ^zOSsrc/COBOL/MYCOBOL\.cbl$

When zOSsrc is false, you would code one of the following:

Regex form: Value to specify:
Simple zOSsrc/COBOL/MYCOBOL\.cbl
or
src/FREEM\.s
Simple qualified ^zOSsrc/COBOL/MYCOBOL\.cbl$
or
^src/FREEM\.s$
Standard project\.name/zOSsrc/COBOL/MYCOBOL\.cbl
or
com\.ibm\.team\.enterprise\.zos\.build/src/FREEM\.s
Standard qualified ^project\.name/zOSsrc/COBOL/MYCOBOL\.cbl$
or
^com\.ibm\.team\.enterprise\.zos\.build/src/FREEM\.s$

When the rule is processed the match text will be converted to the standard qualified form regardless of the method chosen to specify the regular expression. The simple and unqualified alternatives are provided for convenience and downward compatibility.

Yes
name The name of the file metadata property you want included in the export when the regular expression matches the file name. If a name is not specified, all properties will be included in the export. No
projectName The name of the project for which this rule applies. This attribute can be used to limit the scope of a rule to a specific project within a component. By default, rules apply to all projects in a component when zOSsrc is true. When zOSsrc is false, the project name can be specified as part of the match pattern. No
value The value for the file metadata property. A value is optional. If value is specified, the current property value and the specified value must match for the property to be included in the export. If value is not specified, the property is included in the export if found. If value is specified, name is required. If a name is omitted, the value will be ignored. No

Notes

Examples