Beruflich Dokumente
Kultur Dokumente
Topics
Objectives............................................................................................................ 8-2
What Is Metadata? ............................................................................................... 8-4
Kinds of Metadata ................................................................................................ 8-5
Structuring the Project: Elements and Branches..................................................... 8-7
Annotating the Project: Labels and Attributes........................................................ 8-8
Managing Project Policies: Triggers ..................................................................... 8-11
Showing Project Relationships: Hyperlinks.......................................................... 8-14
Applying Metadata ............................................................................................. 8-15
Objectives
Objectives
Upon completing this module, you should be able to:
Define metadata and explain its purpose
List the kinds of ClearCase metadata and explain
the main uses of each
Use labels, attributes, and hyperlinks
Topics
Topics
What is metadata?
Metadata uses
Applying metadata
What Is Metadata?
What Is Metadata?
A set of constructs and annotations that attach to
ClearCase objects
Allows you to organize, manipulate, and manage those
objects
Enables you to:
Find, list, sort, and retrieve information
Access work faster and more directly
Organize tasks
Manage how development tasks are performed
Capture information beyond what ClearCase captures by
default
Enforce policies
4
Metadata is data about data. It is a set of constructs and annotations that you can attach
to ClearCase objects. A ClearCase object is an item stored in a ClearCase VOB.
ClearCase objects include elements, labels, and derived objects. Metadata allows you to
organize and manage ClearCase objects. It is an important tool for process and project
management.
Kinds of Metadata
Kinds of Metadata
Kinds
hello.c
Elements Attributes /bugfix /main
Branches Triggers
Labels Hyperlinks
Types
Specific definitions of the kind Kind: branch
dedicated to particular uses
Type: bugfix
Instances Instance :
One example of a given type hello.c@@/main/bugfix
applied to one or more
ClearCase objects
5
The slide lists the six kinds of ClearCase metadata. You have already learned about
branches.
ClearCase metadata kinds share an implementation scheme, which you saw when
creating branches:
1. Create the metadata type.
2. Create an instance of that metadata type.
In this course, we do not teach you to create metadata types. Instead, we focus on
creating instances of metadata types, which is a much more common task.
Topics
Topics
What is metadata?
Metadata uses
Applying metadata
Elements and branches are both kinds of metadata. In this course, you’ve already
worked with branch types.
ClearCase comes with a number of predefined element types including text_file, html,
rose, xml, and compressed_text_file. You learned about these types when you learned
about the types of elements ClearCase can merge. For a complete list of element types,
see online Help.
ClearCase comes with the predefined branch type /main.
Labels and attributes are kinds of metadata that allow you to annotate ClearCase
objects. These annotations can describe significant project milestones, such as branch
points, baselines, or status. They can also identify starting points for future projects or
identify release configurations.
The next few slides provide specific examples of labels and attributes.
Using Labels
Using Labels
User-defined names that
can be attached to
versions
Uniquely identify a version
Identify a significant task or
project milestone
Typically static
Labels are kinds of metadata that you can use to annotate element versions. Labels
provide a unique identifier for a particular version, and are frequently used to identify a
version with a significant task or a project milestone.
In the example on the slide, the label R1 is applied to versions of these elements that
were included in the R1 build. The R2 label is applied to versions of elements included
in the R2 build. These labels can be used to provide a baseline, to mark a branch point,
to locate particular versions of an element, or to generate report data.
ClearCase comes with predefined label types including LATEST and CHECKEDOUT.
Using Attributes
Using Attributes
Name and value pair
Can annotate any ClearCase
object
Use to represent properties
that can have many possible
values
Example: BugNum=22, 43, 54
Use to represent properties
that change over time
Example: tested=“no”, “ready”,
“yes”, “passed”, “failed”
10
Attributes can also be used to annotate ClearCase objects. Unlike labels which are
attached to element versions, attributes can be attached to any ClearCase object.
Annotations consist of two parts: a name and a value. For some attributes, there will be
enumerated values. In the example above, for the attribute “tested”, the enumerated
values are: “no”, “ready”, “yes”, “passed”, and “failed”. For the “BugNum” attribute,
there are no enumerated values, so the attribute will accept any bug number entered.
Unlike labels, attributes are not static. You can change attribute values. For example,
you can annotate an element version with the tested attribute with the value “ready”.
Later, you can change the value to “passed”.
11
12
Triggers are ClearCase metadata that help support the implementation of project
policies.
Each site can define its own project policies. These policies can vary greatly from site to
site. Therefore, triggers tend to be an extremely site and project-specific type of
metadata.
For the most part, project leads or ClearCase administrators write triggers. However, as
a developer, you may encounter the results of triggers in your everyday work processes.
Post-event triggers
Performed after a successful event
Used to provide information or initiate further actions
Example: A trigger that attaches an attribute with a
particular bug fix number to a version upon check in
13
Triggers can be categorized as pre-event and post-event triggers. Pre-event triggers are
performed before the event and are generally used to enforce project policies. Post-
event triggers are performed after the event and are typically used to provide
information or to initiate further actions. See the examples on the slide.
14
You can create a hyperlink between two VOB objects, each of which may be an
element, branch, version, VOB symbolic link, or non-file-system VOB object (except
another hyperlink). In the example on the slide, a hyperlink is used to show a
relationship between a documentation file and a related source file.
Applying Metadata
Topics
What is metadata?
Metadata uses
Applying metadata
15
1
In the File Browser, Click
Metadata > Label > Attach.
2
Select the desired label,
and then click Ok.
16
Once a label type exists, you can apply instances of that label to versions of elements
from the File Browser or the Version Tree Browser.
CLI Procedure
Usage:
cleartool mklabel
Example:
cleartool mklabel R2 hello.c
Created label “R2” on “hello.c” version
“/main/r2_int/pat_r2/3”.
Viewing a Label
Viewing a Label
You can view labeled versions in the Version Tree Browser or
on the Labels tab of the Describe report.
17
Using the GUI, you can view a label through the Version Tree Browser or through the
Labels tab on the Describe report.
CLI Procedure
Usage:
cleartool describe
Example:
/vobs/Hardware/src% cleartool describe util.c
version "util.c@@/main/3"
created 26-Jan.11:19:23 by pat.training@pat-port
"To merge rel2_bugfix changes with main branch"
Element Protection:
User : pat : r--
Group: training : r--
Other: : r--
element type: text_file
predecessor version: /main/2
Labels:
REL3
Hyperlinks:
Merge <- /Hardware/src/util.c@@/main/rel2_bugfix/2
Use -mklabel
with the -
recurse option
to label entire
directory
structures.
18
You can apply a label to a single version, but in practice you usually apply a label across
many versions, for example, to label a release.
Adding Attributes
Adding Attributes
1
Click Metadata >
Attribute > Attach
to version (or
element).
2
Select the 3
attribute type. Enter the attribute
value, and then
click OK.
19
You can add attributes to any ClearCase object. In this example, we annotate a version
of an element. Therefore, we open the Properties of a Version dialog box.
To add an attribute, that attribute type must already exist.
In the Attributes dialog box, you are prompted to enter the attribute type and the
associated value. You must type in the name of the attribute type. Some attribute types
have enumerated values, others do not. For example, attribute qa_status has
enumerated values “not tested”, “passed”, and “failed”, while attribute bugnum has no
enumerated values.
CLI Procedure
Usage:
cleartool mkattr
Example:
cleartool mkattr qa_status ‘“not tested”’ hello.h
Attaching a Hyperlink
Attaching a Hyperlink
Use cleartool mkhlink to attach hyperlinks to VOB
objects.
Example:
20
Hyperlinks can only be attached through the command line. Use the cleartool mkhlink
command to attach a hyperlink.
In the example on the slide, the hyperlink is established between src/hello.c and
doc/hello.txt.
For more details about command options, see Rational ClearCase Command Reference
or online Help topics mkhlink.
Module Review
Module Review
What is metadata?
How is metadata implemented?
When might you use a label?
When might you use an attribute?
What is a trigger? When might you use one?
When might you use a hyperlink?
How do you attach a label?
How do you attach an attribute?
How do you attach a hyperlink?
21
Module Lab
Module Lab
In this lab, you will perform the following tasks:
Apply a label to multiple files at once
Apply an attribute
Apply a hyperlink
22