Creating rules for files and folders

You can create rules to define asset content and metadata to perform a batch update.

About this task

After you specify the directories that contain the files and folders that you want to create assets from, you must create rules that define the asset content and metadata. You can define this information either by creating a manifest.rmd file that contains rule definitions or by creating a series of rules. To learn how to create a manifest.rmd file, see the following topic: Creating a manifest.rmd file
When you create rules you can often specify a text file in a directory that is populated with data that creates the rule for you. Use the following guide to help you create these text files for each type of rule. These text files can have any name.
Table 1. Text file reference
Asset metadata types Description Example
Attributes This text file must contain the following syntax: one name=value pair per line. Runtime context=Eclipse v3.3

Server context=WebSphere Application Server v6.1

Categories This text file must contain the following syntax: one schema/category/subcategory per line. These must contain a schema, category, and at least one subcategory entry. Automobile/Model/Foreign/Honda/Civic
Description The entire contents of text file becomes the description for the asset. This asset outlines all of the software requirements for the v8.0 release.
Owners This text file must contain one unique ID per line. This ID is not the same as a user ID. The unique ID can be a code or a number assigned that describes your identity in a user registry. jsmith or

3F4467A

Related assets This text file must contain one relationshipType:guid/version per line. Container:{0000-1111-2222-3333}/1.0

Contains:{1111-2222-3333-4444}/1.1

Community, Name, Short Description, Asset Type, Version The first line of the text file for each of these asset elements must be the value for the corresponding element. My Community

Procedure

