mkattype
Creates or updates an attribute type object
APPLICABILITY
ClearCase (cleartool subcommand), Attache (command)
SYNOPSIS
- mkattype [ -rep·lace ] [ -glo·bal [ -acq·uire ] | -ord·inary ]
- [ -vpe·lement | -vpb·ranch | -vpv·ersion ] [ -sha·red ]
[ -vty·pe { integer | real | time | string | opaque } ]
[ [ -gt low-val | -ge low-val ] [ -lt high-val | -le high-val ]
| -enu·m value[,...] ]
[ -def·ault default-val ]
[ -c·omment comment | -cfi·le comment-file-pname |-cq·uery | -cqe·ach | -nc·omment ]
attribute-type-selector ...
DESCRIPTION
The mkattype command creates one or more attribute types for future use within a VOB. After creating an attribute type in a VOB, you can use mkattr to attach attributes of that type to objects in that VOB.
Attributes as Name/Value Pairs
An attribute is a name/value pair. When creating an attribute type, you must specify the kind of value (integer, string, and so on). You can also restrict the possible values to a particular list or range. For example:
- Attributes of type FUNC_TYPE could be restricted to integer values in the range 1-5
- Attributes of type QAed colud be restricted to the string values TRUE and FALSE.
Predefined Attribute Types
Each new VOB is created with two string-valued attributes types, named HlinkFromText and HlinkToText. When you enter a mkhlink -ftext command, the from-text you specify is stored as an instance of HlinkFromText on the hyperlink object. Similarly, an HlinkToText attribute implements the to-text of a hyperlink.
PERMISSIONS AND LOCKS
Permissions Checking: For each object processed, you must be one of the following (for -replace only): type owner, VOB owner, member of the ClearCase group. See the permissions reference page.
Locks: An error occurs if any of the following objects are locked: VOB, attribute type (for -replace only).
OPTIONS AND ARGUMENTS
HANDLING OF NAME COLLISIONS. Default: An error occurs if an attribute type named type-name already exists in the VOB.
- -rep·lace
- Replaces the existing definition of type-name with a new one. If you do not include options from the existing definition, their values are replaced with the defaults (Exception: the type's scope does not change; you must explicitly specify -global or -ordinary).
- If you specify a comment when using -replace, the comment appears in the event record for the modification (displayed with lshistory -minor); it does not replace the object's creation comment (displayed with describe). To change an object's creation comment, use chevent.
- Constraints:
- If there are existing attributes of this type, you cannot change the -vtype value.
|
- If there are existing attributes of this type or if the containing VOB is replicated, you cannot replace a less restrictive -vpelement, -vpbranch, or -vpversion specification with a more restrictive one. (-vpelement is the most restrictive.)
|
- You cannot replace the predefined attribute types HlinkFromText and HlinkToText.
|
- When replacing an attribute type that was created with the -shared option, you must use -shared again; that is, you cannot convert an attribute type from shared to unshared.
|
- When converting a global type to ordinary, you must specify the global type as the attribute-type-selector argument. You cannot specify a local copy of the global type.
|
SPECIFYING THE SCOPE OF THE ATTRIBUTE TYPE. Default: Creates an ordinary attribute type that can be used only in the current VOB.
- -glo·bal [ -acq·uire ]
- Creates an attribute type that can be used as a global resource by client VOBs in the administrative VOB hierarchy. With -acquire, mkattype checks all eclipsing types in client VOBs and converts them to local copies of the new global type.
- For more information, see Administering ClearCase.
- -ord·inary
- Creates an attribute type that can be used only in the current VOB.
INSTANCE CONSTRAINTS. Default: In a given element, one attribute of the new type can be attached to each version, to each branch, and to the element itself. One attribute of the type can be attached to other types of VOB objects.
- -vpe·lement
- Attributes of this type can be attached only to versions; and only one version of a given element can get an attribute of this type.
- -vpb·ranch
- Attributes of this type can be attached only to versions; and only one version on each branch of a given element can get an attribute of this type.
- -vpv·ersion
- Attributes of this type can be attached only to versions; within a given element, all versions can get an attribute of this type.
SPECIFYING THE KIND OF VALUE. Default: One or more string-valued attribute types are created.
- -vty·pe integer
- Attributes of this type can be assigned integer values. You can use these options to restrict the possible values: -gt, -ge, -lt, -le, -enum.
- -vty·pe real
- Attributes of this type can be assigned floating-point values. You can use these options to restrict the possible values: -gt, -ge, -lt, -le, -enum.
- -vty·pe time
- Attributes of this type can be assigned values in the date-time format described in the mkattr reference page. You can use these options to restrict the possible values: -gt, -ge, -lt, -le, -enum.
- -vty·pe string
- Attributes of this type can be assigned character-string values. You can use the -enum option to restrict the possible values.
- -vty·pe opaque
- Attributes of this type can be assigned arbitrary byte sequences as values.
MASTERSHIP OF THE ATTRIBUTE TYPE. Default: Attempts to attach or remove attributes of this type succeeda only in the VOB replica that is the current master of the attribute type. The VOB replica in which the new attribute type is created becomes its initial master.
- -sha·red
- If you specify -vpbranch, -vpelement, or -vpversion, ClearCase checks the mastership of the branch, element, or version's branch to which you attach or remove the attribute when you invoke the mkattr or rmattr command. If you do not specify -vpbranch, -vpelement, or -vpversion, and the object to which you attach or remove the attribute is a version, ClearCase checks the mastership of the branch when you invoke the mkattr or rmattr command. If you do not specify -vpbranch, -vpelement, or -vpversion, and the object to which you attach or remove the attribute is not a version, ClearCase checks the mastership of the object when you invoke the mkattr or rmattr command.
RESTRICTING THE POSSIBLE VALUES. Default: The values that can be assigned to attributes of the new type are unrestricted within the basic value type (any integer, any string, and so on). You can specify a list of permitted values, using -enum; alternatively, you can specify a range using -gt or -ge to specify the lower bound, and -lt or -le to specify the upper bound.
- -gt low-val or -ge low-val
- Lower bound of an integer, real, or time value. -gt means greater than. -ge means greater than or equal to.
- -lt high-val or -le high-val
- Upper bound of an integer, real, or time value. -lt means less than. -le means less than or equal to.
- -enu·m value[,...]
- Comma-separated list (no white space allowed) of permitted values for any value type. See the description of the value argument in the mkattr reference page for details on how to enter the various kinds of value arguments.
SPECIFYING A DEFAULT ATTRIBUTE VALUE. Default: You cannot use mkattr -default to create an instance of this attribute type; you must specify an attribute value on the command line.
- -def·ault default-val
- Specifies a default attribute value; entering a mkattr -default command creates an attribute with the value default-val.
EVENT RECORDS AND COMMENTS. Default: Creates one or more event records, with commenting controlled by your .clearcase_profile file (default: -cqe). See CUSTOMIZING COMMENT HANDLING in the comments reference page. Comments can be edited with chevent.
- -c·omment comment | -cfi·le comment-file-pname |-cq·uery | -cqe·ach | -nc·omment
- Overrides the default with the option you specify. See the comments reference page.
NAMING THE ATTRIBUTE TYPES. Default: The attribute type is created in the VOB that contains the current working directory unless you specify another VOB with the @vob-selector argument.
- attribute-type-selector ...
- Names of the attribute type(s) to be created. Specify attribute-type-selector in the form [attype:]type-name[@vob-selector]
type-name
| Name of the attribute type
See the Object Names section in the cleartool reference page for rules about composing names.
|
vob-selector
| VOB specifier
Specify vob-selector in the form [vob:]pname-in-vob
|
|
| pname-in-vob
| Pathname of the VOB-tag (whether or not the VOB is mounted) or of any file-system object within the VOB (if the VOB is mounted)
|
EXAMPLES
Examples including wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the command interpreter prompt. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.
- Create a string-valued attribute type named Responsible.
cmd-context mkattype -nc Responsible
Created attribute type "Responsible".
- Create an integer-valued attribute type named Confidence_Level, with a low value of 1 and a high value of 10. Constrain its use to one per branch.
cmd-context mkattype -nc -vpbranch -vtype integer -gt 0 -le 10 Confidence_Level
Created attribute type "Confidence_Level".
- Create a string-valued attribute type named QAed, with an enumerated list of valid values.
cmd-context mkattype -nc -enum '"TRUE","FALSE","in progress"' QAed
Created attribute type "QAed".
- In cleartool interactive mode, create an enumerated attribute type, with a default value, called Released.
cleartool> mkattype -nc -enum "TRUE","FALSE" -default "FALSE" Released
Created attribute type "Released".
The same command in cleartool single-command mode shows the difference in quoting.
cleartool mkattype -nc -enum \"TRUE\",\"FALSE\" -default \"FALSE\" Released
Created attribute type "Released".
- Create a time-valued attribute type named QA_date, with the current date as the default value. Provide a comment on the command line.
cmd-context mkattype -c "attribute for QA date" -vtype time -default today QA_date
Created attribute type "QA_date".
- Change the default value of an existing attribute type named TESTED. Provide a comment on the command line.
cmd-context mkattype -replace -default '"TRUE"' -c "changing default value" TESTED
Replaced definition of attribute type "TESTED".
SEE ALSO
lstype, mkattr, rename, rmattr, type_object
Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved.
|