Downloading assets of a specific type or categorization with the download asset extension point

You can use the download asset extension point in the IBM® Rational® Asset Manager Eclipse client to create an importer for assets of a specific asset type or categorization.

About this task

Supplied implementation
Rational Asset Manager includes a default importer that is enabled for all assets that will import assets from the server into your Eclipse workspace. However, you can use this extension point to create your own importer for certain assets.

If the criteria for a custom importer are met, the user is given a choice of wizards to use to download the assets from the server.

Configuration markup
<!ELEMENT extension (downloadContributor+)>
<!ATTLIST extension
point CDATA #REQUIRED
id    CDATA #IMPLIED
name  CDATA #IMPLIED>
assetType
The following condition specifies the asset type of the asset to match. The value of id is the display name of the asset type.
<!ELEMENT assetType EMPTY>
<!ATTLIST assetType
id CDATA #REQUIRED>
assetCategory
The following condition specifies the categorization of the asset to match. The value of id is the display name of the category, including the entire hierarchy of parent categories, separated by /.
<!ELEMENT assetCategory EMPTY>
<!ATTLIST assetCategory
id CDATA #REQUIRED>
artifactPath
Experimental API: This API is experimental and might be removed in future versions. The following condition specifies the path of the artifacts to match. The value of path is the path to artifacts in regular expression format.
<!ELEMENT artifactPath EMPTY>
<!ATTLIST artifactPath
path CDATA #REQUIRED>
Extension point
The following extension point should be used to contribute an importer for assets based on the asset's types and categorization. For class, contributors need to extend the com.ibm.ram.rich.ui.downloadasset.AbstractDownloadAssetContributor class to provide the instance who handles the import of the assets as RAS file streams.
<!ELEMENT downloadContributor (enablement?)>
<!ATTLIST downloadContributor
class CDATA #REQUIRED>
and
The following element performs a logical AND operation on child conditions.
<!ELEMENT and ((assetType  | (and  | or  | not  | assetCategory  | artifactPath)+) | (and  | or  | not  | assetCategory  | artifactPath))>
or
The following element performs a logical OR operation on child conditions.
<!ELEMENT or (and  | or  | not  | assetType  | assetCategory  | artifactPath)>
not
The following element performs a logical NOT operation on child conditions.
<!ELEMENT not (and  | or  | not  | assetType  | assetCategory  | artifactPath)>

Example

In the following example, the contributor provides the class which will be activated when the enablement conditions are met. Complex enablement conditions can be specified using a combination of and, or and not logical operators.

<extension
	point="com.ibm.ram.rich.ui.extension.downloadAsset">
	<downloadContributor
		class="com.ibm.ram.rich.ui.test.downloadasset.RASDownloadContributor">
		<enablement>
			<or>
				<assetType
					id="Service Test">
				</assetType>
				<assetCategory
					id="Automobiles/Color/Red">
				</assetCategory>
				<and>
					<assetCategory
						id="Automobiles/Color/Red">
					</assetCategory>
					<not>
						<artifactPath
							path="/[^/]*/plugin.xml">
						</artifactPath>
					</not>
				</and>
			</or>
		</enablement>
	</downloadContributor>
</extension>

Feedback