To create rules about the content and metadata of an asset:

  1. Right-click the directory path and click Add Rule. You can create either an asset or a community rule for the directory. These rules will apply to all of the folders and archives in the directory.
  2. Create either an asset rule, a community rule, or both types of rules for the directory. Use the following table to learn how to create asset and community rules.
    Option Description
    Asset rule
    1. In the Rule type section, select Asset and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Create assets using all archives and folders to create assets from the primary archives and folders in the directory
      • Option 2: Click Create assets using archives and folders matching this filter, and type a value to filter on. The contents of a text file with a name that contains this value becomes assets.. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes an asset. A folder or archive that meets the filter criterion become assets
    3. Click Finish.
    Community rule -

    If you are adding a community rule to the root directory, then all of the children folders or archives are added to this community.

    1. In the Rule type section, select Community and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Create communities using all of the archives and folders to define communities by all of the folders and archives in this directory. The communities take the name of the folders or archives in the directory.
      • Option 2: Click Create communities using archives and folders matching this filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes a community. The contents of a text file with a name that contains this value becomes the community for the asset.
      • Option 3: Click Specify a community where all assets will be placed, and type the community name that you want all of the assets in the directory to belong to.
    3. Click Finish.
  3. After creating rules for the directory, continue to create rules for the files and folders that are in the directories. Use the following table to help you create other rules.
    Option Description
    Artifact rule -

    Create individual artifact rules for each file, folder, or archive. Create as many artifact rules as needed to achieve the specificity you want to define for your asset. You can also define a URL artifact.

    1. In the Rule type section, select Artifact and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Create artifacts using all files and folders to create artifacts from all of the files and folders in the asset.
      • Option 2: Click Create artifacts using files and folders matching this filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes an artifact.
      • Option 3: Click Specify a URL artifact that will be added to all of the assets to add a URL artifact. Type a name for the URL, and type the URL you want to add as an artifact. The artifact takes the name that you define.
    3. Click Finish.
    Asset type rule -

    You can provide one asset type for each asset that you define in the directory.

    1. In the Rule type section, select Asset type and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Set the asset type using a file matching a filter, and type a value to filter on. The contents of a text file with a name that contains this value becomes the asset type for the asset. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes an asset type..
      • Option 2: Click Specify an asset type that will be applied to all assets, and type a name for the asset type that you want to apply to the assets in the directory that you are defining rules for.
    3. Click Finish.
    Attribute rule -

    The attributes specify the kind of information that users can include when they submit an asset.

    1. In the Rule type section, select Attribute and click Next.
    2. Set the value by clicking Add attributes using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes an attribute..

      The contents of a text file with a name that contains this value becomes the attributes for the asset. This text file must contain the following data with this syntax: Keyword1 =Keyword2 where keyword1 is the attribute name and keyword2 is the attribute value.

    3. Click Finish.
    Category rule -

    Category schemas help you organize assets in the repository so that users can find and reuse them.

    If you want to classify the asset by using more than one category, you must create more than one category rule for that asset.

    1. In the Rule type section, select Category and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Add categories using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree.

        A file or folder that contains this value in the name becomes a category.. The contents of a text file with a name that contains this value becomes the category for the asset.

        This text file must contains the following data with this syntax: Category1/Category2/Category3.

        For example, where Category1 is Automobile, Category 2 is Model, and Category3 is Foreign, the categorization of this asset is Automobile/Model/Foreign.

      • Option 2: Click Specify a category that will be applied to all assets, and type values in these fields:
        • Schema: The highest level category
        • Category: The a child of schema
        • Subcategories: The children of category
        For example:
        • Schema: Automobile
        • Category: Model
        • Subcategories: Foreign/Honda
    3. Click Finish.
    Community rule-

    If you are adding a community rule to the root directory, then all of the children folders or archives are added to this community.

    1. In the Rule type section, select Community and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Create communities using all of the archives and folders to define communities by all of the folders and archives in this directory. The communities take the name of the folders or archives in the directory.
      • Option 2: Click Create communities using archives and folders matching this filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes a community.. The contents of a text file with a name that contains this value becomes the community for the asset.
      • Option 3: Click Specify a community where all assets will be placed, and type the community name that you want all of the assets in the directory to belong to.
    3. Click Finish.
    Description rule -

    This rule defines the description of the asset.

    1. In the Rule type section, select Description and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Select Set the description using a file matching a filter and type a value to filter on. The contents of a file with this filter becomes the description of the asset.
      • Option 2: Select Specify a description that will be applied to all assets and type description for that asset.
    3. Click Finish.
    Name rule -

    This rule defines the name of the asset.

    1. In the Rule type section, select Name and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Set the name using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. The contents of a text file with a name that contains this value becomes a name for the asset.
      • Option 2: Click Specify a name that will be applied to all assets, and type a name for the asset.
    3. Click Finish.
    Owner rule-

    This rule defines the names of the asset owners. If you specify owners of an asset who do not exist in the repository, these owners will be created as users of the repository.

    1. In the Rule type section, select Owner and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Set the owners using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes an owner.. The contents of a file that meets this filter criterion defines the owners of the asset. You must define the owners by using their unique identifier that is defined either on a file system user directory or in an LDAP directory. This file must contain only one unique identifier per line.
      • Option 2: Click Specify a user that will become the owner of all assets, and type a unique identifier that is defined either on a file system user directory or in an LDAP directory.
    3. Click Finish.
    Related asset rule -

    This rule defines all of the related assets.

    1. In the Rule type section, select Related asset and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Add related assets using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree.

        The contents of a text file with a name that contains this value becomes the related asset for the asset. This text file must contains the following data with this syntax: RelationshipType:{GUID}/Version. For example, where RelationshipType is dependent, GUID is 000–111–222, and Version is 1.0, the related assets depend on the asset that you are defining rules for in the source section of the editor. The related assets have the unique identifier previously assigned by Rational Asset Manager as 000–111–222 and are version 1.0 of that asset.

      • Option 2: Click Specify a relationship type and assets to relate to all assets, and type values in each of the following fields.
        • Relationship type is the relationship type of the assets you are relating to the asset that you are working with in the source section of the batch update editor.
        • Unique ID is the GUID, or the unique identifier of the related asset.
        • Version is the version of the related assets.
        For example:
        • Relationship type: Dependant
        • Unique ID: 000–111–222
        • Version: 1.0
    3. Click Finish.
    Short description rule-

    This rule defines the short description of the asset.

    1. In the Rule type section, select Short Description and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Set the short description using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes a short description. The contents of a file that contains this value becomes the short description of the asset.
      • Option 2: Click Specify a short description that will be applied to all assets, and type a short description for the asset.
    3. Click Finish.
    Version rule-

    This rule defines the version of the asset.

    1. In the Rule type section, select Version and click Next.
    2. Set the value for the rule by using one of these options:
      • Option 1: Click Set the version using a file matching a filter, and type a value to filter on. This value can include the following special characters: '*' represents zero or more character, '?' represents one character, and '**' represents everything in a directory tree. A file or folder that contains this value in the name becomes the version. The contents of a file that contains this value becomes the version of the asset.
      • Option 2: Click Specify a version that will be applied to all assets, and type a version for the asset.
    3. Click Finish.

What to do next

After you have defined the rules for asset content and metadata, you can correct all problems that exist with assets, select the repository, and update the assets to the repository.

Feedback