mkattype
Creates or updates an attribute
type object
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 could 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.
RESTRICTIONS
Identities
No special identity
is required unless you specify the –replace option.
For –replace, you must have one of the following identities:
- Type
owner
- VOB
owner
- root (UNIX)
- Member
of the ClearCase administrators group (ClearCase on Windows)
- Local
administrator of the ClearCase LT server host (ClearCase LT on Windows)
Locks
An error occurs if
one or more of these objects are locked: VOB, attribute type (for –replace only).
Mastership
(Replicated VOBs
only) With –replace, your current replica must master
the type.
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 VOBs in the administrative VOB hierarchy. With –acquire, mkattype checks
all eclipsing types in the VOBs and converts them to local copies of the new
global type.
For more information, see the Administrator's Guide.
- –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 succeed 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 and ClearCase LT check
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, mastership of the branch is checked 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, the mastership of the object is checked
when you invoke the mkattr or rmattr command.
If a type is global and shared, additional mastership restrictions exist
when you create instances of the type. You cannot create instances of the
type unless the client VOB contains a local copy of the type, or the administrative
VOB at the current site masters the type. For more information, see the Administrator's Guide.
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 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 types to be created.
Specify attribute-type-selector in the form [attype:]type-name[@vob-selector]
EXAMPLES
The UNIX examples in this section are written for use in csh.
If you use another shell, you may need to use different quoting and escaping
conventions.
The Windows examples that include 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 UNIX shell or Windows command interpreter prompt, followed by the cleartool command.
In cleartool interactive mode, cmd-context represents
the interactive cleartool prompt.