Using analyzers
Analyzers identify modules that break down fetched content. They are invoked after a URI has been fetched into the package instance. You configure analyzers to perform specific actions.
To add an analyzer to an existing package
- Click the Define tab.
- Click the package to which you want to add an analyzer.
- In the References section, click the name of a reference that is associated with an existing URI.
- In the Analyzers section, click Add Analyzer.
- In the Analyzers menu, select an appropriate analyzer.
- Click the Submit checkmark icon.
The system creates a new analyzer and associates it with the resource reference.
Analyzers are associated with references in a package. When an associated reference is fetched, the analyzers are run to further process it. You can assign multiple analyzers in a certain order to a given reference to create a processing chain of events.
Some analyzers invoke actions to perform their processing. Most analyzers do so using a payloaded action method. This means that when the action is run, the artifact contents are sent to the server (storing the contents in a temporary directory), and the specified action is invoked on the server with the current directory set to the directory where the contents were stored. As a result, the action script can access the contents to perform its processing (to extract a file version number, for example). When the action is complete, the temporary directory disappears.
Each separate configuration for an analyzer is saved to a specific name, and that name is assigned to references. For example, the Explode Reference Selectively analyzer extracts files from an artifact based on a regular expression pattern. To extract different sets of files from an artifact, you would create multiple analyzer definitions that use the same analyzer but with different file-matching patterns. You could define "Extract DLLs" and "Extract EXEs," analyzers that use the same "Explode Reference Selectively" analyzer interface module but a %\.dll% file pattern for one and a %\.exe% pattern for the other. Each analyzer interface module configuration is stored with the analyzer configuration. So, no parameters are assigned when the analyzer is associated with a reference.
- To add an analyzer to an existing package
- Add Artifact Configuration Entries analyzer
- Set Artifact Properties analyzer
- Delete Reference analyzer
- Explode Reference analyzer
- Extract Zip analyzer
- Explode Reference Selectively analyzer
- Set Artifact Meta-Data analyzer
- Translate Path analyzer
- Translate Deployment Path analyzer
- Expose WAR Contents analyzer
- Related topic
Under System > Analyzers, the following analyzers are available:
Add Artifact Configuration Entries analyzer
Parameter | Description |
---|---|
Config Entry Generation Action | Action to invoke to generate the configuration entries |
Server To Run Action On | Server on which to invoke the action |
Remove Duplicate Entries | If set to Yes, removes duplicate entries from the configuration data for the artifact |
This analyzer invokes an action on a server and parses the output of that action to set individual configuration settings on an artifact. This is a payloaded action invocation.
The system parses the output of the action, looking for configuration setting specifications, one per line. Configuration settings must conform to the bracket notation ([ ]) used in the console. For each line that matches, a configuration entry is set on the instance. The action can output additional data, but only lines that match the regular expression: '^[.?].+=.$' are considered configuration settings. Configuration data should be formatted as follows: [App Name][Layer1][Layer2]property=value, where you can specify several 'Layers'. Normally, any configuration settings found are appended to the configuration data associated with an artifact.
If the analyzer configuration has Remove Duplicate Entries set to Yes, any duplicate entries are removed.
Set Artifact Properties analyzer
Parameter | Description |
---|---|
Property Generation Action | Action to invoke to generate the artifact properties |
Server To Run Action On | Server on which to invoke the action |
This analyzer invokes an action on a server and parses the output of that action to set individual properties on an artifact. This invocation is a payloaded action.
The system parses the output of the action, looking for name=value on a line by itself. For each line that matches, a property is set on the instance. The action can output additional data, but only lines matching the regular expression ^(.+?)=(.*)$ are considered property settings.
Delete Reference analyzer
Parameters: None
This analyzer deletes the artifact invoking this analyzer. Use this analyzer to delete an artifact that has already been extracted or otherwise processed into other artifacts.
Explode Reference analyzer
Parameter | Description |
---|---|
Strip Paths From Files | If set to Yes, removes the paths of the files in the newly generated artifact |
Delete source content | If set to Yes, the original artifact will be removed |
This analyzer extracts the individual contents of a single artifact into separate, new artifacts. The new artifact names are set to the base file name of the specific entry in the artifact being extracted.
If the Strip Paths from Files parameter is set to Yes, the path name is removed from the contents of the newly created artifact. If the Delete source content parameter is set to Yes, the original artifact is automatically deleted after all contents of the calling artifact were extracted and the new artifacts were created.
Extract Zip analyzer
Parameters: None
This analyzer functions identically to the Explode Reference analyzer, except that it extracts the contents of an artifact that contains a zip file. After all the contents of the calling artifact have been extracted and new artifacts created, the original artifact is deleted. Use this analyzer on an artifact that was fetched from a specific zip file to create new artifacts from the contents of that zip file.
Explode Reference Selectively analyzer
Parameter | Description |
---|---|
Strip Path From Files | If set to Yes, removes the path of the selected file in the newly generated artifact |
Select Pattern | Regular expression that selects the files to extract from the artifact |
Artifact name to create | The new Reference Name that is created to store the extracted artifacts. |
This analyzer functions identically to the Explode Reference analyzer with the following exceptions:
- This analyzer supports a Select Pattern parameter to identify specific content in an artifact to extract into new artifacts.
- When the extraction is complete, the original artifact is not deleted. This enables multiple invocations of this analyzer on an artifact to extract content using several different patterns.
Set Artifact Meta-Data analyzer
Parameter | Description |
---|---|
Meta-Data Generation Action | Action to invoke to generate the artifact metadata |
Server To Run Action On | Server on which to invoke the action |
This analyzer invokes an action on a server and parses the output of that action to set metadata properties on an artifact. This invocation is a payloaded action.
The system parses the output of the action, looking for name=value on a line by itself. For each line that matches, the values are added to the artifact's metadata. If the name of the property being set is Version, that value is set as the artifact's content-specific version. The action can output additional data, but only lines matching the regular expression ^(.+?)=(.*)$ are considered metadata.
Translate Path analyzer
Parameter | Description |
---|---|
Search For | Regular expression to match in the path of the files in an artifact |
Replace With | String to replace the matched pattern with. |
Delete Non-Matching Entries | If set to Yes, the parameter removes all entries that are not matched with the pattern |
This analyzer modifies the content path names stored in an artifact. The artifact's contents are scanned, and when the Search for pattern matches all or part of the path name for a specific piece of content, the matched portion of the path name is replaced by the Replace With string.
This analyzer performs the translation process by creating a new artifact and copying the original contents to the new artifact, translating the path name during the copy process. The original artifact is removed when the copy is complete.
If the analyzer configuration has the Delete Non-Matching Entries parameter set to Yes, any entries which do not match the regular expression in the Search For parameter are removed.
Translate Deployment Path analyzer
Parameter | Description |
---|---|
Search For | Regular expression to match in the path of the files in an artifact |
Replace With | String to replace the matched pattern with |
This analyzer modifies the content path names stored in an artifact temporarily at deployment.
This analyzer functions identically to the Translate Path analyzer except that it is invoked at deployment and paths translated are not preserved. Only the target server receiving the files reflects the altered path names.
Expose WAR Contents analyzer
Parameters: None
This analyzer populates an artifact's table of contents with the list of contents in a WAR file. This allows a WAR file to be pulled into an artifact as a single deployable entity, while still enabling specific deployment processes to be triggered based on the contents of that WAR file.
Related topic