of 22
8/9/2019 scm271_ecc_s08
1/22
Copyright IBM Corp. 2003 8 - 1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 8Applying ClearCase Metadata
1
IBM Software Group
Essentials of Rational ClearCase
Module 8: Applying ClearCase Metadata
Topics
Objectives............................................................................................................ 8-2What Is Metadata? ............................................................................................... 8-4Kinds of Metadata ................................................................................................ 8-5Structuring the Project: Elements and Branches..................................................... 8-7Annotating the Project: Labels and Attributes........................................................ 8-8Managing Project Policies: Triggers ..................................................................... 8-11Showing Project Relationships: Hyperlinks.......................................................... 8-14Applying Metadata ............................................................................................. 8-15
8/9/2019 scm271_ecc_s08
2/22
Essentials of Rational ClearCase
8 - 2 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Objectives
2
Define metadata and explain its purpose
List the kinds of ClearCase metadata and explain
the main uses of each
Use labels, attributes, and hyperlinks
Upon completing this module, you should be able to:
Objectives
8/9/2019 scm271_ecc_s08
3/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 3
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Topics
3
Topics What is metadata?
Metadata uses
Applying metadata
8/9/2019 scm271_ecc_s08
4/22
Essentials of Rational ClearCase
8 - 4 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
What Is Metadata?
4
What Is Metadata?
A set of constructs and annotations that attach toClearCase objects
Allows you to organize, manipulate, and manage thoseobjects
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 bydefault
Enforce policies
Metadata is data about data. It is a set of constructs and annotations that you can attachto 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 projectmanagement.
8/9/2019 scm271_ecc_s08
5/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 5
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Kinds of Metadata
5
Kind: branch
Kinds of Metadata
Kinds
Elements
Branches
Labels
Attributes
Triggers
Hyperlinks
Types
Specific definitions of the kind
dedicated to particular uses
Instances
One example of a given type
applied to one or more
ClearCase objects
/bugfix
Type: bugfix
Instance :
hello.c@@/main/bugfix
hello.c/main
The slide lists the six kinds of ClearCase metadata. You have already learned aboutbranches.
ClearCase metadata kinds share an implementation scheme, which you saw whencreating 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 oncreating instances of metadata types, which is a much more common task.
8/9/2019 scm271_ecc_s08
6/22
Essentials of Rational ClearCase
8 - 6 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Topics
6
Topics What is metadata?
Metadata uses
Applying metadata
8/9/2019 scm271_ecc_s08
7/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 7
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Structuring the Project: Elements and Branches
7
Structuring the Project: Elements and Branches
Elements
Define element storage
and retrieval
characteristics
May be used to group
elements for special
handling
Branches
Provide areas for task
isolation and integration
Elements and branches are both kinds of metadata. In this course, youve alreadyworked 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 learnedabout 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.
8/9/2019 scm271_ecc_s08
8/22
Essentials of Rational ClearCase
8 - 8 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Annotating the Project: Labels and Attributes
8
Annotating the Project: Labels and Attributes
Labels and attributes enable project annotation
Describe significant milestones, status flags, and
tasks:
Branch points
Build configurations
Baselines
Status messages
Identify starting points for future projects
Identify release configurations
Labels and attributes are kinds of metadata that allow you to annotate ClearCaseobjects. These annotations can describe significant project milestones, such as branchpoints, 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.
8/9/2019 scm271_ecc_s08
9/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 9
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Using Labels
9
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. Labelsprovide a unique identifier for a particular version, and are frequently used to identify aversion with a significant task or a project milestone.
In the example on the slide, the label R1 is applied to versions of these elements thatwere included in the R1 build. The R2 label is applied to versions of elements includedin 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.
8/9/2019 scm271_ecc_s08
10/22
Essentials of Rational ClearCase
8 - 10 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Using Attributes
10
Using Attributes Name and value pair
Can annotate any ClearCaseobject
Use to represent propertiesthat can have many possiblevalues
Example: BugNum=22, 43, 54
Use to represent propertiesthat change over time
Example: tested=no, ready,yes, passed, failed
Attributes can also be used to annotate ClearCase objects. Unlike labels which areattached 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 enumeratedvalues 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.
8/9/2019 scm271_ecc_s08
11/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 11
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Managing Project Policies: Triggers
11
Managing Project Policies: Triggers
Triggers define actions to be performed in
response to a ClearCase event
Events are ClearCase operations that modify a VOB
element including check out and check in
Actions include launching batch files, executables, or
another ClearCase operation
Are local to a single VOB
Triggers define actions that are performed in response to a ClearCase event. AClearCase event is any operation that modifies and VOB element including check outand check in. Actions can include launching batch files, executables, prompting some
action from the user, or another ClearCase operation.
Triggers are local to a single VOB.
8/9/2019 scm271_ecc_s08
12/22
Essentials of Rational ClearCase
8 - 12 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Managing Project Policies: Triggers (cont.)
12
Managing Project Policies: Triggers (cont.) Triggers support project policy implementation
Project policies are rules that:
Enforce project methodology
Automate routine operations
Enforce site development policies
Defined by project leads, configuration managers,
or ClearCase administrators developerstypically see only the results
Project policies vary from site to site
Triggers are ClearCase metadata that help support the implementation of projectpolicies.
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 ofmetadata.
For the most part, project leads or ClearCase administrators write triggers. However, asa developer, you may encounter the results of triggers in your everyday work processes.
8/9/2019 scm271_ecc_s08
13/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 13
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Managing Project Policies: Triggers (cont.)
13
Managing Project Policies: Triggers (cont.) Pre-event triggers
Performed before the event
Used to enforce policies
Example: A trigger that
prevents anyone but project
leads from declaring branch types
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
Triggers can be categorized as pre-event and post-event triggers. Pre-event triggers areperformed before the event and are generally used to enforce project policies. Post-event triggers are performed after the event and are typically used to provideinformation or to initiate further actions. See the examples on the slide.
8/9/2019 scm271_ecc_s08
14/22
Essentials of Rational ClearCase
8 - 14 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Showing Project Relationships: Hyperlinks
14
Showing Project Relationships: Hyperlinks
A logical connection between any two VOB objects
Allow you to identifyand preserverelationships betweenVOB objects
Can show a relationship
between objects indifferent VOBs
Automatically created bymerge operation
You can create a hyperlink between two VOB objects, each of which may be anelement, branch, version, VOB symbolic link, or non-file-system VOB object (exceptanother hyperlink). In the example on the slide, a hyperlink is used to show a
relationship between a documentation file and a related source file.
8/9/2019 scm271_ecc_s08
15/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 15
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Applying Metadata
15
Topics
What is metadata?
Metadata uses
Applying metadata
8/9/2019 scm271_ecc_s08
16/22
Essentials of Rational ClearCase
8 - 16 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Creating a Label Instance: Applying a Label
16
Creating a Label Instance: Applying a Label1
In the File Browser, ClickMetadata > Label > Attach.
2Select the desired label,and then click Ok.
z
Once a label type exists, you can apply instances of that label to versions of elementsfrom 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.
8/9/2019 scm271_ecc_s08
17/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 17
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Viewing a Label
17
Viewing a Label
Labels often specify arelease or a nightly build.
You can view labeled versions in the Version Tree Browser oron the Labels tab of the Describe report.
Using the GUI, you can view a label through the Version Tree Browser or through theLabels 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
8/9/2019 scm271_ecc_s08
18/22
Essentials of Rational ClearCase
8 - 18 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Applying Labels to Multiple files
18
Applying Labels to Multiple files
Use wildcards to label allfiles in a specific directory.
Use -mklabelwith the -recurse optionto label entiredirectory
structures.
You can apply a label to a single version, but in practice you usually apply a label acrossmany versions, for example, to label a release.
8/9/2019 scm271_ecc_s08
19/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 19
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Adding Attributes
19
Adding Attributes1
Click Metadata >Attribute > Attachto version (orelement).
2
Select theattribute type.
3
Enter the attribute
value, and thenclick OK.
You can add attributes to any ClearCase object. In this example, we annotate a versionof 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 theassociated value. You must type in the name of the attribute type. Some attribute typeshave enumerated values, others do not. For example, attribute qa_status hasenumerated values not tested, passed, and failed, while attribute bugnum has noenumerated values.
CLI Procedure
Usage:
cleartool mkattr
Example:
cleartool mkattr qa_status not tested hello.h
Created attribute qa_status" on"hello.c@@/main/r2_int/pat_r2/a.
8/9/2019 scm271_ecc_s08
20/22
Essentials of Rational ClearCase
8 - 20 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Attaching a Hyperlink
20
Attaching a HyperlinkUse cleartool mkhlink to attach hyperlinks to VOB
objects.
Example:
/vobs/Hardware% cleartool mkhlinkImplements src/hello.c doc/hello.txt
Created hyperlink"Implements@280@/vobs/Hardware"
Hyperlinks can only be attached through the command line. Use the cleartool mkhlinkcommand to attach a hyperlink.
In the example on the slide, the hyperlink is established between src/hello.c anddoc/hello.txt.
For more details about command options, see Rational ClearCase Command Referenceor online Help topics mkhlink.
8/9/2019 scm271_ecc_s08
21/22
Module 8 - Applying ClearCase Metadata
Copyright IBM Corp. 2003 8 - 21
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module Review
21
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?
Module Review
8/9/2019 scm271_ecc_s08
22/22
Essentials of Rational ClearCase
8 - 22 Copyright IBM Corp. 2003
Module Lab
22
In this lab, you will perform the following tasks:
Apply a label to multiple files at once
Apply an attribute
Apply a hyperlink
Module Lab