Escolar Documentos
Profissional Documentos
Cultura Documentos
Programmer Guide
Release 14.00
B035-3047-071A
November 2011
The product or products described in this book are licensed products of Teradata Corporation or its affiliates.
Teradata, Active Enterprise Intelligence, Applications Within, Aprimo, Aprimo Marketing Studio, Aster, BYNET, Claraview, DecisionCast,
Gridscale, Managing the Business of Marketing, MyCommerce, Raising Intelligence, Smarter. Faster. Wins., SQL-MapReduce, Teradata Decision
Experts, Teradata Labs Logo, Teradata Raising Intelligence Logo, Teradata Source Experts, WebAnalyst, and Xkoto are trademarks or registered
trademarks of Teradata Corporation or its affiliates in the United States and other countries.
Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc.
AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc.
EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation.
GoldenGate is a trademark of Oracle.
Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company.
Intel, Pentium, and XEON are registered trademarks of Intel Corporation.
IBM, CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines Corporation.
Linux is a registered trademark of Linus Torvalds.
LSI is a registered trademark of LSI Corporation.
Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United
States and other countries.
NetVault is a trademark or registered trademark of Quest Software, Inc. in the United States and/or other countries.
Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries.
Oracle, Java, and Solaris are registered trademarks of Oracle and/or its affiliates.
QLogic and SANbox are trademarks or registered trademarks of QLogic Corporation.
SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc.
SPARC is a registered trademark of SPARC International, Inc.
Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States
and other countries.
Unicode is a registered trademark of Unicode, Inc. in the United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other product and company names mentioned herein may be the trademarks of their respective owners.
THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN AS-IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION
MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
The information contained in this document may contain references or cross-references to features, functions, products, or services that are
not announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features,
functions, products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions,
products, or services available in your country.
Information contained in this document may contain technical inaccuracies or typographical errors. Information may be changed or updated
without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any
time without notice.
To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this
document. Please email: teradata-books@lists.teradata.com.
Any comments or materials (collectively referred to as Feedback) sent to Teradata Corporation will be deemed non-confidential. Teradata
Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform,
create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis. Further, Teradata
Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including
developing, manufacturing, or marketing products or services incorporating Feedback.
Copyright 1999-2011 by Teradata Corporation. All Rights Reserved.
Preface
Purpose
This book provides information about the Teradata Meta Data Services Meta Data
Development Kit, which is a Teradata Tools and Utilities product. Teradata Tools and Utilities
is a group of products designed to work with Teradata Database.
Programming information and descriptions of the Application Programming Interfaces
(APIs), Meta Data Services Dynamic Link Libraries (DLLs), and other files needed to interface
with the MDS Repository from customer applications are provided.
The subjects covered in this book include:
COM Interfaces
Error Messages
Audience
This book is intended for use by Meta Data Services:
Developers
Programmers
Administrators
Preface
Supported Releases
Supported Releases
This book supports the following releases:
Go to http://www.info.teradata.com/.
Click Search.
Open the version of the Teradata Tools and Utilities ##.##.## Supported Platforms and
Product Versions spreadsheet associated with this release.
The spreadsheet includes supported Teradata Database versions, platforms, and product
release numbers.
Prerequisites
The following prerequisite knowledge is required for this product:
Linux
Preface
Additional Information
Update
Description
November 2011
Teradata Tools and
Utilities 14.00
Additional Information
Additional information that supports this product and Teradata Tools and Utilities is available
at the web sites listed in the table that follows. In the table, mmyx represents the publication
date of a manual, where mm is the month, y is the last digit of the year, and x is an internal
publication code. Match the mmy of a related publication to the date on the cover of this book.
This ensures that the publication selected supports the same release.
Type of Information
Description
Access to Information
Release overview
1 Go to http://www.info.teradata.com/.
Late information
Preface
Additional Information
Type of Information
Description
Access to Information
Additional product
information
1 Go to http://www.info.teradata.com/.
2 Under the Online Publications subcategory,
Preface
Additional Information
Type of Information
Description
Access to Information
CD-ROM images
1 Go to http://www.info.teradata.com/.
2 Under the Online Publications subcategory,
Ordering
information for
manuals
Go to http://www.info.teradata.com/.
Under Print & CD Publications, click How to
Order.
Follow the ordering instructions.
General information
about Teradata
1 Go to teradata.com.
2 Select a link.
Preface
Additional Information
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Supported Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Changes to This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Chapter 1:
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Types of Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C++ API Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
COM Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Java Class Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
XML Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
27
29
30
31
Chapter 2:
Application Information Metamodels (AIMs) . . . . . . . . . . . . . . . . . . . 33
Overview of Application Information Metamodels (AIMs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
AIM Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Inheritance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Abstract Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Derived Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Derived Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Derived Classes and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Derived Class Benefits/Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
37
38
38
Table of Contents
Chapter 3:
General API Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Common Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Object Name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Object ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Object GUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Version Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Owner ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Security Profile ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
CreateDate/Time, UpdateDate/Time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
PublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
IsFrozen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
BaseVersionLoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
PredecessorVersionLoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
Common Property Constants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
Data Versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Current and Non-current Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Creating a New Version. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Reading Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Deleting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Deleting Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Enabling and Disabling Data Versioning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Retain Associated Business Information and Dormant Objects. . . . . . . . . . . . . . . . . . . . . . . . .85
Enabling or Disabling Dormant Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
Generating Dormant Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
Reactivating Dormant Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
Implicit Transactions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
Explicit Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
Locking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
10
Table of Contents
Delete Propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Owner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Access Permissions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Super-User Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
96
96
96
97
99
99
Chapter 4:
C++ Project Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Include Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Localization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Suggested Project Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Win32 Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Win32 Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Win32 Release Unicode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Win32 Debug Unicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
106
106
106
107
108
108
108
109
109
109
Chapter 5:
CMetaRepository Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
CMetaRepository Class Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BeginTransaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RetryDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetRepositoryRoot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
111
112
112
113
114
114
114
11
Table of Contents
GetObjectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
GetOdbcHenv. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
Deinitialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
SignOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
SignOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
IsVersioningEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
RetainBusinessObjectsSupported . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118
SetRetainBusinessObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118
GetSystemName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118
SuperUserLogon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119
Chapter 6:
CMetaPersist Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
CMetaPersist Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122
GetObjectName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122
SetObjectName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122
GetDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
SetDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
GetObjectGUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
SetObjectGUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
GetObjectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
SetObjectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
GetClassGUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
SetClassGUID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
GetClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
SetClassID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
GetOwnerID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
SetOwnerID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126
GetCreateTimestamp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126
GetUpdateTimestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126
GetCallerName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
SetCallerName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
GetSecurityProfileID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
SetSecurityProfileID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
GetVersionNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
GetPublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
IsPublished . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
IsFrozen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
IsDormant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129
12
Table of Contents
Chapter 7:
CMetaObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
CMetaObject Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dormant Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions with Additional Search Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaObject Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator == . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator < . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadObjectWithLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadVersionWithLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadDormantDIMObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadDormantDIMObjectWithLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetVersions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetVersionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetClassObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetClassObjectVersions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetOrigCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetDestCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetDormantDIMClassObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetDormantDIMClassObjectKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetDormantDIMDestObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Delete. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DeleteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DeleteVersionRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReactivateDIMObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AddToOrigCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AddToDestCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AddManyToOrigCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AddManyToDestCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveFromOrigCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveFromDestCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveManyFromOrigCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveManyFromDestCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveAllFromOrigCollection2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveAllFromDestCollection2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
131
132
132
136
136
137
137
138
138
139
139
139
140
140
141
141
142
143
144
145
147
148
149
150
150
151
151
151
152
152
153
154
155
157
157
158
159
160
161
13
Table of Contents
ReplaceOrigCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162
ReplaceDestCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164
FindLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165
FindAllLabels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166
FindAllOccurrences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166
GetPropertyValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167
GetClassObjectKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168
GetClassObjectVersionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169
SetPropertyValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170
GetClassObjectsByProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171
GetClassObjectVersionsByProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172
GetClassObjectRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
GetClassObjectVersionsRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177
GetOrigCollectionByProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179
GetDestCollectionByProperty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181
GetOrigCollection3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183
GetDestCollection3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186
GetOrigCollectionVersions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .188
GetDestCollectionVersions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191
GetOrigCollectionVersionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194
GetDestCollectionVersionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .197
GetOrigCollectionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .200
GetDestCollectionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
GetOrigCollectionKeys3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
GetDestCollectionKeys3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207
GetDormantDIMOrigCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210
GetDormantDIMDestCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .212
GetDormantDIMOrigCollectionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .214
GetDormantDIMDestCollectionKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216
Chapter 8:
CMetaFilterInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
Substring Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
NULL Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
Property Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
CMetaFilterInfo Class Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
Constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
GetComparisonOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222
SetComparisonOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222
14
Table of Contents
GetLogicalOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetLogicalOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetParenthesesCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetParenthesesCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example Code for CMetaFilterInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
223
223
223
223
225
Chapter 9:
CMetaProperty Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
CMetaProperty Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaProperty Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator == . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator < . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetPropertyID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetPropertyID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PrintProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PrintValue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PrintValueType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions to Get the Property Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions to Set the Property Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
227
227
228
228
228
229
229
229
229
230
230
230
231
231
231
233
Chapter 10:
ObjectKey Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
CMetaObjectKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator == . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operator < . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetObjectName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetObjectName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetObjectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetObjectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
237
237
238
238
238
239
239
239
15
Table of Contents
SetClassName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240
GetClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240
SetClassID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240
CMetaVersionedObjectKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241
Operator == . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241
Operator < . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
GetVersionNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
SetVersionNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
GetPublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
SetPublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
IsPublished . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
IsDormant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
IsFrozen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
CMetaVersionedObjectClassKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244
GetClassName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244
SetClassName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244
GetClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244
SetClassID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
GetVersionNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
SetVersionNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
GetPublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
SetPublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
IsPublished . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
IsDormant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
IsFrozen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
CMetaRelationshipKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247
Operator = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247
GetExplanation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247
SetExplanation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247
CMetaLabeledObjectKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
GetObjectName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
GetObjectID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
GetVersionNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
GetPublishState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249
IsPublished . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249
GetLabelName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249
16
Table of Contents
Chapter 11:
CMetaLabel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
CMetaLabel Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaLabel Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetAIMLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetClassLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetObjectsLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetAndMoveObjectsLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DeleteObjectsLabel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetObjectKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetCreatorName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetCreatorName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
251
251
252
252
252
253
253
254
254
255
255
Chapter 12:
AIM Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
CMetaAIM Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaAIM Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaAIM Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSClassDesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSClassDesc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSDerivedClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSRelationshipDesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetClassDesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetClassDescCollection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetRelationshipDesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetRelationshipDescColl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetVersioningSupport. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetModelVersioningFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteObject/WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
258
258
259
259
259
260
261
262
263
264
265
265
266
266
267
268
CMetaClassDesc Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaClassDesc Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaClassDesc Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSPropertyDesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateMDSDerivedProperty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetUniqueNamesFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
268
268
269
270
270
274
278
17
Table of Contents
SetUniqueNamesFlag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .278
GetPropertyDesc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .278
GetPropertyDescColl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279
GetRelationshipDescColl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279
GetAbstractClassFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279
SetAbstractClassFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280
GetDescriptionRequired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280
SetDescriptionRequired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280
GetSuperClasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .281
SetSuperClasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .281
GetSubClasses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .281
GetDerivedClassFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .281
SetDerivedClassFlag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
GetBaseClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
SetBaseClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
GetVersioningSupport. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
SetClassDescVersioningFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .283
WriteObject/WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284
CMetaPropertyDesc Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
CMetaPropertyDesc Class Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
CMetaPropertyDesc Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
GetCharacterSetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
SetCharacterSetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
GetPropertyLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
SetPropertyLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287
GetPropType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287
SetPropType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287
GetRelPropID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287
SetRelPropID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .288
GetTotalDigits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .288
SetTotalDigits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .288
GetVarType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289
SetVarType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289
GetDerivedPropertyFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289
SetDerivedPropertyFlag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289
GetBasePropertyName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290
SetBasePropertyName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290
GetRelationshipsToProperty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290
SetRelationshipsToProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290
GetIsRequired. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291
WriteObject/WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291
ReadObject/ReadVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291
18
Table of Contents
CMetaRelationshipDesc Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaRelationshipDesc Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaRelationshipDesc Constructors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetPropagateDeleteFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetUniqueNamesFlag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetDestClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetOrigClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetDestClassID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetOriginClassID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetPropagateDeleteFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetUniqueNamesFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteObject/WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadObject/ReadVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
292
292
292
293
293
293
294
294
294
294
294
295
295
296
Chapter 13:
Security Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
CMetaApplicationGroup Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaApplicationGroup Class Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaApplicationGroup Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AddUserToApplicationGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateApplicationGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GetUserCollection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RemoveUserFromApplicationGroup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadObject / ReadVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteObject / WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
297
297
298
298
298
299
299
299
299
300
CMetaUser Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaUser Class Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMetaUser Constructors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreateSuperuser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SetPassword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ChangePassword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IsSuperUser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadObject / ReadVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteObject / WriteVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
300
300
300
300
301
301
302
302
302
303
303
19
Table of Contents
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .303
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .304
CMetaSecurityProfile Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305
CMetaSecurityProfile Class Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305
GetObjectsUsingSecurityProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305
GetPermissionList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .306
PrintCMetaSecurityProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .306
RemoveManyPermissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .306
RemovePermission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .306
ReplacePermissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .307
SetAIMSecurityProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .307
SetClassSecurityProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .308
SetObjectSecurityProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .308
SetSecurityProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .309
UpdateManyPermissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310
UpdatePermission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310
ReadObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .311
WriteObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .311
Chapter 14:
MetaCOMExport Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313
Library and Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313
ColumnFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313
Objects and Collections Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .314
MetaActive Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .314
Common Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357
MetaInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361
MetaInfoKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364
MetaVersionedInfoKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365
MetaPropertyItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366
MetaDIMInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369
MetaFilter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371
MetaHelper Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .374
MetaBIZInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .374
MetaInfoClassKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376
MetaVersionedInfoClassKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .377
MetaLabelInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .377
MetaLabelInfoKey Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .380
AIM Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .381
MetaPropertyInfo Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .381
20
Table of Contents
400
400
402
404
407
412
412
412
420
Chapter 15:
MetaXML Scripting Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
XML Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scripting Interface Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Structure of XML Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MDS DTD/Schema Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
427
429
430
431
456
Chapter 16:
Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
MDS Error Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Transaction Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Gateway Socket Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
XML Scripting Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Gateway Communications Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
21
Table of Contents
Chapter 17:
Steps for Using the MDS APIs and Example Code . . . . . . . . . . . . .485
C++ Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .485
Creating an Application to Load Your Meta Data Model . . . . . . . . . . . . . . . . . . . . . . . . .486
Creating, Reading and Modifying Objects and Collections . . . . . . . . . . . . . . . . . . . . . . . .487
Adding Objects to Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .489
Reading and Displaying Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .491
Getting Properties of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .492
Getting Collections of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .493
Getting Collections of Object Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .496
Getting All Objects or Object Keys of a Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497
Updating Existing Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .499
Removing Objects from Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .500
Replacing Objects in Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502
Deleting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .504
Visual Basic Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .504
Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505
Creating an AIM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505
Writing MDS Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506
Adding Many Objects to a Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507
Getting Objects in a Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507
Getting Objects of a Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509
Replacing/Removing Objects from a Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .511
Reading an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .511
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .519
22
List of Figures
23
List of Figures
24
List of Tables
25
List of Tables
26
CHAPTER 1
Overview
This chapter gives an overview of the interfaces to Meta Data Services. Included is the
following information:
Types of Interfaces
COM Libraries
XML Utility
Types of Interfaces
MDS provides a set of object-oriented Application Programming Interfaces (APIs) that can be
used to:
Add, update and delete meta data objects and collections in the MDS repository.
COM Libraries
The COM Libraries that can be used in Microsoft Visual Basic 6.0, VBScript, Visual C++
6.0.
XML Utility
27
Chapter 1: Overview
Types of Interfaces
information metamodels (AIMs) to update and delete meta data objects, and to access
collections of objects in the repository.
The following is a summary of the C++ classes available in the library. These APIs are
described in detail in this document.
Table 1: C++ API Classes
Type
Class Name
Functions
CMetaRepository Class
Connect to MDS
Manage transactions
Get object identifiers
CMetaObject Class
Create
Read
Maintain
user-defined objects and collections
CMetaProperty Class
CMetaFilterInfo Class
28
GetClassObjectsByProperty
GetClassObjectRange
GetDestCollectionByProperty
GetOrigCollectionByProperty
ObjectKey Classes
CMetaAIM Class
CMetaClassDesc Class
CMetaPropertyDesc Class
CMetaRelationshipDesc Class
CMetaApplicationGroup Class
CMetaUser Class
Create users
Change passwords
CMetaSecurityProfile Class
CMetaSecurityProfileEntry
Class
CMetaLabel Class
Chapter 1: Overview
Types of Interfaces
COM Libraries
The C++ class library provides access to the repository only for C++ programs. The COM
libraries supplement the C++ classes by providing access to the repository using Visual Basic,
J++, and scripting languages such as VBScript and JScript.
The following is a summary of the COM classes available in the MetaCOM library. These
interfaces are described in detail in Chapter 14: MetaCOMExport Library.
Table 2: COM Classes
Type
Class Name
Functions
MetaActive Class
MetaInfo Class
MetaPropertyItem Class
MetaFilter Class
Connect to MDS
Manage transactions
Get object identifiers
Create, read and maintain user-defined
objects and collections
GetClassObjectsByProperty
GetClassObjectsByRange
GetCollectionsByProperty
MetaInfoKey Class
MetaDIMInfo Class
MetaHelper Class
MetaInfoList
MetaInfoKeyList
MetaPropertyItemList
MetaFilterList
MetaPropertyInfoList
MetaRelationshipInfoList
MetaClassInfoList
MetaModelInfoList
MetaUserInfoList
MetaGroupInfoList
MetaSecProfInfoList
29
Chapter 1: Overview
Types of Interfaces
Table 2: COM Classes (continued)
Type
Class Name
Functions
MetaModelInfo Class
MetaClassInfo Class
MetaPropertyInfo Class
MetaRelationshipInfo Class
MetaGroupInfo Class
MetaUserInfo Class
Create users
Change passwords
MetaSecProfInfo Class
com.teradata.mds
com.teradata.mds.metamodel
com.teradata.mds.security
A summary of the packages and their classes is shown in Table 3. Full documentation can be
found in the %METAHOME%\jdk\docs directory.
Table 3: Classes and Functions
30
Package
Class Name
Function
com.teradata.mds
MetaRepository
Initialize/deinitialize, logon/logoff
MetaDataObject
MetaVersionedObject
MetaClassInfo
MetaObjectCollections
Chapter 1: Overview
COM Interfaces Referenced by MetaSurf
Table 3: Classes and Functions (continued)
Package
Class Name
Function
com.teradata.mds.metamodel
MetaModelAIM
MetaModelClass
MetaModelProperty
MetaModelRelationship
MetaLabel
MetaGroup
MetaUser
MetaSecurityProfile
com.teradata.mds.security
XML Utility
The MDS Extensible Markup Language (XML) interface provides a simple and powerful
syntax for defining, describing and exchanging complex structured data. The XML design
used by MDS is meant to be simple and easy to use.
See Chapter 15: MetaXML Scripting Interface, for detailed information and examples for
using the XML scripting interface.
MetaActive
MetaBIZInfo
31
Chapter 1: Overview
COM Interfaces Referenced by MetaSurf
MetaBIZInfoList
MetaClassInfo
MetaDIMInfo
MetaFilter
MetaFilterList
MetaHelper
MetaInfo
MetaInfoList
MetaInfoKey
MetaInfoKeyList
MetaLabelInfo
MetaPropertyItem
MetaPropertyItemList
For additional information on the COM interfaces and associated functions, refer to the
appropriate chapters.
For information about installing MetaSurf, refer to Teradata Tools and Utilities Installation
Guide for Microsoft Windows
32
CHAPTER 2
This chapter discusses application information metamodels (AIMs). Included is the following
information:
Derived Classes
AutoCorporation
Has
AutoDivision
ClassDescription
RelationshipDescription
ClassDescription
3047B050
AIM Components
An AIM consists of the following components:
33
An instance of a class description in the repository is called a class object or object. Big Guy
Motors is an AutoCorporation object and American Autos is an AutoDivision object.
Property descriptions are the data fields associated with class descriptions.
The Auto class description might contain properties such as weight, base price, fuel tank,
and other options.
A collection is a set of objects that have relationships to the same object (called the
source object).
In a relationship description, one class description is defined as the origin and the
other the destination.
ClassDescription
RelationshipDescription:
DivisionMakesSUVs
RelationshipDescription:
DivisionMakesAutos
Auto
SUVs
ClassDescriptions
American Autos
Collection of
autos
manufactured
by
American Autos
Relationship
between American
Autos and Yearling
Tortoise
Yearling
3047B019
American Autos
Relationship
between American Autos
and Hawk
Vulture
Hawk
Collection of
SUVs
manufactured
by
American Autos
3047B051
AIMs are extensible. Class descriptions and relationship descriptions can be added or deleted
from existing AIMs and property descriptions can be added or deleted from existing class
descriptions.
34
Inheritance
Inheritance is a feature that allows creation of a class that inherits the properties and
relationships from a previously defined class. A class that inherits from another class is called a
subclass. The class that the subclass inherits from is called the superclass.
A subclass will contain all the properties of the class(es) it inherits from. In Figure 3:
Class G also has the properties A and B and any properties specifically created for Class G,
for example, properties C and D.
Class M is created from Class G and inherits all the properties of Class G, and also includes
the properties of Class A.
A class can only inherit directly from one class, but the class it inherits from can have up to
four superclasses. So a class can have up to five superclasses: the class it directly inherits and
the superclasses of that class.
Figure 3: Class Inheritance of Properties
ClassA Properties
ClassA
G Inherits
From A
ClassG Properties
ClassG
M Inherits
From G
ClassM Properties
ClassM
F
3047B001
35
Figure 4 shows a relationship called RelAM that has the origin class of ClassA and the
destination class of ClassM. All classes that inherit from ClassA and ClassM also inherit this
relationship. This means that ClassB and ClassC objects can be origin objects in this
relationship and ClassN and ClassO objects can be destination objects. As shown in Figure 4,
you can add a ClassM, ClassN or ClassO object to the destination collection of a ClassA,
ClassB or ClassC object.
Figure 4: Class Inheritance of Relationships
Relationship: RelAM
Origin Class: ClassA
DestClass: ClassM
ClassA
B Inherits
From A
ClassM
N Inherits
From M
ClassB
ClassN
C Inherits
From B
O Inherits
From N
ClassC
ClassO
3047B002
Abstract Class
An abstract class is a class that can not have object instances. An abstract class can have
properties and can be the source or destination class in relationships. An abstract class is
created to enable subclasses of the class to inherit the properties and relationships of the
abstract class. Figure 5 shows an example.
Figure 5: Abstract Class
'DWDEDVH
UHODWLRQVKLS
'DWDEDVH+DV7902EMHFWV
VXSHUFODVV
7902EMHFWDEVWUDFW
7DEOH
9LHZ
7ULJJHU
0DFUR
VXEFODVVHV
&
If a class is defined as an abstract class, the MDS engine will not allow creating objects of that
class type.
36
Derived Classes
A derived class is similar to a view in a Teradata Database. It allows you to create a logical class
using properties that exist in already defined classes.
To understand the value provided by a derived class, look at the metamodel defined in
Figure 6.
Figure 6: Derived Class Sample Metamodel
class : subjectarea
subjectarea name
class : view
view name
DBID
DB name
view description
view requesttext
view ID
data text
character set
Relation :subjectareahasview
column description
Relation :viewhasview column
3047A006
Using the metamodel in Figure 6, you can get a collection of ViewColumn objects with a name
beginning with customer using one API call.
What if you also want your search for ViewColumn with a name beginning with customer
to get the names of the subjectarea and view associated with each ViewColumn object? How
can you perform this task with a single API call?
The solution is to create a derived class. A derived class creates a pseudo class that contains the
properties of a base class plus properties of related classes. A read of a derived class object will
return all properties (base and derived) and searches can be performed on all of the properties
of the derived class.
Create a derived property called ViewName (which is the name property of the view class)
and add it to the newly created derived class.
Create a derived property called SubjectAreaName (which is the name property of the
subjectarea class) and add it to the newly created derived class.
37
To the APIs, the derived class will look like a class containing all the properties of the
ViewColumn class plus the SubjectAreaName and ViewName properties. A search can be
performed on one or more of these properties. The SubjectAreaName and ViewName are
returned in the property list in each of the objects in the return list.
There are no physical objects in a derived class. Derived class objects are created by joining
properties in a base class with properties in related classes. Therefore derived class objects are
read only. You cannot write or delete a derived class object.
3047A018
In the above metamodel from a Column object, the name of the related table can be found by
getting the origin object using the TableHasColumns relationship.
The name of the related database can be found by getting the origin object of the table using
the DatabaseHasTables object. Since these properties can be retrieved through relationships to
the Column class, they can be defined as derived properties of a derived class with the base
class of the Column class.
38
The objects returned will contain all the properties of the base class plus the derived
properties.
Searches and sorts can be specified on the derived properties and the base properties of the
derived class.
A derived property can be a maximum of six relationships from the base class.
If multiple derived properties are defined for a derived class, their relationships must all be on
the same hierarchical path. For example, as shown in Figure 8, a derived class with a base class
of Column could contain derived properties from the DBSystem, Database, and Table classes.
Figure 8: Hierarchical Path of Related Classes
DBSystem
SystemHasDatabases
Database
DatabaseHasTables
Table
TableHasColumns
Column
3047A017
Table
ViewHasTableColumns
TableHasColumns
Column
3047A016
A derived class with a base class of Column cannot contain derived properties from both the
View and Table classes.
39
Extending the DIM with relationships to the database meta data allows MDS to maintain the
integrity of Teradatas meta data.
The DIM is represented in Figure 10 and Figure 11. Table 4 on page 41 and Table 35 on
page 65 contain descriptions of the DIM classes and relationships respectively.
Figure 10: Database Information Metamodel (DIM) (Sheet 1 of 2)
'DWDEDVH6\VWHP
6 X E MH F W$
UH D
1RGH
0 H WD
'DWDEDVH
/RDG7
\SH
( Q WL
% X VL Q H VV
% X VL Q H VV
W\
5 X OH
7U LJ J
H
H
9D OL G 9D OX
0DFU
R 3D U D
P H WH
U
% X V LQ H V
V $ WW UL EX
0DFU
WH
9 LH Z & R OX
6 3 3D UD P
7D E OH
PQ
& R OX P
9 LH Z
5 H IH U
HQFH
H WH U
&KHF
5 H IH U
HQFH&
R OX P Q
UR F H G
6 WR UH G 3
X UH
- R LQ ,Q G H
,Q G H[
& R Q V WD Q
H[
+ D V K ,Q G
,Q G H[
& R OX P
W
(
40
Macro
76
JoinIndex
75
74
View
84
Function
80
69
78
82
FunctionParameter
65
83
81
67
70
Column
UDT
66
MacroParameter
72
79
UDTAttribute
SPParameter
73
Trigger
77
ViewColumn
71
3047A060
DIM Classes
The Global Unique Identifiers for the DIM Class Descriptions and Relationship Descriptions
are defined in the header file dbaim.h. This file also contains the constants for the DIM
Property Names and Relative Property IDs.
A Teradata Database system is initially loaded into the MDS repository using the metaload
program. Meta data objects loaded into the DIM are referred to as DIM objects and are
readable by any MDS User with the appropriate read permission.
The information needed to read the values of the properties of objects in the DIM classes is
contained in the following tables.
Table 4: DIM Class Descriptions
Class Name
Description
BusinessAttribute
BusinessEntity
41
42
Class Name
Description
BusinessRule
Check
Class Function
Column
Constant
A constant value
Database
Teradata Database
DatabaseSystem
FKReference
Function
FunctionParameter
A parameter of a UDF
HashIndex
Index
IndexColumn
A column of an index
JoinIndex
Macro
A Teradata macro
MacroParameter
MetaLoadType
Node
Reference
ReferenceColumn
SPParameter
StoredProcedure
SubjectArea
Table
Teradata table
Trigger
A Teradata trigger
UDT
A user-defined type
UDTAttribute
An attribute of a UDT
ValidValue
Class Name
Description
View
A Teradata view
ViewColumn
Property Name
Description
Property ID
Type
Size
MetaloadDate
PID_SYSTEM_
METALOADDATE
String
20
LoadFlag
PID_SYSTEM_ LOADFLAG
Short
PID_SYSTEM_
MLUSERLOGIN
String
0 = not loaded
1 = all databases loaded
2 = specific databases loaded
3 = specific databases excluded
Set by the metaload utility (command
line or as called by the MetaManager). If
no databases are specified on the initial
load or during a resync, the flag is set to 1
(All). This indicates that the Automatic
DIM Update Gateway is to maintain
updates on all databases in the system.
If databases are specified on the initial
system load, the flag is set to 2 (specific
databases).
If databases are excluded on a system
load, the flag is set to 3 (excluded
databases). This indicates that the
Automatic DIM Update Gateway is to
maintain updates on only the databases
that have been loaded into the MDS
repository.
If the flag is set to 1 (All) and metaload is
run to resync a specific database or
databases, the flag is not changed.
MetaloadUserLogin
128
43
Property Name
Description
Property ID
Type
Size
MetaloadUserPwd
PID_SYSTEM_
MLUSERPWD
Binary
64
MetaloadSystemDSN
PID_SYSYSTEM_
MLSYSDSN
String
30
RecoveryDatabase
PID_SYSTEM_
RECOVERYDB
String
128
RecoveryTableName
String
128
DIMUpdatesEnabled
PID_SYSTEM_
DIMUPDENABLED
String
Y = yes N = no
RecoveryDays
PID_SYSTEM_
RECOVERYDAYS
Integer
RecoveryTime
PID_SYSTEM_
RECOVERYTIME
Double
RecoverOnStartup
PID_SYSTEM_ RECOVER
ONSTARTUP
Short
RDBMSType
PID_SYSTEM_RDBMSTYPE
String
SecurityPropagation
Type
PID_SYSTEM_SECURITYPR Short
OPTYPE
44
30
Property Name
Description
Property ID
Type
Size
CommentString
PID_DATABASE_
COMMENT
String
255
CreatorName
PID_DATABASE_CREATOR
NAME
String
128
DatabaseId
PID_DATABASE_
DATABASEID
Binary
DatabaseType
PID_DATABASE_TYPE
String
PID_DATABASE_
SYNCLEVEL
Short
Property Name
Description
Property ID
Type
Size
CommentString
PID_TABLE_ COMMENT
String
255
CreatorName
PID_TABLE_CREATORNAME
String
128
DatabaseId
PID_TABLE_ DATABASEID
Binary
45
Property Name
Description
Property ID
Type
Size
IsErrorTable
PID_TABLE_ISERRORTABLE
String
PID_TABLE_ISGLOBALTEMP
ORARY
String
LastAlterTimeStamp
PID_TABLE_LASTALTERTIME TimeStamp
STAMP
PrimaryIndexDefined
PID_TABLE_PRIMARYINDEX
DEFINED
String
Internal Flag
PID_TABLE_ SYNCLEVEL
Short
TableId
PID_TABLE_ TABLEID
Binary
Version
PID_TABLE_ VERSION
Short
Property Name
Description
Property ID
Type
CharType
PID_COLUMN_ CHARTYPE
Short
1 Latin
2 Unicode
3 KanjiSJIS
4 Graphic
5 Kanji1
ColumnFormat
PID_COLUMN_
COLUMNFORMAT
String
ColumnId
PID_COLUMN_ COLUMNID
Short
ColumnLength
PID_COLUMN_
COLUMNLENGTH
Integer
46
Size
128
Property Name
Description
ColumnTitle
PID_COLUMN_
Heading for displayed or printed
COLUMNTITLE
results that is different from the
column name, which is used by default.
Property ID
Type
Size
String
256
47
Property Name
Description
Property ID
ColumnType
48
Type
Size
2
A1 1-dimensional Array
AN n-dimensional Array
AT Time
BF Byte
BO BLOB
BV VarByte
CF Character
CO CLOB
CV VarCharacter
D Decimal
DA Date
DH Day To Hour
DM Day To Minute
DS Day To Second
DY Day
F Float
HM Hour To Minute
HR Hour
HS Hour To Second
I Integer
I1 ByteInt
I2 SmallInt
I8 BigInt
MI Minute
MO Month
MS Minute To Second
N Number
PD Period Date
PM Period Timestamp with Time
Zone
PS Period Timestamp
PT Period Time
PZ Period Time with Time Zone
SC Second
SZ Timestamp with Time Zone
TS Timestamp
TZ ANSI Time with Time Zone
UT User-defined Type
M Year To Month
YR Year
Property Name
Description
Property ID
Type
Size
CommentString
PID_COLUMN_ COMMENT
String
255
Compressible
PID_COLUMN_
COMPRESSIBLE
String
C = compress
N = do not compress
CompressValue
PID_COLUMN_
COMPRESSVALUE
String
8192
DatabaseID
PID_COLUMN_ DATABASEID
Binary
DecimalFractDigits
PID_COLUMN_ DECIMAL
FRACTDIGITS
Short
DecimalTotalDigits
PID_COLUMN_ DECIMAL
TOTALDIGITS
Short
DefaultValue
PID_COLUMN_
DEFAULTVALUE
String
1024
IDColType
PID_COLUMN_IDCOLTYPE
String
164
Nullable
PID_COLUMN_NULLABLE
String
Y = acceptable value
N = not acceptable value
TableId
PID_COLUMN_ TABLEID
Binary
UppercaseFlag
PID_COLUMN_
UPPERCASEFLAG
String
Y = small-case converted
N = small-case not converted
49
Property Name
Description
Property ID
Type
Size
CommentString
PID_VIEW_ COMMENT
String
255
CreatorName
PID_VIEW_CREATORNAME
String
128
DatabaseID
PID_VIEW_ DATABASEID
Binary
IsRecursive
PID_VIEW_ISRECURSIVE
String
LastAlterTimeStamp
TimeStamp
ReqText
PID_VIEW_ REQTEXT
String
SynchronizationLevel
Internal Flag
PID_VIEW_ SYNCLEVEL
Short
ViewId
PID_VIEW_VIEWID
Binary
12500
Property Name
Description
Property ID
Type
ColumnID
PID_VIEWCOL_
COLUMNID
Short
ColumnLength
PID_VIEWCOL_
COLUMNLENGTH
Integer
ColumnType
PID_VIEWCOL_
COLUMNTYPE
String
CommentString
String
255
DatabaseID
Binary
50
PID_VIEWCOL_
DATABASEID
Size
Property Name
Description
Property ID
Type
Size
DecimalFractDigits
PID_VIEWCOL_
DECIMALFRACTDIGITS
Short
DecimalTotalDigits
PID_VIEWCOL_
DECIMALTOTALDIGITS
Short
Nullable
ViewID
PID_VIEWCOL_ VIEWID
Binary
Property Name
Description
Property ID
Type
Size
DatabaseID
PID_INDEX_ DATABASEID
Binary
IndexNumber
PID_INDEX_ NUMBER
Short
IndexType
PID_INDEX_TYPE
String
PID_INDEX_TABLEID
Binary
TableID
P (Primary)
Q (Partitioned Primary Index)
S (Secondary)
J (join index)
M (Multi-Column Statistics)
D (Derived column partition statistics)
N (hash index)
K (primary key)
U (unique constraint)
V (value ordered secondary)
H (hash ordered ALL covering
secondary)
O (valued ordered ALL covering
secondary)
I (ordering column of a composite
secondary index)
1 (field1 column of a join or hash
index)
2 (field2 column of a join or hash
index)
51
Property Name
Description
Property ID
Type
Size
UniqueFlag
Size
Property Name
Description
Property ID
Type
ColumnPosition
PID_INDEXCOL_
COLUMNPOSITION
Short
DatabaseID
PID_INDEXCOL_DATABASE Binary
ID
IndexNumber
PID_INDEXCOL_INDEXNU
MBER
Short
TableID
PID_INDEXCOL_TABLEID
Binary
Property Name
Description
Property ID
Type
Size
CheckBool
PID_ CHECKCONSTRAINT_
CHECKBOOL
String
8192
ConstraintType
PID_CHECKCONSTRAINT_TYPE
String
Binary
TableID
Binary
Property Name
Description
Property ID
Type
Size
DatabaseID
PID_ REFCONSTRAINT_
DATABASEID
Binary
RefDatabase
PID_ REFCONSTRAINT_
REFDATABASE
String
128
ReferenceID
PID_ REFCONSTRAINT_
REFERENCEID
Short
52
Property Name
Description
Property ID
Type
Size
RefTable
PID_ REFCONSTRAINT_
REFTABLE
String
128
TableID
PID_ REFCONSTRAINT_
TABLEID
Binary
Property Name
Description
Property ID
Type
Size
DatabaseID
PID_REFCOL_DATABASEID
Binary
ForeignKeyColName
PID_REFCOL_
FOREIGNKEYCOL
String
128
ReferenceColName
PID_REFCOL_
REFERENCECOL
String
128
ReferenceID
PID_REFCOL_REFERENCEID
Short
TableID
Binary
Property Name
Description
Property ID
Type
Size
NodeStatus
U = node is up.
D = node is unavailable
PID_NODE_NODESTATUS
String
Property Name
Description
Property ID
Type
Size
CommentString
PID_SP_COMMENT
String
255
CreatorName
PID_SP_CREATORNAME
String
128
DatabaseID
PID_SP_DATABASEID
Binary
LastAlterTimeStamp
PID_SP_LASTALTERTIMESTAMP
TimeStamp
53
Property Name
Description
Property ID
Type
Size
ProcedureID
PID_SP_PROCEDUREID
Binary
SPText
PID_SP_TEXT
String
12500
SynchronizationLevel
Internal Flag
PID_SP_SYNCLEVEL
Short
54
Property Name
Description
Property ID
Type
Size
CommentString
PID_SPPARAMETER_COMMEN
T
String
255
CreatorName
PID_SPPARAMETER_CREATOR
NAME
String
128
DatabaseId
ParameterId
PID_SPPARAMETER_PARAMETE Short
RID
ParamLength
PID_SPPARAMETER_PARAMLE
NGTH
ParamType
PID_SPPARAMETER_PARAMTYP String
E
ProcedureId
PID_SPPARAMETER_PROCEDU
REID
Binary
PID_SPPARAMETER_ROWTYPE
DBNAME
String
128
RowTypeTableName
PID_SPPARAMETER_ROWTYPE
TBLNAME
String
128
SPParamType
PID_SPPARAMETER_SPPARAMT String
YPE
Integer
"I" = IN
"O" = OUT
"B" = INOUT
Property Name
Description
Property ID
Type
Size
ActionTime
PID_TRIGGER_ACTIONTIME
String
PID_TRIGGER_COMMENT
String
255
CreatorName
PID_TRIGGER_CREATORNAME
String
128
55
Property Name
Description
Property ID
Type
Size
DatabaseId
PID_TRIGGER_DATABASEID
Binary
Event
PID_TRIGGER_EVENT
String
PID_TRIGGER_ENABLED
String
PID_TRIGGER_KIND
String
D = Delete
I = Insert
U = Update
IsEnabled
Kind
LastAlterTimeStamp
PID_TRIGGER_LASTALTERTIME TimeStamp
STAMP
Ordering Position
PID_TRIGGER_ORDER
Short
RequestText
PID_TRIGGER_REQUESTTEXT
String
SynchronizationLevel
Internal Flag
PID_TRIGGER_ SYNCLEVEL
Short
PID_TRIGGER_CREATETIMEST
AMP
TimeStamp
TriggerEnableDisable
TimeStamp
PID_TRIGGER_ENABLEDISABL
ETS
Timestamp
TriggerId
PID_TRIGGER_TRIGGERID
Binary
12500
Property Name
Description
Property ID
Type
Size
CommentString
PID_MACRO_COMMENT
String
255
CreatorName
PID_MACRO_CREATORNAME String
128
56
Property Name
Description
Property ID
Type
Size
DatabaseID
PID_MACRO_DATABASEID
Binary
LastAlterTimeStamp
PID_MACRO_LASTALTERTIM
ESTAMP
Timestamp
MacroID
PID_MACRO_MACROID
Binary
MacroText
PID_MACRO_TEXT
String
12500
SynchronizationLevel
PID_MACRO_SYNCLEVEL
Short
Property Name
Description
Property ID
Type
CharType
PID_MACROPARAM_CHARTYPE
Short
CommentString
String
255
DatabaseID
PID_MACROPARAM_DATABASEID
Binary
DataType
PID_MACROPARAM_DATATYPE
String
DefaultValue
PID_MACROPARAM_DEFAULTVALUE
Character
1024
MacroID
PID_MACROPARAM_PROCEDUREID
Binary
ParameterID
PID_MACROPARAM_PARAMETERID
Short
ParamFormat
PID_MACROPARAM_PARAMFORMAT String
ParamLength
PID_MACROPARAM_PARAMLENGTH Integer
Size
1 Latin
2 Unicode
3 KanjiSJIS
4 Graphic
5 Kanji1
128
57
Property Name
Description
Property ID
Type
Size
ParamTitle
PID_MACROPARAM_TITLE
String
256
Property Name
Description
Property ID
Type
Size
CommentString
PID_JOININDEX_COMMENT
String
255
CreatorName
PID_JOININDEX_CREATORNAME
String
128
DatabaseID
Binary
JoinIndexID
PID_JOININDEX_JOININDEXID
Binary
LastAlterTime
Stamp
PID_JOININDEX_LASTALTERTIMEST
AMP
Timestamp
RequestText
String
PID_JOININDEX_SYNCLEVEL
short
12500
Property Name
Description
Property ID
Type
Size
CommentString
PID_HASHINDEX_COMMENT
String
255
CreatorName
PID_HASHINDEX_CREATORNAME
String
128
DatabaseId
PID_HASHINDEX_DATABASEID
Binary
HashIndexId
PID_HASHINDEX_HASHINDEXID
Binary
LastAlterTime
Stamp
PID_HASHINDEX_LASTALTERTIMES
TAMP
Timestamp
58
Property Name
Description
Property ID
Type
Size
RequestText
PID_HASHINDEX_REQUESTTEXT
String
12500
PID_HASHINDEX_SYNCLEVEL
short
Property Name
Description
Property ID
Type
Size
Author
PID_SUBAREA_AUTHOR
String
255
BusinessDefinition
PID_SUBAREA_BUSDEFID
String
2048
SubjectAreaId
PID_SUBAREA_SUBAREAID Integer
Property Name
Description
Property ID
Type
Size
PID_BUSENTITY_BUSDEFID
String
12500
BusinessNotes
Comment text
PID_BUSENTITY_BUSNOTES
String
12500
EntityId
PID_BUSENTITY_ENTITYID
Integer
EntityType
PID_BUSENTITY_ENTITYTYPE
String
SourceFile
PID_BUSENTITY_SOURCEFILE
String
255
Size
Property Name
Description
Property ID
Type
AttributeId
PID_BUSATTR_ATTRID
Integer
AttributeType
PID_BUSATTR_ATTRTYPE
String
BusinessDefinition
PID_BUSATTR_BUSDEFID
String
12500
BusinessNotes
Comment text
PID_BUSATTR_BUSNOTES
String
12500
ColumnPosition
PID_BUSATTR_COLUMNPOS
Integer
59
Property Name
Description
Property ID
Type
Size
Rolename
PID_BUSATTR_ROLENAME
String
255
Property Name
Description
Property ID
Type
Size
MaximumValue
PID_BUSRULE_MAXVALUE
String
255
MinimumValue
PID_BUSRULE_MINVALUE
String
255
RuleDefinition
PID_BUSRULE_RULEDEF
String
12500
RuleId
PID_BUSRULE_RULEID
Integer
Property Name
Description
Property ID
Type
Size
DisplayValue
PID_VALIDVALUE_DISPLAYVALUE String
SequenceNumber
PID_VALIDVALUE_SEQNUM
Integer
ValueDefinition
PID_VALIDVALUE_VALUEDEF
String
12500
255
Property Name
Description
Property ID
Type
Size
LoadFlags
PID_LOADTYPES_LOADFLAGS
Binary
32
Property Name
Description
Property ID
Type
Size
FunctionId
PID_FUNCTION_FUNCTIONID
Binary
DatabaseId
PID_FUNCTION_DATABASEID
Binary
RequestText
PID_FUNCTION_REQUESTTEXT
String
12500
LastAlterTimestamp
PID_FUNCTION_LASTALTERTIMESTAMP Timestamp
60
Property Name
Description
Property ID
Type
Size
CreatorName
PID_FUNCTION_CREATORNAME
String
128
CommentString
Comment stored in
Teradata for the function
PID_FUNCTION_COMMENTSTRING
String
255
FunctionClass
PID_FUNCTION_CLASS
String
30
PID_FUNCTION_ALIAS
String
128
270
FunctionReturnType
String
SynchronizationLevel
Internal flag
PID_FUNCTION_SYNCLEVEL
Short
FunctionSpecificName
PID_FUNCTION_SPECIFICNAME
String
128
FunctionCallParameters
PID_FUNCTION_CALLPARAMETERS
String
1024
61
Property Name
Description
Property ID
Type
Size
ConstantType
PID_CONSTANT_TYPE
String
128
PID_CONSTANT_VALUE
String
1024
ACCOUNT *
ACTIVITY_COUNT
ALL
ANSIDATE
ASCII
AUTOTEMP
BIGINT
BINARY
CHARSET_COLL
CHAR_SET_GRAPHIC
CURRDATE *
CURRENT_ROLE
CURRENT_USER
CURRTIME *
PROFILE *
CURRTIMESTAMP *
DATABASE *
ConstantValue
DATE *
DECIMAL
DEFAULT
DQUOTESTR
EBCDIC
FLOAT
HEXSTR
HIGH
HOST
INTEGER
INTEGERDATE
JIS_COLL
KANJI
KANJISJIS
LATIN1
LOCAL
LOW
MANUAL
MULTINATIONAL
MEDIUM
NAME
NEVER
NULL
OFF
PARMNAME
PREPARE_COUNT
ROLE *
SESSION *
SOURCE_TIME_ZONE
SQLCODE
SQLSTATE
SQUOTESTR
STAR
TEMPORAL_DATE
TEMPORAL_TIMESTA
MP
TIME *
UNICODE
UNKNOWN
USER *
Values marked with * in the table are converted from constants to functions before being
stored in the MDS repository. They have function class "BI" (built-in). Date, Time,
62
Timestamp and Interval literals are stored with a constant type of SQUOTESTR (single
quoted string).
The following notes apply to constants referenced by a view column and functions referenced
by view columns, stored procedures, macros, and so on:
If a constant is used in an expression with a table column or function, the constant and
expression are not stored in the repository. Only the column or function are stored and
associated with the view column.
For example, when a view column references expressions (c1 + 10) and [sum(c1) + 10],
where c1 is a table column, 10 is a constant, and sum(c1) is a function, only table column
c1 and function sum(c1) are stored in the repository and associated with the view column.
The constant 10 and expressions (c1 + 10) and [sum(c1) + 10] are not.
Operators that are used to combine functions are not stored in the repository.
Property
ID
Type
Size
VARCHAR
255
CreatorName
CHAR
128
DatabaseID
BYTE
DistinctPredefinedType
CHAR
IsStructured
CHAR
LastAlterTimestamp
TIMESTAMP
NumberOfArrayDimensi
ons
10
SMALLINT
RequestText
VARCHAR
SynchronizationLevel
0=not synchronized,
1=synchronized
SMALLINT
Property Name
Description
CommentString
12500
63
Property Name
Description
TypeID
Property
ID
Type
Size
BYTE
Property Name
Description
Property
ID
Type
Size
AttributeFormat
VARCHAR
128
AttributeID
SMALLINT
AttributeLength
INT
CharacterSet
SHORT
1 Latin
2 Unicode
3 KanjiSJIS
4 Graphic
5 Kanji1
CommentString
VARCHAR
255
DataType
CHAR
DecimalFractDigits
n in DECIMAL(M,N)
SMALLINT
DecimalTotalDigits
m in DECIMAL(m,n)
SMALLINT
TypeID
BYTE
Property Name
Description
Property
ID
Type
CharacterSet
64
Size
SHORT
1 Latin
2 Unicode
3 KanjiSJIS
4 Graphic
5 Kanji1
Property
ID
Type
Size
VARCHAR
255
DataType
CHAR
ParameterID
SHORT
ParameterLength
INT
RowTypeDatabaseNa
me
String
128
RowTypeTableName
String
128
Property Name
Description
CommentString
Relationship Name
Number in
Diagram
Description
SystemHasDatabases
SystemHasNodes
DatabaseHasTables
DatabaseHasViews
DatabaseHasMacros
DatabaseHasStoredProcedures
DatabaseHasTriggers
DatabaseHasSubjectAreas
DatabaseHasEntities
DatabaseHasRules
10
DatabaseOwnsDatabases
11
BusEntityHasAttributes
12
BusEntityTable
13
65
Relationship Name
Number in
Diagram
Description
BusEntityView
14
BusAttrViewColumn
15
BusAttrColumn
16
BusAttrRules
17
BusRuleValues
18
SubjectAreaEntities
19
TableHasColumns
20
TableHasIndices
21
IndexContainsColumns
22
TableHasCheckConstraints
23
TableHasRefConstraints
24
ConstraintReferencesColumns
25
TableHasTriggers
26
ColumnHasTriggers
27
ViewHasColumns
28
ViewHasTableColumns
29
ViewReferencesViews
30
ViewColReferencesTableCols
31
SPHasParameters
32
SPReferencesTables
33
SPReferencesViews
34
SPReferencesStoredProcedures
35
SPReferencesMacros
36
SPReferencesTableColumns
37
SPReferencesViewColumns
38
TriggerReferencesMacros
39
MacroHasParameters
40
MacroReferencesTables
41
MacroReferencesViews
42
66
Relationship Name
Number in
Diagram
Description
MacroReferencesSPs
43
MacroReferencesMacros
44
MacroReferencesTriggers
45
MacroReferencesTableColumns
46
MacroReferencesViewColumn
47
DatabaseHasHashIndexes
48
DatabaseHasJoinIndexes
49
JoinIndexHasIndices
50
HashIndexHasIndices
51
JoinIndexReferencesTables
52
JoinIndexReferencesTableColumns
53
HashIndexReferencesTables
54
SPReferencesJoinIndexes
55
MacroReferencesJoinIndexes
56
SystemHasMetaLoadTypes
57
ViewReferencesTables
58
TableHasErrorTable
59
ViewColumnReferencesConstants
60
TriggerReferencesTables
61
HashIndexReferencesTableColumns
62
MacroReferencesHashIndexes
63
SPReferencesHashIndexes
64
DatabaseHasUDTs
65
UDTHasAttributes
66
UDTHasFunctions
67
DatabaseHasFunctions
68
FunctionHasParameters
69
ColumnHasUDT
70
ViewColumnHasUDT
71
67
Relationship Name
Number in
Diagram
Description
MacroParameterHasUDT
72
SPParameterHasUDT
73
JoinIndexReferencesFunctions
74
MacroReferencesFunctions
75
SPReferencesFunctions
76
TriggerReferencesUDTs
77
TriggerReferencesFunctions
78
UDTAttributeHasUDT
79
ViewColumnReferencesFunctions
80
FunctionParameterHasUDT
81
FunctionCallUsesUDF
82
FunctionReferencesFunctions
83
ViewReferencesFunctions
84
68
After these APIs are run, the DIM now looks like Figure 12:
69
Database
Name: char
SystemHasDatabases
Description: varchar
MetaloadDate: varchar
Column
Name: char
DatabaseId: BYTE(4)
Description: varchar
DatabaseHasTables
Table
Name: char
DatabaseId: BYTE(4)
TableId: BYTE(6)
Description: Varchar
TableHasColumns
Name: char
Description: varchar
ColumnId: smallint
TableId: BYTE(6)
DatabaseId: BYTE(4)
ColumnFormat: char
ColumnTitle: varchar
ColumnLength: smallint
DefaultValue: varchar
Nullable: char
DecimalTotalDigits: smallint
DecimalFractionDigits: smallint
UppercaseFlag: char
Compressible: char
CompressValue: varchar
SourceOfColumn
ColumnSource
Name: char(30)
Description: varchar(1024)
ServerName: char(10)
DatabaseName: varchar(30)
Ownername: char(10)
TableName: varchar(30)
ElementName: varchar(30)
ElementDataType: char
ElementKeyPosition: shortint
ElementNulls: char
ElementPosition: integer
3047A054
The Teradata physical databases, tables and columns are loaded into MDS with the metaload
utility. To add the ColumnSource data, an application would need to be written to perform
the following steps:
For our example, we assume there is a Teradata Column called T_DEPT,
Teradata Column
DatabaseName: Employee
TableName: TGT_EMP
ColumnName: T_DEPT
70
Write the new ColumnSource object to the MDS database (See sample code for examples
of writing an object)
Add the new ColumnSource object (DEPT) to the SourceOfColumn collection for the
Column (T_DEPT) object
After the ColumnSource objects and collections are created, the MDS repository will contain
the information about Columns objects and their source data as in Figure 13:
Figure 13: New ColumnSource Objects and Collections
ColumnSource Objects
Column Objects
Name: DEPT
ServerName: paris
Name: ora.emp
TableName: SRC_EMP
Name: T_DEPT
ColumnId: 1935
TableId: 000012340000
DatabaseId: 00003984
Name: MGR
ServerName: paris
Name: ora.emp
TableName: SRC_DEPT
Name: T_ST
ColumnId: 1820
TableId: 0000124900000
DatabaseId: 00003984
Name: FNAME
ServerName: paris
Name: ora.emp
TableName: SRC_EMPLOYEE
Name: T_FNAME
ColumnId:1899
TableId: 0000124900000
DatabaseId: 00003984
3047A055
By creating additional classes and relationships in the DIM and creating applications to
maintain information the new data, you will be able to build a store of information in MDS.
This information provides answers to questions about the warehouse such as where the
information came from, when was it last updated, what is the meaning of the data, etc.
71
The CLM stores meta data information about loading data into the Teradata system through
the use of the Teradata client load utilities.
This meta data information includes:
Information about the data source(s) that are used by the load script
Information about the target(s) that are loaded by the load script
The Table level (Script and Source objects to the DIM Table class objects)
The View level (Script and Source objects to the DIM View class objects)
The Column level (SourceField objects to the DIM Column class objects and the DIM
ViewColumn class objects)
These linkages will allow users to traverse through both models regardless of the model they
started from. The metaclient program is used to load the Client Load meta data information
into the CLM.
72
ScriptHasSources
Source
SourceType
INMODRoutine
StartRecordRange
EndRecordRange
RecordFormat
IndicatorBits
ScriptHasTargets
Target
ScriptLoadsDIMViews
ScriptLoadsDIMTables
TargetType
TargetSystemName
TargetDatabaseName
TargetLevelDDLUsed
TargetLevelDMLUsed
NbrRecsSentToTD
NbrRecordsRead
NbrRecordsDeleted
NbrRecordsInserted
NbrRecordsSkipped
NbrRecordsUpdated
NbrErrorsTbl1
NbrErrorsTbl2
SourceLoadsDIMTables
Table
SourceUpdatesDIMViews
View
Database
Information
Model
SourceHasSourceFields
ScriptField
DataType
DataLenght
RecLayoutName
Column
SourceFieldUpdatesDIMColumns
SourceFieldUpdatesDIMViewColumns
ViewColumn
3047A013
Description
Script
Source
SourceField
Target
The names of all objects in the CLM classes are limited to 255 characters.
73
Property Name
Description
Property ID
Type
VersionId
Short
ScriptQualifier
String
255
OutputFileName
String
255
LoadUtility
String
30
SessCharSet
String
30
ScriptLevelDDLUsed
String
255
ProcessorTime
String
25
HighestReturnCode
Short
CompletionStatus
String
10
StartTime
10
String
StartDate
11
Date
EndTime
12
String
EndDate
13
Date
74
Size
Property Name
Description
Property ID
Type
Size
SourceType
String
30
INMODRoutine
String
255
StartRecordRange
Integer
EndRecordRange
Integer
RecordFormat
String
11
IndicatorBits
String
Property Name
Description
Property ID
Type
Size
DataType
String
15
DataLength
Short
RecLayoutName
String
30
Property Name
Description
Property ID
Type
Size
TargetType
String
30
TargetSystemName
String
256
TargetDatabaseName
String
128
TargetLevelDDLUsed
String
255
TargetLevelDMLUsed
String
255
NbrRecordsRead
Integer
NbrRecsSentToTD
Integer
NbrRecordsDeleted
Integer
NbrRecordsInserted
Integer
NbrRecordsSkipped
10
Integer
NbrRecordsUpdated
11
Integer
75
Property Name
Description
Property ID
Type
NbrErrorsTbl1
12
Integer
NbrErrorsTbl2
13
Integer
Size
Relationship Name
Description
ScriptHasSources
ScriptLoadsDIMTables
ScriptLoadsDIMViews
ScriptHasTargets
SourceHasSourceFields
SourceUpdatesDIMTables
SourceUpdatesDIMViews
SourceFieldUpdatesDIMColumns
76
instructions for using XML Bridge in Appendix D of the Teradata Meta Data Services
Administrator Guide.
The layout of the MDS CWM metamodel is shown in Figure 15. The metamodel supports
OMG CWM Core, Relational, Keys & Indexes, OLAP, and Transformation packages.
Figure 15: CWM_Metamodel layout
CWMRDB_SQLSimpleType
CWMRDB_Catalog
CWMTFM_TransformationTask
CWM_Model
CWMRDB_SQLDistinctType
CWMRDB_Schema
CWMRDB_View
CWMRDB_Table
CWM_Description
CWMRDB_Column
CWMRDB_UniqueConstraint
CWMRDB_PrimaryKey
CWMOLAP_Schema
CWMOLAP_Cube
CWMOLAP_Measure
CWMOLAP_CubeRegion
CWMOLAP_CubeDimensionAssociation
CWM_DataType
CWM_Package
CWMTFM_Transformation
CWMTFM_DataObjectSet
CWM_Association
CWM_AssociationEnd
CWM_Multiplicity
CWMOLAP_Dimension
CWM_Class
CWMOLAP_Level
CWM_Attribute
CWM_StructuralFeature
CWMOLAP_Hierarchy
CWM_TaggedValue
CWM_KeyRelationship
CWMOLAP_HierarchyLevelAssociation
CWMRDB_ForeignKey
CWMTFM_TransformationMap
CWMRDB_SQLIndex
CWMTFM_ClassifierMap
CWMRDB_SQLIndexColumn
CWMTFM_FeatureMap
CWMRDB_Trigger
CWMTFM_ClassifierMapSource
CWMRDB_Procedure
CWMTFM_ClassifierMapTarget
CWMRDB_SQLParameter
3118A002
For more information about CWM_Metamodel classes, see the Teradata Meta Data Services
Administrator Guide.
For a complete list of all CWM_Metamodel classes and their properties, see the metamodel as
defined in the XML file, or as viewed in MetaBrowse.
77
78
CHAPTER 3
This chapter gives information about how the MDS APIs work:
Common Properties
Data Versioning
Transactions
Locking
Delete Propagation
Security
Repository Root
Labels
Multithreaded Applications
Common Properties
Metadata in the MDS repository is represented as objects. Every object stored in the MDS
repository has a set of common properties. These properties are described in the following
subsection.
Note: Object API calls return all common properties for an object as described in the
following subsections. ObjectKey API calls, however, return a small subset of those properties,
such as object name and ID. When fewer details are required, ObjectKey calls are more
efficient, resulting in better performance. See Chapter 10 ObjectKey Classes on page 237.
User-defined property filters allow for greater flexibility when standard Object API calls
return too much information and the ObjectKey calls return too little. See Chapter
8 CMetaFilterInfo Class on page 219.
Object Name
Objects can be given names, but a name is not required. Names are limited to 255 characters.
If the unique option on the class description is specified, unique names will be maintained
within a class.
If the unique option on the relationship description is specified, MDS will maintain unique
names in the relationship collections.
Objects can be retrieved by specifying the class identifier and name of the object.
79
Description
Each object has a description property. Descriptions are limited to 1024 characters.
The description provides information about the meta data and how it is used. It is
recommended that the description property be set when creating an object. The designer of a
class can define it as requiring a description for all objects in the class.
Object ID
Each object (instance of a class) is given a unique internal identifier by MDS. When data
versioning is enabled for a class, each version of an object in the class will have a separate,
unique internal identifier. This ID is a long integer and is often abbreviated as a LOID. An
object or a specific version of an object can be retrieved by specifying the LOID associated
with the object or version.
Object IDs are 32-bit 2's-complement signed integers in Teradata, which means their range is
-(2^31) ... (2^31 - 1). The order in which object IDs are used is:
1, 2, 3, ... 2,147,483,647, -2,147,483,648, ..., -3, -2, -1
When you get to -1, you run out of object IDs and MDS returns the
META_E_NO_UNUSED_LOIDS (0x80007018) error code if someone attempts to write a
new object. There are 4,294,967,295 (4.3 billion) legal object IDs and 0, the null object ID.
To update an existing object, the Object ID of a version of the object must be specified.
Object GUID
Each object (instance of a class) is also given a globally unique identifier (GUID). Unlike the
Object ID, the GUID can be specified for an object when first created. If an object is not
assigned a globally unique identifier at creation time, MDS will generate one for the
object.When data versioning is enabled for a class, each version of an object in the class will
have the same GUID.
A GUID is a Microsoft globally unique identifier and is a Microsoft implementation of the
DCE UUID. All GUID values should be computer-generated to guarantee uniqueness.
Microsoft provides function calls to create a GUID. (Executing the utility Guidgen.exe on
Windows is one means to create GUIDs.)
An object can be retrieved by specifying the GUID of the object.
Version Number
Each object can have one or more versions, with the version numbers starting at 1. Version
numbers are assigned by MDS. The version number is a read-only property that cannot be set
by an application. In a non-versioned repository, the version number is always set to 1.
Owner ID
The MDS user who creates an object is by default the owner of an object, although the creator
can specify another user as owner. An object can only have one owner.
80
The Owner ID is used to specify the owner of a new object or to search or sort by owner. For
more information on users, see Security.
Security Profile ID
MDS maintains the ID of the security profile assigned to the object. For more information on
security profiles, see Security.
CreateDate/Time, UpdateDate/Time
For each object, MDS maintains the date and time the object was created and last updated.
These are read only properties and cannot be set by an application.
PublishState
For each version of an object, MDS maintains a state indicating the version's visibility. The
highest numbered version of an object will have a publish state of current; all other versions
are considered non-current or inactive. This is a read-only property that cannot be set by an
application.
IsFrozen
For each version of an object, MDS maintains a flag indicating the version's changeability.
Frozen versions may not be modified; unfrozen versions may be modified. Currently, only the
highest numbered version of an object is unfrozen and modifiable. This is a read-only
property and cannot be set by an application.
BaseVersionLoid
BaseVersionLoid is an internal property visible only to MDS. An application cannot read or
set the values.
PredecessorVersionLoid
PredecessorVersionLoid is an internal property visible only to MDS. An application cannot
read or set the values.
Property Name
Relative Property ID
CMetaProperty function
PROPNAME_NAME
PID_CMN_NAME
SetString()
PROPNAME_DESCRIPTION
PID_CMN_DESCRIPTION
SetString()
PROPNAME_LOID
PID_CMN_LOID
SetLong()
81
Property Name
Relative Property ID
CMetaProperty function
PROPNAME_GOID
PID_CMN_GOID
SetBinary()
PROPNAME_OWNERID
PID_CMN_OWNERID
SetLong()
PROPNAME_CREATEDATE
PID_CMN_CREATEDATE
PROPNAME_CREATETIME
PID_CMN_CREATETIME
PROPNAME_UPDATEDATE
PID_CMN_UPDATEDATE
PROPNAME_UPDATETIME
PID_CMN_UPDATETIME
PROPNAME_SECPROFID
PID_CMN_SECPROFID
SetLong()
PROPNAME_PUBLISHSTATE
PID_CMN_PUBLISHSTATE
GetShort()
PROPNAME_VERSIONNUMBER
PID_CMN_VERSIONNUMBER
GetLong()
PROPNAME_ISFROZEN
PID_CMN_ISFROZEN
GetShort()
Data Versioning
MDS supports the ability to retain historical copies of data objects within classes. The
historical copies provide the ability to see the progression of changes made to an object after
its initial creation. An application will only be allowed to modify the latest version of an
object, but the earlier versions will be viewable, within the restrictions of the applicable
security profile.
Versioning only applies to data objects within classes. Versioning cannot be used with the
definitions of metamodels, classes, relationships, properties, users, security profiles, and
application groups. Classes with LOIDs below 1000 do not support data versioning.
copy knows that it is always seeing the latest values for an object's properties if it only knows
the object ID returned by the first ReadObject for the object.
No changes to the application should be necessary for it to function correctly in a data
versioning environment; consequently, the application should always be assured of working
with the latest, current property values of an object without needing to know the object ID of
the object's latest version. The object ID created when the object was created should be
sufficient throughout the life of the application to get the latest property values via
ReadObject and to update the latest property values via WriteObject. When data versioning is
active, there is no guarantee that the object ID returned by ReadObject is still the object ID of
the latest version. In between calling ReadObject and WriteObject, another application could
have changed the object's values and created a new version. Consequently, to stipulate that an
application always know the identity of the latest version of an object is unrealistic and
unenforceable, thus all APIs that work with the current property values must always disregard
the version represented by the object's internal object ID and instead determine the correct
object ID.
Reading Versions
ReadObject() will always return the property values for the current version of an object. If an
application needs to see a previous version of an object, it should call GetVersionKeys to get
the object IDs for the object's versions, and then call ReadVersion() for the specific version.
Deleting Objects
Deleting an object via Delete() will delete all versions of an object. This will enable an
application to immediately create a new object with the same name, which matches the
functionality for a class that does not support data versioning.
Deleting Versions
Specific versions of an object may be deleted by calling DeleteVersion() or
DeleteVersionRange(). Any version of an object can be deleted via those two interfaces. If the
current version of an object is deleted, the previous version becomes the current version. If an
object has only one version, deleting that version is the same as deleting the object, i.e. the
object no longer exists.
83
Collections
When a new version of an object is created, MDS automatically gives the new version the same
collection states as the previous version. This is consistent with previous functionality, in that
changing the property values via WriteObject() did not affect the object's inclusion in
collections. Because the new version is now the current version of the object, changes to the
collections of the object will only be reflected in the new version. The previous versions'
collections will be frozen to retain their correct historical information.
With source collections, the source objects will have their appropriate collections modified so
that the current version of the source object will point to the new version of the current object.
For instance, if an application modifies an object in the DIM Table class, the DIM Database
object which includes the table object in its DatabaseHasTables collection will now have the
new version of the Table object as a destination object. When the application requests the
destination objects satisfying the database's DatabaseHasTables relationships, it will be
returned the new version of the Table object.
With destination collections, the new object version will have the same destination objects as
the previous version. Thus, after the new version is created, a GetDestCollection will return
the same values as before the version was created. Changing the Description property of a
DIM Table object will create a new version of the object, but it will not change what columns,
indices, etc. the table references, which is the expected functionality.
Data versioning for a new model is determined by the state of versioning set in metaroot. Data
versioning for a new class is determined from the state of versioning for the model that created
the class.
An application can modify the data versioning state for a model by calling
CMetaAIM::SetModelVersioningFlag. The application can only enable versioning for a model
if data versioning is enabled at the repository level.
An application can modify the data versioning state for a class by calling
CMetaClassDesc::SetClassDescVersioningFlag. The application can only enable versioning for
a class if data versioning is enabled at the repository level.
84
CMetaObject::Delete is called
85
The object has defined business definitions when one or more of the following is true:
Rather than deleting the object from the repository, the object will remain in the repository,
but the PublishState will be changed to signify a dormant object. At that point, the object will
only be visible to selected APIs called by MDS Administrator users; normal non-privileged
users will never see the dormant objects.
Unlike WriteObject and WriteVersion, ReactivateDIMObject does not modify the object in
the repository with the calling object's properties; it only changes the PublishState of the
object.
Transactions
MDS supports two types of one-phase commit transactions: implicit and explicit.
Implicit transactions are automatically provided at the MDS API level without any special
action by the user. These ensure that the data in the MDS repository remains consistent at
an MDS object and relationship level. They are required because many MDS APIs must
perform multiple SQL commands, all of which must succeed or fail together to maintain
repository consistency.
Explicit transactions are under the express control of the user application and can be used
to group multiple MDS API calls into a single all-or-nothing transaction.
Both types of transactions will be implemented using the ANSI Teradata ODBC session mode
and ODBCs manual commit transaction interface. Using the ANSI session mode instead of
Teradatas native mode will allow MDSs transaction to be more easily ported to other ANSIand ODBC-compliant platforms. To facilitate this, MDS will avoid sending Teradata-specific
transaction management SQL commands directly to Teradata, and will instead use the ODBC
transaction APIs to manage transactions.
86
Implicit Transactions
Implicit transactions are MDS API-level transactions which automatically occur without any
special action from the user. If the user has not initiated an explicit MDS transaction, then
each MDS API call is automatically performed as a separate implicit transaction. The implicit
transaction brackets all database activity occurring within the MDS API call, guaranteeing the
ACID properties.
These transactions ensure that the MDS repository data remains consistent at the MDS object
level, i.e., that the structure of all MDS repository objects and the relationships between them
remain intact. Implicit transactions are needed because in the database, MDS objects are
decomposed into relational table entries, and the data comprising a single object will in
general be stored in multiple rows distributed among multiple tables. Without implicit
transactions, it would be possible for several MDS users to read and write parts of a single
MDS object in an interleaved fashion, resulting in inconsistent data returned and/or persisted
in the repository, or for a crash during an MDS APIs execution to leave the repository in an
inconsistent state.
Because the structural preservation of MDS repository objects fundamentally depends on the
existence of implicit MDS API-level transactions, there is no way for the user to disable them.
Database changes made during an MDS API call will only be committed if the entire API
completes execution without errors. Otherwise the changes will be rolled back to the state
prior to the API call.
Explicit Transactions
Explicit transactions are user-controlled MDS transactions that can be used to bracket
changes requiring multiple MDS API calls. An MDS user application starts an explicit
transaction by calling the CMetaRepository::BeginTransaction API and ends it by explicitly
calling either the CMetaRepository::Commit or the CMetaRepository::Rollback API. Until the
user expressly closes an explicit MDS transaction, the transaction remains open. Only one
explicit transaction can be active at a time.
Explicit transactions may be pseudo nested by calling CMetaRepository::BeginTransaction
multiple times before calling CMetaRepository::Commit or CMetaRepository::Rollback.
If this is done, each instance of CMetaRepository::BeginTransaction must be paired with a
matching subsequent call to CMetaRepository::Commit in order to finally close the
transaction and commit the changes.
Following is an example of an explicit MDS transaction management syntax. It shows a legal
call sequence for an MDS explicit transaction.
CMetaRepository::BeginTransaction
CMetaRepository::BeginTransaction
CMetaObject::ReadObject
CMetaObject::ReadObject
CMetaObject::WriteObject
CMetaRepository::Commit
CMetaRepository::BeginTransaction
87
This enables greater flexibility for the application that is using MDS transactions, but it does
not provide true nested transactions. The term pseudo nesting will be used throughout this
document to refer to this kind of nesting.
The entire transaction from the first CMetaRepository::BeginTransaction to the final
CMetaRepository::Commit is in reality a single flat transaction. This is because MDS uses
standard ANSI transaction management, which does not include nested transactions.
Therefore, the syntactically nested subtransactions are not independent transactions of their
own, and their calls to CMetaRepository::Commit do not actually commit work to the
database but instead merely close the current pseudo nesting level.
The reason pseudo nesting is allowed is that the added flexibility it provides can simplify the
coding of applications that use MDS explicit transactions. For instance, suppose an
application has two methods, A() and B(), that use MDS explicit transactions. An example is
shown below of how pseudo nesting can simplify MDS explicit transaction coding.
A()
{
CMetaRepository::BeginTransaction
Because MDS allows pseudo nested transactions, this works correctly. If MDS did not allow
this, however, the above example code would break when B() called A(), because A() attempts
to open a transaction after B() has already opened one. Without the ability to pseudo nest
transactions, in such a situation the application programmer would need to add data
members and conditional code to keep track of whether or not A() should attempt to open a
transaction depending on whether or not one of its ancestors had already done so.
Closing Explicit Transactions
The user must always specifically close an explicit MDS transaction. After an explicit
transaction is closed, either all of the work it performed will have been successfully committed
to the database, or none of it will have. (See Behavior of Transactions Containing DDL
Statements for the only exception transactions containing multiple DDL statements.)
While ANSIs definition of commit allows individual SQL statements that succeeded to
commit while other SQL statements that failed to roll back, MDS must disallow this
88
An explicit transaction can only be committed if no errors occurred anywhere within the
entire transaction and the user never called CMetaRepository::Rollback within the
transaction. To commit the transaction, the user application must call
CMetaRepository::Commit enough times to close all open pseudo nesting levels. At the time
the final CMetaRepository::Commit is issued, the transaction will be committed to the
repository if and only if there have been no errors, and MDS will return the success code
S_OK. If any errors were detected, the entire explicit transaction will be rolled back, and MDS
will return the error code META_E_TX_ROLLED_BACK.
User-Initiated Transaction Rollback
The user application may force the termination and rollback of an open explicit transaction at
any time by calling the MDS CMetaRepository::Rollback API once. When this API is called,
MDS will abort and roll back the entire explicit transaction, regardless of the current nesting
level. The user application must be aware that calling CMetaRepository::Rollback terminates
all open nesting levels of the explicit transaction, ending the transaction entirely. This is
different from CMetaRepository::Commit, which only closes a single nesting level. MDS
therefore treats further MDS API calls as either new implicit transactions if
CMetaRepository::BeginTransaction is not called again, or as part of a new explicit
transaction if it is.
Transaction Rollbacks Due to Errors
If an error occurs anywhere within an explicit MDS transaction, the entire transaction will be
aborted and rolled back, and MDS will return error codes from the current and all subsequent
MDS API calls within that transaction.
However, because the user by definition always has control over explicit transactions, the user
must explicitly close the transaction before MDS will consider the transaction closed. In this
way, both the user and MDS are in agreement as to the boundaries of the explicit transaction.
As an optimization, MDS will not actually perform any additional work in an explicit
transaction once it has detected an error, because the entire transaction must be aborted and
rolled back. However, until the user application closes the transaction, MDS will continue to
treat MDS API calls as part of the currently open (failed) explicit transaction.
89
If the user application checks the MDS return code and sees that MDS has returned an error
code, it can call CMetaRepository::Rollback to close the entire explicit transaction
immediately, regardless of the current pseudo nesting level.
However, if the user application does not check the error code returned by MDS, it will not
realize the transaction must ultimately be rolled back and could continue issuing MDS API
calls that are all part of the original explicit transaction, including pseudo nested
CMetaRepository::BeginTransaction and CMetaRepository::Commit calls.
In this case, MDS will simply return error codes for all MDS APIs the user calls, rather than
actually performing the work, until the user closes the explicit transaction, at which point
MDS will return the META_E_TX_ROLLED_BACK error code. The following shows an
example of a rollback of an explicit transaction due to an error.
CMetaRepository::BeginTransaction
CMetaRepository::BeginTransaction
Assume that MDS API call 3 generates an error. At this point, MDS aborts the entire explicit
transaction, rolls back the work performed thus far (MDS API calls 1-2 and potentially parts
of call 3 if they have been executed), and returns an error code for MDS API call 3.
Remember, because ANSI transactions do not provide true transaction nesting, the call to
CMetaRepository::Commit after MDS API call 2 does not actually commit the work of MDS
API calls 1-2 to the database.
The next API call MDS receives is MDS API call 4, indicating that the user application is
continuing work within the currently open (ultimately doomed) explicit transaction. Because
the fate of this entire explicit transaction is to be rolled back, MDS will not attempt to perform
any more work as part of this transaction. Instead, it will immediately return an error code
from MDS API call 4. The user application continues processing, calling
CMetaRepository::Commit, MDS API call 5, and CMetaRepository::Commit again.
In response to each of these calls, MDS will return an error code instead of performing the
work. The final call to CMetaRepository::Commit closes the transaction, and MDS will return
the error code META_E_TX_ROLLED_BACK. The end result is that the entire transaction
failed, and no part of the work it performed was committed to the database. Subsequent MDS
API calls will initiate implicit transactions on an API level if the user application does not
begin another explicit transaction, or will begin a new explicit transaction if the user calls
CMetaRepository::BeginTransaction again.
90
The reason MDS requires the user application to expressly close all explicit transactions, even
those in which an error occurs, is to preserve the guarantee that everything between the users
initial call to CMetaRepository::BeginTransaction and the final closing of the transaction via
either CMetaRepository::Rollback or CMetaRepository::Commit must succeed or fail as a unit
regardless of the behavior of the user application. The user will thus be able to view MDSs
internal transaction management as a black box and not be required to exhibit any special
behavior to make it work. Specifically, the user application should not be required to check
error codes returned by MDS APIs in the middle of an explicit transaction and detect that
MDS wants to end the transaction early because an error occurred. Therefore, MDS will not
close the transaction when it detects an error, but will wait for the user application to close the
transaction explicitly.
To understand what would happen if MDS implicitly aborted the transaction when an error
occurred without the user application explicitly closing it, look at the previous example of a
rollback of an explicit transaction due to an error.
In that case, when MDS API call 3 generated an error, MDS would terminate the transaction,
roll back the work of MDS API calls 1-3, and assume the user application realized the
transaction had been aborted.
However, in fact the user application may not have checked the return code and so might not
realize this. Believing the original explicit transaction was still open, the user application
would proceed with MDS API call 4, which would in fact commit that APIs changes to the
database via an implicit MDS transaction. The user application would follow this with
CMetaRepository::Commit, generating another MDS error (because there is no open explicit
transaction as far as MDS is concerned); MDS API call 5, which would again commit work to
the database as an implicit MDS transaction; and a final CMetaRepository::Commit,
generating another MDS error.
At this point, work from MDS API calls 1-3 has been rolled back, but work from MDS API
calls 4-5 has been committed to the database, violating the guarantee that work bracketed
within an explicit transaction is either all committed or all rolled back. This is why MDS only
closes an explicit transaction if instructed to do so by the user application.
Rollbacks on Application Termination, Server Crashes, Network Outages
If the user application terminates while an explicit transaction it has initiated is still open, the
transaction will be rolled back. An open explicit transaction will also be rolled back if the
Teradata Database Systems crashes or is reset, if the ODBC connection between the
MetaManager and Teradata is lost, or if the MDS Manager crashes.
Behavior of Transactions Containing DDL Statements
The Teradata Database Systems places a restriction on data definition language (DDL) calls
within transactions (e.g., the SQL commands CREATE, REPLACE, DROP, and ALTER). At
most one DDL statement may occur in a transaction, and it must be the last statement in that
transaction. Several MDS APIs may execute DDL statements:
CMetaAIM::CreateMDSClassDesc
CMetaClassDesc::CreateMDSPropertyDesc
91
CMetaObject::RemoveFromDestCollection, CMetaObject::RemoveFromOrigCollection
if the relationship instance removed is of the ClassHasProperties type
(RELLOID_ClassHasProperties or RELGUID_ClassHasProperties)
In the case of CMetaObject::Delete, the API may need to execute multiple DDL statements,
e.g., to remove columns or tables when deletion propagates to multiple class or property
description objects.
In order to accommodate Teradatas restriction on DDL in transactions, both implicit and
explicit MDS transactions will postpone executing their DDL statements until the end of the
transaction. The CMetaStorage class will log specifications of postponed DDL statements
associated with a transaction as rows in a table named metaddl.
When a transaction is ready to commit (either because the user issues the final
CMetaRepository::Commit of an explicit transaction, or the end of an implicit transaction is
reached), CMetaStorage will check the metaddl table for any DDL statements associated with
the transaction which must be executed. If there are any, it will execute the first DDL as the last
statement of the transaction and then attempt the commit.
If the transaction could not be committed (e.g., an error occurred during it), it will be rolled
back, and any other DDLs that were associated with that transaction will not be attempted. All
DDL specification rows in metaddl that were associated with that transaction will be removed
as a side effect of the rollback, because they were inserted into that table in the same
transaction. At this point, the repository is in a consistent state, as no part of the original
transaction, including any of its DDLs, was persisted in the database. MDS will return the
error code META_E_TX_ROLLED_BACK.
If the transaction committed successfully and additional DDLs are associated with it,
CMetaStorage will attempt all of these DDLs, even if some of them produce errors. If they all
succeed, MDS will return the success code S_OK. In this case, the repository is consistent, as
both the transaction and all of its associated DDLs were persisted. If any of the additional
DDLs fail, MDS will return the META_E_TX_COMMITTED_WITH_INCOMPLETE_DDL
error code specifying that the original transaction committed but some of its associated DDLs
failed. This is the only case where the repository will be left in an inconsistent state. The user
can call the CMetaRepository::RetryDDL API to clean up by retrying the failed DDLs.
The reason MDS will attempt all the associated DDLs for a committed transaction even after
some of them produce errors is to complete as many of the DDLs associated with the
transaction as possible because that transaction did commit. Because Teradata allows only one
DDL in a transaction, it is impossible to guarantee all-or-nothing behavior of the original
transaction plus all of its DDLs if there are multiple DDLs.
Because MDS postpones DDL execution to the end of each transaction, it is possible for the
user to create an entire AIM within an explicit transaction and be guaranteed that everything
either succeeds or fails as a unit except the DDL statements. In the case of AIM creation, the
92
DDL statements creates tables and columns for the unique properties of classes, so if
processing fails during the DDLs, the only cleanup necessary is to create the missing tables and
columns. Note that the user must close such a transaction before attempting to add data to
any new classes created or any classes to which they have added new properties, as the tables
and columns designated to contain that data will not exist until the DDL that creates them is
executed.
Locking
A locking protocol is necessary to guarantee the standard ACID properties of transactions
(atomicity, consistency, isolation, and durability) when multiple concurrent transactions are
being processed against the MDS repository (e.g., when there are multiple active MDS
application processes). The Teradata Database System automatically handles all issues related
to locking for transaction management, including read locking, write locking, prioritizing,
and queuing lock requests, upgrading locks, and releasing locks.
Teradata also automatically detects and resolves deadlocks at the database level. Each MDS
application processes only one transaction at a time, so there is no possibility of a local
deadlock inside an MDS process.
MDS does not allow users to read repository information that is write locked by another
transaction as doing so could return inconsistent data.
Delete Propagation
Delete propagation means recursively deleting any child (destination) object that was
contained by a parent (origin) object that itself is being deleted if no other object contains
the child. This functionality is useful in containment situations where deletion of a parent
object implies that certain of its contained child objects no longer exist.
For example, if the MDS repository holds an object t representing a database table, an object r
representing one of its rows, and a contains relationship relating these as table t contains row
r, if t is deleted, r should also be deleted automatically through delete propagation if t was the
only object that contained r.
Delete propagation is turned on and off at the relationship description level. Each relationship
description object has a PropagateDeleteFlag which, if set on, will cause deletions involving
that relationship to be propagated.
The delete propagation MDS provides implements a semantics of containment. Enabling
delete propagation for a given relationship is equivalent to marking it as a containment
relationship. Doing this reduces the status of the destination objects of this relationship type:
it indicates that they are subordinate objects that depend for their existence on being
contained by at least one superordinate object via a relationship that has delete propagation
enabled.
93
A containment relationship means a relationship type that has its delete propagation flag
turned on, and if object A is said to contain object B, it means that A is the origin object and B
is the destination object of a containment relationship that links them as shown in Figure 16.
In the following example, Object A is said to contain Object B, because A points to B with a
relationship whose PropagateDeleteFlag is set.
Figure 16: Delete Propagation Example 1
object A
containment_relationship
object B
(PropagateDeleteFlag is set)
3047A029
An object will be deleted via delete propagation if it was previously contained and the last
object that contained it gets deleted. That is, if an origin object of a given destination object is
deleted and it points to the destination object with one or more relationship types for which
delete propagation is enabled, the destination object will also be deleted if there are no other
origin objects pointing to it with any relationship types for which delete propagation is
enabled.
Deleting an object is affected by delete propagation as follows: when an object in the MDS
repository is deleted, all relationship instances of which it is the origin or destination will also
be deleted (regardless of whether their delete propagation flags are set). For each such
relationship in which the deleted object was the origin of a containment relationship, MDS
will check the destination object. If the destination object is not contained by any other object
(i.e., the destination object is not pointed to by any other relationships that had delete
propagation enabled), MDS will recursively delete that destination object.
Because delete propagation is a recursive process, deletions may propagate through many
layers of relationships and objects when the user deletes a single object. This has two
important implications:
1
Delete propagation can be dangerous. Large portions of the network of objects in the
repository can potentially be deleted when the user explicitly deletes a single object.
For these reasons, and especially the first one, delete propagation should only be turned on for
a containment relationship type for which the user is absolutely certain that deleting an origin
object always means its contained objects should be deleted if they are not contained by any
other origin objects. The fact that a contained object participates in other non-containment
relationships will not prevent it from being deleted by delete propagation if its last containing
parent is deleted.
Delete propagation functionality is provided expressly for containment situations where
deletion of a parent may imply deletion of a child. This is why it will delete an object even if
the object is involved in other non-containment relationships.
For example, if tables contain rows and a table is deleted, a contained row should also be
deleted even if it has another relationship such as row r was_inserted_on date d, where r is
94
the row object and d is an object specifying the rows insertion date. In the example below, the
left side is before deleting table t, and the right is after deleting table t. Because
table_contains_row has its PropagateDeleteFlag on, it is a containment relationship, so delete
propagation also deletes row r. Because was_inserted_on has its PropagateDeleteFlag off, it is
not a containment relationship, so deletion will not propagate to the date d object.
Figure 17: Delete Propagation Example 2
table t
row r
date d
date d
3047A030
A single destination object can be contained by multiple origin objects. The destination object
will only be deleted by delete propagation when its last containing parent is deleted.
For example, assume the repository held a database table object t, a spreadsheet object s, a row
object r, and two containment relationships (relationships with delete propagation enabled):
table_contains_row and spreadsheet_has_row.
If these objects are related by t table_contains_row r and s spreadsheet_contains_row r, the
same row r is contained by both the table and the spreadsheet.
Both table t and spreadsheet s contain row r, so delete propagation will not delete r unless both
s and t are deleted.
As long as either the table or the spreadsheet still exists, the row can continue to exist. If the
user deletes the table, the row will not get deleted via delete propagation because it is still the
destination of another containment relationship, namely s spreadsheet_contains_row r.
95
table t
table_contains_row
s'sheet s
spreadsheet_contains_row
row r
3047A031
Security
Object-level security has to do with who can access an object and what they can do with the
object once they have accessed it.
For example, you might want objects containing sensitive information to be unreadable by
other applications and for objects with less sensitive information to be readable by everyone.
Object-level security allows you to set an objects access permissions by determining:
Authentication is the system identifying a user based on user id and password. MDS will
authenticate users when they attempt to connect to the repository. Only valid users will be
allowed access to the repository.
Owner
The creator of an object is by default the owner of an object, unless he or she specifies the
owner to be another user. An object has one owner.
Only the owner can change the owner of an object. Once ownership has been changed, it can
only be changed back by the new owner.
A user cannot be deleted from MDS if he is an owner of any objects in the repository.
Application Group
The application group is a group of users. Permissions assigned to an application group are
granted to all users in the group. An application group has zero to many users.
96
Application
Group
is a grouping of
Users
3047A032
Access Permissions
An objects access permissions tell us who can do what with it.
The permissions that can be applied to an object are:
Collection - the right to add or remove an object from a collection. The user must have
collection access on the source object, destination object, and the relationship description
object.
Create the right to create objects of the class (only meaningful when applied to a Class
Description Object)
The permissions will be grouped into types to assign to the users and application groups. This
is because some of the permissions are dependent on the user having other permissions.
For example, to update an object, the user requires read access to the object. To delete an
object, the user requires collection privileges to remove the object from existing collections.
The types of access that can be assigned to a user or application group in a security profile are:
Full (Grants Read, Collection, Create, Write and Delete access rights)
Access Type
Description
Read
97
Access Type
Description
Collection
Grants read access to an object and the ability to add or remove the object from a
collection.
Collection permission is needed on an object if it is to be added to a collection.
You would grant collection permission (without update permission) to an object if you
want to make it available to other users to add to existing or new relationships. For
example, collection permission is needed on most objects in the DIM. Metaclient links the
source in the load script to the destination table or view object in the DIM. It also links the
source fields in the load script to the column and view column objects in the DIM. For
metaclient to set up these relationships, the user running metaclient must have collection
permission to all DIM objects that will be linked to the client load objects.
To add or remove an object from a collection, the user must have Collection permissions to
the source, destination and relationship description objects.
To add Column: SSN to the SourceFieldUpdatesDIMColumns
collection of SourceField:ORA_SSN, a user must have collection
privileges on the SSN and ORA_SSN objects and the
SourceFieldUpdatesDIMColumns relationship.
Column: SSN
SourceFieldUpdatesDIMColumns
3047A033
Update
Grants read, update and delete permission to the object and the ability to add or remove
the object from a collection.
Full
Grants read, update and delete permission to the object and the ability to add or remove
the object from a collection. Also when applied to a class description, grants permission to
create objects of the class.
Special Permissions
Table 43: Special Permissions
Access Type
Description
Object Owner
AIM objects
metasu or superuser
98
Super-User Access
The user metasu is the administrative id created by MDS. The user metasu has full access to all
objects in the MDS repository. The password for metasu should be a well kept secret, for use
only by system administrators.
Any user in the repository can be granted superuser status if it is created by calling
CMetaUser::CreateSuperuser. Granting superuser status to a user gives the user full access to
all objects in the MDS repository. For that reason, system administrators should careful about
which users have superuser status, and the passwords for those users should be protected.
Security Profiles
A security profile is a named object containing the permissions for a set of groups and users.
One and only one Security Profile is assigned to each object in the repository. Access to the
object is based on the access type permissions defined in the assigned Security Profile. The ID
of the Security Profile will be stored in a common property of every object.
One Security Profile can be assigned to many objects.
Figure 20 is an example of a Security Profile.
Figure 20: Security Profile Example 1
Security Profile
3047B034
Access to objects in MetaSurf, MetaBrowse or other MDS applications is based on the access
type in the Security Profile associated with the object. If an object is not given public read
access, a user will not be able to see the object unless specifically granted access as a user or as
a member of an application group in the Security Profile for that object.
In the example in Figure 21, Mary, Fred and all users in the Acct and Payroll Application
Groups have read permission to databases A and B. Fred and all the users in the Payroll
Application Group can update objects corresponding to databases A and B.
Lucy and all users in the Application Group Acct have read and write access to databases C and
D. No other users can view these databases.
99
Database
A
Security
Profile
Payroll
Payroll
Acct
User: Lucy Rights: Full
Acct
It is possible for a user can have multiple access rights defined in the profile. In the above
example, user Mary has been granted explicit Read rights. If Mary is also a member of the
Payroll group, she will also have Full rights. The user will be granted the highest level of rights
(in this case, Full rights).
There will be one special term that can be used to define rights in a Security Profile. The term
is Everyone. Everyone specifies permissions for anyone connecting to the MDS repository.
Security on Security Profiles
Access to security profiles will be as follows:
The creator of a security profile can set the owner of the profile
Users that are granted read access in the security profile are given read permission to the
security profile.
Default Profiles
The MDS system will have a configurable default security profile. Initially the profile will be:
User
Access Type
Everyone
Read
100
Preconfigured Profiles
MDSDefaultSecurityProfile
The MDSDefaultSecurityProfile defines the permissions to all objects which are not assigned a
specific security profile. The initial setting will be (Everyone, Read). Only metasu or another
superuser can change the permissions. The profile cannot be deleted.
MDSMetaModelSecurityProfile
Updates and deletes to MDSMetaModel objects are not permitted by any user (including
metasu or other superuser).
The MDSMetaModel security profile determines who can create metamodels, classes and
relationships. A user must have FULL permission in the MDSMetaModelSecurityProfile to
create a model, class, relationship or property.
To view the MDSMetaModel components, a user must have READ permission in the
MDSMetaModelSecurityProfile.
Only metasu or another superuser can change the permissions. The profile cannot be
deleted.
DIMSecurityProfile
The DIMSecurityProfile is assigned to the DIM AIM components. The initial setting will be
(Everyone, Collection). Permissions on DIM components are:
To add a class or relationship to the DIM, a user must have FULL permission in the
MDSMetaModelSecurityProfile and COLLECTION permission in the
DIMSecurityProfile.
To view the DIM AIM components, a user must have READ permission in the
DIMSecurityProfile.
Only metasu or another superuser can change the DIM permissions. The profile cannot be
deleted.
This is not the security profile which will be assigned to DIM class objects. This profile is
only for the DIM AIM objects.
101
Metasu, or any superuser, through the MetaManager, will be able to change the Security
Profile on AIM components. Otherwise updates to AIM objects are not permitted.
The Security Profile assigned to a Class Description determines what users can create
objects of that class type. The user must have FULL permission in the profile.
The Security Profile assigned to each AIM component determines who can read the object.
The user must have READ permission in the profile.
To create a class in a model which is owned by another user, a user must have FULL
permission in the MDSMetaModel security profile and COLLECTION permission in the
models security profile.
To create a relationship in a model which is owned by another user, a user must have FULL
permission in the MDSMetaModel security profile, COLLECTION permission in the
models security profile and COLLECTION permission to the classes which are defined in
the relationship.
To create a property in a class which is owned by another user, a user must have FULL
permission in the MDSMetaModel security profile and COLLECTION permission in the
class security profile.
Only the owner of a class can remove property descriptions in the class.
102
INTEGER
SMALLINT
DECIMAL(n)
FLOAT(n)
CHAR(n)
VARCHAR(n)
BYTE(n)
VARBYTE(n)
DATE
NUMERIC(n)
REAL
DOUBLE PRECISION
BYTEINT TIME(n)
TIMESTAMP(n)
Teradata built in functions can be used to set the value of a property. The supported functions
are shown in Table 44.
Table 44: Supported Teradata Functions to Set the Value of a Property
Teradata Function
CURRENT_DATE
DATE
DATE
CURRENT_TIME
TIME
CURRENT_TIMESTAMP
TIMESTAMP
Repository Root
The engine maintains one object that is the root level object of the repository. The root object
contains the system-wide parameters.
Labels
A label is a name that can be applied to one or more objects in the repository. Using a label, an
application can determine the versions of objects in the repository that existed when the label
was defined.
A label is an object defined by the CMetaLabel class. Using functions in the CMetaLabel class,
a label can be defined to reference one or more objects in the repository. The label can only be
applied to the current version of an object. After a label has been applied to a version of an
object that same label cannot be applied to other versions of the object. After a label has been
applied to objects, new functions in the CMetaObject class can be used to read the object
versions with a specific label. These functions allow an application to specify the name of a
label that is used to filter out object versions not containing the label.
103
Multithreaded Applications
On Windows, you can create an application with multiple threads accessing the MDS APIs.
The MDS objects are thread-safe at the class level but not at the object level. This means that
you can have two separate threads manipulating two different CMetaObject objects, but not
two threads manipulating the same CMetaObject object. If you have multiple threads
manipulating the same object, you must protect the access with Win32 synchronization
mechanisms.
Each thread must call the Initialize or SignOn function. Only the users who have Initialized or
Signed On in the thread will have permission to objects in the thread.
Each thread will have a separate ODBC connection to the Teradata Database Systems. Along
with this, MDS transactions are maintained per thread. Therefore, if your application is using
MDS transactions, you must maintain thread affinity. You cannot issue a BeginTransaction
and WriteObject on one thread and another WriteObject and Commit on another.
104
CHAPTER 4
This chapter describes the settings and information you need when working with the C++
APIs.
Include Files
Localization
Code Generation
Include Files
You must add an include statement to your program to bring in all the necessary include files
for writing an MDS application.
Add the statement to your program to bring in the MDS include files.
#include <metaincludes.h>
All MDS include files are installed in the <MDS Installation directory>/include.
You must have installed the MDS SDK to get all the include files required.
Localization
When an application needs the internationalized functions working under _MBCS or
_UNICODE settings, the application developer must set the locale in the application.
You can set the locale dynamically in your application based on the Windows locale setting as
follows:
//*** Get User Locale Info.
lcid = GetUserDefaultLCID(); // get locale ID here
GetLocaleInfo( lcid, LOCALE_SABBREVLANGNAME, m_lpszLangU, 4);
GetLocaleInfo( lcid, LOCALE_SENGLANGUAGE, m_lpszLangEng, 20);
//setlocale(LC_ALL, "target_language");
setlocale(LC_ALL, m_lpszLangEng);
105
Code Generation
Windows C++ applications (console applications or DLLs) using the MDS APIs must set the
C/C++ Code Generation Category to Use run-time library: Multithreaded DLL. If an
executable is built using the Single-threaded or Multithreaded libraries instead of the
Multithreaded DLL library, an access violation will occur during program termination.
Win32 Release
C/C++ tab
Category: General
Warning level: Level 3
Debug info: none
Optimizations: Maximize Speed
Preprocessor Definitions:
WIN32,NDEBUG,_WINDOWS,_MBCS
Category: C++ Language
Representation method: Best-Case Always *
Enable exception handling: checked
Category: Code Generation
Processor: Blend *
Use run-time library: Multithreaded DLL
Calling convention: __cdecl * (If building a
DLL to be called by a Microsoft Excel macro,
the calling convention must be __stdcall)
Struct member alignment: 8 Bytes *
Category: Customize
Suppress startup banner and information
messages: checked
Category: Optimizations
Optimizations: Maximize Speed
Inline function expansion: Only __inline
Category: Precompiled Headers
Not using precompiled headers: checked
Category: Preprocessor
Preprocessor Definitions:
WIN32,NDEBUG,_WINDOWS,_MBCS
Additional include directories: METAHOME\include
Link tab
Category: Input
Object/library modules: add metadk.lib metaosc.lib
Additional library path: METAHOME\lib
Win32 Debug
C/C++ tab
Category: General
Warning level: Level 3
106
107
108
metadkd.lib
metaoscd.lib
metadkud.lib
metaoscud.lib
metadk.lib
metaosc.lib
metadku.lib
metaoscu.lib
All MDS library files are installed in <MDS Installation directory>/lib. You must have installed
the MDS SDK to get these libraries.
109
110
CHAPTER 5
CMetaRepository Class
This chapter describes the C++ Class CMetaRepository functions used to connect to MDS,
manage transactions, and get object identifiers.
Initialize
BeginTransaction
Commit
Rollback
RetryDDL
GetRepositoryRoot
GetObjectID
GetOdbcHenv
Deinitialize
SignOn
SignOff
IsVersioningEnabled
RetainBusinessObjectsSupported
SetRetainBusinessObjects
GetSystemName
SuperUserLogon
111
Initialize
Purpose
The CMetaRepository class Initialize function creates a connection to the MDS repository
database.
Description
The connection remains until the Deinitialize function is called or the process or thread is
terminated. Applications should always call the Deinitialize function before terminating to
ensure that the database connection is terminated properly.
Note: For multi-threaded application, each thread must call Initialize (or SignOn) and each
thread will have a separate connection to the MDS repository database.
Requirements
Initialize must be called before any other MDS APIs.
Syntax
HRESULT Initialize (LPCTSTR User,
LPCTSTR Password,
HENV henv = SQL_NULL_HENV);
Argument
In/Out
Description
User
In
Password
In
henv
In
(optional)
BeginTransaction
Purpose
The CMetaRepository class BeginTransaction function starts a new explicit transaction and
sets the transaction nesting level counter to one or increments the nesting level counter.
Description
If an explicit transaction is not currently open, the CMetaRepository class BeginTransaction
function starts a new one and sets the transaction nesting level counter to one.
112
BeginTransaction();
Commit
Purpose
Depending upon the status of transactions, the CMetaRepository class Commit function
decrements the transaction nesting level counter, closes an explicit transaction, commits the
transaction to the database or rolls the transaction back and.
Description
If an explicit transaction is currently open, the CMetaRepository class Commit function
decrements the transaction nesting level counter. If the new counter value is zero, the function
closes the explicit transaction.
If there were no errors anywhere in the transaction, the function commits the transaction to
the database and returns a success code. Otherwise, the function rolls the entire explicit
transaction back and returns an error code.
If the user calls the Commit function when there is no explicit transaction open, Commit
returns an error code.
Note: The nested transactions within an explicit transaction are not separate transactions, but
are part of a single flat transaction, so the Commit function does not actually commit any
work to the database until the nesting counter reaches zero, indicating that the entire outer flat
transaction is closed
Syntax
HRESULT
Commit(SERIAL_t *txSerial=NULL);
Argument
In/Out
Description
txSerial
Out
(Optional)
113
Rollback
Purpose
The CMetaRepository class Rollback function resets the transaction nesting level counter to
zero and closes an open explicit transaction.
Description
If an explicit transaction is currently open, the CMetaRepository class Rollback function resets
the transaction nesting level counter to zero and closes the transaction. The entire explicit
transaction is rolled back.
Nested transactions within an explicit transaction are not separate transactions, but are part
of a single flat transaction, so the Rollback function rolls all such nested transactions back.
If the user calls the Rollback function when there is no explicit transaction open, the Rollback
function returns an error code.
Note: The Rollback function closes all nesting levels of the currently open transaction and
terminates the entire transaction, whereas the Commit function closes only the current
nesting level.
Syntax
HRESULT
Rollback();
RetryDDL
Purpose
The CMetaRepository class RetryDDL function retries applying the DDL changes for the
specified transaction number.
Syntax
HRESULT RetryDDL(SERIAL_t txSerial=NULL);
Argument
In/Out
Description
txSerial
In
(Optional)
GetRepositoryRoot
Purpose
The CMetaRepository class GetRepositoryRoot function returns the root repository object.
114
Description
The root repository object allows navigation to the collection of AIM metamodels or to the
top level class in an AIM.
The root repository object contains system-wide parameters.
Syntax
HRESULT
Argument
In/Out
Description
MetaRoot
Out
GetObjectID
Purpose
The CMetaRepository class GetObjectID function returns the internal object ID of the object
specified by global object identifier or class ID and name.
Syntax
HRESULT GetObjectID (const GUID &guid,
LPOBJECTID objid);
HRESULT GetObjectID(const GUID &gClassID,
const LPCTSTR strObjName,
LPOBJECTID objid);
HRESULT GetObjectID(const OBJECTID_t lClassID,
const LPCTSTR strObjName,
LPOBJECTID objid);
HRESULT GetObjectID (const GUID &guid,
LPOBJECTID objid)
const bool ErrIfNotFound);
HRESULT GetObjectID(const GUID &gClassID,
const LPCTSTR strObjName,
LPOBJECTID objid)
const bool ErrIfNotFound);
HRESULT GetObjectID(const OBJECTID_t lClassID,
const LPCTSTR strObjName,
LPOBJECTID objid)
const bool ErrIfNotFound);
Argument
In/Out
Description
guid
In
gClassID
In
lClassID
In
strObjName
In
objid
Out
115
Argument
In/Out
Description
ErrIfNotFound
In
GetOdbcHenv
Purpose
The CMetaRepository class GetOdbcHenv function returns the ODBC HENV pointer created
by Meta Data Services.
Description
ODBC only permits one HENV pointer per process. If a client application is using ODBC
separately from MDS, it can create the HENV pointer and pass it to MDS in the Initialize
function.
If henv is SQL_NULL_HENV on Initialize, MDS will create a HENV pointer. The
CMetaRepository.GetOdbcHenv function can be used to get the HENV pointer created by
MDS.
Syntax
HENV GetOdbcHenv();
Deinitialize
Purpose
The CMetaRepository class Deinitialize function removes the connection to the MDS
Repository database in the process or thread.
Description
Applications should always call the Deinitialize function before terminating to ensure that the
database connection is terminated properly.
Syntax
HRESULT Deinitialize ();
SignOn
Purpose
The CMetaRepository class SignOn function allows multiple users to sign on to MDS. An
MDS username and password are required.
116
Description
SignOn can be called in replace of Initialize. If not previously initialized, SignOn will set up
the connection to the MDS repository database. The connection remains until DeInitialize is
called or the thread or process terminates. Applications should always call the Deinitialize
function before terminating to ensure that the database connection is terminated properly.
For a multi-threaded application, each thread must call Initialize or SignOn and each thread
will have a separate connection to the MDS Repository database.
If SignOn is issued for multiple users, you must set the CallerName in the object before using
a CMetaObject function to indicate which users permission to apply for the function call.
Syntax
HRESULT SignOn(LPCTSTR strUser, LPCTSTR strPassword);
SignOff
Purpose
The CMetaRepository class SignOff function is used to sign off the specified MDS user.
Description
The SignOff of the last user does not remove the connection to the MDS Repository database.
Be sure to call the Deinitialize function before terminating your application to ensure that the
database connection is terminated properly.
Syntax
HRESULT SignOff(LPCTSTR strUser);
IsVersioningEnabled
Purpose
IsVersioningEnabled returns an indication of the current state of data versioning at the
repository level.
Description
If the return value is true, data versioning is allowed in the repository. If the return value is
false, data versioning may not be used in the repository
Syntax
HRESULT IsVersioningEnabled(bool& fVersioning);
Argument
In/Out
Description
fVersioning
Out
117
RetainBusinessObjectsSupported
Purpose
RetainBusinessObjectsSupported returns an indication of the current repository setting for
the support of retaining business objects in a dormant state.
Description
If the return value is true, deleted business objects are retained in a dormant state in the
repository. If the return value is false, dormant objects are not allowed in the repository.
Syntax
HRESULT RetainBusinessObjectsSupported (bool& bDormantObjects);
Argument
In/Out
Description
bDormantObjects
Out
SetRetainBusinessObjects
Purpose
SetRetainBusinessObjects modifies the state of retaining business objects in a dormant state.
Description
If the input value is true, dormant DIM objects will be allowed. If the input value is false,
support of dormant DIM objects will be disabled and any existing dormant objects in the
repository will be removed from the repository.
Syntax
HRESULT SetRetainBusinessObjects(const bool bRetainObjects);
Argument
In/Out
Description
RetainObjects
In
GetSystemName
Purpose
GetSystemName returns the name of the system containing the MDS repository.
Syntax
LPCTSTR GetSystemName();
118
SuperUserLogon
Purpose
SuperUserLogon returns an indication if the user given by strUser is currently logged onto
MDS as a superuser.
Description
If strUser is NULL, the return value indicates if the first user to logon to MDS is a superuser.
If strUser is not NULL then
if the name is found in the list of currently logged on users, that user's superuser status is
returned.
If the name is not found in the list of currently logged on users, a value of false is returned.
Syntax
bool SuperUserlogon(LPCTSTR strUser);
Argument
In/Out
Description
strUser
In
119
120
CHAPTER 6
CMetaPersist Class
This chapter describes the C++ Class CMetaPersist functions that provide the get and set
functions for the common attributes of all objects that are stored in the repository.
CMetaPersist is the abstract base class from which the CMetaObject MDS API class inherits.
The following classes inherit from CMetaObject, therefore, they also support CMetaPersist
functions:
CMetaAIM
CMetaClassDesc
CMetaPropertyDesc
CMetaRelationshipDesc
CMetaUser
CMetaApplicationGroup
CMetaSecurityProfile
Because the CMetaPersist class is an abstract base class, you cannot create CMetaPersist
objects.
Initialize
GetObjectName
SetObjectName
GetDescription
SetDescription
GetObjectGUID
SetObjectGUID
GetObjectID
121
SetObjectID
GetClassGUID
SetClassGUID
GetClassID
SetClassID
GetOwnerID
SetOwnerID
GetCreateTimestamp
GetUpdateTimestamp
GetCallerName
SetCallerName
GetSecurityProfileID
SetSecurityProfileID
GetVersionNumber
GetPublishState
IsPublished
IsFrozen
IsDormant
Initialize
Purpose
The CMetaPersist class Initialize function resets the CMetaPersist attributes to the default
values.
Syntax
void Initialize(void);
GetObjectName
Purpose
The CMetaPersist class GetObjectName retrieves the object name.
Syntax
LPCTSTR GetObjectName(void);
SetObjectName
Purpose
The CMetaPersist class SetObjectName function sets the object name.
122
Syntax
void SetObjectName(LPCTSTR strObjName);
Argument
In/Out
Description
strObjName
In
GetDescription
Purpose
The CMetaPersist class GetDescription function gets the object's description.
Syntax
LPCTSTR GetDescription(void);
SetDescription
Purpose
The CMetaPersist classSetDescription function sets the objects description.
Syntax
void SetDescription(LPCTSTR strDescription);
Argument
In/Out
Description
strDescription
In
GetObjectGUID
Purpose
The CMetaPersist class GetObjectGUID function gets the globally unique ID of the object.
Syntax
const GUID GetObjectGUID(void);
SetObjectGUID
Purpose
The CMetaPersist class SetObjectGUID function sets the globally unique ID of the object.
Description
The ID should be created by a program such as guidgen.exe on WindowsTM. If the object
GUID is not set (equal to NULLGUID) on the WriteObject of a new object to the MDS
repository, MDS generates a GUID for the object.
123
Syntax
void SetObjectGUID(const GUID gOID);
Argument
In/Out
Description
gOID
In
GetObjectID
Purpose
The CMetaPersist class GetObjectID function gets the internal object ID of the object.
Syntax
const OBJECTID_t GetObjectID(void);
SetObjectID
Purpose
The CMetaPersist class SetObjectID function sets the object ID of the CMetaObject.
Requirements
To write a new object to the MDS repository, the object ID must be set to 0 (zero). If the object
ID is not 0 (zero), MDS assumes the WriteObject is an update of the specified object ID.
To read or update an object or a collection of objects, or to add or remove an object from a
collection, the object ID must be a known ID of an existing object.
Syntax
void SetObjectID(const OBJECTID_t lOID);
Argument
In/Out
Description
lOID
In
GetClassGUID
Purpose
The CMetaPersist class GetClassGUID function gets the class ID of the object, which is of type
GUID.
Syntax
const GUID GetClassGUID(void);
124
SetClassGUID
Purpose
The CMetaPersist class SetClassGUID function sets the globally unique class ID in the local
object. This is the Class GUID of the class description object given or created for the class
when the AIM was created.
Set this field when you want to read or write an object in the indicated class.
Syntax
void SetClassGUID(const GUID gCLSID);
Argument
In/Out
Description
gCLSID
In
GetClassID
Purpose
The CMetaPersist class GetClassID function gets the internal class ID of the object.
Syntax
const OBJECTID_t GetClassID(void);
SetClassID
Purpose
The CMetaPersist class SetClassID function sets the internal class ID in the local object.
The internal class ID is the ID of the class description object created for the class when the
AIM was created.
Set this field when you want to read or write an object in the indicated class.
Syntax
void SetClassID(const OBJECTID_t CLSID);
Argument
In/Out
Description
CLSID
In
GetOwnerID
Purpose
The CMetaPersist class GetOwnerID function gets the owner user ID of the object.
125
Syntax
const OBJECTID_t GetOwnerID(void);
SetOwnerID
Purpose
The CMetaPersist class SetOwner sets the owner user ID of the CMetaObject.
Description
If this attribute is not set (or set to 0 (zero)), the owner ID of a new object is set to the user
specified in CMetaRepository::Initialize.
Syntax
void SetOwnerID(const OBJECTID_t
OwnerID);
Argument
In/Out
Description
OwnerID
In
Example:
To get the user ID from the user name, perform the following function call using the
CMetaRepository class:
CMetaRepository repos;
result = repos.GetObjectID(CLSLOID_UserClass,
UserName, &userID);
GetCreateTimestamp
Purpose
The CMetaPersist class GetCreateTimestamp function gets the object creation date and time.
Syntax
HRESULT GetCreateTimestamp(METADATE_STRUCT
*pcreateDate, METATIME_STRUCT *pcreateTime);
Argument
In/Out
Description
pcreateDate
Out
The year, month, day (create date) the object was created.
pcreateTime
Out
GetUpdateTimestamp
Purpose
The CMetaPersist class GetUpdateTimestamp function gets the date and time of the last
update of the object.
126
Syntax
HRESULT GetUpdateTimestamp(METADATE_STRUCT
*pupdateDate, METATIME_STRUCT *ppupdateTime);
Argument
In/Out
Description
pUpdateDate
Out
The year, month, day (update date) the object was last updated
pUpdateTime
Out
The hour, minute, second (update time) the object was last updated
GetCallerName
Purpose
The CMetaPersist class GetCallerName function gets the user name of the caller set in the
object.
Syntax
LPCTSTR GetCallerName(void);
SetCallerName
Purpose
The CMetaPersist class GetCallerName function sets the caller name to the specified user.
Description
Subsequent function calls using this object will be validated using the caller users
permissions.
Syntax
void SetCallerName(LPCTSTR user);
Argument
In/Out
Description
user
In
Name of signed on user to use for function calls from this object.
GetSecurityProfileID
Purpose
The CMetaPersist class GetSecurityProfileID function gets the ID of the security profile of the
object.
Syntax
const OBJECTID_t GetSecurityProfileID (void);
127
SetSecurityProfileID
Purpose
The CMetaPersist class SetSecurityProfileID function sets the ID of the security profile of the
CMetaObject.
Syntax
void SetSecurityProfileID (const OBJECTID_t 1SecurityProfile);
Argument
In/Out
Description
ISecurityProfile
In
GetVersionNumber
Purpose
GetVersionNumber retrieves the version number for the object.
Syntax
VERSIONNUMBER_t GetVersionNumber(void) const;
GetPublishState
Purpose
GetPublishState returns the PublishState common property for an object.
Syntax
META_PUBLISH_STATE GetPublishState(void) const;
IsPublished
The IsPublished function returns true if the version's publish state indicates that it is the
current published version, else it returns false
bool IsPublished(void) const;
IsFrozen
Purpose
IsFrozen indicates if the object version can be modified.
Description
A value of true means the version's properties in the repository can not be changed. A value of
false means the version's properties in the repository can be changed.
Syntax
bool IsFrozen();
128
IsDormant
Purpose
IsDormant indicates if the object version is in a dormant state.
Description
A value of true means the object is dormant and is not normally visible. A value of false
means the object exists and is visible..
Syntax
bool IsDormant();
129
130
CHAPTER 7
CMetaObject Class
This chapter describes the C++ Class CMetaObject functions that create, update, and delete
objects in the MDS repository and that create and update collections of objects. CMetaObject
inherits all the functions of the CMetaPersist class.
CMetaObject Constructors
Initialize
Operator =
Operator ==
Operator <
ReadObject
ReadObjectWithLock
ReadVersion
ReadVersionWithLock
ReadDormantDIMObject
ReadDormantDIMObjectWithLock
GetVersions
GetVersionKeys
GetClassObjects
GetClassObjects
GetClassObjectVersions
GetOrigCollection
GetDestCollection
GetDormantDIMClassObjects
GetDormantDIMClassObjectKeys
GetDormantDIMDestObject
WriteObject
WriteVersion
Delete
DeleteVersion
DeleteVersionRange
ReactivateDIMObject
AddToOrigCollection
AddToDestCollection
AddManyToOrigCollection
AddManyToDestCollection
RemoveFromOrigCollection
RemoveFromDestCollection
RemoveManyFromOrigCollection
RemoveManyFromDestCollection
RemoveAllFromOrigCollection2
RemoveAllFromDestCollection2
ReplaceOrigCollection
131
ReplaceDestCollection
FindLabel
FindAllLabels
FindAllOccurrences
GetPropertyValue
GetClassObjectKeys
GetClassObjectVersionKeys
SetPropertyValue
GetClassObjectsByProperty
GetClassObjectVersionsByProperty
GetClassObjectRange
GetClassObjectVersionsRange
GetOrigCollectionByProperty
GetDestCollectionByProperty
GetOrigCollection3
GetDestCollection3
GetOrigCollectionVersions
GetDestCollectionVersions
GetOrigCollectionVersionKeys
GetDestCollectionVersionKeys
GetOrigCollectionKeys
GetDestCollectionKeys
GetOrigCollectionKeys3
GetDestCollectionKeys3
GetDormantDIMOrigCollection
GetDormantDIMDestCollection
GetDormantDIMOrigCollectionKeys
GetDormantDIMDestCollectionKeys
Dormant Objects
The Retain Associated Business Information feature is implemented by creating dormant
object support for certain types of objects when the objects are deleted. The following routines
work with dormant objects.
ReadDormantDIMObject
ReadDormantDIMObjectWithLock
GetDormantDIMClassObjects
GetDormantDIMClassObjectKeys
GetDormantDIMDestObject
GetDormantDIMDestCollection
GetDormantDIMDestCollectionKeys
GetDormantDIMOrigCollection
GetDormantDIMOrigCollectionKeys
132
The following functions allow for further refinement of the objects returned in the collection
or class. This refinement is based on matching property values in the destination or origin
objects.
GetClassObjectsByProperty
GetClassObjectVersionsByProperty
GetClassObjectRange
GetClassObjectVersionsRange
GetDestCollection3
GetDestCollectionByProperty
GetDestCollectionKeys
GetDestCollectionKeys3
GetDestCollectionVersions
GetDestCollectionVersionKeys
GetOrigCollection3
GetOrigCollectionByProperty
GetOrigCollectionKeys
GetOrigCollectionKeys3
GetOrigCollectionVersions
GetOrigCollectionVersionKeys
GetDormantDIMDestCollection
GetDormantDIMDestCollectionKeys
GetDormantDIMOrigCollection
GetDormantDIMOrigCollectionKeys
Sort List
The sortList can contain zero or more CMetaObjectKey objects. Each CMetaObjectKey
identifies a property by ID or name on which to sort the returned objects. The sort key created
is constructed by concatenating the property values.
The maximum size of the sort key is limited to 4096 bytes. If the sort key is greater than 4096
bytes, the key is truncated and the data may or may not come back in the desired order.
By default, the result values of a character property are sorted in ascending order, using the
collating sequence in effect for the Teradata session.
To enable specifying sort by ascending or descending order, use one of the following two
property values:
PID_SORT_ASCENDING
PID_SORT_DESCENDING
These variables are defined in metaglobals.h. To set the sort order to descending, set a
CMetaObjectKey ObjectID to PID_SORT_DESCENDING and push the object on the sortList
vector. For example:
133
The % and _ characters may be used in any combination in the search string
The % (percent sign) character represents any string of zero or more arbitrary characters.
Any single character is acceptable in the position in which the underscore character
appears, and any string of characters is acceptable as a replacement for the percent.
The backslash character (\) can be used as an escape character to search for the \, % or _
characters ( \\, \%, \_ ) in the name.
Both leading and trailing pad characters in the name field must match exactly with the
search string. For example, A%BC matches AxxBC, but not AxxBD, and A%BD
matches AxxBD, but not AxxBC or AxxBD indicates a pad character).
134
The name in the strObjName parameter is always ANDd to the values in the propFilter
list. A name in the propFilter can be ORd to other values in the propFilter.
The name in the strObjName parameter is always compared using the REGEX comparison
operator. A name in the propFilter can be set to use any of the other comparison
operators.
Column Filter
Some interfaces provide a column filters parameter. This parameter provides an additional
method to restrict the properties returned for an object. This will reduce the amount of data
transmitted from the repository.
The column filters parameter is a vector of type MetaObjectIDVector. Each entry in the vector
provides the relative propertyID for a property in a class. A property ID can be either one of
the unique properties for the class or it can be one of the common properties present in all
CMetaObject objects. The common properties IDs are defined in the C++ include deck
metaglobals.h and range from PID_CMN_NAME to PID_CMN_ISFROZEN.
Due to processing requirements within MDS, the following common properties will always be
fetched from the repository: PID_CMN_NAME, PID_CMN_OWNERID, PID_CMN_LOID,
and PID_CMN_SECURITYPROFID.
If the column filters parameter is an empty vector, all properties for the objects will be
returned by the interface.
If a non-empty column filters parameter is used, the properties not listed in the vector will
have undefined values in the returned objects. The properties not listed will not be set up by
MDS; this applies to both the unique class properties and the common properties.
Inheritance
A class inherits all the relationships of its superclasses. In Figure 23, there is a relationship
called RelAM that has the origin class of ClassA and the destination class of ClassM. Classes
that inherit from ClassA and ClassM also inherit the relationship. ClassB and ClassC objects
can be origin objects in the relationship and ClassN and ClassO objects can be destination
objects.
Figure 23: Class Inheritance and Collections
Relationship: RelAM
Origin Class: ClassA
DestClass: ClassM
ClassA
Collections
A1
ClassM
M1
RelAM
M3
M2
B Inherits
From A
N Inherits
From M
ClassB
A1
N1
ClassN
O1
O Inherits
From N
ClassC
RelAM
N3
N2
A1
C Inherits
From B
RelAM
O3
O2
ClassO
3047C014
135
Figure 23 also shows example collections. In the examples, object A1 has collections with class
M, N, and O objects using the RelAM relationship. The returnClass and allClasses parameters
of GetDestCollection3 determine the class of objects that are returned. To return one specific
class type, set the returnClass to this value. For example to return the collection of ClassN
objects for A1, set the returnClass to the object id of ClassN. To return all destination class
types, set allClasses to true. Getting the destinations objects of A1 in RelAM with allClasses set
to true will return the objects M1,M2,M3,N1,N2,N3,O1,O2, and O3.
CMetaObject Constructors
The first step for users of the CMetaObject class is to instantiate the CMetaObject by calling
one of the constructors for the CMetaObject. The following are the CMetaObject
constructors:
CMetaObject()
This is the default constructor and takes no arguments. It instantiates a CMetaObject with
default values.
CMetaObject(const GUID &gClassID, LPCTSTR strObjName)
This constructor instantiates a CMetaObject with default values and then calls
CMetaPersist::SetClassGUID with gClassID and CMetaPersist::SetObjectName with
strObjName.
CMetaObject(const OBJECTID_t lClassID, LPCTSTR strObjName)
This constructor instantiates a CMetaObject with default values and then calls
CMetaPersist::SetClass with : lClassID and CMetaPersist::SetObjectName with strObjName.
CMetaObject(const OBJECTID_t lOID)
This constructor instantiates a CMetaObject with default values and then calls
CMetaPersist::SetObjectID with lOID.
Initialize
Purpose
Initializes the CMetaObject fields to default values.
Syntax
void Initialize();
136
Operator =
Purpose
The CMetaObject class = operator function copies objectB to objectA.
Syntax
CMetaObject &operator=(const CMetaObject &);
Usage
CMetaObject objectA, objectB;
.
.
.
objectA = objectB;
Operator ==
Purpose
The CMetaObject class == operator function returns 1 if objectA is equal to objectB, 0 if the
objects are not equal.
Syntax
int operator==(const CMetaObject &);
Usage
CMetaObject objectA, objectB;
.
.
.
if (objectA == objectB)
//objects are equal
.
.
.
else
//objects are not equal
.
.
.
137
Operator <
Purpose
The CMetaObject class < operator function returns TRUE if the Object ID of objectA is less
than the Object ID objectB.
Syntax
bool operator<(const CMetaObject &object);
Usage
CMetaObject objectA, objectB;
.
.
.
if (objectA < objectB)
//object identifier A is less than object identifier B
.
.
.
else
//object identifier A is not less than object identifier B
.
.
ReadObject
Purpose
The CMetaObject class ReadObject function reads the current version of an object from the
repository database into the instantiated CMetaObject. This may require waiting for the
release of write locks held by other transactions. MDS does not support reads of write-locked
MDS repository data.
Requirements
The class ID (internal or globally unique) and object name or the object ID (internal or
globally unique) must be set before calling ReadObject. If given, the internal object ID must
be for a version of the object.
Note: The order of evaluation to determine the object to be read is: (1) internal object ID if
not zero; (2) global object ID if not null; (3) internal class ID and name if the internal class ID
is not zero; and (4) global class ID and name.
Syntax
HRESULT ReadObject(void);
138
ReadObjectWithLock
Purpose
ReadObjectWithLock reads in the current version of an object from the repository into the
instantiated CMetaObject. ReadObjectWithLock differs from ReadObject in that it acquires
all database locks necessary to both read and write the object. For a subsequent WriteObject
on this object, this will prevent a deadlock caused by lock upgrades. This function should
always be used within an explicit transaction to retain the locks since locks are maintained
until the transaction commits or rolls back.
Requirements
The class ID (internal or globally unique) and object name or the object ID (internal or
globally unique) must be set before calling ReadObjectWithLock.
Note: The order of evaluation to determine the object to be read is: (1) internal object ID if
not zero; (2) global object ID if not null; (3) internal class ID and name if the internal class ID
is not zero; and (4) global class ID and name
Syntax
HRESULT ReadObjectWithLock();
ReadVersion
Purpose
ReadVersion reads in a specific version of an object from the repository into the instantiated
CMetaObject. This may require waiting for write locks held by other transactions to be
released. MDS does not support reads of write-locked MDS repository data
Requirements
The internal object ID for the desired version must be set before calling ReadVersion.
Syntax
HRESULT ReadVersion(void);
ReadVersionWithLock
Purpose
ReadVersionWithLock reads in a specific version of an object from the repository into the
instantiated CMetaObject. ReadVersionWithLock differs from ReadVersion in that it acquires
all database locks necessary to both read and write the object. For a subsequent WriteVersion
on this object, this will prevent a deadlock caused by lock upgrades. This function should
always be used within an explicit transaction to retain the locks since locks are maintained
until the transaction commits or rolls back.
139
Requirements
The internal object ID for the desired version must be set before calling
ReadVersionWithLock.
Syntax
HRESULT ReadVersionWithLock();
ReadDormantDIMObject
Purpose
ReadDormantDIMObject extends the functionality of ReadObject to support the Retain
Associated Business Information feature. ReadDormantDIMObject returns an object that is
either active or dormant. The requirements for specifying the object to be returned are the
same as for ReadObject.
If the return status is S_OK, the caller should call IsDormant() to determine if the object exists
or is dormant.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
The class ID (internal or globally unique) and object name or the object ID (internal or
globally unique) must be set before calling ReadDormantDIMObject. If given, the internal
object ID must be for a version of the object.
Syntax
HRESULT ReadDormantDIMObject();
ReadDormantDIMObjectWithLock
Purpose
ReadDormantDIMObjectWithLock extends the functionality of ReadObject to support the
Retain Associated Business Information feature. ReadDormantDIMObjectWithLock returns
an object that is either active or dormant. The requirements for specifying the object to be
returned are the same as for ReadObject. ReadDormantDIMObjectWithLock differs from
ReadDormantDIMObject in that it acquires all database locks necessary to both read and
write the object. For a subsequent WriteObject on this object, this prevents a deadlock caused
by lock upgrades. This function should always be used within an explicit transaction to retain
the locks since locks are maintained until the transaction commits or rolls back.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
The class ID (internal or globally unique) and object name or the object ID (internal or
globally unique) must be set before calling ReadDormantDIMObjectWithLock. If given, the
internal object ID must be for a version of the object.
140
Syntax
HRESULT ReadDormantDIMObjectWithLock();
GetVersions
Purpose
The CMetaObject class GetVersions returns the objects for all of the versions of an object for
which the caller has read permission. The objects will be ordered in descending order of the
version number, i.e. the object for the highest-numbered (current) version of the object will
be the first entry in the return list.
Description
The order of evaluation to determine the object to be read is:
1
Requirements
The class ID (internal or globally unique) and object name or the object ID (internal or
globally unique) must be set before calling GetVersion. If given, the internal object ID must be
for a version of the object.
Syntax
HRESULT GetVersions(MetaObjectVector& returnList);
GetVersionKeys
Purpose
The CMetaObject class GetVersionKeys returns the name, loid, and version for all of the
versions of an object for which the caller has read permission. The keys will be ordered in
descending order of the version number, i.e. the key for the highest-numbered (current)
version of the object will be the first entry in the return list.
Description
The order of evaluation to determine the object to be read is:
1
141
Requirements
The class ID (internal or globally unique) and object name or the object ID (internal or
globally unique) must be set before calling GetVersionKeys. If given, the internal object ID
must be for a version of the object.
Syntax
HRESULT GetVersionKeys(vector<CMetaVersionedObjectkey>& returnList);
GetClassObjects
Purpose
The CMetaObject class GetClassObjects function returns current versions of objectList (list of
CMetaObjects) in the specified class.
Description
If strObjName is not specified (NULL), all objects in the class are returned.
If strObjName is specified, only the objects of the specified name in the class are returned.
The name search is not case sensitive.
Specifying an empty string () for strObjName returns objects in the class with no name.
Requirements
The internally unique or globally unique class ID must be specified.
The objects in the list returned by GetClassObjects are in ascending sort order of the object
names. Use GetClassObjectsByProperty to specify properties to sort the list by.
Syntax
HRESULT GetClassObjects(
vector<CMetaObject> &objectList,
const GUID &gClassID,
const OBJECTID_t lClassID = NULLLOID,
LPCTSTR strObjName = NULL);
HRESULT GetClassObjects(
vector<CMetaObject> &objectList,
const GUID &gClassID,
const OBJECTID_t lClassID,
LPCTSTR strObjName,
const bool WithLock);
142
Argument
In/Out
Description
objectList
In/Out
gClassID
In
Argument
In/Out
Description
lClassID
In
(Optional)
strObjName
In
(Optional)
WithLock
In
GetClassObjectVersions
Purpose
GetClassObjectVersions returns all versions of the objects (list of CMetaObjects) in the
specified class.
Description
If strObjName is not specified (NULL), all objects in the class are returned.
If strObjName is specified, only the objects of the specified name in the class are returned.
The name search is not case sensitive.
Specifying an empty string () for strObjName returns objects in the class with no name.
If strLabel is specified, only the versions that also have the label will be returned.
Requirements
The internally unique or globally unique class ID must be specified.
The objects in the list returned by GetClassObjectVersions are in ascending sort order of the
object names, and within each name are sorted in descending order of the version number.
Use GetClassObjectsVersionsByProperty to specify properties to sort the list by.
Syntax
HRESULT GetClassObjectVersions(
vector<CMetaObject> &objectList,
const GUID &gClassID,
const OBJECTID_t lClassID = NULLLOID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false);
Argument
In/Out
Description
objectList
In/Out
143
Argument
In/Out
Description
gClassID
In
lClassID
In
(Optional)
strObjName
In
(Optional)
strLabel
In
WithLock
In
GetOrigCollection
Purpose
The CMetaObject class GetOrigCollection function returns the collection of objects of the
origin class associated with this CMetaObject for the specified relationship.
If a strObjName is not specified (NULL), all objects in the collection are returned.
If a strObjName is specified, only the objects of the specified name in the collection are
returned. The name search is not case sensitive.
Description
Specifying an empty string () for strObjName returns only objects in the collection with no
name.
When the origin class supports versioning, GetOrigCollection will return object versions in
the origin class that have a rigid relationship to the current version of this CMetaObject. The
returned objects are not guaranteed to be the current version of their respective objects, i.e
CMetaPersist::IsPublished() may be true or false for each returned object
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
CMetaObject must be set with the ObjectID of an object in the destination class of the
relationship.
If the origin class of the relationship is a superclass, this function will only return objects in the
origin class. To return objects in the subclasses, use the GetOrigCollection3 function.
Requirements
The internal object id must be set in the object and it must be for a version of the object.
The objects in the list returned by GetOrigCollection are not in any order. Use
GetOrigCollectionByProperty to specify properties to sort the list by.
144
Syntax
HRESULT GetOrigCollection(
vector<CMetaObject> &objectList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL);
HRESULT GetOrigCollection(
vector<CMetaObject> &objectList,
const GUID &gRelID,
const OBJECTID_t lRelID,
LPCTSTR strObjName,
const bool WithLock);
Argument
In/Out
Description
objectList
In/Out
gRelID
In
Relationship GUID.
Can be set to NULLGUID if lRelID is set.
lRelID
In
(Optional)
strObjName
In
(Optional)
WithLock
In
GetDestCollection
Purpose
The CMetaObject class GetDestCollection function returns the collection of objects of the
destination class associated with this CMetaObject for the specified relationship.
Description
If a strObjName in the collection is not specified (NULL), then all objects in the collection are
returned.
If strObjName is specified, only the objects of the specified name in the collection are
returned. The name search is not case sensitive.
Specifying an empty string () for strObjName returns only objects in the collection with no
name.
GetDestCollection only returns the current versions of objects referenced by the current
version of this CMetaObject.
145
146
Argument
In/Out
Description
objectList
In/Out
gRelID
In
Relationship GUID.
Can be set to NULLGUID if lRelID is set.
lRelID
In (Optional)
strObjName
In (Optional)
WithLock
In
GetDormantDIMClassObjects
Purpose
GetDormantDIMClassObjects returns in objectList the list of dormant objects in the specified
class that match selection criteria.
Description
The property id, property value and comparison operator on which to perform the search can
all be specified. If multiple properties are specified in the search, the logical operator between
the property searches must also be specified. The name of the property upon which to sort the
returned list can also be specified.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
The class ID (internal or globally unique) must be set.
The propFilter list may contain zero or more CMetaFilterInfo objects.
The PropertyID (SetPropertyID()) or PropertyName (SetName()) of the value attribute in
each CMetaFilterInfo object must contain a valid Relative Property Id or name of a property
description in the class.
The value attribute in each CMetaFilterInfo object must also be set to the value on which the
search will be made. This value must be of the same type as the property description. For
example, if the search is to be made on Relative Property ID = 1 and Relative Property ID 1 is
defined as an integer, Value must be set to an integer (SetInt()). If relative Property ID 1 is a
string, Value must be set to a string (SetString()).
The default ComparisonOperator in each CMetaFilterInfo object is EQUAL and the default
LogicalOperator is META_AND.
If the propFilter list contains zero objects, the function will perform a search by strObjName
only. If strObjName is also NULL, the API will return all the objects in the collection.
If the propFilter list contains objects and strObjName is set, the logical operator between the
properties and the name will the AND. To perform a search of a name OR a property, set
strObjName to NULL and add a CMetaFilterInfo object to the propFilter list for a name
search.
Syntax
HRESULT GetDormantDIMClassObjects(
vector<CMetaObject>& objectList,
const MetaFilterInfoVector& propFilter,
const MetaObjectKeyVector& sortlist,
const GUID& gClassID,
const OBJECTID_t lClassID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false);
147
Argument
In/Out
Description
objList
In/Out
propFilter
In
sortList
In
gClassID
In
Class GUID.
IClassID
In
Class internal ID
StrObjName
In
WithLock
In
GetDormantDIMClassObjectKeys
Purpose
GetDormantDIMClassObjectKeys returns a list of CMetaObjectKeys (contains object id and
name only) that identify the dormant objects in the specified class. This API enables a meta
data browser to display the name/id of objects in a class without having to read the entire
collection of objects into memory. This is important for large collections which would
consume a large amount of process space if all read into memory.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
The class ID (internal or globally unique) must be set.
Syntax
HRESULT GetDormantDIMClassObjectKeys(
MetaObjectKeyVector& objectKeyList,
const GUID& gClassID,
const OBJECTID_t lClassID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false);
148
Argument
In/Out
Description
objectKeyList
In/Out
Argument
In/Out
Description
gClassID
In
Class GUID.
IClassID
In
Class internal ID
StrObjName
In
WithLock
In
GetDormantDIMDestObject
Purpose
GetDormantDIMDestObject determines if a specific object is dormant or active. sObjName is
the name of an object to search for in the destination class of the relationship.
Description
GetDormantDIMDestObject has three possible return scenarios:
A META_E_OBJECT_NOT_FOUND result indicates that the object does not exist, not
even in dormant form; the returned CMetaObject will have null/default values.
A S_OK and IsPublished()=true result means that the object actually exists in an active
state and the current object will be returned; this would be same as calling
GetDestCollection().
A S_OK and IsDormant()=true result means that the object currently exists in a dormant
form, and the object's previous properties will be returned.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
The calling object must be from the origin class of the relationship specified by relGuid or
relLoid and the calling object must specify the loid or guid of a version of the object.
Syntax
HRESULT GetDormantDIMDestObject(
CMetaObject& returnObj,
LPCTSTR sObjName,
const GUID&relGuid,
const OBJECTID_t relLoid = NULLLOID);
Argument
In/Out
Description
returnObj
In/Out
149
Argument
In/Out
Description
sObjName
In
relGuid
In
Relationship GUID
relLoid
In
Relationship internal ID
WriteObject
Purpose
The CMetaObject class WriteObject function writes the memory object to the repository.
Description
If the object does not exist, the WriteObject function creates the object in the repository. If the
object exists WriteObject will:
overwrite the object in the repository if data versioning is not allowed for the class
containing the object.
will create a new version of the object from the current version of the object if data
versioning is allowed for the class containing the object.
not change the existing value for the property if data versioning is not allowed for the class
containing the object.
substitute the propertys value from the current version of the object if data versioning is
allowed for the class containing the object.
Requirements
If the object does not exist in the repository, a Class ID attribute is required to be set (internal
or globally unique). All class properties of type SQL_DATE must also be set. The internal
ObjectID set to zero indicates that this object is to be created in the repository. When the
internal ObjectID is not zero, it must be for a version of the object.
Syntax
HRESULT WriteObject(void);
WriteVersion
Purpose
WriteVersion writes out a CMetaObject to the repository. Unlike WriteObject, WriteVersion
always overwrites the current version of the object, i.e. a new version of an existing object is
not created. In all other aspects of functionality, WriteVersion is identical to WriteObject.
150
Requirements
If the object does not exist in the repository, a Class ID attribute is required to be set (internal
or globally unique). All class properties of type SQL_DATE must also be set. The internal
ObjectID set to zero indicates that this object is to be created in the repository. When the
internal ObjectID is not zero, it must be for a version of the object.
Syntax
HRESULT WriteVersion(void);
Delete
Purpose
The CMetaObject class Delete function deletes all versions of this object from the MDS
repository database. The user must have delete permission on all of the object's versions.
Requirements
The ObjectID must be set in the object. and it must be for a version of the object.
See the section on Delete Propagation in Chapter 3 of this guide.
Syntax
HRESULT Delete(void);
DeleteVersion
Purpose
DeleteVersion deletes a specific version of an object from the MDS Repository database. The
user must have delete permission on the version to be deleted. If the current version is deleted,
then the immediately preceding version will become the current version. Deleting the only
version of an object is the same as issuing Delete().
Requirements
The internal object id must be set in the object and it must be for the version to be deleted.
Syntax
HRESULT DeleteVersion(void);
DeleteVersionRange
Purpose
DeleteVersionRange deletes one or more versions of an object from the MDS Repository
database. The user must have delete permission on the versions to be deleted. startVersion
provides the first version in the range to be deleted; it must have a value greater than zero. If
startVersion is less than one or exceeds the highest numbered version for the object, an error
will be returned. endVersion indicates the last version in the range to be deleted. If endVersion
is not provided, all versions from startVersion through the highest numbered version for the
151
object will be deleted. If endVersion is greater than the highest numbered version, the highest
numbered version will be assumed.
Requirements
The internal object id must be set in the object and it must be for a version of the object. The
version represented by the internal object id need not be in the range of startVersion to
endVersion.
Syntax
HRESULT DeleteVersionRange(
const VERSIONNUMBER_t startVersion,
const VERSIONNUMBER_t endVersion = -1);
Argument
In/Out
Description
startVersion
In
endVersion
In
ReactivateDIMObject
Purpose
ReactivateDIMObject changes a dormant object to an active object. The change is
immediately made to the repository. By default, the reactivation is propagated to all objects
that are the destination in a relationship from this origin object.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
Reactivating an object will require DELETE permission.
Additional requirements are the same as for WriteObject.
Syntax
HRESULT ReactiveDIMObject();
AddToOrigCollection
Purpose
The CMetaObject class AddToOrigCollection function adds the specified origin class object
ID to the collection of this CMetaObject for the specified relationship ID.
Description
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
AddToOrigCollection only creates a relationship between the current version of this
CMetaObject and the current version of the object referenced by lOrigID. If explanatory
152
Argument
In/Out
Description
lOrigID
In
sExplanation
In
gRelID
In
lRelID
In
(Optional)
AddToDestCollection
Purpose
The CMetaObject class AddToDestCollection adds the specified destination class's object ID
to the collection of this CMetaObject for the specified relationship ID. If explanatory
information, sExplanation, is provided, it will be included in the new
entry..AddToDestCollection only creates a relationship between the current version of this
CMetaObject and the current version of the object referenced by lDestID. If necessary,
AddToDestCollection will determine the current version for the current object and lDestID.
Description
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
Requirements
The internal object id must be set in the object and it must be for a version of the object.
lDestID must be the internal object id of a version of the destination object. CMetaObject
153
must be an object in the origin class and lDestID must be an object in the destination class of
the relationship.
Syntax
HRESULT AddToDestCollection(
const OBJECTID_t lDestID,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
HRESULT AddToDestCollection(
const OBJECTID_t lDestID,
LPCTSTR sExplanation,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
Argument
In/Out
Description
lDestID
In
sExplanation
In
gRelID
In
lRelID
In
(Optional)
Internal Relationship ID
Optional if gRelID is set
Must be provided when gRelID is NULLGUID
AddManyToOrigCollection
Purpose
The CMetaObject class AddManyToOrigCollection function adds a list of origin IDs to the
collection of this CMetaObject for the specified relationship ID.
Description
AddManyToOrigCollection only creates a relationship between the current version of this
CMetaObject and the current versions of the objects referenced by origIDList or origRelList. If
necessary, AddManyToOrigCollection will determine the current version for the current
object and the objects referenced in origIDList or origRelList.
When the variant with origRelList is specified, only the object ID and explanation in each
entry of origRelList will be used; the other fields are ignored.
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
If the origin class of the relationship is a superclass, the origIDList or origRelList can contain
IDs of objects of the origin class type and its subclasses.
154
Requirements
The ObjectID must be set in the object and it must be for a version of the object. The
ObjectID must be of an object in the destination class and all objectIDs in the origIDList and
origRelList must be IDs of objects in the origin class of the relationship.
Syntax
HRESULT AddManyToOrigCollection(
const LLOBJECTID_t &origIDList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
HRESULT AddManyToOrigCollection(
const LLOBJECTID_t &origIDList,
const GUID &gRelID,
const OBJECTID_t lRelID,
const bool mergeList);
HRESULT AddManyToOrigCollection(
const vector<CMetaRelationshipKey> &origRelList,
const GUID &gRelID,
const OBJECTID_t lRelID,
const bool mergeList);
Argument
In/Out
Description
origIDList
In
origRelList
In
gRelID
In
lRelID
In
(Optional)
Internal Relationship ID
Optional if gRelID is set
mergeList
In
AddManyToDestCollection
Purpose
The CMetaObject class AddManyToDestCollection function adds a list of destination IDs to
the collection of this CMetaObject for the specified relationship ID.
Description
AddManyToDestCollection only creates a relationship between the current version of this
CMetaObject and the current version of the objects referenced by destIDList or destRelList. If
necessary, AddToDestCollection will determine the current version for the current object and
each object referenced in destIDList or destRelList.
155
156
Argument
In/Out
Description
destIDList
In
destRelList
In
gRelID
In
lRelID
In
(Optional)
mergeList
In
RemoveFromOrigCollection
Purpose
The CMetaObject class RemoveFromOrigCollection function removes the specified object ID
from the Origin collection.
Description
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
RemoveFromOrigCollection only removes the current version of the CMetaObject from the
collection of lOrigID's current version. If necessary, RemoveFromOrigCollection will
determine the current version for the CMetaObject and lOrigID.
Requirements
The ObjectID of the destination object must be set in the object and it must be for a version of
the object. lOrigID must be for a version of an object.
Syntax
HRESULT RemoveFromOrigCollection(
const OBJECTID_t lOrigID,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
Argument
In/Out
Description
lOrigID
In
gRelID
In
Relationship ID.
Can be set to NULLGUID if lRelID is set.
lRelID
In
(Optional)
RemoveFromDestCollection
Purpose
The CMetaObject class RemoveFromDestCollection function removes the specified object
from the collection of the specified object.
Description
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set). RemoveFromDestCollection only removes the current version of the
destination object from the collection of the current version of the CMetaObject. If necessary,
RemoveFromDestCollection will determine the current version for the CMetaObject and
lDestID.
157
Requirements
The ObjectID of the origin object must be set in the object and it must be for a version of the
object. lDestID must be for a version of an object.
Syntax
HRESULT RemoveFromDestCollection(
const OBJECTID_t lDestID,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
Argument
In/Out
Description
lDestID
In
gRelID
In
Relationship ID.
Can be set to NULLGUID if lRelID is set.
lRelID
In
(Optional)
RemoveManyFromOrigCollection
Purpose
The CMetaObject class RemoveManyFromOrigCollection function removes a specified list of
object IDs from the Origin collection.
Description
RemoveManyFromOrigCollection only removes the current versions of the objects referenced
by origIDList from the collection of the CMetaObject's current version. If necessary,
RemoveManyFromOrigCollection will determine the current version for the CMetaObject
and the entries in origIDList.
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
RemoveFromOrigCollection only removes the current version of the CMetaObject from the
collection of lOrigID's current version. If necessary, RemoveFromOrigCollection will
determine the current version for the CMetaObject and lOrigID.
If the origin class of the relationship is a superclass, the origIDList can contain IDs of objects
of the origin class type and its subclasses.
Requirements
The ObjectID of the destination object must be set in the object and it must be for a version of
the object. Each key in origIDList must be for a version of an origin object to be removed from
the collection.
Syntax
HRESULT RemoveManyFromOrigCollection(
const LLOBJECTID_t &origIDList,
158
Argument
In/Out
Description
origIDList
In
gRelID
In
Relationship ID.
Can be set to NULLGUID if lRelID is set.
lRelID
In
(Optional)
mergeList
In
If true, IDs in the origIDList which are not in the collection will be
ignored. If false, an error will be returned if there are IDs in the list
which are not in the collection. mergeList=false is the behavior of
the function without the mergeList parameter.
RemoveManyFromDestCollection
Purpose
The CMetaObject class RemoveManyFromDestCollection function removes the specified list
of object IDs from the collection of the specified object.
Description
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
RemoveManyFromDestCollection only removes the current version of the destination objects
from the collection of the current version of the CMetaObject. If necessary,
RemoveFromDestCollection will determine the current version for the CMetaObject and each
entry in lDestIDs.
If the destination class of the relationship is a superclass, the destIDList can contain IDs of
objects of the destination class type and its subclasses.
Requirements
The ObjectID of the origin object must be set in the object and it must be for a version of the
object. Each object id in lDestIDs must be for a version of an object.
Syntax
HRESULT RemoveManyFromDestCollection(
const LLOBJECTID_t &destIDlist,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
159
HRESULT RemoveManyFromDestCollection(
const LLOBJECTID_t &destIDlist,
const GUID &gRelID,
const OBJECTID_t lRelID,
const bool mergeList);
Argument
In/Out
Description
destIDList
In
gRelID
In
Relationship ID.
Can be set to NULLGUID if lRelID is set.
lRelID
In
(Optional)
mergeList
In
If true, IDs in the destIDList which are not in the collection will be
ignored. If false, an error will be returned if there are IDs in the list
which are not in the collection. mergeList=false is the behavior of
the function without the mergeList parameter.
RemoveAllFromOrigCollection2
Purpose
RemoveAllFromOrigCollection2 removes all objects in a collection.
Description
The relationship id is specified by the GUID relationship id or internal relationship id (one of
which must be set). If the origin class defined in the relationship is a superclass, the origClass
and allClasses parameters determine the class of objects to be removed. Only the relationships
of the current version of the CMetaObject are affected.
Requirements
The internal object id must be set in the object. CMetaObject must be an object in the
destination class.
Syntax
HRESULT RemoveAllFromOrigCollection2(
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
const OBJECTID_t origClass = NULLLOID,
const bool allClasses = false);
160
Argument
In/Out
Description
gRelID
In
Relationship ID.
lRelID
In
Internal Relationship ID
Argument
In/Out
Description
origClass
In
allClasses
In
RemoveAllFromDestCollection2
Purpose
RemoveAllFromDestCollection2 removes all objects in a collection.
Description
The relationship id is specified by the GUID relationship id or internal relationship id (one of
which must be set). If the destination class defined in the relationship is a superclass, the
destClass and allClasses parameters determine the class of objects to be removed. Only the
relationships of the current version of the CMetaObject are affected.
Requirements
The internal object id must be set in the object. CMetaObject must be an object in the origin
class.
Syntax
HRESULT RemoveAllFromDestCollection2(
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
const OBJECTID_t destClass = NULLLOID,
const bool allClasses = false);
Argument
In/Out
Description
gRelID
In
Relationship ID.
lRelID
In
Internal Relationship ID
destClass
In
161
Argument
In/Out
Description
allClasses
In
ReplaceOrigCollection
Purpose
The CMetaObject class ReplaceOrigCollection function replaces the collection with Ids in the
specified list (lOrigIDs or origRelList) by adding the IDs in the list not in the collection;
removing IDs from the collection that are not in the specified list.
The lOrigIDs list contains object ids. The origRelList contains origin loids and explanation
strings.
Description
The relationship id is specified by the GUID relationship id or internal relationship id (one of
which must be set).
ReplaceOrigCollection only modifies the collection of the current version of the
CMetaObject, and it only uses the current version of each object in the lOrigIDs or origRelList
list. If necessary, RemoveFromOrigCollection will determine the current version for the
CMetaObject and each entry in lOrigIDs or origRelList.
When origRelList is specified, only the origin loid and explanation from each entry are used;
the other fields are ignored.
If the origin class of the relationship is a superclass, this function will replace only the
collections for classes of objects on the replace list. Note the example in Figure 24.
162
A2
ClassA
ClassM
A1
RelAM
RelAM
A3
O1
O1
B Inherits
From A
N Inherits
From M
ClassB
A3
B2
ClassN
B1
C Inherits
From B
RelAM
O Inherits
From N
ClassC
ClassO
C1
B3
B1
RelAM
O1
O1
A1
C2
RelAM
C3
C1
O1
RelAM
B3
C3
O1
The replace list contains object IDs for A3, B1, and B3. The collection of object O1 with
ClassA objects is replaced with A3. The collection of object O1 with ClassB objects is replaced
with B1 and B3. The collection of object O1 with ClassC objects is not affected as there are no
ClassC objects on the replace list. To remove all objects from a collection use the
RemoveAllFromOrigCollection2 function.
Requirements
The internal object id must be set in the object and it must be for a version of the object. Each
object id in lOrigIDs must be for a version of an object. CMetaObject must be an object in the
destination class.
Syntax
HRESULT ReplaceOrigCollection(
const LLOBJECTID_t &origIDList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
HRESULT ReplaceOrigCollection(
const vector<CMetaRelationship> &origRelList
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
Argument
In/Out
Description
IOrigIDs
In
origRelList
In
gRelID
In
Relationship ID
163
Argument
In/Out
Description
lRelID
In
ReplaceDestCollection
Purpose
The CMetaObject class ReplaceDestCollection function replaces the collection with Ids in the
specified list (lDestIDs or destRelList) by adding the IDs in the list not in the collection;
removing IDs from the collection that are not in the specified list.
Description
The relationship id is specified by the GUID relationship id or internal relationship id (one of
which must be set).
ReplaceDestCollection only modifies the collection of the current version of the CMetaObject,
and it only uses the current version of each object in the lDestIDs or destRelList list. If
necessary, RemoveFromDestCollection will determine the current version for the
CMetaObject and each entry in lDestIDs or destRelList.
When destRelList is specified, only the origin loid and explanation from each entry are used;
the other fields are ignored.
If the destination class of the relationship is a superclass, this function will replace only the
collections for classes of objects on the replace list. Note the example in Figure 25.
Figure 25: ReplaceDestCollection Function Example
Collections
Relationship: RelAM
OriginClass: ClassA
DestClass: ClassM
ClassA
A2
ClassM
A1
RelAM
RelAM
A3
O1
O1
B Inherits
From A
N Inherits
From M
ClassB
B2
ClassN
B1
C Inherits
From B
ClassC
A3
O Inherits
From N
ClassO
C1
RelAM
B3
B1
RelAM
O1
O1
A1
C2
RelAM
C3
C1
RelAM
B3
C3
O1
O1
The replace list contains object IDs for M2, N1, and N3. The collection of object A1 with
ClassM objects is replaced with M2. The collection of object A1 with ClassN objects is
replaced with N1 and N3. The collection of object A1 with ClassO objects is not affected as
164
there are no ClassO objects on the replace list. To remove all objects from a collection use the
RemoveAllFromDestCollection2 function.
Requirements
The internal object id must be set in the object and it must be for a version of the object. Each
object id in lDestIDs must be for a version of an object.
Syntax
HRESULT ReplaceDestCollection(
const LLOBJECTID_t &destIDList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
HRESULT ReplaceDestCollection(
const vector<CMetaRelationship> &destRelList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
Argument
In/Out
Description
IDestIDs
In
destRelList
In
gRelID
In
Relationship ID
lRelID
In
FindLabel
Purpose
The CMetaObject class FindLabel function returns the key for the first version of the object
that has the specified label.
Description
If none of the versions of the object have the label, the status META_E_LABEL_NOT_USED
will be returned, and the return key will specify a loid of NULLLOID and a version number of
zero. If multiple versions of the object have the label, the status
META_E_MULTIPLE_OBJECTS_FOUND will be returned and the return key will specify the
first version using the label.
Requirements:
The object ID (local or global) or the name and class ID must specify a version of the
object to be searched.
165
Syntax
HRESULT FindLabel(
const TCHAR *labelToFind,
CMetaVersionedObjectKey& key);
Argument
In/Out
Description
labelToFind
In
Key
Out
Contains the key information for the version matching the search
criteria.
FindAllLabels
Purpose
The CMetaObject class FindAllLabels function returns a list of the labels currently applied to
the versions of the CMetaObject. Each entry in the labels vector will provide the name of a
label and a key for the object version having that label.
Requirements:
The object ID (local or global) or the name and class ID must specify a version of the object to
be searched.
Syntax
HRESULT FindAllLabels(vector<CMetaLabeledObjectKey>& labels);
Argument
In/Out
Description
Labels
Out
FindAllOccurrences
Purpose
The CMetaObject class FindAllOccurrences function returns a list of version keys for the
versions of the object that satisfy a search condition.
Description
The types of searches possible are: find a property value, find when a class contained a
property, and find when a metamodel contained a class.
When a CMetaProperty object is used, two types of search are allowed:
166
If the object is for a class definition, it is determined if the class currently contains the
property (ClassHasProperties). The property is specified by its name.
If the object is for a class data object, the versions of the object are searched to return those
versions that contain the property value. When a character string value is provided, a
substring search is performed; for all other types of property values, an equality search is
made.
When a class name, class GUID, or class loid is given, the calling object is assumed to be a
metamodel definition and it is determined if the class exists in the metamodel
(AIMHasClasses).
Requirements:
The object ID (internal or globally unique) must be set and it must be for one of the
versions of an object.
Syntax
HRESULT FindAllOccurrences(
vector<CMetaVersionedObjectKey>& returnKeys,
CMetaProperty& prop,
const TCHAR *strLabel = NULL);
HRESULT FindAllOccurrences(
vector<CMetaVersionedObjectKey>& returnKeys,
const GUID& gClassID,
const OBJECTID_t lClassID = NULLLOID,
const TCHAR *className = NULL,
const TCHAR *strLabel = NULL);
Argument
In/Out
Description
returnKeys
In/Out
prop
In
gClassID
In
Class GUID.
IClassID
In
className
In
strLabel
In
GetPropertyValue
Purpose
The CMetaObject class GetPropertyValue function retrieves the value of the property.
167
Requirements
Before calling GetPropertyValue, the user must first call ReadObject or ReadVersion on the
object.
Syntax
HRESULT GetPropertyValue(
const OBJECTID_t lPropID,
CMetaProperty &metaProperty);
Argument
In/Out
Description
lPropID
In
metaProperty
Out
GetClassObjectKeys
Purpose
The GetClassObjectKeys function returns a list of CMetaObjectKeys (contains object id and
name only) which identify the current versions of objects in the specified class. The object
keys in the list returned by GetClassObjectKeys are in ascending sort order of the object
names.
Description
The GetClassObjectKeys function returns the names and object ids of class objects without
having to read the entire collection of objects into memory, thereby minimizing the use of
memory and processing time.
Requirements
The internally unique or globally unique class ID must be specified.
Syntax
HRESULT GetClassObjectKeys(
vector<CMetaObjectKey> &objectKeyList,
const GUID &gClassID,
const OBJECTID_t lClassID = NULLLOID);
HRESULT GetClassObjectKeys(
vector<CMetaObjectKey> &objectKeyList,
const GUID &gClassID,
const OBJECTID_t lClassID,
LPCTSTR strObjName,
const bool WithLock = false);
168
Argument
In/Out
Description
objectKeyList
In/Out
Argument
In/Out
Description
gClassID
In
lClassID
In
(Optional)
strObjName
In
WithLock
In
GetClassObjectVersionKeys
Purpose
GetClassObjectVersionKeys returns a list of CMetaVersionedObjectKeys (object id, name,
version number, and publish state) which identify all of the versions of objects in the specified
class.
Description
The GetClassObjectVersionKeys function is expected to be used by an application to enable it
to display the name or ID of objects in a class without having to read the entire collection of
objects into memory. This is important for large classes which would consume a large amount
of process space if all the objects are read into memory.
Requirements
The internally unique or globally unique class ID must be specified.
Syntax
HRESULT GetClassObjectVersionKeys(
vector<CMetaVersionedObjectKey> &objectKeyList,
const GUID &gClassID,
const OBJECTID_t lClassID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false);
Argument
In/Out
Description
objectKeyList
In/Out
gClassID
In
169
Argument
In/Out
Description
lClassID
In
(Optional)
strObjName
In
strLabel
In
WithLock
In
SetPropertyValue
Purpose
The CMetaObject class SetPropertyValue function sets the property in the in-memory object
to the value specified.
Requirements
If updating an existing object in the repository, the user must first call ReadObject on the
object before calling SetPropertyValue.
Syntax
HRESULT SetPropertyValue (
const OBJECTID_t &PropID,
CMetaProperty &metaProperty);
The above function sets the value of the property to the value set in metaProperty. This
function uses PropID to identify the property. The Property ID or Property Name set in
metaProperty are ignored.
Note: The property value is not written to the MDS repository until the WriteObject or
WriteVersion function is called.
HRESULT SetPropertyValue (
CMetaProperty &metaProperty
This function sets the value of the property to the value set in metaProperty. The PropertyID
or PropertyName must be set in metaProperty to identify the property.
Note: The property value is not written to the MDS repository until the WriteObject or
WriteVersion function is called.
170
Argument
In/Out
Description
PropID
In
ID of property to be set
metaProperty
In
GetClassObjectsByProperty
Purpose
The CMetaObject GetClassObjectsByProperty returns the list of CMetaObjects in the
specified class which match selection criteria.
GetClassObjectsByProperty only returns the current version for objects in the class.
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The properties to be returned can be
restricted by using a columns filter.
If multiple properties are specified in the search, the logical operator between the property
searches must also be specified. The name of the property upon which to sort the returned list
can also be specified.
Requirements
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
171
Syntax
HRESULT GetClassObjectsByProperty (
MetaObjectVector &objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID & gClassID,
const OBJECTID_t lClassID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false);
HRESULT GetClassObjectsByProperty (
MetaObjectVector &objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const MetaObjectIDVector &columnFilters,
const GUID & gClassID,
const OBJECTID_t lClassID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false);
Argument
In/Out
Description
objectList
In/out
propFilter
In
sortList
In
columnFilters
In
gClassID
In
Class GUID.
lClassID
In
StrObjName
In
WithLock
In
GetClassObjectVersionsByProperty
Purpose
The CMetaObject GetClassObjectVersionsByProperty returns the list of CMetaObjects in the
specified class which match selection criteria.
172
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The properties to be returned can be
restricted by using a columns filter.
If multiple properties are specified in the search, the logical operator between the property
searches must also be specified. The name of the property upon which to sort the returned list
can also be specified.
GetClassObjectVersionsByProperty returns all versions for objects in the class that match the
search criteria.
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
Requirements
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetClassObjectVersionsByProperty (
MetaObjectVector &objectList,
const MetaFilterInfoVector &propFilter,
173
Argument
In/Out
Description
objectList
In/out
propFilter
In
sortList
In
columnFilters
In
gClassID
In
Class GUID.
lClassID
In
StrObjName
In
strLabel
In
WithLock
In
GetClassObjectRange
Purpose
The CMetaObject class GetClassObjectRange returns the specified subset of CMetaObjects in
the class that matches the selection criteria. The GetClassObjectRange only returns the
current version for objects matching the search criteria.
174
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The properties upon which to sort the
returned list can also be specified. This function allows specifying the start number and
number of objects to return. The properties to be returned can be restricted by using a
columns filter.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
Requirements
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetClassObjectRange (
vector<CMetaObject>&objectList,
int *totalCount,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const int startNum,
const int returnCount,
const GUID &gClassID,
const OBJECTID_t lClassID = 0,
LPCTSTR strObjName = NULL,
const bool WithLock = false);
175
Total # of objects
in search results
Start Number
Return Count
Number of
objects returned
Objects returned
100
20
20
1-20
100
41
50
50
41-90
100
91
20
10
91-100
100
200
20
20
20
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
176
Argument
In/Out
Description
objectList
In/out
totalCount
out
propFilter
In
sortList
In
columnFilters
In
Argument
In/Out
Description
gClassID
In
Class GUID.
lClassID
In
StrObjName
In
WithLock
In
GetClassObjectVersionsRange
Purpose
The CMetaObject class GetClassObjectVersionsRange returns the specified subset of
CMetaObjects in the class that matches the selection criteria. The
GetClassObjectVersionsRange will return any version of an object matching the search criteria
not just the current version.
Description
The function allows you to specify the property id, property value and comparison operator
on which to perform the search. The properties upon which to sort the returned list can also
be specified. This function allows specifying the start number and number of objects to
return. The properties to be returned can be restricted by using a columns filter.
Syntax
HRESULT GetObjectVersionsRange (
vector<CMetaObject>&objectList,
int *totalCount,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const int startNum,
const int returnCount,
const GUID &gClassID,
const OBJECTID_t lClassID = 0,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false);
HRESULT GetObjectVersionsRange (
vector<CMetaObject>&objectList,
int *totalCount,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const MetaObjectKeyVector &columnFilters,
const int startNum,
const int returnCount,
const GUID &gClassID,
const OBJECTID_t lClassID = 0,
177
Total # of objects
in search results
Start Number
Return Count
Number of
objects returned
Objects returned
100
20
20
1-20
100
41
50
50
41-90
100
91
20
10
91-100
100
200
20
20
20
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
178
Argument
In/Out
Description
objectList
In/out
totalCount
out
propFilter
In
sortList
In
columnFilters
In
gClassID
In
Class GUID
lClassID
In
Class internal ID
Argument
In/Out
Description
StrObjName
In
strLabel
In
WithLock
In
Requirements
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
GetOrigCollectionByProperty
Purpose
GetOrigCollectionByProperty returns the collection (list of CMetaObjects) of the origin class
associated with this CMetaObject for the specified relationship, which match the selection
criteria.
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
179
between the property searches must be specified. The name of the property upon which to
sort the returned list can also be specified.
When the origin class supports versioning, GetOrigCollectionByProperty will return object
versions in the origin class that have a rigid relationship to the current version of this
CMetaObject. The returned objects are not guaranteed to be the current version of their
respective objects, i.e CMetaPersist::IsPublished() may be true or false for each returned
object.
If the origin class of the relationship is a superclass, this function will only return objects in the
origin class. To return objects in the subclasses, use the GetOrigCollection3 function.
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetOrigCollectionByProperty(
MetaObjectVector &objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID &gRelID,
180
Argument
In/Out
Description
objectList
In/out
propFilter
In
sortList
In
gReID
In
Relationship GUID.
lReID
In
StrObjName
In
WithLock
In
GetDestCollectionByProperty
Purpose
GetDestCollectionByProperty returns the collection (list of CMetaObjects) of the destination
class associated with this CMetaObject for the specified relationship that matches the selection
criteria.
GetDestCollectionByProperty only returns the current version for objects in the class.
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified. The name of the property upon which to
sort the returned list can also be specified
181
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetDestCollectionByProperty (
MetaObjectVector &objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false)
182
Argument
In/Out
Description
objectList
In/out
propFilter
In
sortList
In
gRelID
In
Relationship GUID.
lRelID
In
Argument
In/Out
Description
StrObjName
In
WithLock
In
GetOrigCollection3
Purpose
GetOrigCollection3 returns the collection (list of CMetaObjects) of the origin class associated
with this CMetaObject for the specified relationship, which match the selection criteria.
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search.
The search is performed on the list of objects in the collection. If multiple properties are
specified for the search, the logical operator between the property searches must be specified.
The properties to be returned can be restricted by the use of the column filters vector. The
name of the property upon which to sort the returned list can also be specified.
When the origin class supports versioning, GetOrigCollection3 will return object versions in
the origin class that have a rigid relationship to the current version of this CMetaObject. The
returned objects are not guaranteed to be the current version of their respective objects, i.e
CMetaPersist::IsPublished() may be true or false for each returned object.
Requirements
The internal object id must be set in the object and it must be for a version of the
destination object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
183
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetOrigCollection3(
vector<CMetaObject >& objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false);
HRESULT GetOrigCollection3(
vector<CMetaObject >& objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const MetaObjectKeyVector &columnFilters,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false);
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
184
Argument
In/Out
Description
ObjectList
In/out
Argument
In/Out
Description
propFilter
In
sortList
In
columnFilters
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
WithLock
In
returnClass
In
allClasses
In
skipValidation
In
185
GetDestCollection3
Purpose
GetDestCollection3 returns the collection (list of CMetaObjects) of the destination class
associated with this CMetaObject for the specified relationship that matches the selection
criteria.
GetDestCollection3 only returns the current version of each object and only uses the current
version of the CMetaObject.
Description
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified. The properties to be returned can be
restricted by the use of the column filters vector. The name of the property upon which to sort
the returned list can also be specified.
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetDestCollection3(
vector<CMetaObject >& objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID &gRelID,
186
Argument
In/Out
Description
ObjectList
In/out
propFilter
In
sortList
In
columnFilters
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
WithLock
In
187
Argument
In/Out
Description
returnClass
In
allClasses
In
skipValidation
In
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
GetOrigCollectionVersions
Purpose
GetOrgCollectionVersions returns the collection (list of CMetaObjects) of the origin class
associated with this CMetaObject for the specified relationship that matches the selection
criteria.
188
Description
The function allows you to specify the property id, property value and comparison operator
on which to perform the search. The search is performed on the list of objects in the
collection. If multiple properties are specified for the search, the logical operator between the
property searches must be specified. The properties to be returned can be restricted by the use
of the column filters vector. The name of the property upon which to sort the returned list can
also be specified.
GetOrigCollectionVersions can be used with any version of the object and by default it will
return all object versions that are found via rigid relationships and match the search
conditions. If rigidRelsOnly is set to false, both rigid and semi-rigid relationships will be used
to find origin objects.
Requirements
The internal object id must be set in the object and it must be for a version of the
destination object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetOrigCollectionVersions(
vector<CMetaObject >& objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
189
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
190
Argument
In/Out
Description
ObjectList
In/out
propFilter
In
sortList
In
columnFilters
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
strLabel
In
Argument
In/Out
Description
WithLock
In
returnClass
In
allClasses
In
skipValidation
In
rigidRelsOnly
In
If set true, the function will only return origin objects that are
found via rigid relationships, i.e. they are the latest version of the
origin object associated with the version of the calling object. If
set false, the function will return all origin object versions that
can be reached from the destination object version.
GetDestCollectionVersions
Purpose
GetDestCollectionVersions returns the collection (list of CMetaObjects) of the destination
class associated with this CMetaObject for the specified relationship that matches the selection
criteria. The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified. The properties to be returned can be
restricted by the use of the column filters vector. The name of the property upon which to sort
the returned list can also be specified.
191
Description
GetDestCollectionVersions can be used with any version of the object and by default it will
return all object versions that are found via rigid relationships and match the search
conditions. If rigidRelsOnly is set to false, both rigid and semi-rigid relationships will be used
to find destination objects.
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetDestCollectionVersions(
vector<CMetaObject >& objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false,
const bool rigidRelsOnly = true);
HRESULT GetDestCollectionVersions(
vector<CMetaObject >& objectList,
const MetaFilterInfoVector &propFilter,
const MetaObjectKeyVector &sortList,
const MetaObjectKeyVector &columnFilters,
const GUID &gRelID,
192
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on using the columnFilters parameter, see section Column Filter on
page 135.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
Argument
In/Out
Description
ObjectList
In/out
propFilter
In
sortList
In
columnFilters
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
strLabel
In
WithLock
In
193
Argument
In/Out
Description
returnClass
In
allClasses
In
skipValidation
In
rigidRelsOnly
In
If set true, the function will only return destination objects that
are found via rigid relationships, i.e. they are the latest version of
the destination object associated with the version of the calling
object. If set false, the function will return all destination object
versions that can be reached from the origin object version.
GetOrigCollectionVersionKeys
Purpose
GetOrigCollectionVersionKeys returns a list of CMetaVersionedObjectClassKey objects
(contains object id, object name, object version, class id, and class name) or a list of
CMetaRelationshipKey objects (contains object id, object name, object version, class id, class
name, and explanation string) which identify the collection of the destination class objects
associated with this CMetaObject for the specified relationship.
Description
This API is expected to be used by a meta data browser to enable it to display the name/id of
objects in a collection without having to read the entire collection of objects into memory.
This is important for large collections that would consume a large amount of process space if
all read into memory. The function allows you to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
194
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified.
GetOrigCollectionVersionKeys works with any version of the object and by default returns
only versions of the origin objects that are reachable via rigid relationships and satisfy the
other search conditions. Setting rigidRelsOnly to false will return all origin object versions
that satisfy the other search conditions.
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetOrigCollectionVersionKeys(
MetaVersionedObjectClassKeyVector& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false,
const bool rigidRelsOnly = true);
HRESULT GetOrigCollectionVersionKeys(
vector<CMetaRelationshipKey>& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
195
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
Argument
In/Out
Description
ObjectKeyList
In/out
Reference to the list of object keys that will hold the collection
returned. The list is cleared before adding the return collection.
propFilter
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
strLabel
In
WithLock
In
returnClass
In
196
Argument
In/Out
Description
allClasses
In
skipValidation
In
rigidRelsOnly
In
If set true, the function will only return origin objects that are
found via rigid relationships, i.e. they are the latest version of the
origin object associated with the version of the calling object. If
set false, the function will return all origin object versions that
can be reached from the destination object version.
GetDestCollectionVersionKeys
Purpose
GetDestCollectionVersionKeys returns a list of CMetaVersionedObjectClassKey objects
(contains object id, object name, object version, class id, and class name) or a list of
CMetaRelationshipKey objects (contains object id, object name, object version, class id, class
name, and explanation string) which identify the collection of the destination class objects
associated with this CMetaObject for the specified relationship.
Description
This API is expected to be used by a meta data browser to enable it to display the name/id of
objects in a collection without having to read the entire collection of objects into memory.
This is important for large collections that would consume a large amount of process space if
all read into memory.
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified.
GetDestCollectionVersionKeys works with any version of the object and by default returns
only versions of the destination objects that are reachable via rigid relationships and satisfy the
other search conditions. Setting rigidRelsOnly to false will return all destination object
versions that satisfy the other search conditions.
197
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT DestCollectionVersionKeys(
MetaVersionedObjectClassKeyVector& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false,
const bool rigidRelsOnly = true);
HRESULT DestCollectionVersionKeys(
vector<CMetaRelationshipKey>& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
LPCTSTR strLabel = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false,
const bool rigidRelsOnly = true);
198
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
Argument
In/Out
Description
ObjectKeyList
In/out
Reference to the list of object keys that will hold the collection
returned. The list is cleared before adding the return collection.
propFilter
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
strLabel
In
WithLock
In
returnClass
In
allClasses
In
199
Argument
In/Out
Description
skipValidation
In
rigidRelsOnly
In
If set true, the function will only return destination objects that
are found via rigid relationships, i.e. they are the latest version of
the destination object associated with the version of the calling
object. If set false, the function will return all destination object
versions that can be reached from the origin object version.
GetOrigCollectionKeys
Purpose
The CMetaObject class GetOrigCollectionKeys function returns a list of CMetaObjectKeys
that contains object ID and name of the origin class objects associated with this CMetaObject
for the specified relationship.
The third variant of GetOrigCollectionKeys listed returns a list of CMetaRelationshipKey
objects (contains object id, object name, class id, class name, and optional explanation text)
which identify the collection of the destination class objects associated with this CMetaObject
for the specified relationship. This API functions in all respects the same as
GetOrigCollectionKeys3 except for the type of the return objects.
Description
The GetOrigCollectionKeys function is expected to be used by an application to enable it to
display the name or ID of objects in a collection without having to read the entire collection of
objects into memory. This is important for large collections which consume a large amount of
process space if all objects are read into memory.
When the origin class supports versioning, GetOrigCollectionKeys will return the keys of
object versions in the origin class that have a rigid relationship to the current version of this
CMetaObject. The returned keys are not guaranteed to be for the current version of their
respective objects, i.e CMetaPersist::IsPublished() may be true or false for each returned object
key.
The relationship ID is be specified by the GUID relationship ID or the internal relationship ID
(one must be set).
If the origin class of the relationship is a superclass, this function will only return objects in the
origin class. To return objects in the subclasses, use the GetOrigCollection3 function.
Requirements
The internal object id must be set in the object and it must be for a version of the object. The
ObjectID must be of an object in the destination class of the specified relationship.
200
201
Argument
In/Out
Description
objectKeyList
In/Out
propFilter
In
gRelID
In
Relationship ID.
Can be set to NULLGUID if lRelID is set.
lRelID
In
(Optional)
strObjName
In
WithLock
In
returnClass
In
202
allClasses
In
skipValidation
In
GetDestCollectionKeys
Purpose
The CMetaObject class GetDestCollectionKeys function returns a list of CMetaObjectKeys
that contains the object ID and name. The keys identify the collection of the destination class
objects associated with this CMetaObject for the specified relationship.
Description
The GetDestCollectionKeys function is expected to be used by an application to enable it to
display the name or ID of objects in a collection without having to read the entire collection of
objects into memory. This is important for large collections which consume a large amount of
process space if all objects are read into memory.
GetDestCollectionKeys only returns the keys of the current versions of objects referenced by
the current version of this CMetaObject.
The relationship ID is specified by the GUID relationship ID or the internal relationship ID
(one must be set).
If the destination class of the relationship is a superclass, this function will only return objects
in the destination class. To return objects in the subclasses, use the
GetDestinationCollectionKeys3 function.
The third variant of GetDestCollectionKeys listed returns a list of CMetaRelationshipKey
objects (contains object id, object name, class id, class name, and optional explanation text)
which identify the collection of the destination class objects associated with this CMetaObject
for the specified relationship. This API functions in all respects the same as
GetDestCollectionKeys3 except for the type of the return objects.
Requirements
The internal object id must be set in the object and it must be for a version of the object. The
ObjectID must be the ID of an object in the origin class of the specified relationship.
The relationship id is specified by the GUID relationship id or internal relationship id (one of
which must be set). CMetaObject must be an object in the origin class of the relationship.
The propFilter list can contain zero or more CMetaFilterInfo objects.
The PropertyID (SetPropertyID()) or PropertyName (SetName()) of the value attribute in
each CMetaFilterInfo object must contain a valid Relative Property Id or name of a property
description in the class.
The value attribute in each CMetaFilterInfo object must also be set to the value on which the
search will be made. This value must be of the same type as the property description. For
example, if the search is to be made on Relative Property ID = 1 and Relative Property ID 1 is
defined as an integer, Value must be set to an integer (SetInt()). If relative Property ID 1 is a
string, Value must be set to a string (SetString()).
The default ComparisonOperator in each CMetaFilterInfo object is EQUAL and the default
LogicalOperator is META_AND.
203
If the propFilter list contains zero objects, the function will perform a search by strObjName
only. If strObjName is also NULL, the API will return all the objects in the collection.
If the propFilter list contains objects and strObjName is set, the logical operator between the
properties and the name will the "AND". To perform a search of a name "OR" a property, set
strObjName to NULL and add a CMetaFilterInfo object to the propFilter list for a name
search.
Syntax
HRESULT GetDestCollectionKeys(
vector<CMetaObjectKey> &objectKeyList,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID);
HRESULT GetDestCollectionKeys(
vector<CMetaObjectKey> &objectKeyList,
const GUID &gRelID,
const OBJECTID_t lRelID.
LPCTSTR strObjName,
const bool WithLock = false);
HRESULT GetDestCollectionKeys(
Vector<CMetaRelationshipKey>& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID.
LPCTSTR strObjName,
const bool WithLock = false);
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
204
Argument
In/Out
Description
objectKeyList
In/Out
Reference to the list of keys that will hold the collection returned.
The list is cleared before adding the return collection.
propFilter
In
gRelID
In
Relationship ID.
Can be set to NULLGUID if gRelID is set.
lRelID
In
(Optional)
strObjName
In
Argument
In/Out
Description
returnClass
In
WithLock
In
allClasses
In
GetOrigCollectionKeys3
Purpose
GetOrigCollectionKeys3 returns a list of CMetaObjectClassKey objects (contains object id,
object name, class id, and class name) which identify the collection of the Origin class objects
associated with the current version of this CMetaObject for the specified relationship.
Description
The GetOrigCollectionKeys3 function only uses the current version of the CMetaObject.
This API is expected to be used by a meta data browser to enable it to display the name/id of
objects in a collection without having to read the entire collection of objects into memory.
This is important for large collections that would consume a large amount of process space if
all read into memory. The function allows you to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified.
When the origin class supports versioning, GetOrigCollectionKeys3 will return the keys of
object versions in the origin class that have a rigid relationship to the current version of this
CMetaObject. The returned keys are not guaranteed to be for the current version of their
205
respective objects, i.e CMetaPersist::IsPublished() may be true or false for each returned object
key.
Requirements
The internal object id must be set in the object and it must be for a version of the
destination object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetOrigCollectionKeys3(
MetaObjectClassKeyVector& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false);
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
206
Argument
In/Out
Description
ObjectKeyList
In/out
Reference to the list of object keys that will hold the collection
returned. The list is cleared before adding the return collection.
propFilter
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
WithLock
In
returnClass
In
allClasses
In
skipValidation
In
GetDestCollectionKeys3
Purpose
GetDestCollectionKeys3 returns a list of CMetaObjectClassKey objects (contains object id,
object name, class id, and class name) which identify the collection of the destination class
objects associated with this CMetaObject for the specified relationship.
207
Description
This API is expected to be used by a meta data browser to enable it to display the name/id of
objects in a collection without having to read the entire collection of objects into memory.
This is important for large collections that would consume a large amount of process space if
all read into memory.
The function allows the programmer to specify the property id, property value and
comparison operator on which to perform the search. The search is performed on the list of
objects in the collection. If multiple properties are specified for the search, the logical operator
between the property searches must be specified.
GetDestCollectionKeys3 only returns the keys for the current versions of objects and only uses
the current version of the CMetaObject.
Requirements
The internal object id must be set in the object and it must be for a version of the origin
object.
The value attribute in each CMetaFilterInfo object must also be set to the value on which
the search will be made. This value must be of the same type as the property description.
For example, if the search is to be made on Relative Property ID = 1 and Relative Property
ID 1 is defined as an integer, Value must be set to an integer (SetInt()). If relative Property
ID 1 is a string, Value must be set to a string (SetString()).
If the propFilter list contains zero objects, the function will perform a search by
strObjName only. If strObjName is also NULL, the API will return all the objects in the
collection.
If the propFilter list contains objects and strObjName is set, the logical operator between
the properties and the name will the AND. To perform a search of a name OR a
property, set strObjName to NULL and add a CMetaFilterInfo object to the propFilter list
for a name search.
Syntax
HRESULT GetDestCollectionKeys3(
MetaObjectClassKeyVector& objectKeyList,
const MetaFilterInfoVector &propFilter,
const GUID &gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
const bool WithLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false);
208
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
Argument
In/Out
Description
ObjectKeyList
In/out
Reference to the list of object keys that will hold the collection
returned. The list is cleared before adding the return collection.
propFilter
In
gRelID
In
Relationship GUID.
lRelID
In
StrObjName
In
WithLock
In
returnClass
In
allClasses
In
skipValidation
In
209
GetDormantDIMOrigCollection
Purpose
GetDormantDIMOrigCollection returns the collection of dormant objects of the origin class
associated with this CMetaObject for the specified relationship that matches the selection
criteria.
Description
The calling object can be dormant or active.
The property id, property value and comparison operator on which to perform the search can
all be specified. The search is performed on the list of objects in the collection. If multiple
properties are specified for the search, the logical operator between the property searches
must be specified. The name of the property upon which to sort the returned list can also be
specified.
Requirements
The requirements are the same as for GetDormantDIMDestCollection.
Syntax
HRESULT GetDormantDIMOrigCollection(
vector<CMetaObject>& objectList,
const MetaFilterInfoVector& propFilter,
const MetaObjectKeyVector& sortList,
const GUID& gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR sObjName = NULL,
const bool withLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false);
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
210
Argument
In/Out
Description
objectList
In/Out
propFilter
In
Argument
In/Out
Description
sortList
In
gRelID
In
Relationship GUID
IRelID
In
Relationship internal ID
StrObjName
In
WithLock
In
returnClass
In
allClasses
In
SkipValidation
In
211
GetDormantDIMDestCollection
Purpose
GetDormantDIMDestCollection returns the collection of dormant objects of the destination
class associated with this CMetaObject for the specified relationship that matches the selection
criteria.
Description
The calling object can be dormant or active.
The property id, property value and comparison operator on which to perform the search can
all be specified. The search is performed on the list of objects in the collection. If multiple
properties are specified for the search, the logical operator between the property searches
must be specified. The name of the property upon which to sort the returned list can also be
specified.
Requirements
You must be initialized as an MDS Administrator (superuser) to use this function.
The class ID (internal or globally unique) must be set.
The propFilter list may contain zero or more CMetaFilterInfo objects.
The PropertyID (SetPropertyID()) or PropertyName (SetName()) of the value attribute in
each CMetaFilterInfo object must contain a valid Relative Property Id or name of a property
description in the class.
The value attribute in each CMetaFilterInfo object must also be set to the value on which the
search will be made. This value must be of the same type as the property description. For
example, if the search is to be made on Relative Property ID = 1 and Relative Property ID 1 is
defined as an integer, Value must be set to an integer (SetInt()). If relative Property ID 1 is a
string, Value must be set to a string (SetString()).
The default ComparisonOperator in each CMetaFilterInfo object is EQUAL and the default
LogicalOperator is META_AND.
If the propFilter list contains zero objects, the function will perform a search by strObjName
only. If strObjName is also NULL, the API will return all the objects in the collection.
If the propFilter list contains objects and strObjName is set, the logical operator between the
properties and the name will the AND. To perform a search of a name OR a property, set
strObjName to NULL and add a CMetaFilterInfo object to the propFilter list for a name
search.
Syntax
HRESULTGetDormantDIMDestCollection(
vector<CMetaObject>& objectList,
const MetaFilterInfoVector& propFilter,
const MetaObjectKeyVector& sortList,
const GUID& gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR strObjName = NULL,
212
Argument
In/Out
Description
objectList
In/Out
propFilter
In
sortList
In
gRelID
In
Relationship GUID
IRelID
In
Relationship internal ID
StrObjName
In
WithLock
In
returnClass
In
allClasses
In
213
Argument
In/Out
Description
SkipValidation
In
GetDormantDIMOrigCollectionKeys
Purpose
GetDormantDIMOrigCollectionKeys returns the collection of dormant objects of the origin
class associated with this CMetaObject for the specified relationship that matches the selection
criteria.
Description
The calling object can be dormant or active.
This enables a meta data browser to display the name/id of objects in a collection without
having to read the entire collection of objects into memory. This is important for large
collections that consume a large amount of process space if all read into memory.
The property id, property value and comparison operator on which to perform the search can
all be specified. The search is performed on the list of objects in the collection. If multiple
properties are specified for the search, the logical operator between the property searches
must be specified.
The calling object may be dormant or active.
Requirements
The requirements are the same as for GetDormantDIMDestCollection.
Syntax
HRESULT GetDormantDIMOrigCollectionKeys(
CMetaObjectClassKeyVector& objectKeyList,
const MetaFilterInfoVector& propFilter,
const MetaObjectKeyVector& sortList,
const GUID& gRelID,
const OBJECTID_t lRelID = NULLLOID,
LPCTSTR sObjName = NULL,
const bool withLock = false,
const OBJECTID_t returnClass = NULLLOID,
const bool allClasses = false,
const bool skipValidation = false);
For more information on creating the propFilter for the search, see Chapter 8:
CMetaFilterInfo Class.
214
For more information on building the strObjName parameter for a search, see Name Search
on page 134.
For more information on building the sortList parameter, see Sort List on page 133.
For more information on the settings for allClasses and returnClass, see Inheritance on
page 135.
Argument
In/Out
Description
objectKeyList
In/Out
propFilter
In
sortList
In
gRelID
In
Relationship GUID
lRelID
In
Relationship internal ID
StrObjName
In
WithLock
In
returnClass
In
215
Argument
In/Out
Description
allClasses
In
SkipValidation
In
GetDormantDIMDestCollectionKeys
Purpose
GetDormantDIMDestCollectionKeys returns a list of CMetaObjectClassKey objects (contains
object id, object name, class id, and class name) that identify the collection of dormant objects
associated with this CMetaObject for the specified relationship.
Description
The calling object can be dormant or active.
This enables a meta data browser to display the name/id of objects in a collection without
having to read the entire collection of objects into memory. This is important for large
collections that consume a large amount of process space if all read into memory.
The property id, property value and comparison operator on which to perform the search can
all be specified. The search is performed on the list of objects in the collection. If multiple
properties are specified for the search, the logical operator between the property searches
must be specified.
The calling object may be dormant or active.
Requirements
The requirements are the same as for GetDormantDIMDestCollection.
Syntax
HRESULT GetDormantDIMDestCollectionKeys(
MetaObjectClassKeyVector& objectKeyList,
const MetaFilterInfoVector& propFilter,
216
Argument
In/Out
Description
objectKeyList
In/Out
propFilter
In
sortList
In
gRelID
In
Relationship GUID
lRelID
In
Relationship internal ID
StrObjName
In
WithLock
In
returnClass
In
217
Argument
In/Out
Description
allClasses
In
SkipValidation
218
In
CHAPTER 8
CMetaFilterInfo Class
This chapter describes the C++ Class CMetaFilterInfo functions that are used to define search
properties for the GetDestCollectionByProperty, GetOrigCollectionByProperty, and
GetClassObjectsByProperty APIs.
This chapter also includes example code for CMetaFilterInfo.
Filter
The CMetaFilterInfo class contains an attribute called Filter which is an object of the
CMetaProperty class:
CMetaProperty
Filter
Relative Property ID or Name of the property on which to perform the search. This can be
any of the objects Common Properties or Unique Properties defined for the class.
Search value.
The id is set using the CMetaProperty::SetPropertyID function. The name is set using the
CMetaProperty::SetName function. For example:
CMetaFilterInfo filterInfo;
filterInfo.Initialize();
filterInfo.Filter.SetPropertyID(3);
The search value is set using a CMetaProperty::Setxxx function such as SetString, SetInt,
SetShort, SetBinary, etc. For example:
filterInfo.Filter.SetString(_TEXT("FOO"));
To search on unique properties of a class, you must specify the relative property id or property
name specified for the Property Description in the Model.
Substring Search
Using the REGEX ComparisonOperator, character string properties can be searched for a
match of a character string pattern within the property character string.
The following describes the search string value:
The % and _ characters may be used in any combination in the search string
The % (percent sign) character represents any string of zero or more arbitrary characters.
219
Any single character is acceptable in the position in which the underscore character
appears, and any string of characters is acceptable as a replacement for the percent.
The backslash character (\) can be used as an escape character to search for the %, _ or %
characters ( \\, \%, \_ ) in the name or property value.
Both leading and trailing pad characters in the property field must match exactly with the
search string. For example, A%BC matches AxxBC, but not AxxBD, and A%BD
matches AxxBD, but not AxxBC or AxxBD indicates a pad character).
Example 1
Using the following settings in a CMetaFilterInfo object:
filterInfo.Filter.SetPropertyID(PID_NAME);
filterInfo.Filter.SetString(_T(%Pres%));
filterInfo.SetComparisonOperator(REGEX);
The MDS function will return objects with the following names:
VicePresident
President
PresidentElect
Elvis Presley
Example 2
Changing the search string to:
filterInfo.Filter.SetString(_T(P%));
The MDS function will return all objects with the names beginning with the character P:
Peterson
Powell
Pruitt
Example 3
Changing the search string to:
filterInfo.Filter.SetString(_T(_a%));
Uses the % and _ characters to select a list of names with the letter A as the second letter in the
name. The length of the name returned may be two or more characters. The function will
return objects with the following names:
Marston
Watson
Car
If the example used _a_, the search would be for a three-character string name with the letter
a as the second character. In this case, the only object returned is:
Car
220
NULL Values
Setting the search string value to NULL would cause indeterminate results so this is not
allowed. MDS will not return NULL property fields as matches.
Property Types
The REGEX ComparisonOperator can only be used with character string properties (those
which have been defined with PropertyType=SQL_CHAR or SQL_VARCHAR). Although
properties with a ProperyType=SQL_DATE accept and return a string value, REGEX is not a
valid ComparisonOperator for those property types.
Constructor
Initialize
GetComparisonOperator
SetComparisonOperator
GetLogicalOperator
SetLogicalOperator
GetParenthesesCount
SetParenthesesCount
Constructor
The CMetaFilterInfo Class constructor is as follows:
CMetaFilterInfo();
Initialize
Purpose
This CMetaFilterInfo Initialize function resets to default conditions and empties the property
constraint.
Syntax
void Initialize();
221
GetComparisonOperator
Purpose
The CMetaFilterInfo GetComparisonOperator function returns the value of the
ComparisonOperator.
Syntax
MetaComparisonOperator GetComparisonOperator() const;
SetComparisonOperator
Purpose
The CMetaFilterInfo SetComparisonOperator function sets the ComparisonOperator to the
type of comparison to use in the property search.
Description
The default value for the ComparisonOperator is EQUAL.
Syntax
void SetComparisonOperator(
const MetaComparisonOperator &compOp);
Argument
In/Out
Description
comparisonOpera
tor
In
EQUAL
LESS_THAN
GREATER_THAN
NOT_EQUAL
LESS_THAN_OR_EQUAL
GREATER_THAN_OR_EQUAL
IS_NULL (matches properties in which the property value has
never been set)
IS_NOT_NULL (matches properties in which a value has been
set. This value can be zero).
REGEX (applicable to string comparisons only searches for a
character string pattern within another character string or
character string expression)
Example 1
filterInfo.SetComparisonOperator(REGEX);
222
GetLogicalOperator
Purpose
The CMetaFilterInfo GetLogicalOperator function returns the value of the LogicalOperator.
Syntax
MetaLogicalOperator GetLogicalOperator() const;
SetLogicalOperator
Purpose
The CMetaFilterInfo SetComparisonOperator function sets the LogicalOperator to use in the
property search.
Description
If multiple properties are specified in the search, the logical operator between the property
searches must be specified. The default value for the LogicalOperator is META_AND.
Syntax
void SetLogicalOperator(
const MetaLogicalOperator &logicalOp);
Argument
In/Out
Description
logicalOperator
In
GetParenthesesCount
Purpose
The CMetaFilterInfo GetParenthesesCount returns the number of open or close parentheses
that have been set for this search property.
Syntax
void GetOpenParenthesesCount(short &openCountArg) const;
void GetCloseParenthesesCount(short &closeCountArg) const;
SetParenthesesCount
Purpose
The CMetaFilterInfo SetParenthesesCount function sets the number of open parentheses to
place before this search argument or the number of close parentheses to place after the
argument.
223
Description
The precedence of the search properties can be set.
The total number of open parentheses set in the CMetaFilterInfo list must match the total
number of close parentheses set.
Syntax
void SetOpenParenthesesCount(const short CountArg);
void SetCloseParenthesesCount(const short CountArg);
Argument
In/Out
Description
CountArg
In
For SetOpenParenthesesCount, the number of open parentheses to place before this property in
the search SQL. For SetCloseParenthesesCount, the number of close parentheses to place after this
property in the search SQL
Example 1
With three search properties and a search precedence of:
Name=basket AND (Type>10 OR Size<999)
The open count of the Parentheses in the CMetaFilterInfo object for the Type property
would be set to 1. The close count of the Parentheses Count in the CMetaFilterInfo object for
the Size property would be set to 1. The following is an example of how this would be coded:
CLEARVECTOR(propFilter);
filterInfo.value.SetPropertyID(PID_CMN_NAME);
filterInfo.SetComparisonOperator(EQUAL);
filterInfo.value.SetString(_T("basket"));
filterInfo.SetLogicalOperator(META_AND);
propFilter.push_back(filterInfo);
filterInfo.Initialize();
filterInfo.value.SetPropertyID(10);
filterInfo.SetComparisonOperator(GREATER_THAN);
filterInfo.value.SetInt(10);
filterInfo.SetOpenParenthesesCount(1);
// Open Parenthesis Count = 1
filterInfo.SetLogicalOperator(META_OR);
propFilter.push_back(filterInfo);
filterInfo.Initialize();
filterInfo.value.SetPropertyID(12);
filterInfo.SetComparisonOperator(LESS_THAN);
filterInfo.value.SetInt(999);
filterInfo.SetCloseParenthesesCount(1); // Close Parenthesis Count = 1
propFilter.push_back(filterInfo);
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
result = obj.GetClassObjectsByProperty(objectList, propFilter, sortList,
gClassID, lClassID);
Example 2
Here is an example of using multiple open parentheses:
224
225
226
CHAPTER 9
CMetaProperty Class
This chapter describes the C++ Class CMetaProperty functions that get and set CMetaObject
properties.
CMetaProperty Constructors
Operator =
Operator ==
Operator <
Initialize
Copy
GetName
SetName
GetPropertyID
SetPropertyID
PrintProperty
PrintValue
PrintValueType
CMetaProperty Constructors
The first step for users of the CMetaProperty class is to instantiate the CMetaProperty by
calling one of the CMetaProperty constructors.
CMetaProperty(void)
This CMetaProperty Class constructor is the default constructor and takes no arguments. It
instantiates a CMetaProperty with default values.
227
Operator =
Purpose
The CMetaProperty class = operator function copies object B to object A.
Syntax
CMetaProperty & operator=(const CMetaProperty &);
Usage:
CMetaProperty objectA, objectB;
.
.
.
objectA = objectB;
Operator ==
Purpose
The CMetaProperty class == operator function returns 1 if objectA is equal to objectB. The
operator returns 0 if the objects are not equal.
Syntax
int operator==(const CMetaProperty &);
Usage:
CMetaProperty objectA, objectB;
.
.
.
if (objectA == objectB){
//objects are equal
}else{
//Objects are not equal
}
Operator <
Purpose
The CMetaProperty class < operator function returns 1 if the PropertyID of objectA is less
than the PropertyID of objectB.
The operator returns 0 if the PropertyID of objectA is equal to or greater than the PropertyID
of objectB.
228
Syntax
static bool operator<(const CMetaProperty &x const CMetaProperty &y);
Usage:
CMetaProperty objectA, objectB;
.
.
.
if (objectA < objectB){
//property ID of A is less than property ID of B
}else{
//property ID of A is not less than property ID of B
}
Initialize
Purpose
The CMetaProperty class Initialize function resets the CMetaProperty attributes to the default
values.
Syntax
void Initialize(void);
Copy
Purpose
The CMetaProperty class Copy function copies the specified object to this object.
Syntax
HRESULT Copy(const CMetaProperty &prop);
Argument
In/Out
Description
prop
In
GetName
Purpose
The CMetaProperty class GetName function retrieves the property name.
Syntax
LPCTSTR GetName(void);
SetName
Purpose
The CMetaProperty class SetName function sets the property name.
229
Syntax
void SetName(LPCTSTR Name);
Argument
In/Out
Description
Name
In
Property name.
GetPropertyID
Purpose
The CMetaProperty class GetPropertyID function returns the property ID of the object.
Syntax
const OBJECTID_t GetPropertyID(void);
SetPropertyID
Purpose
The CMetaProperty class SetPropertyID function sets the property ID of the object.
Syntax
HRESULT
SetPropertyID(OBJECTID_t ObjectID);
Argument
In/Out
Description
objectID
In
Relative propertyID.
PrintProperty
Purpose
The CMetaProperty class PrintProperty function displays the property attributes to standard
output.
Syntax
void PrintProperty(ostream& os=cout);
Examples:
CarId=1003abdf
Property99=103
VehicleType=Sports and GT Cars
230
PrintValue
Purpose
The CMetaProperty class PrintValue function writes the property value to the ostream.
Syntax
void PrintValue(ostream &os);
PrintValueType
Purpose
The CMetaProperty class PrintValueType function writes the property type to the ostream.
Syntax
void PrintValueType(ostream &os);
Returns true if the value was set with the SetBinaryString function. Returns false if the value
was set with the SetBinary function or was read from the MDS repository. If true, the value is
a hex string for example 3030303030633034 for the hex value 0x00c4.
HRESULT GetBinary(void* buf, int &bufsz);
Caller must provide a pointer <buf> to a buffer large enough to hold the return value. Copies
the binary buffer to <buf> and sets <bufsz> to the number of bytes in the buffer for a binary
property. Returns <bufsz> = 0 if the property value is NULL.
HRESULT GetBinaryAsString(String &val);
Returns a string containing the value of a binary buffer printed as hexadecimal or an empty
string if the property value is NULL.
HRESULT GetBool(short &val)
Returns the value of a (short) Boolean property or 0 if the property value is NULL.
HRESULT GetChar(char &val);
Returns the value of a floating-point date property 0.0 if the property value is NULL.
HRESULT GetDbl(double &val)
231
Returns the value of a double property or 0.0 if the property value is NULL. Equivalent to
GetDouble.
HRESULT GetDouble(double &val)
Returns the value of a double property or 0.0 if the property value is NULL. Equivalent to
GetDbl.
HRESULT GetFloat(float &val)
Returns the value of a floating-point property or 0.0 if the property value is NULL.
HRESULT GetInt(int &val)
Returns the value of an integer property or 0 if the property value is NULL. Equivalent to
GetLong.
HRESULT GetLong(long &val)
Returns the value of a long property or 0 if the property value is NULL. Equivalent to GetInt.
HRESULT GetShort(short &val)
Returns the value of a string property or an empty string if the property value is NULL.
HRESULT GetUChar(unsigned char &val)
Returns the value of an unsigned char property or 0 if the property value is NULL.
VARIANT GetValue(void);
GetValue returns the property value and type in a Windows VARIANT structure. This
function is used to support the CMetaCOM APIs and will only be available on Windows
platforms. When the caller is done with the VARIANT that is returned, they should clear it
using the VariantClear function provided by Windows to free any string or array pointers it
may contain.
const unsigned short GetVarType(void) const;
GetVarType returns the numeric value for the Variant Type for the current property.
232
Variant Type
VT_I2
VT_I4
VT_R8
VT_DATE
VT_BSTR
VT_BOOL
11
VT_UI1
17
VT_ARRAY|VT_UI1
8209
A char represents a signed binary integer value in the range 128 to 127.
void SetDate(const double val);
SetDate stores the date value using the DATE data type. DATE is represented as an 8-byte
floating-point number. Days are represented by whole number increments starting with 30
December 1899, midnight as time zero. Hour values are expressed as the absolute value of the
fractional part of the number. The following table illustrates this.
Date and time
Representation
0.00
52.00
105.00
105.25
105.50
105.875
// same as SetDouble
// same as SetDbl
// same as SetLong
// same as SetInt
Passing in a NULL pointer to SetString is equivalent to setting the property value to NULL.
233
MDS will write the string exactly as specified. For strings set with the SetString function, MDS
will add single quotes around the value when creating the SQL to issue to Teradata to write the
value to the MDS repository. For strings set with the SetStringLiteral function, MDS will not
add the single quotes. Therefore when using SetStringLiteral, val must contain a single quoted
string or a Teradata built in function name. The supported functions are:
CURRENT_DATE
DATE
CURRENT_TIME
CURRENT_TIMESTAMP
TIME 15:30
DATE 1998-06-01
XmL (CS)
1A1FXC
The char type is used to store the integer value of a member of the character set. That integer
value is the ASCII code corresponding to the specified character. Character values of type
unsigned char have a range from 0 to 0xFF hexadecimal or 0 to 255 decimal.
HRESULT SetValue(VARIANT value);
SetValue accepts a Windows VARIANT structure and sets the CMetaProperty value and type
according to those in the VARIANT. This function is used to support the CMetaCOM APIs
and will only be available on Windows platforms. Only the following VARIANT types are
supported:
VT_I2
VT_I4
VT_R8
VT_DATE
VT_BSTR
VT_BOOL
VT_UI1
VT_UI1 | VT_ARRAY
234
SetNull(); // can
SetBinaryNull();
SetBoolNull();
SetCharNull();
SetDateNull();
SetDblNull();
SetDoubleNull();
SetFloatNull();
SetIntNull();
SetLongNull();
SetShortNull();
SetStringNull();
SetUCharNull();
// same as SetDoubleNull
// same as setDblNull
// same as SetLongNull
// same as SetIntNull
235
236
CHAPTER 10
ObjectKey Classes
CMetaObjectKey Class
CMetaObjectClassKey Class
CMetaVersionedObjectKey Class
CMetaVersionedObjectClassKey Class
CMetaLabeledObjectKey Class
CMetaRelationshipKey Class
CMetaObjectKey Class
The CMetaObjectKey class defines the identifiers of an object (Object ID and name). It is
returned from CMetaObject::GetClassObjectKeys, CMetaObject::GetDestCollectionKeys and
CMetaObject::GetOrigCollectionKeys functions. The class has the following functions:
Initialize
Operator ==
Operator <
GetObjectName
SetObjectName
GetObjectID
SetObjectID
Note: ObjectKey API calls return a subset of the properties returned by the standard interface
that returns all of an objects properties. For example, an ObjectKey call can return specific
parameter values for an object, such as the object name and id. If fewer details are required,
use of ObjectKey calls provides more efficiency resulting in better performance.
For something in between the standard object API and ObjectKey calls, use a property filter
that allows fetching additional object properties that are not provided through an ObjectKey
call. Filters allow users to specify specific object properties to be returned.
Initialize
Purpose
The Initialize function resets CMetaObjectKey attributes to default values.
237
Syntax
void Initialize(void);
Operator ==
Purpose
The Operator== function returns 1 if objectA is equal to objectB, 0 if the objects are not
equal.
Syntax
int operator==(const CMetaObjectKey &);
Usage:
CMetaObjectKey objectA, objectb:
...
if (objectA == objectB)
//objects are equal
else
//objects are not equal
Operator <
Purpose
The Operator< function returns TRUE if the object ID of objectA is less than the object ID of
object B.
Syntax
bool operator< (const CMetaObjectKey& object)
Usage:
CMetaObjectKey objectA, objectb:
...
if (objectA < objectB)
//objectid of A is less than objectid of B
else
// objectid of A is not less than objectid of B
GetObjectName
Purpose
The GetObjectName function retrieves the object name.
Syntax
LPCTSTR GetObjectName(void);
238
SetObjectName
Purpose
The SetObjectName function sets the object name.
Syntax
void SetObjectName(LPCTSTR strObjName);
GetObjectID
Purpose
The GetObjectID function retrieves the object ID.
Syntax
LPCTSTR GetObjectID (void);
SetObjectID
Purpose
The SetObjectID function sets the object ID.
Syntax
void SetObjectID (LPCTSTR strObjName);
CMetaObjectClassKey Class
The CMetaObjectClassKey Class contains the identifiers of an object (Object ID and name),
from CMetaObjectKey, and adds the Class Name and Class ID of the object.
It is returned from CMetaSecurityProfile::GetObjectsUsingSecurityProfile.
This class inherits CMetaObjectKey.
The class has the following functions:
Initialize
GetClassName
SetClassName
GetClassID
SetClassID
Initialize
Purpose
The Initialize function resets CMetaObjectClassKey attributes to default values.
239
Syntax
void Initialize(void);
GetClassName
Purpose
The GetClassName function retrieves the name of the class in which the object belongs.
Syntax
LPCTSTR GetClassName(void);
SetClassName
Purpose
The SetClassName function sets the class name.
Syntax
void SetClassName(LPCTSTR strClassNameArg);
GetClassID
Purpose
The GetClassID function retrieves the class ID of the object.
Syntax
const OBJECTID_t GetClassID(void);
SetClassID
Purpose
The SetClassID function sets the class ID of the object.
Syntax
void SetClassID(const OBJECTID_t lOIDArg);
240
CMetaVersionedObjectKey Class
The CMetaVersionedObjectKey class defines the identifiers of an object version (Object ID,
name, version number, and publish state).
It is returned from the CMetaObject::GetClassObjectVersionKeys,
CMetaObject::FindAllOccurrences and CMetaObject::FindLabel functions.
This class inherits from CMetaObjectKey class.
The class has the following functions:
Initialize
Operator ==
Operator <
GetVersionNumber
SetVersionNumber
GetPublishState
SetPublishState
IsPublished
IsDormant
IsFrozen
Initialize
Purpose
The Initialize function resets CMetaVersionedObjectKey attributes to default values.
Syntax
void Initialize(void);
Operator ==
Purpose
The Operator== function returns 1 if objectA is equal to objectB, 0 if the objects are not
equal. Two objects are equal if the object ID, name, version number, and publish state are
equal.
Syntax
int operator==(const CMetaObjectKey &);
Usage:
CMetaVersionedObjectKey objectA, objectb:
...
if (objectA == objectB)
//objects are equal
241
Operator <
Purpose
The Operator< function returns TRUE if the object ID of ObjectA is less than the object ID or
ObjectB or the version number of ObjectA is less than the version number of ObjectB.
Syntax
bool operator< (const CMetaObjectKey& object)
Usage:
CMetaVersionedObjectKey objectA, objectb:
...
if (objectA < objectB)
//objectid of A is less than objectid of B
else
// objectid of A is not less than objectid of B
GetVersionNumber
Purpose
The GetVersionNumber function retrieves the version number.
Syntax
VERSIONNUMBER_t GetVersionNumber(void) const;
SetVersionNumber
Purpose
The SetVersionNumber function sets the version number.
Syntax
void SetVersionNumber(const VERSIONNUMBER_t lVer);
GetPublishState
Purpose
The GetPublishState function returns the publish state.
Syntax
META_PUBLISH_STATE GetPublishState(void) const;
242
SetPublishState
Purpose
The SetPublishState function sets the publish state.
Syntax
void SetPublishState(const META_PUBLISH_STATE lPublish);
IsPublished
Purpose
The IsPublished function returns true if the version's publish state indicates that it is the
current published version, else it returns false
Syntax
bool IsPublished(void) const;
IsDormant
Purpose
The IsDormant function returns true if the version is dormant, else it returns false
Syntax
bool IsDormant(void) const;
IsFrozen
Purpose
The IsFrozen function returns true if the object is frozen and can not be modified, else it
returns false
Syntax
bool IsFrozen(void) const;
CMetaVersionedObjectClassKey Class
The CMetaVersionedObjectClassKey Class contains the identifiers of an object version
(Object ID, name, version number, and publish state), from CMetaVersionedObjectKey, and
adds the Class Name and Class ID of the object.
It is returned from CMetaObject::GetDestCollectionVersionKeys and
CMetaObject::GetOrigCollectionVersionKeys.
This class inherits CMetaObjectClassKey.
243
Initialize
GetClassName
SetClassName
GetClassID
SetClassID
GetVersionNumber
SetVersionNumber
GetPublishState
SetPublishState
IsPublished
IsDormant
IsFrozen
Initialize
Purpose
The Initialize function resets CMetaVersionedObjectClassKey attributes to default values.
Syntax
void Initialize(void);
GetClassName
Purpose
The GetClassName function retrieves the name of the class in which the object belongs.
Syntax
LPCTSTR GetClassName(void);
SetClassName
Purpose
The SetClassName function sets the class name.
Syntax
void SetClassName(LPCTSTR strClassNameArg);
GetClassID
Purpose
The GetClassID function retrieves the class ID of the object.
244
Syntax
const OBJECTID_t GetClassID(void);
SetClassID
Purpose
The SetClassID function sets the class ID of the object.
Syntax
void SetClassID(const OBJECTID_t lOIDArg);
GetVersionNumber
Purpose
The GetVersionNumber function retrieves the version number.
Syntax
VERSIONNUMBER_t GetVersionNumber(void) const;
SetVersionNumber
Purpose
The SetVersionNumber function sets the version number.
Syntax
void SetVersionNumber(const VERSIONNUMBER_t lVer);
GetPublishState
Purpose
The GetPublishState function returns the publish state.
Syntax
META_PUBLISH_STATE GetPublishState(void) const;
SetPublishState
Purpose
The SetPublishState function sets the publish state.
Syntax
void SetPublishState(const META_PUBLISH_STATE lPublish);
245
IsPublished
Purpose
The IsPublished function returns true if the version's publish state indicates that it is the
current published version, else it returns false
Syntax
bool IsPublished(void) const;
IsDormant
Purpose
The IsDormant function returns true if the version is dormant, else it returns false
Syntax
bool IsDormant(void) const;
IsFrozen
Purpose
The IsFrozen function returns true if the object is frozen and can not be modified, else it
returns false
Syntax
bool IsFrozen(void) const;
CMetaRelationshipKey Class
The CMetaRelationshipKey class describes an entry in a repository relationship. It contains
the identifiers of an object version (Object ID, name, version number, and publish state, class
name, and class ID), from CMetaVersionedObjectClassKey, and adds an explanation string
describing the relationship between the referenced object and an origin or destination object.
This class inherits the CMetaVersionedObjectClassKey and all of the routines externalized by
that class.
The class has the following functions:
246
Initialize
Operator =
GetExplanation
SetExplanation
Initialize
Purpose
The Initialize function resets CMetaRelationshipKey class attributes to default values.
Syntax
void Initialize();
Operator =
Purpose
Assigns the fields of one CMetaRelationshipKey object to those of another
CMetaRelationshipKey object.
Syntax
CMetaRelationshipKey &operator=(const CMetaRelationshipKey &);
GetExplanation
Purpose
The GetExplanation function returns the explanation string for the relationship represented
by this key.
Syntax
String GetExplanation() const;
SetExplanation
Purpose
The SetExplanation function sets the value of the explanation string. The routine will return
an error if memory can not be obtained to save the passed string value.
Syntax
HRESULT SetExplanation(LPCTSTR s);
CMetaLabeledObjectKey Class
The CMetaLabeledObjectKey class contains the name, objectID, version, and publish state of
an object, plus the name of a label that is applied to the object.
This class is returned by CMetaObject::FindAllLabels.
The class has the following functions:
Initialize
GetObjectName
247
GetObjectID
GetVersionNumber
GetObjectID
GetVersionNumber
GetPublishState
IsPublished
GetLabelName
Initialize
Purpose
The Initialize function resets CMetaLabeledObjectKey attributes to default values.
Syntax
void Initialize(void);
GetObjectName
Purpose
The GetObjectName function retrieves the object name.
Description
This information is necessary because the different versions of an object may have different
names.
Syntax
LPCTSTR GetObjectName(void);
GetObjectID
Purpose
The GetObjectID function retrieves the object ID.
Syntax
LPCTSTR GetObjectID (void);
GetVersionNumber
Purpose
The GetVersionNumber function retrieves the version number.
Syntax
VERSIONNUMBER_t GetVersionNumber(void) const;
248
GetPublishState
Purpose
The GetPublishState function returns the publish state.
Syntax
META_PUBLISH_STATE GetPublishState(void) const;
IsPublished
The IsPublished function returns true if the version's publish state indicates that it is the
current published version, else it returns false
bool IsPublished(void) const;
GetLabelName
Purpose
The GetLabelName function returns the name of the label that has been applied to the object
version.
Syntax
LPCTSTR GetLabelName(void) const;
249
250
CHAPTER 11
CMetaLabel Class
This chapter describes the C++ Class CMetaLabel Class functions that contain the identifiers
of an object (Object ID and name).
Use the CMetaLabel class to define labels and to define the objects that a specific label will
apply to. Because the CMetaLabel class is non-versioned, the class can not be redefined and
the individual entries will never have more than one version.
CMetaLabel Constructors
Initialize
SetAIMLabel
SetClassLabel
SetObjectsLabel
GetObjectKeys
GetCreatorName
SetCreatorName
SetAndMoveObjectsLabel
DeleteObjectsLabel
CMetaLabel Constructors
CMetaLabel(void)
This constructor instantiates a CMetaLabel object to be created.
CMetaLabel(const OBJECTID_t lOID);
This constructor instantiates a CMetaLabel object identified by the internal object ID lOID.
The user invokes ReadObject to retrieve the object from the repository.
CMetaLabel(const TCHAR *label, const TCHAR *creator);
This constructor instantiates a CMetaLabel object to create. Follow this call with a call to
WriteObject to write the label definition to the MDS Repository. This constructor can also be
used to instantiate an object for reading, in which case the creator value is ignored.
251
Initialize
Purpose
Initialize sets the CMetaLabel attributes to default values.
Syntax
void Initialize(void);
SetAIMLabel
Purpose
SetAIMLabel applies the current label to all objects in all classes in the specified AIMs.
Description
The label is only applied to the currently published version for each object in an AIM.
Requirements:
The object ID (internal or globally unique) or the name must be set.
Syntax
HRESULT SetAIMLabel(LLOBJECTID_t &AIMList);
Argument
In/Out
Description
AIMList
In
SetClassLabel
Purpose
SetClassLabel applies the current label to all objects in the specified classes.
Description
If bPropagate is true, the label will also be applied recursively to all destination objects
reachable from the class's objects, else only the specific objects in the class will receive the
label. The label is only applied to the currently published version for each object in a class.
Requirements:
The object ID (internal or globally unique) or the name must be set.
Syntax
HRESULT SetClassLabel(
LLOBJECTID_t &classList,
const bool bPropagate = true);
252
Argument
In/Out
Description
classList
In
bPropagate
In
SetObjectsLabel
Purpose
SetObjectsLabel applies the current label to all objects in objList.
Description
If bPropagate is true, the label will also be applied recursively to all destination objects
reachable from the objects, else only the specific objects themselves will receive the label. The
label is only applied to the currently published version for each object.
Requirements:
The object ID (internal or globally unique) or the name must be set.
Syntax
HRESULT SetObjectsLabel(
LLOBJECTID_t &objList,
const bool bPropagate = true);
Argument
In/Out
Description
objList
In
bPropagate
In
SetAndMoveObjectsLabel
Purpose
SetAndMoveObjectsLabel applies the current label to all objects in objList.
Description
If bPropagate is true, the label will also be applied recursively to all destination objects
reachable from the objects, else only the specific objects themselves will receive the label. The
label is only applied to the currently published version for each object.
If the label is currently applied to a non-current version of one of the objects, the label will be
moved from the non-current version to the current version.
Requirements:
The object ID (internal or globally unique) or the name must be set.
253
Syntax
HRESULT SetAndMoveObjectsLabel(
LLOBJECTID_t &objList,
const bool bPropagate = true);
Argument
In/Out
Description
objList
In
bPropagate
In
DeleteObjectsLabel
Purpose
DeleteObjectsLabel removes the current label from all objects in objList.
Description
If bPropagate is true, the removal will also be applied recursively to all destination objects
reachable from the objects, else only the specific objects themselves will lose the label
Requirements:
The object ID (internal or globally unique) or the name must be set.
Syntax
HRESULT DeleteObjectsLabel(
LLOBJECTID_t &objList,
const bool bPropagate = true);
Argument
In/Out
Description
objList
In
bPropagate
In
GetObjectKeys
Purpose
GetObjectKeys returns the keys for all object versions in the repository, in a metamodel, or in
a class that have the current label.
Description
If all of the four parameters gModelGuid, ModelLoid, gClassGuid, and ClassLoid are null or
not specified, then all object versions in the repository with the current label are returned.
If one of gModelGuid or ModelLoid is not null, then all object versions in the metamodel with
the current label are returned.
254
If both gModelGuid and ModelLoid are null and one of gClassGuid or ClassLoid is not null,
then all object versions in the class with the current label are returned.
Requirements:
The object ID (internal or globally unique) or the name must be set.
Syntax
HRESULT GetObjectKeys(
vector<CMetaVersionedObjectClassKey>& returnList,
const GUID &gModelGuid = NULLGUID,
const OBJECTID_t ModelLoid = NULLLOID,
const GUID &gClassGuid = NULLGUID,
const OBJECTID_t ClassLoid = NULLLOID);
Argument
In/Out
Description
returnList
In
gModelGuid
In (Optional)
ModelLoid
In (Optional)
gClassGuid
In (Optional)
ClassLoid
In (Optional)
GetCreatorName
Purpose
GetCreatorName returns the name of the user that created the label.
Syntax
void GetCreatorName(String& name);
SetCreatorName
Purpose
SetCreatorName sets the name of the label's creator.
Description
This is a free-form string that can provide any desired identifying information. If this
information is not provided, the name of the creating MDS user is used.
Syntax
void SetCreatorName(const TCHAR *name);
255
256
CHAPTER 12
AIM Classes
This chapter describes the Meta Data Services APIs that describe to MDS the data that an
application will store in the MDS repository. The data definitions are described in Class,
Property, and Relationship descriptions. The group of data definitions for an application is
called an AIM.
The AIM classes are:
CMetaAIM Class: Class to create and read AIM objects, and to create Class and
Relationship Description objects, linking them to the AIM.
CMetaClassDesc Class: Class to create property description objects, and link them to this
class. Also used to get associated properties, and access the collection of relationship
descriptions involving that class.
All AIM classes inherit the functions of the CMetaPersist and CMetaObject classes. Changes
that can be made to an AIM are:
Deleting a class description (deletes all objects in the class as well as the class description)
Deleting a relationship description (deletes all relationships of that type as well as the
relationship description)
Deleting an AIM (deletes all class, property and relationship descriptions in the AIM)
Note: See the WriteObject function in each AIM class section for the list of properties that can
be updated.
MDS manages the creation of these classes within the repository. To create an AIM, perform
the following steps:
257
Repeat the last two steps for each class description being created in the Model.
Create the type of object desired using a constructor taking the ObjectGUID or
ObjectID.
CMetaAIM Class
CMetaAIM Class Functions
The CMetaAIM class functions are:
CMetaAIM Constructors
Initialize
CreateMDSModel
CreateMDSClassDesc
CreateMDSClassDesc2
CreateMDSDerivedClass
CreateMDSRelationshipDesc
GetClassDesc
GetClassDescCollection
GetRelationshipDesc
GetRelationshipDescColl
GetVersioningSupport
SetModelVersioningFlag
WriteObject/WriteVersion
258
CMetaAIM Constructors
CMetaAIM(void);
This CMetaAIM constructor instantiates a CMetaAIM to be created. You need to follow this
call with invocation of the CreateModel function in the newly instantiated CMetaAIM object
to create a new model.
CMetaAIM(const OBJECTID_t lOID);
This CMetaAIM constructor instantiates a CMetaAIM identified by the ObjectID. You then
need to invoke the ReadObject function to retrieve the object from the repository database.
CMetaAIM(const GUID &GID);
This CMetaAIM constructor instantiates a CMetaAIM identified by an ObjectGUID. You then
need to invoke the ReadObject function to retrieve the object from the repository database.
CMetaAIM(LPCTSTR name);
This CMetaAIM constructor instantiates a CMetaAIM identified by the object name. You then
need to invoke the ReadObject function to retrieve the object from the repository database.
Initialize
Purpose
The CMetaAIMclass Initialize function resets the CMetaAIM attributes to default values.
Syntax
void Initialize(void);
CreateMDSModel
Purpose
The CMetaAIM CreateMDSModel function creates an AIM model object.
Description
The GUID can optionally be provided. The default OwnerID is the logged in user. The
metamodel's versioning support will be set from the repository's versioning support flag.
Requirements
When creating an AIM, CMetaAIM names must be unique within the repository database.
Updates to an existing model object are not permitted.
Syntax
HRESULT CreateMDSModel(
LPCTSTR strModelName,
LPCTSTR strModelDesc,
const GUID& gGID,
const OBJECTID_t lOwnerID = NULLLOID,
259
Argument
In/Out
Description
Name
In
Desc
In
Description of model.
gGUID
In
OwnerID
In (Optional)
SecurityProfileID
In (Optional)
CreateMDSClassDesc
Purpose
The CMetaAIM CreateMDSClassDesc function creates a new class description in the current
model.
Description
The class can be used to create its associated property descriptions. It can also be used in new
relationship description definitions.
The default OwnerID is the logged in user. The class's versioning support will be set from the
AIM's versioning support.
Requirements
Updates to an existing Class Description object are not permitted.
Class names must be unique within an AIM.
Syntax
HRESULT CreateMDSClassDesc(
CMetaClassDesc *&pClassObj,
LPCTSTR strClassName,
LPCTSTR strClassDesc,
const short sUniqueNamesFlag,
const GUID& gClassID,
const OBJECTID_t lOwnerID,
const OBJECTID_t SecurityProfileID,
const bool bRootClass);
260
Argument
In/Out
Description
pClassObj
In/Out
Name
In
Argument
In/Out
Description
Desc
In
Description of class.
UniqueNamesFlag
In
gClassID
In
OwnerID
In
bRootClass
In
SecurityProfileID
in
CreateMDSClassDesc2
Purpose
Creates a new class description and contains it in the current model.
Description
The class can be used to create its associated property descriptions. It can also be used in new
relationship description definitions.
The default OwnerID is the logged in user. The class's versioning support will be set from the
AIM's versioning support.
Requirements
Class names must be unique within an AIM.
Syntax
HRESULT CreateMDSClassDesc2(
CMetaClassDesc *&pClassObj,
LPCTSTR strClassName,
LPCTSTR strClassDesc,
const short sUniqueNamesFlag,
const GUID& gClassID,
const OBJECTID_t lOwnerID,
const OBJECTID_t SecurityProfileID,
const bool bRootClass,
const bool bAbstractClass,
const bool bDescriptionRequired,
MetaObjectIDVector &superClasses);
261
Argument
In/Our
Description
pClassObj
in/out
strClassName
in
strClassDesc
in
description of class
sUniqueNamesFlag
in
gClassID
in
lOwnerID
in
SecurityProfileID
in
bRootClass
in
True = set this class to be a root class of the model. The MDS
browsers begin tree displays of the data in the model at the
root classes.
bAbstractClass
in
bDescriptionRequired
in
superClasses
in
CreateMDSDerivedClass
Purpose
The CMetaAIM CreateMDSDerivedClass function creates a derived class in the current
model.
Description
A derived class is similar to a View in an RDBMS. It allows for creation of a logical class using
properties that exist in already defined classes. A derived class is a class that contains the
properties of a base class plus properties of related classes. A read of a derived class object will
return all properties (base and derived) and searches can be performed on all of the properties
of the derived class.
The default OwnerID is the logged in user. The class's versioning support will be set from the
derived classs base classs versioning support.
Requirements
Names must be unique for classes and derived classes within an AIM.
262
Syntax
HRESULT CreateMDSDerivedClass(
CMetaClassDesc *&pClassObj,
LPCTSTR strClassName,
LPCTSTR strClassDesc,
const GUID& gClassID,
const OBJECTID_t BaseClassID,
const OBJECTID_t lOwnerID = NULLLOID,
const OBJECTID_t SecurityProfileID = NULLLOID);
Argument
In/Out
Description
pClassObj
In/Out
Name
In
Desc
In
Description of class.
gClassID
In
BaseClassID
In
The class ID of the class that is the base class for this
derived class.
OwnerID
In
OwnerID
In
SecurityProfileID
In
CreateMDSRelationshipDesc
Purpose
The CMetaAIM CreateMDSRelationshipDesc function creates a new relationship description
between two classes.
Description
Relationships can be between two classes either within one AIM, or across different AIMs.
The origin class and the destination class can be the same class.
The default OwnerID is the logged in user.
Note: A class description can be defined in multiple relationships, however, all relationships
that have the same class ID as the origin or destination class must have unique names. Since all
relationships within a metamodel must have unique names, this is only an issue if
relationships with the same name were created in two different metamodels with the same
class as an origin or destination class. The create of the second relationship will fail.
Requirements
Updates to an existing Relationship Description object are not permitted. Both
lOriginClassOID and lDestClassOID are not a NULLLOID.
263
Both classes must have been previously defined to MDS before creating the relationship.
Syntax
HRESULT CreateMDSRelationshipDesc(
CMetaRelationshipDesc *&pRelObj,
LPCTSTR strRelName,
LPCTSTR strRelDesc,
const OBJECTID_t lOriginClassOID,
const OBJECTID_t lDestClassOID,
const short sUniqueNamesFlag,
const short sPropagateDeleteFlag,
const GUID& gGUID,
const OBJECTID_t lOwnerID = 0,
const OBJECTID_t SecurityProfileID = 0);
Argument
In/Out
Description
pRelObj
Out
Name
In
Desc
In
Relationship description.
OriginClassOID
In
DestClassOID
In
UniqueNamesFlag
In
PropagateDeleteFlag
In
GUID
In
OwnerID
In (Optional)
SecurityProfileID
In (Optional)
GetClassDesc
Purpose
The CMetaAIM GetClassDesc function returns the class description object specified by name.
Description
If an application has the ObjectGUID or ObjectID of this object, it can instantiate the
CMetaClassDesc using these identification parameters, and use the ReadObject function to
read this object.
264
Argument
In/Out
Description
Name
In
pClassPtr
Out
GetClassDescCollection
Purpose
The CMetaAIM GetClassDescCollection function returns all of the class description objects in
the model.
Syntax
HRESULT GetClassDescCollection (
LLCMetaClassDesc& classobjectList);
Argument
In/Out
Description
classobjectList
Out
GetRelationshipDesc
Purpose
The CMetaAIM GetRelationshipDesc function returns the relationship object specified by
Name.
Description
The application is responsible to free the relationship description object returned.
Requirements
The relationship must be in the current model.
Syntax
HRESULT GetRelationshipDesc (
LPCTSTR Name,
CMetaRelationshipDesc *&pRelationship);
265
Argument
In/Out
Description
Name
In
pRelationship
Out
GetRelationshipDescColl
Purpose
The CMetaAIM GetRelationshipDescColl function returns all the relationship objects in the
model.
Syntax
HRESULT GetRelationshipDescColl (
LLCMetaRelationshipDesc &relobjectList);
Argument
In/Out
Description
relobjectList
Out
GetVersioningSupport
Purpose
GetVersioningSupport returns the current setting for the VersioningSupport property of a
CMetaAIM object.
Description
The VersioningSupport property has three possible values:
META_NO_VERSIONING - the AIM does not support data versioning, none of the
existing classes created by the AIM support versioning, and any new classes for the AIM
will not support versioning.
META_HAD_DATA_VERSIONING - the AIM does not support data versioning and any
new classes for the AIM will not support versioning. However, some of the classes in the
AIM currently retain multiple versions of data objects that existed when data versioning
was disabled for the AIM. Even though multiple versions may exist for a data object,
WriteObject will never create new versions for existing data objects; only the latest version
for an object will be modified
META_HAS_DATA_VERSIONING - the AIM supports data versioning and any new class
for the model will, by default, support versioning; existing classes may or may not support
versioning.
For an existing AIM, this value is only meaningful after calling ReadObject for the AIM.
Syntax
META_VERSIONING_SUPPORT_LEVELS GetVersioningSupport();
266
SetModelVersioningFlag
Purpose
SetModelVersioningFlag allows an application to dynamically enable or disable data
versioning for a metamodel.
Description
If bVersioningAllowed is false, versioning will be disabled for the metamodel.
If bVersioningAllowed is true and the repository allows versioning, then versioning will be
enabled for the metamodel, else versioning will be left disabled for the metamodel.
bDeleteVersions indicates if existing historical versions for objects in the AIM's classes should
be deleted or retained.
The metamodel is specified with the same values as needed for ReadObject.
When versioning is enabled:
Any new classes added to the metamodel will also support versioning.
No changes are made to the existing objects in any of the model's classes, however
whenever any object in the classes is modified, a new version of the object will be
automatically created, as if the class had always supported data versioning
All existing classes in the metamodel are modified to not support versioning.
Any new classes added to the metamodel will be created without support of versioning
If bDeleteVersions is true, all objects in the metamodel's classes will be modified so that all
non-published versions are deleted and the remaining versions will be renumbered to
version one. This can be a very lengthy operation.
If bDeleteVersions is false, all existing versions of data objects in the metamodel's classes
will be retained.
Requirements
The caller must have write permission for the metamodel and for all classes in the metamodel.
The object name or the object ID (internal or globally unique) must be set
Syntax
HRESULT SetModelVersioningFlag(
const bool bVersioningAllowed,
const bool bDeleteVersions = false);
Argument
In/Out
Description
bVersioningAllowed
in
267
Argument
In/Out
Description
bDeleteVersions
in
WriteObject/WriteVersion
Purpose
The CMetaAIM WriteObject and WriteVersion functions update the CMetaAIM object.
Description
The properties of a CMetaAIM object that can be modified are:
Name
Description
OwnerID
SecurityProfileID
Name
10
MDSMetaModel
11
Core
1000
DatabaseModel
Syntax
HRESULT WriteObject ();
HRESULT WriteVersion();
CMetaClassDesc Class
CMetaClassDesc Class Functions
The CMetaClassDesc class functions are:
268
CMetaClassDesc Constructors
Initialize
CreateMDSPropertyDesc
CreateMDSDerivedProperty
GetUniqueNamesFlag
SetUniqueNamesFlag
GetPropertyDesc
GetPropertyDescColl
GetRelationshipDescColl
GetAbstractClassFlag
SetAbstractClassFlag
GetSuperClasses
SetSuperClasses
GetSubClasses
GetDerivedClassFlag
SetDerivedClassFlag
GetBaseClassID
SetBaseClassID
GetVersioningSupport
SetClassDescVersioningFlag
WriteObject/WriteVersion
CMetaClassDesc Constructors
To create a new CMetaClassDesc object, use the CMetaAIM class.
To read an existing ClassDesc, use the CMetaAIM object only if the objects name is known.
If the objects name is not known and ObjectGUID or ObjectID is known, use the
constructors listed below, followed with ReadObject invocation.
CMetaClassDesc();
This is the default CMetaClassDesc constructor.
CMetaClassDesc(const GUID &GID);
This CMetaClassDesc constructor instantiates a CMetaClassDesc identified by the
ObjectGUID.
CMetaClassDesc(const OBJECTID_t lOID);
This CMetaClassDesc constructor instantiates a CMetaClassDesc identified by the ObjectID.
269
Initialize
Purpose
The CMetaClassDesc Initialize function resets the CMetaClassDesc attributes to default
values.
Syntax
void Initialize(void);
CreateMDSPropertyDesc
Purpose
The CMetaClassDesc CreateMDSPropertyDesc function creates a property description and
associates it with the specified class.
Description
This function allows setting of the Character Set in which the property data will be stored.
Updates to an existing Property Description object are not permitted.
The property Name is used as the column name of the class table in the repository database.
Because of this, the name of a property description has the same restrictions as a Teradata
column name. Refer to the Teradata SQL documentation for more information.
The property can be defined as "required" so that all objects added to the class must contain a
value for the property. If a property is required and a value is not specified for the property
when adding or updating an object in the class, the WriteObject will fail with the status
META_E_MISSING_REQUIRED_PROPERTY.
Property names and the RelativePropID must be unique for a class.
The default OwnerID is the logged in user.
Syntax
HRESULT CreateMDSPropertyDesc(
CMetaPropertyDesc *&pPropertyDescObj,
LPCTSTR strPropertyName,
LPCTSTR strPropertyDesc,
const short sTotalDigits,
const long sPropLength,
const short sPropType,
const long lRelativePropID,
const unsigned short sVariantType,
const GUID& GID = NULLGUID,
LPCTSTR strCharacterSetName = NULL,
const OBJECTID_t OwnerID = NULLLOID,
const OBJECTID_t SecurityProfileID = NULLLOID);
HRESULT CreateMDSPropertyDesc(
CMetaPropertyDesc *&pPropertyDescObj,
LPCTSTR strPropertyName,
LPCTSTR strPropertyDesc,
const bool bIsRequired,
270
The following tables define data types supported and the associated variant types.
Argument
In/Out
Description
PropertyDescObj
Out
strPropertyName
In
Name of the Property to create. MDS creates common properties in each class.
The names of these properties are reserved by MDS and cannot be used as the
name of a property. The reserved property names are:
loid
name
ApplicationGroupID
OwnerID
AccessRights
goid
description
CreateDate
CreateTime
UpdateDate
UpdateTime
SecurityProfileID
IsFrozen
BaseVersionLoid
PredecessorVersionLoid
VersionNumber
PublishState
strPropertyDesc
In
Property description
bIsRequired
In
Set to true if class objects must contain a value for the property; set to false if class
objects need not set the property
strDefaultValue
In
The value to be assigned for this property to existing objects in the class; may be
set NULL if the class contains no objects or bIsRequired is false
TotalDigits
In
The number of digits to the right of the decimal point for a numeric property. The
precision of TIME and TIMESTAMP properties.
271
Argument
In/Out
Description
PropSize
In
The size in bytes of the property if defined as characters. The number of digits if
the property is defined as a numeric type. This value is ignored if the data type of
the property inherently specifies the size of the property (such as integer).
PropType
In
The SQL data type of the property. This type defines how the data field is stored in
the database repository.
Note: Teradata does not have a long data type -- use SQL_INTEGER. See the
tables below to relate VariantTypes and with acceptable PropTypes.
RelativePropID
In
VariantType
In
Defines the data type that will be used by the application to set and get the data
field.
See the tables below to relate VariantTypes with acceptable PropTypes
GID
In
AccessRights
In
OwnerID
In
AppGroupID
In
strCharacterSetName
In
Character set type in which this property field will be stored in Teradata. If not
specified, the column character type will be the default character type for the
database user (the database user configured for MDS to use to connect to the
MDS repository database). Two of the character set types supported are LATIN
and UNICODE. See Teradata documentation for information on additional
character sets that are supported.
SecurityProfileID
In
PropSize
SQL_CHAR
>= 1
CHAR[(size)]
SQL_VARCHAR
>= 1
VARCHAR(size)
SQL_DATE
TotalDigits
DATE
SQL_BINARY
>= 1
BYTE[(size)]
SQL_VARBINARY
>= 1
VARBYTE(size)
SQL_SMALLINT
SMALLINT
SQL_INTEGER
INTEGER
272
PropSize
TotalDigits
SQL_DECIMAL
1-18
0-scale
DECIMAL[(size[,scale])]
SQL_NUMERIC
1-18
0-scale
NUMERIC[(size[,scale])]
SQL_FLOAT
0-54
FLOAT[(size)]
SQL_REAL
REAL
SQL_DOUBLE
DOUBLE [PRECISION]
SQL_TINYINT
BYTEINT
SQL_TIME
0-6
TIME
SQL_TIMESTAMP
0-6
TIMESTAMP
CMetaProperty Get/Set
Functions
VariantType
Compatible PropType
VT_I1
SQL_TINYINT
GetChar(),
SetChar()
VT_I2
SQL_SMALLINT
GetShort()
SetShort()
VT_I4
SQL_INTEGER
GetInt()
SetInt()
VT_R8
GetDouble()
GetDbl()
SetDouble()
SetDbl()
VT_DATE
SQL_DOUBLE
GetDate()
SetDate ()
VT_BSTR
SQL_CHAR
SQL_VARCHAR
SQL_DATE
GetString(
SetString()
VT_BOOL
SQL_SMALLINT
GetBool()
SetBool()
273
CMetaProperty Get/Set
Functions
VariantType
Compatible PropType
VT_UI1
SQL_BINARY (size=1)
GetUChar ()
SetUChar ()
VT_ARRAY | VT_UI1
SQL_BINARY
SQL_VARBINARY
GetBinaryAsString()
GetBinary()
SetBinary()
CreateMDSDerivedProperty
Purpose
The CMetaClassDesc class CreateMDSDerivedProperty function creates a derived property
description and associates it with the specified derived class.
Description
A derived property creates a join between the base class specified for the derived class and a
property in a related class. A read of a derived class object will return all properties (base and
derived) and searches can be performed on all of the properties of the derived class.
Class: Author
Properties:
name
description
author
AuthorHasBooks
Class: Book
Properties:
name
description
title
3047A056
In the above metamodel, a derived class can be created with the base class of Book. The
derived class (AuthBook) will have all properties of Book (name, description, title). Because
the Author class is an origin class related to the Book class with the AuthorHasBooks
relationship, derived properties can be created for each of the properties of the Author class
(name, description, author). If we create one derived property with the property author in the
Author class, the derived class will have the following properties:
Derived Class: AuthBook
Properties:
name
description
title
author
3047A057
274
There are no actual objects in a derived class. A derived class joins together properties in the
base class and the properties in related classes.
Derived properties can be created from relationships from 1 to 6 levels. In the first level
relationship, the destination class of the relationship must be the base class of the derived
property. In the next level relationship, the destination class must be the origin class of the
previous level relationship. This continues until the last relationship. Note in the following
picture, the classes and relationships of the database model.
Database
DatabaseHasTables
Table
TableHasColumns
Column
3047A018
This is a valid hierarchy for derived properties. If a derived class was created with the base class
Column, derived properties could be created from properties in the Table, Database, and
DBSystem classes.
A derived class can contain derived properties from multiple related classes.
Class: Publisher
Properties:
name
description
PublisherHasAuthors
Class: Author
Properties:
name
description
author
AuthorHasBooks
Class: Book
Properties:
name
description
title
3047A058
In the above metamodel, a derived class (ExBook) is created with the base class of Book. It has
a derived property (author) using the author property of the Author class and a derived
property (PublisherName) using the name property of the Publisher class.
275
Note that the name of the derived property can be the name of the base property if the name is
a unique name for the properties in the base class and the derived class. In ExBook, the
derived property, author, is the same name as the property in its class. However, the derived
property, PublisherName, could not be given the name of the base property (name) as the
base class already has a name property.
If multiple derived properties are defined for a derived class, their relationships must all be on
the same hierarchical path. For example:
DBSystem
SystemHasDatabases
Database
DatabaseHasTables
Table
TableHasColumns
Column
3047A017
a derived class with a base class of Column could contain derived properties from the
DBSystem, Database, and Table classes. An example, which is not permitted, is:
View
Table
ViewHasTableColumns
TableHasColumns
Column
3047A016
a derived class with a base class of Column CANNOT contain derived properties from both
the View and Table classes.
Property names and RelativePropID must be unique in the derived class and the base class of
the derived class.
276
Argument
In/Out
Description
PropertyDescObj
Out
Name
In
loid
name
ApplicationGroupID
OwnerID
AccessRights
goid
description
CreateDate
CreateTime
UpdateDate
UpdateTime
SecurityProfileID
IsFrozen
BaseVersionLoid
PredecessorVersionLoid
VersionNumber
PublishState
Desc
In
Property description
BasePropertyName
In
RelationshipsToProperty
In
277
Argument
In/Out
Description
RelativePropID
In
GID
In
OwnerID
In
SecurityProfileID
In
GetUniqueNamesFlag
Purpose
The CMetaClassDesc GetUniqueNamesFlag function retrieves the flag that indicates if unique
naming is turned on for the class description.
Syntax
const short GetUniqueNamesFlag(void);
SetUniqueNamesFlag
Purpose
SetUniqueNamesFlag sets the unique naming flag for the class.
Syntax
void SetUniqueNamesFlag (const short FlagArg)
Argument
In/Out
Description
FlagArg
In
GetPropertyDesc
Purpose
The CMetaClassDesc GetPropertyDesc function returns the property description object
specified by name. The application is responsible to free returned PropertyDesc object.
Syntax
HRESULT GetPropertyDesc(
LPCTSTR strPropertyName,
278
Argument
In/Out
Description
Name
In
pProperty
Out
GetPropertyDescColl
Purpose
The CMetaClassDesc GetPropertyDescColl function returns all property description objects
for the class.
Syntax
HRESULT GetPropertyDescColl(
LLCMetaPropertyDesc &objectList);
Argument
In/Out
Description
objectList
Out
GetRelationshipDescColl
Purpose
The CMetaClassDesc GetRelationshipDescColl function returns the relationship description
collection associated with the class of the object.
Syntax
HRESULT GetRelationshipDescColl(
LLCMetaRelationshipDesc &relobjectList);
Argument
In/Out
Description
relobjectList
Out
GetAbstractClassFlag
Purpose
GetAbstractClassFlag retrieves the flag that indicates if the class is an abstract class.
Syntax
const short GetAbstractClassFlag()
279
SetAbstractClassFlag
Purpose
SetAbstractClassFlag sets the flag indicating if this will be a abstract class.
Syntax
void SetAbstractClassFlag (const short FlagArg)
Argument
In/Out
Description
FlagArg
In
GetDescriptionRequired
Purpose
GetDescriptionRequired returns the current value of the DescriptionRequired property for
the class. It is assumed that the application has called ReadObject or WriteObject for the
current object.
Syntax
const bool GetDescriptionRequired();
SetDescriptionRequired
Purpose
SetDescriptionRequired is used to change the current setting of the class property indicating if
a class object must have a non-null Description property. The change will not be effective
until WriteObject is called.
The class loid must be greater than 10000.
If bRequired is true the class may not be in the reserved metamodels: DIM, CLM, MDSBase
and CWM.
If bRequired is true and one or more existing objects in the class do not currently have a
description, the error META_E_MISSING_REQUIRED_DESCRIPTION will be returned by
WriteObject
Syntax
HRESULT SetDescriptionRequired(const bool bRequired);
Argument
In/Out
Description
bRequired
In
280
GetSuperClasses
Purpose
GetSuperClasses retrieves the list of superclasses defined for the class.
Syntax
void GetSuperClasses(MetaObjectIDVector &superClassesList);
Argument
In/Out
Description
superClassesList
Out
SetSuperClasses
Purpose
SetSuperClasses sets the list of classes that this class will inherit from.
Syntax
HRESULT SetSuperClasses (MetaObjectIDVector &superClassesList)
Argument
In/Out
Description
superClassesList
In
GetSubClasses
Purpose
GetSubClasses retrieves the list of subclasses that inherit from this class.
Syntax
HRESULT GetSubClasses(MetaObjectKeyVector &returnSubClassList);
Argument
In/Out
Description
returnSubClassList
Out
GetDerivedClassFlag
Purpose
GetDerivedClassFlag retrieves the flag that indicates if the class is an derived class.
Syntax
const short GetDerivedClassFlag ()
281
SetDerivedClassFlag
Purpose
SetDerivedClassFlag sets the flag indicating if this will be a derived class.
Syntax
void SetDerivedClassFlag (const short FlagArg)
Argument
In/Out
Description
FlagArg
In
GetBaseClassID
Purpose
GetBaseClassID retrieves the base class ID of the derived class.
Syntax
const OBJECTID_t GetBaseClassID ()
SetBaseClassID
Purpose
SetBaseClassID sets the base class id for the derived class.
Syntax
void SetBaseClassID (const OBJECTID_t ClassIDArg)
Argument
In/Out
Description
ClassIDArg
In
GetVersioningSupport
Purpose
GetVersioningSupport returns the current value for the class object's VersioningSupport
property.
Description
The VersioningSupport property has three possible values:
282
the class. Even though multiple versions may exist for a data object, WriteObject will never
create new versions for existing data objects; only the latest version for an object will be
modified.
For an existing class, the value is only meaningful after a ReadObject of the class.
Syntax
META_VERSIONING_SUPPORT_LEVELS GetVersioningSupport();
SetClassDescVersioningFlag
Purpose
SetClassDescVersioningFlag allows an application to dynamically enable or disable data
versioning for a class.
Description
If bVersioningAllowed is false, data versioning will be disabled for the class. If
bVersioningAllowed is true and repository versioning is enabled, then data versioning will be
enabled for the class, else versioning will be left disabled for the class. bDeleteVersions
indicates if existing historical versions for objects in the class should be deleted or retained.
The class is specified with the same values as needed for ReadObject.
Disabling versioning can affect the existing objects in the class. If bDeleteVersions is true, all
objects in the class will be modified so that all non-published versions are deleted and the
remaining versions will be renumbered to version one. This can be a very lengthy operation. If
bDeleteVersions is false, all existing versions of data objects in the class will be retained. Any
new objects added to the class will be created without support of versioning.
Changing the data versioning support for a class will also change the versioning support for
any derived classes that have the class as their base class. A derived class's data versioning
support is always the same as that of the base class.
Requirements
The object name or the object ID (internal or globally unique) must be set
Derived classes may not be used with this API.
The caller must have write permission for the class.
Syntax
HRESULT SetClassDescVersioningFlag(
const bool bVersioningAllowed,
const bool bDeleteVersions = false);
Argument
In/Out
Description
bVersioningAllowed
in
283
Argument
In/Out
Description
bDeleteVersions
in
Indicates if existing data objects in the class should have their nonpublished versions deleted. True = delete all non-published
versions; false = retain all non-published versions
WriteObject/WriteVersion
Purpose
The CMetaClassDesc WriteObject and WriteVersion functions update the CMetaClassDesc
object.
Description
The properties of a CMetaClassDesc object that can be modified are:
Name
Description
DescriptionRequired
OwnerID
SecurityProfileID
SuperClasses
Name
100-1063
MDSMetaModel classes
Syntax
HRESULT WriteObject ();
HRESULT WriteVersion ();
284
CMetaPropertyDesc Class
CMetaPropertyDesc Class Functions
The CMetaPropertyDesc class functions are:
CMetaPropertyDesc Constructors
Initialize
GetCharacterSetName
SetCharacterSetName
GetPropertyLength
GetPropType
SetPropType
GetRelPropID
SetRelPropID
GetTotalDigits
SetTotalDigits
GetVarType
SetVarType
GetDerivedPropertyFlag
SetDerivedPropertyFlag
GetBasePropertyName
SetBasePropertyName
GetRelationshipsToProperty
SetRelationshipsToProperty
Initialize
WriteObject/WriteVersion
ReadObject/ReadVersion
CMetaPropertyDesc Constructors
To create a PropertyDesc object initially, use the CMetaClassDesc object for the owning class.
To read an existing CMetaPropertyDesc, if the ObjectID or ObjectGUID is known, instantiate
the object using the appropriate constructor, then use the ReadObject function.
CMetaPropertyDesc();
This is the default CMetaPropertyDesc constructor.
285
Initialize
Purpose
The CMetaPropertyDesc Initialize function resets the CMetaPropertyDesc attributes to
default values.
Syntax
void Initialize(void);
GetCharacterSetName
Purpose
The CMetaPropertyDesc GetCharacterSetName function returns the character set name for
the property if specified.
Syntax
LPCTSTR GetCharacterSetName();
SetCharacterSetName
Purpose
The CMetaPropertyDesc GetCharacterSetName function sets the character set name for the
property.
Syntax
void SetCharacterSetName (LPCTSTR charSetArg)
Argument
In/Out
Description
charSetArg
In
GetPropertyLength
Purpose
The CMetaPropertyDesc GetPropertyLength function retrieves the size in bytes of the
property if the property is defined as characters, or the number of digits if the property is
defined as a numeric type.
286
Syntax
const long GetPropertyLength(void)
SetPropertyLength
Purpose
The CMetaPropertyDesc SetPropertyLength function sets the size in bytes of the property if
the property is defined as characters, or the number of digits if the property is defined as a
numeric type.
Syntax
void SetPropertyLength (const long propLengthArg)
Argument
In/Out
Description
propLengthArg
In
GetPropType
Purpose
The CMetaPropertyDesc GetPropType function retrieves the property type of the property.
Syntax
const short GetPropType(void);
SetPropType
Purpose
The CMetaPropertyDesc SetPropType function sets the property type of the property.
Syntax
void SetPropType (const short propTypeArg)
Argument
In/Out
Description
proTypeArg
In
GetRelPropID
Purpose
The CMetaPropertyDesc GetRelPropID function retrieves user-defined ID number for this
property.
287
Syntax
const long GetRelPropID(void);
SetRelPropID
Purpose
The CMetaPropertyDesc SetRelPropID function sets the user-defined ID number for this
property.
Syntax
void SetRelPropID (const short propIDArg)
Argument
In/Out
Description
propIDArg
In
GetTotalDigits
Purpose
The CMetaPropertyDesc GetTotalDigits function retrieves the number of digits to the right of
the decimal point for a numeric property.
Syntax
const long GetTotalDigits(void)
SetTotalDigits
Purpose
The CMetaPropertyDesc SetTotalDigits function sets the number of digits to the right of the
decimal point for a numeric property.
Syntax
void SetTotalDigits (const short totalDigitsArg)
288
Argument
In/Out
Description
totalDigitsArg
In
GetVarType
Purpose
The CMetaPropertyDesc GetVarType function retrieves the variant type of the property.
Syntax
const unsigned short GetVarType(void);
SetVarType
Purpose
The CMetaPropertyDesc SetVarType function sets the variant type of the property.
Syntax
void SetVarType (const unsigned short varTypeArg)
Argument
In/Out
Description
varTypeArg
In
Defines the data type that will be used by the application to set
and get the data field. If COM and the CMetaCOM APIs are to
be used to reference this class, then this Variant Type must match
the OLE Automation type of the property.
GetDerivedPropertyFlag
Purpose
GetDerivedPropertyFlag retrieves the flag that indicates if this is a derived property.
Syntax
const short GetDerivedPropertyFlag ()
SetDerivedPropertyFlag
Purpose
SetDerivedPropertyFlag sets the flag that indicates if this is a derived property.
Syntax
void SetDerivedPropertyFlag (const short flagArg)
Argument
In/Out
Description
flagArg
In
289
GetBasePropertyName
Purpose
GetBasePropertyName retrieves the name of the property in the origin class that is retrieved
for the derived property.
Syntax
LPCTSTR GetBasePropertyName ()
SetBasePropertyName
Purpose
SetBasePropertyName sets the name of the property in the origin class that is retrieved for the
derived property.
Syntax
void SetBasePropertyName (LPCTSTR basePropArg)
Argument
In/Out
Description
basePropArg
In
GetRelationshipsToProperty
Purpose
GetRelationshipsToProperty retrieves the relationships used to traverse to the origin property.
Syntax
void GetRelationshipsToProperty (MetaObjectIDVector &relList)
Argument
In/Out
Description
relListArg
Out
SetRelationshipsToProperty
Purpose
SetRelationshipsToProperty sets the relationships used to traverse to the origin property.
Syntax
HRESULT SetRelationshipsToProperty (MetaObjectIDVector &relList)
290
Argument
In/Out
Description
relListArg
In
GetIsRequired
Purpose
GetIsRequired indicates if the property is required to have a value.
Syntax
const bool GetIsRequired();
WriteObject/WriteVersion
Purpose
The CMetaPropertyDesc WriteObject and WriteVersion functions update the
CMetaPropertyDesc object.
Description
The properties of a CMetaPropertyDesc object that can be modified are:
Description
OwnerID
SecurityProfileID
Name
301-399
MDSMetaModel properties
Syntax
HRESULT WriteObject ();
HRESULT WriteVersion();
ReadObject/ReadVersion
Purpose
ReadObject and ReadVersion functions read the specified property object.
Requirements
Versioning of property objects is not supported.
291
CMetaRelationshipDesc Class
CMetaRelationshipDesc Class Functions
The CMetaRelationshipDesc class functions are:
CMetaRelationshipDesc Constructors
Initialize
SetPropagateDeleteFlag
SetUniqueNamesFlag
SetDestClassID
SetOrigClassID
GetDestClassID
GetOriginClassID
GetPropagateDeleteFlag
GetUniqueNamesFlag
WriteObject/WriteVersion
ReadObject/ReadVersion
CMetaRelationshipDesc Constructors
To create a new CMetaRelationshipDesc object, use the CMetaAIMDesc object for the owning
AIM.
To read an existing CMetaRelationshipDesc, use the parent CMetaAIM object if only the
name is known.
If the ObjectGUID or ObjectID is known, use the constructors listed below, followed by the
ReadObject function invocation.
CMetaRelationshipDesc(const GUID GID);
This CMetaRelationshipDesc constructor instantiates a CMetaRelationshipDesc identified by
the ObjectGUID.
CMetaRelationshipDesc(const OBJECTID_t lOID);
This CMetaRelationshipDesc constructor instantiates a CMetaRelationshipDesc identified by
the internal ObjectID.
292
CMetaRelationshipDesc();
This is the default CMetaRelationshipDesc constructor.
Initialize
Purpose
The Initialize function resets the CMetaRelationshipDesc attributes to default values.
Syntax
void Initialize(void);
SetPropagateDeleteFlag
Purpose
SetPropagateDeleteFlag sets the flag that indicates if delete propagation is set on the
relationship description.
Syntax
void SetPropagateDeleteFlag (const short flagArg)
Argument
In/Out
Description
flagArg
In
SetUniqueNamesFlag
Purpose
SetUniqueNamesFlag sets the flag that indicates if unique naming is set on the relationship
description
Syntax
void SetUniqueNamesFlag (const short flagArg)
Argument
In/Out
Description
flagArg
In
293
SetDestClassID
Purpose
SetDestClassID sets the destination class id of the relationship description
Syntax
void SetDestClassID (const OBJECTID_t classArg)
Argument
In/Out
Description
classArg
In
SetOrigClassID
Purpose
SetOrigClassID sets the origin class id of the relationship description.
Syntax
void SetOrigClassID (const OBJECTID_t classArg)
Argument
In/Out
Description
classArg
In
GetDestClassID
Purpose
The GetDestClassID function retrieves the destination class ID of the relationship description.
Syntax
const OBJECTID_t GetDestClassID(void);
GetOriginClassID
Purpose
The GetOriginClassID function retrieves the origin class ID of the relationship description.
Syntax
const OBJECTID_t GetOriginClassID(void);
GetPropagateDeleteFlag
Purpose
The GetPropagateDeleteFlag function retrieves the flag that indicates if delete propagation is
set on the relationship description.
294
Syntax
const short GetPropagateDeleteFlag(void);
GetUniqueNamesFlag
Purpose
The GetUniqueNamesFlag function retrieves the flag that indicates if unique naming is set on
the relationship description.
Syntax
const short GetUniqueNamesFlag(void);
WriteObject/WriteVersion
Purpose
The WriteObject and WriteVersion functions update the CMetaRelationshipDesc object.
Description
The properties of a CMetaRelationshipDesc object that can be modified are:
Name
Description
OwnerID
SecurityProfileID
UniqueNamesFlag
Name
200-208
MDSMetaModel relationships
Syntax
HRESULT WriteObject ();
HRESULT WriteVersion();
295
ReadObject/ReadVersion
Purpose
ReadObject and ReadVersion read the specified relationship object.
Requirements
Versioning of relationship objects is not supported, thus there exists only one version of a
relationship object.
The object ID (internal or globally unique) must be set.
Syntax
HRESULT ReadObject ();
HRESULT ReadVersion ();
296
CHAPTER 13
Security Classes
CMetaApplicationGroup Class
CMetaUser Class
CMetaSecurityProfileEntry Class
CMetaSecurityProfile Class
The CMetaApplicationGroup class and CMetaUser class define users who have access to meta
data objects.
A user must be defined to enable logon to MDS. The logged on user has access to objects based
on the access permissions defined for each object.
An Applications Group defines a set of users. For objects assigned to an Application Group, all
users in the Application Group have the same access to the objects based on the Application
Group access permissions assigned to objects.
The CMetaSecurityProfile and CMetaSecurityProfileEntry classes are used to create, delete,
and update permissions in security profiles.
Only a super user can use these APIs.
CMetaApplicationGroup Class
CMetaApplicationGroup Class Functions
The following is a list of the functions in the CMetaApplicationGroup Class:
CMetaApplicationGroup Constructors
AddUserToApplicationGroup
CreateApplicationGroup
GetUserCollection
RemoveUserFromApplicationGroup
Initialize
297
CMetaApplicationGroup Constructors
To create a CMetaApplicationGroup object initially, use the default constructor. Follow the
constructor with a call to the CreateApplicationGroup function.
Note: Names of application groups must be unique within the repository database.
To read an existing group object from the repository database, instantiate the object using the
appropriate constructor, then use the ReadObject function.
CMetaApplicationGroup();
This is the default constructor.
CMetaApplicationGroup(const OBJECTID_t lOID);
This constructor instantiates a CMetaApplicationGroup identified by the ObjectID. Follow
the constructor with a call to the ReadObject function.
CMetaApplicationGroup(LPCTSTR name);
This constructor instantiates a CMetaApplicationGroup identified by a name. Follow the
constructor with a call to the ReadObject function.
AddUserToApplicationGroup
Purpose
The AddUserToApplicationGroup function adds user strName to the collection of users
belonging to this Application Group.
Syntax
HRESULT AddUserToApplicationGroup(
LPCTSTR strName);
Argument
In/Out
Description
strName
In
CreateApplicationGroup
Purpose
The CreateApplicationGroup function creates an application group object in the repository
database.
Requirements
The name of an application group must be unique.
Syntax
HRESULT CreateApplicationGroup(LPCTSTR Name,
LPCTSTR Description=NULL);
298
Argument
In/Out
Description
Name
In
Description
In (Optional)
GetUserCollection
Purpose
The GetUserCollection function retrieves the collection of users belonging to this
ApplicationGroup.
Syntax
HRESULT GetUserCollection(
vector<CMetaUser> &UserList);
Initialize
Purpose
The Initialize function resets the CMetaApplicationGroup attributes to default values.
Syntax
void Initialize(void);
RemoveUserFromApplicationGroup
Purpose
The RemoveUserFromApplicationGroup function removes user strName from the collection
of users belonging to this Application Group.
Syntax
HRESULT RemoveUserFromApplicationGroup(
LPCTSTR strName);
Argument
In/Out
Description
strName
In
ReadObject / ReadVersion
The CMetaApplicationGroup class does not support versioning, thus there exists only one
version for such an object, and ReadVersion functions equivalently to ReadObject.
299
WriteObject / WriteVersion
CMetaApplicationGroup does not support versioning, thus there exists only one version for
such an object, and WriteVersion functions equivalently to WriteObject.
CMetaUser Class
CMetaUser Class Functions
The following is a list of the functions in the CMetaUser class:
CMetaUser Constructors
Initialize
CreateUser
CreateSuperuser
SetPassword
ChangePassword
IsSuperUser
ReadObject / ReadVersion
WriteObject / WriteVersion
CMetaUser Constructors
CMetaUser ();
This is the default CMetaUser constructor.
CMetaUser (const OBJECTID_t lOID);
This CMetaUser constructor instantiates a CMetaUser identified by the ObjectID.
CMetaUser (LPCTSTR UserName);
This CMetaUser constructor instantiates a CMetaUser identified by name.
Initialize
Purpose
The Initialize function resets the CMetaUser attributes to default values.
Syntax
void Initialize(void);
300
CreateUser
Purpose
The CreateUser function creates a user to enable the application to logon to Meta Data
Services.
Requirement
The Name of the user must be unique.
Syntax
HRESULT CreateUser(LPCTSTR Name,
LPCTSTR Password,
LPCTSTR Desc=NULL);
Argument
In/Out
Description
Name
In
Password
In
Desc
In (Optional)
CreateSuperuser
Purpose
Creates a super user to enable login to Meta Data Services.
Note: A super user has all of the privileges currently allowed to the built-in meta super user
'metasu'.
Requirements
The name of the super user must be unique. A super user may only be created by another
super user.
Syntax
HRESULT CreateSuperuser(LPCTSTR Name,
LPCTSTR Password,
LPCTSTR Desc=NULL);
Argument
In/Out
Description
Name
In
Password
In
Desc
In (Optional)
301
SetPassword
Purpose
The SetPassword function sets the password in the user object.
Requirement
This must be followed by a WriteObject function.
Note: It is recommended that the application use the ChangePassword function to change a
user password.
Syntax
HRESULT SetPassword(
const LPCTSTR NewPassword);
Argument
In/Out
Description
NewPassword
In
ChangePassword
Purpose
The ChangePassword function changes the password of the user.
Requirements
Only the user or a super user can change the password.
The name of the user must be set in the object. OldPassword must be the current password for
the user unless the logged on user is a super user.
Note: If the logged on user is a super user, OldPassword is not required to change any users
password.
Syntax
HRESULT ChangePassword(
LPCTSTR OldPassword,
LPCTSTR NewPassword);
Argument
In/Out
Description
OldPassword
In
NewPassword
In
New Password.
IsSuperUser
Purpose
The IsSuperUser function returns the TRUE if the current user is a super user.
302
Syntax
bool IsSuperUser ();
ReadObject / ReadVersion
The CMetaUser does not support versioning, thus there exists only one version for such an
object, and ReadVersion functions equivalently to ReadObject.
WriteObject / WriteVersion
CMetaUser does not support versioning, thus there exists only one version for such an object,
and WriteVersion functions equivalently to WriteObject.
CMetaSecurityProfileEntry Class
Purpose
The CMetaSecurityProfileEntry class is used to add or change a user or application groups
permissions in a security profile.
Syntax
class CMetaSecurityProfileEntry
{
public:
bool: isUser;
OBJECTID_t ObjectID;
short permissions;
};
Argument
Description
isUser
ObjectID
Set to the ObjectID of the user or application group that is being granted
permissions in the security profile.
Permissions
303
Functions
GetAll
Purpose
Argument
In/Out
Description
isUser
Out
ObjectID
Out
AccessType
Out
SetAll
Purpose
304
Argument
In/Out
Description
isUser
In
ObjectID
In
AccessType
In
CMetaSecurityProfile Class
This section describes the CMetaSecurityProfile class functions that create, update, and delete
security profiles.
GetObjectsUsingSecurityProfile
GetPermissionList
PrintCMetaSecurityProfile
RemoveManyPermissions
RemovePermission
ReplacePermissions
SetAIMSecurityProfile
SetClassSecurityProfile
SetObjectSecurityProfile
SetSecurityProfile
UpdateManyPermissions
UpdatePermission
ReadObject
WriteObject
GetObjectsUsingSecurityProfile
Purpose
The GetObjectsUsingSecurityProfile function returns all objects using this profile.
Syntax
HRESULT GetObjectsUsingSecurityProfile (
MetaObjectClassKeyVector &keyList);
Argument
In/
Out
keyList
Out
Description
List of object class keys (classID, className, name and ID) of objects
assigned to this profile.
305
GetPermissionList
Purpose
The GetPermissionList function returns a vector of CMetaSecurityProfileEntrys that is the list
of the permissions in the profile.
Syntax
const SecurityProfileEntryVector &GetPermissionList(void) const;
PrintCMetaSecurityProfile
Purpose
The PrintCMetaSecurityProfile function displays to standard output the security profile
name, object ID, and permissions.
Syntax
void PrintCMetaSecurityProfile(void);
RemoveManyPermissions
Purpose
The RemoveManyPermissions function removes a list user or application group permissions
from the profile. The application must issue a WriteObject to write the change to the MDS
repository.
Syntax
HRESULT RemoveManyPermissions (
MetaObjectIDVector &ObjectIDList);
Argument
In/
Out
ObjectIDList
In
Description
List of IDs of the users and application groups to remove from
the profile.
RemovePermission
Purpose
The RemovePermission function removes a user or application group permission from the
profile. The application must issue a WriteObject to write the change to the MDS repository.
Syntax
HRESULT RemovePermission (
const OBJECTID_t ObjectID);
306
Argument
In/
Out
Description
ObjectID
In
ReplacePermissions
Purpose
The ReplacePermissions function replaces all existing permissions in the profile with the
permissions in the list. The application must issue a WriteObject to write the change to the
MDS repository.
Syntax
HRESULT ReplacePermissions (
SecurityProfileEntryVector &entryList);
Argument
In/
Out
Description
entryList
In
List of permissions.
SetAIMSecurityProfile
Purpose
The SetAIMSecurityProfile function assigns the Security Profile ID (set in the object) to the
AIMs specified in the AIMList. If PropagateFlag is set to MD_PROPAGATE, the Security
Profile ID in all class, property and relationship descriptions in the AIM will also be updated.
You must be initialized as a super user to use this function.
Syntax
HRESULT SetAIMSecurityProfile (
MetaObjectIDVector &AIMList,
const short PropagateFlag);
Argument
In/
Out
Description
AIMList
In
PropagateFlag
In
307
SetClassSecurityProfile
Purpose
The SetClassSecurityProfile function assigns the Security Profile ID (set in the object) to the
Class Description objects specified in the classList. If PropagateFlag is set to
MD_PROPAGATE, the Security Profile ID in all objects in the class will also be updated. You
must be initialized as a super user to use this function.
Syntax
HRESULT SetClassSecurityProfile (
MetaObjectIDVector &classList,
const short PropagateFlag);
Argument
In/
Out
Description
classList
In
PropagateFlag
In
SetObjectSecurityProfile
Purpose
The SetObjectSecurityProfile function assigns the Security Profile ID (set in the object) to the
objects specified in the objList.
Requirements
All objects in the list must be in the same class.
You must be initialized as a super user to use this function.
Description
If PropagateFlag is set to MD_PROPAGATE, the Security Profile ID in all related objects will
also be updated.
Related objects are determined by the containment relationships of the specified object. A
containment relationship is a relationship that has delete propagation flag turned on. If object
A is said to contain object B, it means that A is the origin object and B is the destination object
of a containment relationship. Propagation will continue until an object is reached which has
no containment relationships.
It is assumed that many customers will partition access to DIM objects based on databases.
Most of the DIM relationships are containment relationships. The propagate feature allows
administrators to set the security profile ID on a specific database object and the security
profile ID will be propagated to all objects in the database.
308
Syntax
HRESULT SetObjectSecurityProfile (
MetaObjectIDVector &objList,
const short PropagateFlag);
Argument
In/
Out
Description
objList
In
PropagateFlag
In
DataBase
DatabaseHasTables
DatabaseHasViews
Table
TableHasCheckConstraints
Check
View
TableHasColumns
Column
TableHasIndices
Index
IndexContainsColumns
IndexColumn
ViewHasTableColumns
ViewHasColumns
ViewColumn
TableHasRefConstraints
Reference
ConstraintReferenceColumns
ReferenceColumn
3047A010
SetSecurityProfile
Purpose
The SetSecurityProfile function assigns the Security Profile ID (set in the object) to the objects
in a list.
Description
The list can contain objects in different classes.
Requirements
The ClassID and the ObjectID of the object must be set in each CMetaObjectClassKey in the
ObjList.
You must be initialized as a super user to use this function.
309
Syntax
HRESULT SetSecurityProfile (
MetaObjectClassKeyVector &ObjList);
Argument
In/
Out
ObjectList
In
Description
List of object class keys (classID, className, name and ID) of objects
assigned to this profile.
UpdateManyPermissions
The UpdateManyPermissions function updates a list of user and application group
permissions in the profile.
The application must issue a WriteObject to write the change to the MDS repository.
HRESULT UpdateManyPermissions (
SecurityProfileEntryVector &entryList,);
Argument
In/
Out
Description
EntryList
In
List of permissions.
UpdatePermission
Purpose
The UpdatePermission function changes the permission for a user or application group in the
profile.
Requirements
The application must issue a WriteObject to write the change to the MDS repository.
Syntax
HRESULT UpdatePermission (
const bool IsUser,
const OBJECTID_t ObjectID,
const short AccessType);
310
Argument
In/
Out
IsUser
In
ObjectID
In
AccessType
In
Description
ReadObject
Purpose
Reads the security profile object.
Requirements:
The internal object ID must be set.
Syntax
HRESULT ReadObject(void);
WriteObject
Purpose
Writes the security profile object.
Requirements:
The internal object ID must be set.
Syntax
HRESULT WriteObject(void);
311
312
CHAPTER 14
MetaCOMExport Library
The COM libraries supplement the C++ classes by providing access to the repository using
Visual Basic, J++, and scripting languages such as VBScript, JScript, and XML.
ColumnFilter
Prior to MDS 13.0, new GetClassObject and Get Collection routines in the MetaActive Class
return all the properties for an object. This can be time consuming if only a few of the unique
properties are actually needed.
The following routines provide the ability to specify and restrict the unique properties to be
returned through the used of a ColumnFilter parameter:
GetClassObjectsByProperty2
GetClassObjectVersionsByProperty2
GetCollectionsByProperty3
GetCollectionVersionsByProperty3
GetClassObjectsByRange2
GetClassObjectVersionsByRange2
If the ColumnFilter parameter for these routines is NULL (or the IMetaInfoKeyList is empty)
all unique properties of every object are returned by the method call. This is the same
behavior as that of the previous version of the call.
Specify only those unique properties to be returned by adding an IMetaInfoKey object, with
its ObjectID set to the Property ID (PID) of the property, for each property needed, to the
ColumnFilter list.
313
Depending on the number of objects and the number of unique properties not needed, and
therefore not returned, this can result in a significant savings in time, and database spoolspace. (The SQL generated by the MDS engine requests only those columns (properties)
specified when it builds the SELECT statement.)
For security and other reasons, all "common" properties are always returned, with the
exception of the Description and ObjectGUID properties. When unique properties are
specified in the ColumnFilter list, these two common properties will have empty and
NULLGUID values respectively, unless their PIDs are also added to the ColumnFilter list.
(Note: the PIDs for common properties can be found in the MetaGlobals_h.bas file.)
Example
Dim colList As METACOMEXPORT21Lib.MetaInfoKeyList
Set colList = New MetaInfoKeyList
Dim col As MetaInfoKey
Set col = New MetaInfoKey
col.ObjectID = dbaim_h.PID_DATABASE_DATABASEID
colList.Add col
col.ObjectID = dbaim_h.PID_DATABASE_TYPE
colList.Add col
The "colList" object can now be used for the ColumnFilter parameter to retrieve objects from
the DIM Column class. The result will be the usual number of objects, based on any other
filters present, but with only the DatabaseID and DatabaseType unique properties present in
each object's PropertyItem collection. Each object will also have all its common property
values present, except for Description and ObjectGUID. To have either of these returned also,
simply add their PIDs to the colList.
MetaActive Class
The IMetaActive COM class contains one interface: IMetaActive. The interface supports a
variety of functions and methods to maintain repository objects.
314
Property
Type
Description
DIMInfoNeeded
Boolean
Initialize
Purpose:
The Initialize method will create a connection to the MDS repository. Either the Initialize or
SignOn method must be called before any other MDS COM calls. The connection remains
open until the DeInitialize method is called.
Syntax:
HRESULT Initialize(
[in] BSTR Username,
[in] BSTR Password);
Argument
In/Out
Description
Username
In
Password
In
DeInitialize
Purpose:
The DeInitialize method removes or closes the connection to the MDS repository.
Description:
This method should always be called before terminating to insure the database connection to
the MDS repository is properly closed.
Syntax:
HRESULT DeInitialize();
SignOn
Purpose:
Each MDS MetaActive COM class object will support one user. If the user signs on with a
different user name, any subsequent MDS API calls will have the new user name as the caller
and the security will be based on the user access rights. To support multiple users in a single
process, create multiple MetaActive objects and assign one user per each of the MetaActive
objects.
If the MDS repository has not already been initialized, it will be at this time.
Syntax:
HRESULT SignOn(
315
Argument
In/Out
Description
Username
In
Password
In
SignOff
Purpose:
Use this method to sign off the user that was signed on.
Description
If the MDSUserName is not specified, the MDS user associated with this MetaActive object is
signed off. An MDS user can be associated with a MetaActive object in one of three ways: first,
during an Initialize call, second, during a SignOn call or third, by setting the MDSCaller
property for the object. If no user name is specified for the call, and no user is associated with
the MetaActive object, the engine will return a META_E_USER_NOT_SIGNED_ON error.
Syntax:
HRESULT SignOff([in] BSTR MDSUserName);
ReadObject
Purpose:
This may require waiting for write locks held by other transactions to be released. MDS does
not support reads of write-locked MDS repository data.
In a repository with versioning on, ReadObject always returns the published or current
version. This includes the case where the LOID of the MetaInfo object to be read is *not* the
LOID of the published version. This allows ReadObject to behave in a similar fashion on
repositories with versioning on or off. To read a specific object version, use
ReadObjectVersion.
Reading an object from one of the classes in the DIM AIM (DatabaseModel meta model) will
also return the object's DIM information (System Name, Database Name and Table Name).
This DIM information is placed in the "DIMInfo" property of the MetaInfo object. This
information is acquired by several JOIN operations, and can cause some performance
overhead, especially in version-enabled repositories.
If DIM information is not needed for an object from a DIM class, set the MetaActive
DIMInfoNeeded property to FALSE before the object is read. With this setting the MDS
engine executes the read as if the object is from a non-DIM class, so it will not execute the
DIM-related JOINs. All other object properties will be retrieved as usual; the DIM fields will
316
be empty. The result can be significant performance savings when the DIM information is not
needed. Note that objects from classes not in the DIM AIM never retrieve DIM information,
and so never incur the JOIN overhead.
Requirements:
The MDS COM MetaInfo object must be created and the object identification attributes must
be set before calling the ReadObject method. The object identification attributes can be the
class ID (internal or globally unique) and the object name or the object identifier (internal or
globally unique).
Syntax:
HRESULT ReadObject(
[in] IMetaInfo *MetaInfo);
Argument
In/Out
Description
Metainfo
In/out
ReadObjectVersion
Purpose:
Identical to the ReadObject call, except that in a repository with versioning on, the version of
the object read is the one specifically identified by the LOID in the MetaInfo interface object.
In contrast, the ReadObject call always returns the published version of the object no matter
which version the LOID is associated with.
Reading an object from one of the classes in the DIM AIM (DatabaseModel meta model) will
also return the object's DIM information (System Name, Database Name and Table Name).
This DIM information is placed in the "DIMInfo" property of the MetaInfo object. This
information is acquired by several JOIN operations, and can cause some performance
overhead, especially in version-enabled repositories.
If DIM information is not needed for an object from a DIM class, set the MetaActive
DIMInfoNeeded property to FALSE before the object is read. With this setting the MDS
engine executes the read as if the object is from a non-DIM class, so it will not execute the
DIM-related JOINs. All other object properties will be retrieved as usual; the DIM fields will
be empty. The result can be significant performance savings when the DIM information is not
needed. Note that objects from classes not in the DIM AIM never retrieve DIM information,
and so never incur the JOIN overhead.
Syntax:
HRESULT ReadObjectVersion(
[in] IMetaInfo *MetaInfo);
317
Argument
In/Out
Description
Metainfo
In/out
ReadDormantObject
Purpose:
This routine extends the functionality of ReadObject to return an object that is either active
("mdsCurrent") or dormant.
Description:
If the DIMInfoNeeded property for this class has been set to True, the IMetaInfo object will
have its DIMInfo information associated with it.
If the return status is S_OK, check the PublishState to determine if the object is current
(PublishState is "mdsCurrent") or is dormant (PublishState is "mdsDormant").
The order of evaluation to determine the object to be read is:
1
Reading an object from one of the classes in the DIM AIM (DatabaseModel meta model) will
also return the object's DIM information (System Name, Database Name and Table Name).
This DIM information is placed in the "DIMInfo" property of the MetaInfo object. This
information is acquired by several JOIN operations, and can cause some performance
overhead, especially in version-enabled repositories.
If DIM information is not needed for an object from a DIM class, set the MetaActive
DIMInfoNeeded property to FALSE before the object is read. With this setting the MDS
engine executes the read as if the object is from a non-DIM class, so it will not execute the
DIM-related JOINs. All other object properties will be retrieved as usual; the DIM fields will
be empty. The result can be significant performance savings when the DIM information is not
needed. Note that objects from classes not in the DIM AIM never retrieve DIM information,
and so never incur the JOIN overhead.
Requirements:
The requirements for specifying the object to be returned are the same as those for
ReadObject.
This routine can only be called by an administrative user.
Syntax:
HRESULT ReadDormantObject(
[in] IMetaInfo *MetaInfo);
318
Argument
In/Out
Description
Metainfo
In/out
WriteObject
Purpose:
Use this method to write the object into the MDS repository.
Description:
This may require waiting for write locks held by other transactions to be released. MDS does
not support reads of write-locked MDS repository data.
In a repository with versioning on, WriteObject writes a new version of the object to the
repository. The new object has the same GUID as the current version, but the LOID is
different and of course, and the version number is one greater than the current version of
the object. This also means that this write produces the new current or published version
of the object, replacing the previous current version (which is now in the inactive published
state). To re-write the current version of the object when versioning is on, use
WriteObjectVersion.
Requirements
The MDS COM MetaInfo object must be created and the object identification attributes must
be set before calling the WriteObject method. The object identification attributes can be the
class ID (internal or globally unique) and the object name or the object identifier (internal or
globally unique).
Syntax:
HRESULT WriteObject(
[in] IMetaInfo *MetaInfo);
Argument
In/Out
Description
Metainfo
In/out
WriteObjectVersion
Purpose:
Use this method to write the object into the MDS repository.
Description:
Identical to the WriteObject method except that in a repository with versioning on, the
published (current) version is updated, that is, a new version is not written. Since only the
current version of an object can be updated, if WriteObjectVersion is attempted on any other
version, the user will receive an error (META_E_OBJECT_ISFROZEN).
319
Argument
In/Out
Description
Metainfo
In/out
Delete
Purpose:
This may require waiting for write locks held by other transactions to be release.
In a repository with versioning on, Delete deletes all versions of the object from the repository
so that the object is completely removed from the repository. This makes its behavior
consistent with that of a non-versioned repository, where a Delete also completely removes the
object from the repository. If you wish to remove a specific version(s) of the object, use
DeleteVersion or DeleteVersionRange.
If the object is from a DIM class that has business information associated with it, and the
retain-business-objects feature is enabled, the object will have its PublishState changed to
"dormant" (mdsDormant) and not be removed from the repository. The object can be reactivated or removed at a later time with the appropriate function call (see
ActivateDormantObject or DeleteDormantObject, respectively). If the objects PublishState is
mdsDormant, this call will fail; use the DeleteDormantObject to specifically delete dormant
objects.
Requirements
The MDS COM MetaInfo object must be created and the object identification attribute must
be set before calling the Delete method. The object identification attribute is the object
identifier.
Syntax:
HRESULT Delete(
[in] IMetaInfo *MetaInfo);
Argument
In/Out
Description
Metainfo
In/out
DeleteDormantObject
Purpose:
Use this method to force the deletion an object from the MDS repository even if the object
would otherwise be a candidate for having its publish state set to dormant because the retainbusiness-objects feature is enabled.
320
Argument
In/Out
Description
Metainfo
In/out
ActivateDormantObject
Purpose:
Use this method to change a dormant object to an active object, and re-associate of all its
business information back to it.
Description:
The change is immediately made to the repository. By default, the (re)activation is propagated
to all objects that are in the destination class of any relationship from this (origin) object, and
those objects also have their business information (if any), re-associated. The call has no
effect if the object is already active, i.e. the PublishState is already "mdsCurrent".
Requirements
Argument
In/Out
Description
Metainfo
In/out
DeleteVersion
Purpose:
Identical to the Delete routine except that the DeleteVersion routine removes only that version
identified by the MetaInfo object; no other versions are deleted. If the current or published
version is deleted, then the previous version becomes the current version.
321
DeleteVersionRange
Purpose:
Identical to the DeleteVersion routine except that the user can specify a range of versions to be
deleted. If the startVersion parameter is less than 1, or greater than the highest version for the
object, an error will be returned. The endVersion parameter indicates the highest version to be
deleted. If endVersion is not provided, all versions from startVersion to the current version
will be deleted, and the new highest version number will become the current version. If
endVersion is 0, or greater than the current version number, the current version number will
be assumed to be the end version.
Syntax:
HRESULT
[in]
[in]
[in]
DeleteVersionRange(
IMetaInfo *MetaInfo
long startVersion.
long endVersion = 0);
GetObjectID
Purpose:
Use this method to get the local internal object identifier given the class identification and
name or object GUID.
Description:
If the ObjectGUID is known, it is sufficient by itself to retrieve the objects ID. However, if the
objects GUID is not known, you will need to specify either the ClassGUID or ClassID, along
with the objects name.
If the object is not found in the repository and there were not repository errors reported (that
is, HRESULT is S_OK), an ObjectID of 0 is returned.
Syntax:
HRESULT GetObjectID(
[in, optional] BSTR ObjectGUID,
[in, optional] BSTR ClassGUID,
[in, optional] long ClassID,
[in, optional] BSTR Name,
[out, retval] long *lpObjectID);
Argument
In/Out
Description
ObjectGUID
In
The string GUID of the object. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
322
Argument
In/Out
Description
ClassGUID
In
The string GUID of the class. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
ClassID
In
Name
In
IPObjectID
Out
GetClassObjects
Purpose:
This may require waiting for write locks held by other transactions to be release. If the
optional Name parameter is specified, the method will only retrieve the object with the
matching object name.
Requirements:
The class identification can be a class GUID or a class internal identifier. The class GUID is a
string representation of the GUID format (for example: {8CAF7740-EECD-11d3-9D0100902781A33F}).
Syntax:
HRESULT GetClassObjects(
[in] BSTR ClassGUID,
[in] long ClassID,
[in, optional] BSTR Name,
[out, retval] IMetaInfoList **InfoList);
Argument
In/Out
Description
ClassGUID
In
The string GUID of the object. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
ClassID
In
Name
In
InfoList
Out
323
GetClassObjectVersions
Purpose:
Use this method to get the local internal object identifier given the class identification and
name or object GUID.
Description:
Identical to the GetClassObjects routine except for the addition of the optional LabelName
parameter.
For repositories that have versioning enabled, this routine returns not only all objects for the
class, but all versions of each object, unless a label is specified by the LabelName parameter. In
that case, the label acts like a filter returning only those object versions that have the label
attached to them.
Syntax:
HRESULT GetClassObjects(
[in] BSTR ClassGUID,
[in] long ClassID,
[in, optional] BSTR Name,
[in, optional] BSTR LabelName,
[out, retval] IMetaInfoList **InfoList);
GetClassObjectKeys
Purpose:
Use this method to retrieve the MDS object keys in a particular class. This may require waiting
for write locks held by other transactions to be release.
Description:
If a value for the optional Name parameter is specified, only those objects whose names match
the pattern are returned. (Name-patterns accept Teradata wildcard characters.) If the Name
parameter is omitted, all objects from the class are returned. For a version-enabled repository,
the returned objects are the current, non-frozen versions only. To get inactive or frozen
versions of an object, use GetClassObjectVersionKeys or any GetClassObjects call.
Requirements:
The class identification can be a class GUID or a class internal identifier. The class GUID is a
string representation of the GUID format (i.e., {8CAF7740-EECD-11d3-9D0100902781A33F}).
Syntax:
HRESULT GetClassObjectKeys(
[in] BSTR ClassGUID,
[in] long ClassID,
[in, optional] BSTR Name,
[out, retval] IMetaInfoKeyList **InfoKeyList);
324
Argument
In/Out
Description
ClassGUID
In
The string GUID of the object. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
ClassID
In
Name
In
InfoKeyList
Out
GetDormantClassObjectKeys
Purpose:
Use this method to retrieve only the keys for dormant objects in a particular class.
Description:
This routine returns a list of IMetaInfoKeys in the InfoKeyList parameter, that identifies the
dormant objects in the specified class. Only the keys of dormant objects (PublishState =
"mdsDormant") are returned. The class must be specified by either the ClassGUID or ClassID.
If only one named object is to be returned from the class, its name should be specified in the
Name parameter.
This routine is expected to be used by a meta data browser to enable it to display the name
and/or id of objects in a class without having to read the entire collection of objects into
memory.
This routine can only be called by an administrative user.
Syntax:
HRESULT GetDormantClassObjectKeys(
[in] BSTR ClassGUID,
[in] long ClassID,
[in, optional] BSTR Name,
[out, retval] IMetaInfoKeyList **keyList);
GetClassObjectVersionKeys
Purpose:
Use this method to retrieve the MDS object keys in a particular class.
Description:
Identical to the GetClassObjectKeys routine except for the addition of the optional LabelName
parameter, and the return of a collection of MetaVersionedInfoKeys instead of MetaInfoKeys.
For repositories that have versioning enabled, this routine returns not only keys of all objects
in the repository, but all versions of all objects, unless a label is specified. If a label is specified
325
by the LabelName parameter, it acts as a filter returning only those object versions that have
the label attached to them.
If the optional Name parameter is provided, only those objects whose Name matches the
parameter are returned. [The match is exact but case-insensitive. The effect is similar to
adding a filter of WHERE (...) AND Name = name-value to the SQL.]
Syntax:
HRESULT GetClassObjectVersionKeys(
[in] BSTR ClassGUID,
[in] long ClassID,
[in, optional] BSTR LabelName,
[in, optional] BSTR Name,
[out, retval] IMetaversionedInfoKeyList **keyList);
GetCollections
Purpose:
Use this method to retrieve the MDS collection objects in the object relationship.
Description:
This may require waiting for write locks held by other transactions to be release. If the
optional Name parameter is specified, the method will only retrieve the object with the
matching object name in the object relationship.
Requirements
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
326
Argument
In/Out
Description
RelationshipID
In
Name
In
InfoList
Out
GetCollectionKeys
Purpose:
Use this method to retrieve the MDS collection object keys in the object relationship.
Description:
This may require waiting for write locks held by other transactions to be release. If the
optional Name parameter is specified, the method will only retrieve the object key with the
matching object name in the object relationship.
Requirements
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
327
Argument
In/Out
Description
RelationshipID
In
Name
In
InfoKeyList
Out
GetClassObjectsByProperty
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
Description:
The GetClassObjectsByProperty method returns a list of MetaInfo objects that matches the
selected criteria. The function allows the programmer to specify the property id, property
value and comparison operator on which to perform the search. If multiple properties are
specified in the search, the logical operator between the property searches must also be
specified.
If the DIMInfoNeeded property for this class has been set to True, the IMetaInfo objects
returned will each have DIM information associated with them. For more information on this
method and its usage, see Chapter 8: CMetaFilterInfo Class, and
GetClassObjectsByProperty in Chapter 7: CMetaObject Class.
Requirements:
The Filters parameter list must contain zero or more MetaFilter objects.
For each of the MetaFilter object, the property identifier or the property name must be set
and must contain a valid relative property identifier or name of a property description in
the class. The value must also be set on which the search will be made. This value must be
of the same type as the property description. For example, if the search is to be made on
the relative property identifier = 1 and the relative property identifier is defined as an
integer, the value must be set to an integer.
Syntax:
HRESULT
[in]
[in]
[in]
[in]
328
GetClassObjectsByProperty(
BSTR ClassGUID,
long ClassID,
BSTR NamePattern,
IMetaFilterList *Filters,
Argument
In/Out
Description
ClassGUID
In
The string GUID of the class. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
If the empty string ("") is entered, the class identifier is required.
ClassID
In
NamePattern
In
Filters
In
SortKey
In
InfoList
Out
GetClassObjectsByProperty2
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
Description:
329
GetClassObjectVersionsByProperty
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
Description:
Identical to the GetClassObjectsByProperty except for the addition of the optional LabelName
parameter.
For a repository that has versioning enabled, this routine returns all versions of those objects
that match the property filter, unless a label is also specified by the LabelName parameter. In
that case, the label acts as another filter returning only those objects that also have the label
attached to them. (Note also that the filter list and sort key list are both optional.)
Syntax:
HRESULT GetClassObjectVersionsByProperty(
[in] BSTR ClassGUID,
[in] long ClassID,
[in] BSTR NamePattern,
[in, optional] BSTR LabelName,
[in, optional] IMetaFilterList *Filters,
[in, optional] IMetaInfoKeyList *SortKeys,
[out, retval] IMetaInfoList **InfoList);
GetClassObjectVersionsByProperty2
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
Description:
GetClassObjectsByRange
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
330
This method is identical to the GetClassObjectsByProperty method with the addition of three
new parameters. The new parameters allow the caller to specify how many items are to be
returned in "RequestCount", and the offset in the result set at which to start returning in
"Start". It also returns the actual count of items in the ReturnCount parameter.
If the DIMInfoNeeded property for this class has been set to True, the IMetaInfo objects
returned will each have DIM information associated with them.
This method was created especially for browser applications where there are 10s or 100s of
thousands of items that could be returned, but only a "page full" at a time will be displayed. It
would be of no value for the application to wait for all the items to become available (which
could take some time), as happens in the GetClassObjectsByProperty call. With this method,
the user can specify a page-full of items starting at anywhere in the result set, and thereby get
results much faster than waiting for the entire result set.
Requirements:
Argument
In/Out
Description
ClassGUID
In
The string GUID of the class. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
If the empty string ("") is entered, the class identifier is required.
ClassID
In
NamePattern
In
Start
In
RequestCount
In
331
Argument
In/Out
Description
ReturnCount
Out
Filters
In
SortKey
In
InfoList
Out
GetClassObjectsByRange2
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
Description:
GetClassObjectVersionsByRange
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
332
Identical to the GetClassObjectsByRange routine except for the addition of the optional
LabelName parameter.
For repositories that have versioning enabled, this routine returns the range of all versions of
those class objects that match the property filter, unless a label is also supplied. If a label is
supplied by the LabelName parameter, it acts as a filter returning only those versions of the
objects that have the label attached to them. Since the LabelName is used with a "LIKE" clause
when the request is sent to the database, it can have Teradata wildcard search characters in it.
(Note that the filter list and sort-key list are also optional.)
Requirements:
GetClassObjectVersionsByRange2
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified class.
Description:
333
GetDormantClassObjects
Purpose:
Use this method to search for objects with their publish state set to mdsDormant in the
specified class.
Description:
This routine is essentially the same as the GetClassObjectsbyProperty routine, except the only
objects returned are those that are "dormant", i.e. they all have their PublishState =
"mdsDormant".
If the DIMInfoNeeded property for this class has been set to True, the IMetaInfo objects
returned will each have DIMInfo information associated with them.
Requirements:
Argument
In/Out
Description
ClassGUID
In
The string GUID of the class. The string format of the GUID is:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
If the empty string ("") is entered, the class identifier is required.
334
ClassID
In
NamePattern
In
Filters
In
SortKey
In
Argument
In/Out
Description
InfoList
Out
GetCollectionsByProperty
Purpose:
Use this method to perform searching on the matching properties of the objects in the
specified relationship.
Description:
The GetCollectionByProperty method returns a list of MetaInfo objects that matches the
selected criteria in the specified relationship. The function allows the programmer to specify
the property id, property value, and comparison operator on which to perform the search. If
multiple properties are specified in the search, the logical operator between the property
searches must also be specified.
If the DIMInfoNeeded property for this class has been set to True, the IMetaInfo objects
returned will each have DIM information associated with them. For more information on this
method and its usage, see Chapter 8: CMetaFilterInfo Class and Chapter 7: CMetaObject
Class.
Requirements:
The Filters parameter list must contain zero or more MetaFilter objects.
For each of the MetaFilter object, the property identifier or the property name must be set
and must contain a valid relative property identifier or name of a property description in
the class. The value must also be set on which the search will be made. This value must be
of the same type as the property description. For example, if the search is to be made on
the relative property identifier = 1 and the relative property identifier is defined as an
integer, the value must be set to an integer.
Syntax:
HRESULT GetCollectionsByProperty(
[in] CollectionType Direction,
[in] long ObjectID,
[in] BSTR RelationshipGUID,
[in] long RelationshipID,
[in] BSTR NamePattern,
[in] IMetaFilterList *Filters,
[in] IMetaInfoKeyList *SortKeys,
[out, retval] IMetaInfoList **InfoList);
335
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
NamePattern
In
Filters
In
SortKey
In
InfoList
Out
IsVersioningEnabled
Purpose:
Returns VARIANT_TRUE (true) if versioning is enabled (on) for the repository, else it returns
FALSE. Currently, repository versioning can only be enabled/disabled during a metacreate or
metamigrate.
Syntax:
HRESULT IsVersioningEnabled(
[out, retval] VARIANT_BOOL* val);
put_DIMInfoNeeded
Purpose:
336
When this property is set to "true" (its default setting), the DIM information will be set for
each of the returned items. This means that the MetaInfo property get_DIMInfo will return a
filled-out MetaDIMInfo class. This is the normal case. However, for performance reasons, the
user may not need DIM info for the returned MetaInfo items, and so can save time (and
memory) by setting the DIMInfoNeeded property to "false" before making the MetaActive
call. The only method calls affected by this property are:
ReadObject
ReadObjectVersion
GetClassObjectsByProperty
GetClassObjectVersionsByProperty
GetCollectionsByProperty
GetClassObjectsByRange
GetClassObjectVersionsByRange
GetCollectionsByProperty2
GetCollectionVersionsByProperty2
GetDormantClassObjects
ReadDormantObject
Syntax:
HRESULT put_DIMInfoNeeded(
[in] VARIANT_BOOL newVal);
get_DIMInfoNeeded
Purpose:
AddManyToCollection
Purpose:
Use this method to add a list of object keys to the object relationship.
Description:
This may require waiting for write locks held by other transactions to be release. The merge
argument indicates whether the specified object key list should be merged with the object
collection. If the merge argument is true (1), the MDS repository will ignore any object ids in
the list that are already in the object collection. If false, an error will be returned if the object
ids are already in the object collection.
337
AddManyToCollection(
CollectionType Direction,
long ObjectID,
BSTR RelationshipGUID,
long RelationshipID,
IMetaInfoKeyList *ObjectList,
optional] BOOL Merge);
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
ObjectList
In
Merge
In
A flag to indicate how to add the object list. If true, the operation
will merge the object list with the object collection. If false, an
error will be returned if the object identifier is already in the
object collection.
AddManyToRelCollection
Purpose:
Use this method to add a list of object keys to the object relationship where an Explanation
property is to be attached to relationship associations.
Description:
This call is identical to the AddManyToCollection call, except that the ObjectList parameter is
of type IMetaRelationInfoKeyList. This list contains MetaRelationInfoKey objects, instead of
MetaInfoKey objects which the AddManyToCollection call uses. The MetaRelationInfoKey
338
object includes an Explanation property which can be used to set the "Explanation" for the
each of the objects in the association. If relationship associations do not have an Explanation
property attached (which is the normal case), use the AddManyToCollection call.
Requirements:
AddManyToRelCollection(
CollectionType Direction,
long ObjectID,
BSTR RelationshipGUID,
long RelationshipID,
IMetaRelationshipInfoKeyList *ObjectList,
optional] VARIANT_BOOL Merge);
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
ObjectList
In
Merge
In
A flag to indicate how to add the object list. If true, the operation
will merge the object list with the object collection. If false, an
error will be returned if the object identifier is already in the
object collection.
RemoveManyFromCollection
Purpose:
Use this method to remove a list of object keys to the object relationship.
339
This may require waiting for write locks held by other transactions to be release. The merge
argument indicates whether the specified object key list should be removed from the object
collection. If the merge argument is true, the MDS repository will ignore any object ids in the
list that are not already in the object collection. If false, an error will be returned if the object
ids are not already in the object collection.
Requirements:
RemoveManyFromCollection(
CollectionType Direction,
long ObjectID,
BSTR RelationshipGUID,
long RelationshipID,
IMetaInfoKeyList *ObjectList,
optional] BOOL Merge);
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
340
RelationshipID
In
ObjectList
In
Merge
In
RemoveAllFromCollection
Purpose:
Use this method to remove all the objects from a collection, as specified by the direction,
object ID and Relationship indicated.
Description:
Objects are removed from the collection, not the repository. That is, collections are the result
of relationships which indicate a mapping between two objects, one set from the "Origin"
class(es) and the other from the "Destination" class(es). (We say "classes" because due to
inheritance, more that one class may be part of the Origin or Destination set of classes.) So
this routine removes objects from the collection, which means deleting the mapping, but not
the objects themselves, from the repository.
The optional parameters "TargetClass" and "AllClasses" are used for collections that involve
inheritance.
This routine call ultimately calls CMetaObject:: RemoveAllFromOrigCollection2 and
RemoveAllFromDestCollection2 in the MDS C++ class library.
Requirements:
RemoveAllFromCollection(
CollectionType Direction,
long ObjID,
optional] BSTR RelGUID,
optional] long RelID, ,
defaultvalue(0)] long TargetClass,
defaultvalue(0)] VARIANT_BOOL AllClasses);
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
In
341
Argument
In/Out
Description
TargetClass
In
AllClasses
In
ReplaceCollection
Purpose:
Use this method to replace a list of object keys of the object relationship. This may require
waiting for write locks held by other transactions to be release.
Description:
342
ReplaceCollection(
CollectionType Direction,
long ObjectID,
BSTR RelationshipGUID,
long RelationshipID,
IMetaInfoKeyList *ObjectList);
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
ObjectList
In
ReplaceRelCollection
Purpose:
Use this method to replace a list of object keys of the object relationship. This may require
waiting for write locks held by other transactions to be release.
Description:
Identical to the ReplaceCollection call, except that the ObjectList parameter is of type
IMetaRelationInfoKeyList. This list contains MetaRelationInfoKey objects, instead of
MetaInfoKey objects which the ReplaceCollection call uses. The MetaRelationInfoKey object
includes an Explanation property which can be used to set the Explanation for the each of the
objects in the association. If not attaching an Explanation to the relationship associations
(which would be the normal case), use the ReplaceCollection call.
Requirements:
ReplaceRelCollection(
CollectionType Direction,
long ObjectID,
BSTR RelationshipGUID,
optional, defaultvalue(0)] long RelationshipID,
IMetaRelationInfoKeyList *ObjectList);
343
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
ObjectList
In
GetBIZObjectsByRange
Purpose:
This routine returns business-related properties from the business classes, based on the
requested filter list. The Start and RequestCount parameters can be used to request a specific
range of the total result to be returned.
The following business classes and properties are included in the search:
344
Class
Properties
Table
View
Column
ViewColumn
Subject Area
BusinessEntity
BusinessAttribute
BusinessRule
This routine is the only way that MetaBIZInfoList can be created. This routine ultimately calls
CMetaBIZObject::GetBIZObjectsByRange in the MDS C++ class library.
Requirements:
Although the Filters parameter shows as optional, the engine will return a "missing required
parameter" if one is not set.
Syntax:
HRESULT GetBIZObjectsByRange(
[in] int Start,
[in] int RequestCount,
[in] MetaSortType SortType,
[out] VARIANT *ReturnCount,
[in] IMetaFilterList *Filters,
[in, optional] BSTR Label,
[out, retval] IMetaBIZInfoList **BIZInfoList);
Argument
In/Out
Description
Start
In
RequestCount
In
Used to specify the total number of rows to return for this call.
SortType
In
ReturnCount
Out
Filters
In
Label
In
BIZInfoList
Retval
GetBIZObjectVersionsByRange
Purpose:
This routine is identical to the GetBIZObjectsByRange except that all versions of each object
are returned, not just the "Current" (or Published) version. What this means is that, unlike the
345
GetBIZObjectsByRange call, if a label is specified in the Label parameter, it does not have to be
applied to the Current version of an object for that version of the object to be returned.
This routine makes sense to use only in versioned repositories; for non-versioned repositories,
use the GetBIZObjectsByRange call described above.
Syntax:
HRESULT GetBIZObjectVersionsByRange(
[in] int Start,
[in] int RequestCount,
[in] MetaSortType SortType,
[out] VARIANT *ReturnCount,
[in] IMetaFilterList *Filters,
[in, optional] BSTR Label,
[out, retval] IMetaBIZInfoList **BIZInfoList);
GetCollectionKeysByProperty
Purpose:
This routine is used to search the repository for the origin or destination collection of the
relationship of the object.
Description:
The search can be for repository objects of a given name (if desired), and/or using a filter list.
(The "origin or destination" is given by the Direction parameter, the "relationship" is given by
either the RelationshipGUID or RelationshipID parameter, the "object" itself is identified by
the ObjectID parameter, the "name" is given by the Name parameter and the "filter list" is
given by the Filters parameter.)
The caller can also specify the class ID of a particular class to search (the ReturnClass
parameter), or that all classes are to be searched (the AllClasses parameter). These two
parameters are useful for searches of relationships that have been inherited by the given object,
and can therefor include many classes in the resulting collection.
The user can also ask that the MDS engine check to see that the object ID is in the proper
origin or destination class for the given Destination and Relationship. Set the SkipValidation
parameter to false if this check is desired. If validation is not preformed (SkipValidation is
true), and this step would have returned an error, the call will simply return S_OK and have 0
objects in the InfoKeyList collection.
What is returned is a collection of IMetaInfoClassKey interface objects, which contain the
"keys", i.e. object IDs and Names, of all the items found in the repository for the collection,
which also match any filters given.
This routine ultimately calls CMetaObject::GetOrigCollectionKeys3 or
CMetaObject::GetDestCollectionKeys3 in the C++ class library.
Syntax:
HRESULT
[in]
[in]
[in,
346
GetCollectionKeysByProperty(
CollectionType Direction,
long ObjectID,
optional] BSTR RelationshipGUID,
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
Name
In
Filters
In
ReturnClass
In
AllClasses
In
347
Argument
In/Out
Description
SkipValidation
In
InfoClassKeyList
Retval
GetCollectionVersionKeysByProperty
Purpose:
This routine is used to search the repository for the origin or destination collection of the
relationship of the object.
Description:
Identical to the GetCollectionKeysByProperty routine except for the addition of the optional
LabelName parameter.
For repositories with versioning enabled, returns the collection keys for the object (given by
ObjectID and relationship identification) whose versions match the filter, unless a label is
supplied. If a label is specified by the LabelName parameter, it acts as an additional filter
returning only those object versions that also have the label attached to them.
Syntax:
HRESULT GetCollectionVersionKeysByProperty(
[in] CollectionType Direction,
[in] long ObjectID,
[in, optional] BSTR RelationshipGUID,
[in, optional] long RelationshipID,
[in, optional] BSTR Name,
[in, optional] BSTR LabelName,
[in, optional] IMetaFilterList *Filters,
[in, defaultvalue(0)] long ReturnClass,
[in, defaultvalue(0)] VARIANT_BOOL AllClasses,
[in, defaultvalue(0)] VARIANT_BOOL SkipValidation,
[out, retval] IMetaVersionedInfoKeyList **keyList);
GetCollectionVersionRelKeys
Purpose:
Use this routine to search the repository for the origin or destination collection of the
relationship object if the Explanation property is attached to some or all of the relationship
pairs.
Description:
348
This list contains MetaVersionedInfoRelKey objects. The objects are the same as
MetaVersionedInfoClassKey objects (which are returned in the list from the
GetCollectionVersionKeysbyProperty call), with the addition of the Explanation property.
If the associated relation pairs do not have an Explanation property attached (the usual case),
use the GetCollectionVersionKeysByProperty call.
Syntax:
HRESULT GetCollectionVersionRelKeys(
[in] CollectionType Direction,
[in] long ObjectID,
[in, optional] BSTR RelationshipGUID,
[in, optional] long RelationshipID,
[in, optional] BSTR Name,
[in, optional] BSTR LabelName,
[in, optional] IMetaFilterList *Filters,
[in, defaultvalue(0)] long ReturnClass,
[in, defaultvalue(0)] VARIANT_BOOL AllClasses,
[in, defaultvalue(0)] VARIANT_BOOL SkipValidation,
[out, retval] IMetaVersionedInfoRelKeyList **keyList);
GetCollectionsByProperty2
Purpose:
This routine is used to search the repository for the origin or destination collection of the
relationship of the object.
Description:
349
Argument
In/Out
Description
Direction
In
ObjectID
In
RelationshipGUID
In
RelationshipID
In
NamePattern
In
Filters
In
SortKeys
In
ReturnClass
In
AllClasses
In
350
SkipValidation
In
InfoKeyList
Retval
GetCollectionsByProperty3
Purpose:
This routine is used to search the repository for the origin or destination collection of the
relationship of the object.
Description:
GetDormantCollectionKeys
Purpose:
Use this method to search for objects with their publish state set to mdsDormant in the
specified class.
Description:
GetDormantCollectionKeys(
CollectionType Direction,
long ObjectID,
optional] BSTR RelationshipGUID,
351
GetDormantCollectionObjects
Purpose:
This routine is used to search the repository for dormant objects in the collection specified for
the object.
Description:
This routine is identical to the GetCollectionsByProperty2 routine, except that the InfoList
which is returned has only the dormant objects of the specified collection for the object,
limited by the filters and inheritance information parameters, if present.
If the Interface has the DIMInfoNeeded property set to True, the MetaInfo objects in the
returned collection will have their DIMInfo filled in, else they will not.
The calling object may be dormant or active.
This routine may only be called by an administrative user.
Syntax:
HRESULT GetDormantCollectionObjects(
[in] CollectionType Direction,
[in] long ObjectID,
[in, optional] BSTR RelationshipGUID,
[in, optional, defaultvalue(0)] long RelationshipID,
[in, optional] BSTR NamePattern,
[in, optional] IMetaFilterList *Filters,
[in, optional] IMetaInfoKeyList *SortKeys,
[in, optional, defaultvalue(0)] long ReturnClass,
[in, optional, defaultvalue(0)] VARIANT_BOOL AllClasses,
[in, optional, defaultvalue(0)] VARIANT_BOOL SkipValidation,
[out, retval] IMetaInfoList **InfoList);
GetCollectionVersionsByProperty2
Purpose:
This routine is used to search the repository for the origin or destination collection of the
relationship of the object.
Description:
Identical to the GetCollectionsByProperty2 routine except for the addition of the LabelName
parameter. In repositories with versioning enabled, it returns the collection class associated
with a version of this object (given by ObjectID) for the specified relationship, which match
the selection criteria, unless a label is specified. If a label is specified with the LabelName
parameter, then it acts as an additional filter.
352
GetCollectionVersionsByProperty3
Purpose:
This routine is used to search the repository for the origin or destination collection of the
relationship of the object.
Description:
GetRelationExplanation
Purpose:
Use this method to return the Explanation property for a particular pair of associated objects.
353
The GetRelationExplanation call returns the Explanation for the object-association given by
the OrigID and DestID pair, for the indicated Relationship, identified by the Relationship
GUID or ID.
Requirements:
The object association must already exist. Therefore, the DestID object must already be in the
destination collection of the OrigID object for the relationship.
Syntax:
HRESULT GetRelationExplanation(
[in] long OrigID,
[in] long DestID,
[in] BSTR RelationshipGUID,
[in, optional] long RelationshipID,
[out, retval] BSTR *Explanation);
Argument
In/Out
Description
OrigID
In
DestID
In
SetRelationExplanation
Purpose:
Use this method to set the Explanation property for a particular pair of associated objects.
Description:
The SetRelationExplanation call sets the Explanation for the object-association given by the
OrigID and DestID pair, for the indicated Relationship, identified by the Relationship GUID
or ID.
Requirements:
The object association must already exist. Therefore, the DestID object must already be in the
destination collection of the OrigID object for the relationship.
Syntax:
HRESULT
[in]
[in]
[in]
[in,
[in]
354
SetRelationExplanation(
long OrigID,
long DestID,
BSTR RelationshipGUID,
optional] long RelationshipID,
BSTR Explanation);
Argument
In/Out
Description
OrigID
In
DestID
In
BeginTransaction
Purpose:
RollbackTransaction
Purpose:
CommitTransaction
Purpose:
GetMDSUsers
Purpose:
Use this method to return a collection of all the users currently in the MDS repository, as
IMetaUserInfo objects.
Syntax:
HRESULT GetMDSUsers(
[out, retval] IMetaUserInfoList ** UserList);
put_MDSCaller
Purpose:
Use this method to set the MDSCaller for the MetaActive object.
Description
This can be used to specify a specific MDS user for the object which will then be used for all
subsequent calls from the object, including the SignOff call. This allows for MetaActive objects
to be used for repository access, which are different from the object where the original sign-on
occurred. Note that this is not needed for a single-user MDS application, since only one MDS
user is signed on the Repository, and the MDS engine is aware of who that user is (the one
specified at SignOn or Initialize).
This property is only useful for a multi-user (and possibly multi-threaded) MDS application.
Syntax:
HRESULT put_MDSCaller(
355
get_MDSCaller
Purpose:
Use this method to get the MDSCaller for the MetaActive object.
Description
This can be used to specify a specific MDS user for the object which will then be used for all
subsequent calls from the object, including the SignOff call. This allows for MetaActive objects
to be used for repository access, which are different from the object where the original sign-on
occurred. Note that this is not needed for a single-user MDS application, since only one MDS
user is signed on the Repository, and the MDS engine is aware of who that user is (the one
specified at SignOn or Initialize).
This property is only useful for a multi-user (and possibly multi-threaded) MDS application.
Syntax:
HRESULT get_MDSCaller(
([out, retval] BSTR* MDSCallerName);
SuperUserLogon
Purpose:
Use this method to determine if the MDS user specified in the UserName parameter is an
MDS super-user.
Description
This method returns VARIANT_TRUE (true) if the user named in UserName is an MDS
super-user (administrator), else it returns VARIANT_FALSE (false).
Requirements:
The User identified in UserName must be currently logged in from the running process, else
the return will be VARIANT_FALSE in all cases.
Syntax:
HRESULT SuperUserLogon([in] BSTR UserName,
[out, retval] VARIANT_BOOL *pVal);
EnableRetainBIZInfo
Purpose:
Use this method to set the value of the retain-business-objects feature for the repository.
Description:
When this feature is enabled, objects in the appropriate DIM classes, which have business
information associated with them, are *not* removed from the repository when they are
deleted, they are instead marked with a publish state of "dormant".
These dormant objects can later be returned to the "active" state if the DIM objects they were
previously associated with are re-loaded back into the appropriate DIM class, with their
356
(previous) business information re-associated with them. With the feature enabled, this
behavior is automatically done by the MDS engine. These types of objects are not normally
accessible but can be managed by the various calls for dormant objects from this interface.
There is no effect if the method is called with Enable set to "true" and the feature is currently
enabled, or with Enabled set to "false" and the feature is currently disabled.
When called with Enabled set to "false", not only will the feature be disabled, but *all* objects
currently in the "dormant" state, if any, will finally be removed from the repository. This
amounts to a final clean-up from the previous delete of these objects.
Syntax:
HRESULT EnableRetainBIZInfo(
[in, defaultvalue(VARIANT_TRUE)] VARIANT_BOOL Enable);
UsingRetainBIZInfo
Purpose:
This routine returns the current repository setting for the support of the retain-businessobjects feature: VARIANT_TRUE (true) if the repository supports the feature, and
VARIANT_FALSE (false) if not.
Syntax:
HRESULT UsingRetainBIZInfo(
[out, retval] VARIANT_BOOL* value);
Common Properties
The following attributes and functions are supported by the MetaInfo, MetaLabelInfo, and
COM AIM classes. Additional versioning properties are supported by the IMetaInfo and
IMetaBIZInfo interfaces.
Property
Type
Description
ObjectID
Long
Name
BSTR
Description
BSTR
CreateDate
DATE
The date and time when the object was created (read only).
UpdateDate
DATE
The data and time when the object was updated (read only).
Class
BSTR
Owner
BSTR
OwnerID
Long
ClassGUID
BSTR
ObjectGUID
BSTR
357
Property
Type
Description
ClassID
Long
SecurityProfileID
Long
get_ObjectID
Purpose:
put_ObjectID
Purpose:
get_Name
Purpose:
put_Name
Purpose:
get_Description
Purpose:
put_Description
Purpose:
358
get_CreateDate
Purpose:
get_UpdateDate
Purpose:
get_Class
Purpose:
put_Class
Purpose:
get_Owner
Purpose:
put_Owner
Purpose:
Sets ownername.
Syntax:
HRESULT put_Owner(BSTR newVal);
359
get_ClassGUID
Purpose:
put_ClassGUID
Purpose:
get_ObjectGUID
Purpose:
put_ObjectGUID
Purpose:
get_ClassID
Purpose:
put_ClassID
Purpose:
get_SecurityProfileID
Purpose:
put_SecurityProfileID
Purpose:
MetaInfo Class
The IMetaInfo interface contains the basic functions of the CMetaObject and
CMetaRepository classes and additional enhanced properties.
Property
Type
Common
Properties
Description
See Common Properties.
PropertyItems
IMetaPropertyItemList
DIMInfo
IMetaDIMInfo
PublishState
MetaPublishState
VersionNumber
long
get_PropertyItems
Purpose:
put_PropertyItems
Purpose:
361
get_DIMInfo
Purpose:
Gets or sets a pointer to the DIMInfo object for this MetaInfo object.
Syntax:
HRESULT get_DIMInfo(
[out, retval] IMetaDIMInfo* *pVal);
put_DIMInfo
Purpose:
get_PublishState
Purpose:
Returns the PublishState of the object. The MetaPublishState enumeration has four values:
mds_psCurrent (2), which means this is the currently active or published version -- it is the
latest version and may be modified; mds_psInactive (1), which means this version is frozen
and may not be modified (typically any version other than the published or current
version); and mds_psDeleted (0), which means this version has been deleted but not removed
from the repository; and mdsDormant (-1) which means the object is in the dormant state.
Syntax:
HRESULT get_PublishState(
[out, retval] MetaPublishState* state);
get_VersionNumber
Purpose:
get_Frozen
Purpose:
This property returns the frozen state of the object. If an object is frozen it cannot be modified.
The current or active version of the object can also be frozen in some cases. An object version
that is inactive will always be frozen.
Syntax:
HRESULT get_Frozen(
[out, retval] VARIANT_BOOL* pVal);
362
GetObjectVersionKeys
Purpose:
GetObjectVersions
Purpose:
Returns all the versions of the object in the InfoList return parameter.
Description:
No DIM information will be returned with the objects so fields of the IMetaDIMInfo object
returned by the DIMInfo property will all be empty. It is not necessary to "Read" the object
before this call is made. You can use *any* object ID of the various versions of the object, as
they will all return the same list of objects namely, those of all the versions.
Syntax:
HRESULT GetObjectVersions(
[out, retval] IMetaInfoList** InfoList);
FindLabel
Purpose:
This routine returns the key for the version of the object that has the specified label. If none of
the versions of the object have the label, the status META_E_LABEL_NOT_USED will be
returned.
Syntax:
HRESULT FindLabel(
[in] BSTR LabelName,
[out, retval] IMetaVersionedInfoKey** key);
GetObjectPropertyKeys
Purpose:
Returns a list of versioned-object keys that match the value of the property named in the
IMetaPropertyItem interface object.
Description:
If the property value is a string, a substring search is performed; for all other types of property
values, an equality search is made. The LabelName, if provided, is used as a filter on the
keyList in that only those object versions that match the property value and have the label
applied will be returned.
Requirements:
363
GetObjectLabelKeys
Purpose:
Returns a list of the labels currently applied to the versions of the CMetaObject.
Description:
Each entry in the keyList vector is an IMetaLabeledInfoKey object, which will provide the
name of a label and a key for the object version having that label. Only versions of the object
that have a label applied will be in the key list.
Syntax:
HRESULT GetObjectLabelKeys(
[out, retval] IMetaLabelInfoKeyList** keyList);
MetaInfoKey Class
The IMetaInfoKey interface is returned from the MetaActive GetClassObjectKeys and
GetCollectionKeys functions. It is also used as input for some object ID collections (vectors),
e.g., for the IMetaSecProfInfo:SetAIMsProfile's AIMList parameter. This parameter is an
IMetaInfoKeyList where the key-list's MetaInfoKey interfaces contain the object IDs of the
AIM profiles to be changed.
Property
Type
Description
ObjectID
Long
Name
BSTR
get_ObjectID
Purpose:
put_ObjectID
Purpose:
364
get_Name
Purpose:
put_Name
Purpose:
MetaVersionedInfoKey Class
The MetaVersionedInfoKey class inherits all the properties from the IMetaInfoKey interface
and adds versioning information.
get_ObjectID
Purpose:
get_Name
Purpose:
get_VersionNumber
Purpose:
get_PublishState
Purpose:
Returns the Publish state of the object. See the MetaInfo Class on page 361 for information
on the MetaPublishState enumeration.
365
get_Publish
Purpose:
get_Dormant
Purpose:
get_Frozen
Purpose:
MetaPropertyItem Class
The IMetaPropertyItem interface contains the basic functionality of the CMetaPropertyDesc
class. The main difference is that instead of many, different "Set" functions for the many
different data types possible, this uses a "Value" property of type VARIANT to cover all
different types except string. The string type is covered by the ValueString and StringLiteral
properties.
366
Property
Type
Description
PropertyID
Long
Name
BSTR
ValueString
BSTR
Property
Type
Description
StringLiteral
BSTR
Value
VARIANT
Variant Type
VariantType
get_PropertyID
Purpose:
put_PropertyID
Purpose:
get_Name
Purpose:
put_Name
Purpose:
367
get_ValueString
Purpose:
Returns a hex string representation of a binary property value. For example, a property of type
SQL_BYTE with a value of 0x1003ABDF would be returned by this call as the string
1003ABDF
Syntax:
HRESULT get_ValueString(
[out, retval] BSTR *pVal);
get_Value
Purpose:
put_Value
Purpose:
get_IsNull
Purpose:
Gets the IsNull property for the property item, which is a direct reflection of the NULL value
of the column in the database true if the property value is NULL, false if it is not. (Each
property of a class translates to a column for the table that represents that class.)
Syntax:
HRESULT get_IsNull(
[out, retval] VARIANT_BOOL *pVal);
put_IsNull
Purpose:
Sets the IsNull property for the property item, which is a direct reflection of the NULL value of
the column in the database true if the property value is NULL, false if it is not. (Each property
of a class translates to a column for the table that represents that class.)
Syntax:
HRESULT put_IsNull(
[in] VARIANT_BOOL newVal);
368
put_StringLiteral
Purpose:
Sets the value as a string "literal", indicating to the MDS engine not to quote this string when it
is sent to Teradata.
Syntax:
HRESULT put_StringLiteral(
[in] BSTR newVal);
get_VariantType
Purpose:
Returns the VARIANT type of the property. SeeAIM Classes on page 381 for VariantType
enumeration values.
Syntax:
HRESULT get_VariantType(
[out, retval] VariantType *pVal);
MetaDIMInfo Class
The IMetaDIMInfo interface contains the basic DIM properties of the CMetaDIMObject
class.
This class is not user-creatable. It can only be created by a call to the DIMInfo property of the
MetaInfo class.
Property
Type
Description
System
BSTR
Database
BSTR
Table
BSTR
Owner
BSTR
SecurityProfileID
Long
get_SecurityProfileID
Purpose:
369
put_SecurityProfileD
Purpose:
get_Owner
Purpose:
put_Owner
Purpose:
get_Table
Purpose:
Gets the name of the Table to which this object belongs, if applicable.
Syntax:
HRESULT get_Table(
[out, retval] BSTR *pVal);
put_Table
Purpose:
get_Database
Purpose:
Gets the name of the Database to which this object belongs, if applicable.
Syntax:
HRESULT get_Database(
[out, retval] BSTR *pVal);
370
put_Database
Purpose:
Sets the name of the Database to which this object belongs, if applicable.
Syntax:
HRESULT put_Database(
[in] BSTR newVal);
get_System
Purpose:
put_System
Purpose:
MetaFilter Class
The IMetaFilter interface contains the basic properties of the CMetaFilterInfo class. See
CMetaFilterInfo Class Functions for more detailed information.
Property
Type
Description
Operator
MetaComparisonOperator
Logical
MetaLogicalOperator
Filter
IMetaPropertyItem
OpenParenthesesCount
Short
CloseParenthesesCount
Short
371
get_Filter
Purpose:
put_Filter
Purpose:
get_Logical
Purpose:
Gets the Logical Operator. This operator can be used between two or more property filter
items, to indicate how they are logically connected ("and" or "or"). If no logical operator is
specified between two filter items, "and" is assumed. The logical operator "and" has
precedence over "or", but the use of parentheses can be used to change this.
Syntax:
HRESULT get_Logical(
[out, retval] MetaLogicalOperator *pVal);
put_Logical
Purpose:
Sets the Logical Operator. This operator can be used between two or more property filter
items, to indicate how they are logically connected ("and" or "or"). If no logical operator is
specified between two filter items, "and" is assumed. The logical operator "and" has
precedence over "or", but the use of parentheses can be used to change this.
Syntax:
HRESULT put_Logical(
[in] MetaLogicalOperator newVal);
get_Operator
Purpose:
Gets the Comparison Operator. The operator is used to create a comparison between the
property and the value named in the filter. If no Operator value is set, EQUAL is assumed.
Syntax:
HRESULT get_Operator(
[out, retval] MetaComparisonOperator *pVal);
372
put_Operator
Purpose:
Sets the Comparison Operator. The operator is used to create a comparison between the
property and the value named in the filter. If no Operator value is set, EQUAL is assumed.
Syntax:
HRESULT put_Operator(
[in] MetaComparisonOperator newVal);
get_OpenParenthesesCount
Purpose:
Gets the current count of opened parentheses, effectively enclosing filters in groups. This can
be done to over-ride the usual precedence of AND over OR.
Syntax:
HRESULT get_OpenParenthesesCount(
[out, retval] short *pVal);
put_OpenParenthesesCount
Purpose:
Sets the current count of opened parentheses, effectively enclosing filters in groups. This can
be done to over-ride the usual precedence of AND over OR.
Syntax:
HRESULT put_OpenParenthesesCount(
[in] short newVal);
get_CloseParenthesesCount
Purpose:
Gets the current count of closed parentheses, effectively enclosing filters in groups. This can be
done to over-ride the usual precedence of AND over OR.
Syntax:
HRESULT get_CloseParenthesesCount (
[out, retval] short *pVal);
put_CloseParenthesesCount
Purpose:
Sets the current count of closed parentheses, effectively enclosing filters in groups. This can be
done to over-ride the usual precedence of AND over OR.
Syntax:
HRESULT put_CloseParenthesesCount (
[in] short newVal);
373
MetaHelper Class
The MetaHelper class provides helper functions.
StringHexToBinary
Purpose:
This function translates a string representation of the hexadecimal number into the actual
hexadecimal number.
Syntax:
HRESULT StringHexToBinary (
[in] BSTR StringHex,
[out. Retval] VARIANT *BinaryVariant);
MetaBIZInfo Class
The MetaBIZInfo class is a non-creatable class that is returned only by the Item and Next calls
from a MetaBIZInfoList collection object. If the search criteria matched multiple fields, all
those that matched are returned.
get_ClassID
Purpose:
get_ObjectID
Purpose:
get_Name
Purpose:
This is a read-only property that returns the name of the object. The name of the object is
always returned even if it did not match the search criteria, that is, even if the object is in the
collection due to a match on the object's Description, Definition or Notes. (Note though, the
name itself may be blank.).
Syntax:
HRESULT get_Name(
[out, retval] BSTR *pVal);
374
get_NameMatch
Purpose:
This is a read-only property that returns VARIANT_TRUE if this object is in the collection
due to a match on its name. If the item is in the list due to a match on the Description,
Definition or Notes instead, this is VARIANT_FALSE. (VARIANT_TRUE and
VARIANT_FALSE are just True and False in Visual Basic.)
Syntax:
HRESULT get_NameMatch(
[out, retval] VARIANT_BOOL *pVal);
get_Description
Purpose:
This is a read-only property that returns the business description for this object.
Syntax:
HRESULT get_Description(
[out, retval] BSTR *pVal);
get_Definition
Purpose:
This is a read-only property that returns the business definition for this object.
Syntax:
HRESULT get_Definition(
[out, retval] BSTR *pVal);
get_Notes
Purpose:
This is a read-only property that returns the business notes for this object.
Syntax:
HRESULT get_Notes(
[out, retval] BSTR *pVal);
get_VersionNumber
Purpose:
375
get_PublishState
Purpose:
This is a read-only property that returns the object version's publish state. The publish state is
an enumeration of mdsCurrent, mdsInactive, mdsDeleted (currently not used) and
mdsDormant.
Syntax:
HRESULT get_PublishState (
MetaPublishState *pVal);
get_Frozen
Purpose:
This is a read-only property that returns the object version's frozen property.
Syntax:
HRESULT get_Frozen (
VARIANT_BOOL *pVal);
MetaInfoClassKey Class
This class inherits from the MetaInfoKey class and adds the class name and id of each object
being returned.
get_ClassName
Purpose:
put_ClassName
Purpose:
get_ClassID
Purpose:
376
put_ClassID
Purpose:
MetaVersionedInfoClassKey Class
This class inherits all the properties of the IMetaVersionedInfoKey interface and adds
ClassName and ClassID properties to each object key.
get_ClassName
Purpose:
get_ClassID
Purpose:
MetaLabelInfo Class
This class manages labels in the repository via the usual Read, Write and Delete routines. It
also provides for the labeling of objects across entire metamodels, or just a class in a
metamodel or a specific list of objects.
Property
Type
Common Properties
CreatorName
Description
See Common Properties.
BSTR
Read
Purpose:
Gets the label object identified, from the repository. The usual object identifiers must be set to
identify the label object.
377
Write
Purpose:
This routine Writes the in-memory label object (contained in this object) to the repository. If
the LOID = 0, a new label object is created, otherwise, the existing one (identified by the
MetaLabelInfo's identifier information) is located and updated.
Syntax
HRESULT Write();
Delete
Purpose:
CreatorName
Purpose:
Sets or gets the CreatorName property for the object. If this property value is not provided by
the caller when the label is created, the name of the creating user is used.
Syntax:
HRESULT get_CreatorName(
[out, retval] BSTR* CreatorName);
HRESULT put_CreatorName(
[in] BSTR CreatorName);
ApplyToModel
Purpose:
Applies this label to all the objects in all the classes of the metamodel identified by the
ModelID.
Description:
The label is applied to only the currently published version of each object. Unlike the next two
calls (ApplyToClass and ApplyToObjects), the bPropagate parameter does not exist; it is
always assumed to be true, i.e. the label will be applied to all objects in all classes of the
metamodel and all the destination targets of all those objects.
Requirements:
The label object must have its LOID or GOID or Name set.
Syntax:
HRESULT ApplyToModel(
[in] long ModelID);
378
ApplyToClass
Purpose:
This routine applies this label to all objects in the specified class.
Description:
If bPropagate is VARIANT_TRUE (true), the label will also be applied recursively to all
destination objects reachable from the class's objects, else only the specific objects in the class
will receive the label. The label is only applied to the currently published version for each
object in a class.
Requirements:
The label object must have its LOID or GOID or Name set.
Syntax:
HRESULT ApplyToClass(
[in] long ClassID,
[in] VARIANT_BOOL bPropagate);
ApplyToObjects
Purpose:
The keys in the objectList parameter need only have their ObjectID property set; all other key
properties are ignored. If bPropagate is VARIANT_TRUE (true), the label will also be applied
recursively to all destination objects in the objectList, reachable from the objects, else only the
specific objects themselves will receive the label.
If bMoveLabel is VARIANT_TRUE (true), then any of the objects that have the label already
applied to an "inactive" version, will have the label removed from that version and applied to
the "current" version of the object.
If bMoveLabel is VARIANT_FALSE (the default), and an object in the list has the label already
applied to an "inactive" version, the engine will return an error. When there are no errors, the
label is applied to the currently published version of each object.
Requirements:
The label object must have its LOID or GOID or Name set.
Syntax:
HRESULT
[in]
[in]
[in]
ApplyToObjects(
IMetaInfoKeyList* objectList,
VARIANT_BOOL bPropagate)
VARIANT_BOOL bMoveLabel);
RemoveFromObjects
Purpose:
This routine removes the label from the objects in the objectList parameter.
379
If the bPropagate parameter is VARIANT_TRUE, the label will also be removed from all
objects reachable from the objects in the objectList.
To delete the label from the repository, and by default remove it from all the repository objects
to which it is applied, use the Delete routine for this interface.
Requirements:
The label object must have its LOID or GOID or Name set.
Syntax:
HRESULT RemoveFromObjects(
[in] IMetaInfoKeyList* objectList,
[in] VARIANT_BOOL bPropagate);
GetObjectKeys
Purpose:
If all of the four parameters ModelGUID, ModelID, ClassGUID, and ClassID are null or not
specified, then all object versions in the repository with the current label are returned. If one
of ModelGUID or ModelID is not null, then all object versions in the metamodel with the
current label are returned. If both ModelGUID and ModelID are null and one of ClassGUID
or ClassID is not null, then all object versions in the class with the current label are returned.
Requirements:
The label object must have its LOID or GOID or Name set.
Syntax:
HRESULT GetObjectKeys(
[in, optional] long ModelID,
[in, optional] BSTR ModelGUID,
[in, optional] long ClassID,
[in, optional] BSTR ClassGUID,
[out, retval] IMetaVersionedInfoClassKeyList** objList);
MetaLabelInfoKey Class
This class inherits from IMetaVersionedInfoKey getting all its properties, and it adds the
LabelName property. It is the contained key for the associated MetaLabelInfoKeyList that is
returned by the IMetaInfo::GetObjectLabelKeys routine. All of the properties of this class are
read only since they are the result of a fetch of data from the repository.
get_LabelName
Purpose:
Returns the name of the label associated with this object version.
380
AIM Classes
This section describes the MDS COM AIM classes. These classes are used to maintain
metamodel objectsAIMs, classes, properties, and relationships.
MetaPropertyInfo Class
This class is used to create, read, modify or delete a CMetaPropetyDesc object. However, after
the object has been created and its properties set to whatever values are appropriate, it is
actually added to the MDS repository via the IMetaClassInfo::AddProperty routine with this
object as that routine's parameter. This means that all the "put" properties below are only
setting in-memory values and as far as the MDS repository goes, they are useful only before
the call to IMetaClassInfo::AddProperty when creating the property, or Update when
modifying the property.
See CMetaPropertyDesc Class for more detailed information.
Property
Type
Common Properties
Description
See Common Properties.
NumDigit
Short
PropertyLength
Long
SQL_Type
Enum
enum { sqlChar = 1,
sqlNumeric = 2,
sqlDecimal = 3,
sqlInteger = 4,
sqlSmallInt = 5,
sqlFloat = 6,
sqlReal = 7,
sqlDouble = 8,
sqlDate = 9,
sqlVarChar = 12,
sqlBinary = -2,
sqlVarBinary = -3,
sqlTinyInt = -6,
381
Property
Type
Description
sqlTime = 10,
sqlTimeStamp = 11
} ColumnType;
Identifier
Long
VARIANT_Type
Enum
CharacterSet
BSTR
ValueRequired
BOOL
DefaultValue
String
382
BasePropertyName
BSTR
DerivedRelationshipList
IMetaInfoKeyList
Common Properties
See Common Properties.
get_Identifier
Purpose:
put_Identifier
Purpose:
get_CharacterSet
Purpose:
put_CharacterSet
Purpose:
get_VARIANT_Type
Purpose:
383
put_VARIANT_Type
Purpose:
get_SQL_Type
Purpose:
put_SQL_Type
Purpose:
get_PropertyLength
Purpose:
put_PropertyLength
Purpose:
get_NumDigit
Purpose:
384
put_NumDigit
Purpose:
get_ValueRequired
Purpose:
put_ValueRequired
Purpose:
get_DefaultValue
Purpose:
385
get this as the value for the property. The string must be able to be converted to the type of the
property
This MetaPropertyInfo attribute can only be "set" at the creation of the property, it cannot be
updated.
Syntax:
HRESULT get_DefaultValue([out, retval] BSTR *pVal);
put_DefaultValue
Purpose:
get_BasePropertyName
Purpose:
put_BasePropertyName
Purpose:
386
setting the list of relationships used to get to that (base) class, i.e., it is the list of relationships
in the chain leading to the base class.
The user would use these two functions to set up this derived property, before making the call
to add the property to the (derived) class, using the MetaClassInfo AddProperty function.
Syntax:
HRESULT put_BasePropertyName ([in] BSTR newVal);
get_DerivedRelationshipList
Purpose:
Gets the list of object IDs that lead to the derived-property class for this property. The
get_BasePropertyName function (above) will contain the actual name of the property in that
class. Used for derived properties only.
Syntax:
HRESULT get_DerivedRelationshipList([out, retval] IMetaInfoKeyList
*pVal);
put_ DerivedRelationshipList
Purpose:
Sets the list of object IDs that lead to the derived-property class for this property. The
put_BasePropertyName function (above) is used to identify the name of the property in the
base class. Used for derived properties only.
Syntax:
HRESULT put_ DerivedRelationshipList ([in] IMetaInfoKeyList newVal);
Delete
Purpose:
Use this method to delete the property description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
Read
Purpose:
Use this method to read the property description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Read method.
Syntax:
HRESULT Read();
387
Update
Purpose:
Use this method to modify certain attributes of the MetaPropertyInfo object after it has been
created. See the Microsoft Visual C++ Programmers Guide for attributes that can be changed.
Syntax
HRESULT Update();
MetaClassInfo Class
The IMetaClassInfo interface is used to create, read, modify or delete a CMetaClassDesc
object. However, after the object has been created and its properties set to whatever values are
appropriate, it is actually added to the MDS repository through the
IMetaModelInfo::AddClass routine with this object as that routine's parameter. This means
that all the "put" properties below are only setting in-memory values and as far as the MDS
repository goes, they are useful only before a call to AddClass or to this classs Update routine.
See Chapter 12: AIM Classes for more detailed information.
Property
Type
Common
Properties
388
Description
See Common Properties on page 357.
PropertyList
IMetaPropertyInfoList
RelationshipList
IMetaRelationshipInfoList
UniqueNaming
Boolean
RootClass
Boolean
BaseClassID
Long
ObjectDescReq
Boolean
AbstractClass
Boolean
Property
Type
Description
SuperClassList
IMetaInfoKeyList
SubClassList
IMetaInfoKeyList
Common Properties
See Common Properties.
get_PropertyList
Purpose:
get_RelationshipList
Purpose:
get_ UniqueNaming
Purpose:
389
put_ UniqueNaming
Purpose:
get_RootClass
Purpose:
put_RootClass
Purpose:
get_BaseClassID
Purpose:
put_ BaseClassID
Purpose:
Sets the object ID of the base class, making this class a derived class.
Syntax:
HRESULT put_BaseClassID([in] long newVal);
AddProperty
Purpose:
390
get_AbstractClass
Purpose:
This property returns the AbstractClass value. This value is VARIANT_TRUE if this is an
abstract class and VARIANT_FALSE if it is not. (Note that for Visual Basic, VARIANT_TRUE
and VARIANT_FALSE are just True and False.)
Syntax:
HRESULT get_AbstractClass(
[out, retval] VARIANT_BOOL *pVal);
put_AbstractClass
Purpose:
This property sets the AbstractClass value. The default value is VARIANT_FALSE, that is, this
is not an abstract class. Set this property to VARIANT_TRUE before this class is created in the
model, if you want this class to be an abstract class. (Note that for Visual Basic,
VARIANT_TRUE and VARIANT_FALSE are just True and False.)
Syntax:
HRESULT put_AbstractClass(
[in] VARIANT_BOOL newVal);
get_ObjectDescReq
Purpose:
This property allows the meta model designer to force all objects in a class to have a
Description rather than a NULL value.
Gets the ObjectDescReq value for the class. When set to True, the engine will check as any
object is added to the class (or updated in the class) that the Description property for the
object is not NULL. If it is, an error will be returned and the object add (or update) will fail.
An error will be returned if this property is used on class objects in MDS-owned meta models.
Syntax:
HRESULT get_ObjectDescReq(
[out, retval] VARIANT_BOOL *pVal);
put_ObjectDescReq
Purpose:
This property allows the meta model designer to force all objects in a class to have a
Description rather than a NULL value.
Sets the ObjectDescReq value for the class. When set to True, the engine will check as any
object is added to the class (or updated in the class) that the Description property for the
object is not NULL. If it is, an error will be returned and the object add (or update) will fail.
391
get_SuperClassList
Purpose:
This property returns a IMetaInfoKeyList collection object, which contains the object IDs and
names of the super-classes of this class.
Syntax:
HRESULT get_SuperClassList(
[out, retval] IMetaInfoKeyList* *pVal);
put_SuperClassList
Purpose:
This property sets the list of super-classes for this object via the IMetaInfoKeyList parameter.
By default this list is empty, that is, there are no super classes for this class. If you wish to
inherit properties and relationships from other classes, add IMetaInfoKey objects to this
collection where the IMetaInfoKey objects have the class ID of the class you wish to inherit
from. (Any names you specify for the IMetaInfoKey objects will be ignored.)
Syntax:
HRESULT put_SuperClassList(
[in] IMetaInfoKeyList* newVal);
get_SubClassList
Purpose:
This read-only property is used to return the list of sub classes for this class, i.e. the list of
classes for which this class is a super class. The IMetaInfoKey items contained in the
IMetaInfoKeyList collection are the names and class IDs (loids) of the sub classes. It is not
necessary to do a Read before calling this routine, but in that case the ObjectID must be set.
Syntax:
HRESULT get_SubClassList(
[out, retval] IMetaInfoKeyList* *pVal);
Delete
Purpose:
Use this method to delete the class description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
392
Read
Purpose:
Use this method to read the class description object from the MDS repository.
Description
The Detail argument indicates whether to read the list of the relationships and property
descriptions for this particular class. If the Detail is true, read the class description and its
relationships and property descriptions. If the Detail is false (0), read the class description
object only.
Requirements:
The object identifier must be set before calling the Read method.
Syntax:
HRESULT Read(
[in, optional] VARIANT_BOOL Detail);
Update
Purpose:
Use this method to modify certain attributes of the MetaPropertyInfo object after it has been
created. See the Microsoft Visual C++ Programmers Guide for attributes that can be changed.
Syntax
HRESULT Update();
GetVersionSupport
Purpose:
Returns the current setting for the VersioningSupport property of a MetaClassInfo object. For
an existing Class, this value is only meaningful after calling Read.
Description:
mdsHadVersioning - the class does not support data versioning and any new objects for
the class will not support versioning. However, some of the objects in the class currently
retain multiple versions that existed when data versioning was disabled for the class. Even
though multiple versions may exist for a data object, WriteObject will never create new
versions for existing data objects; only the latest version for an object will be modified.
Syntax:
HRESULT GetVersionSupport(
[out, retval] MetaVersionSupportLevel* level);
393
SetVersioning
Purpose:
Derived classes may not be used with this API. If bVersioningAllowed is false, data versioning
will be disabled for the class. If bVersioningAllowed is true and repository versioning is
enabled, then data versioning will be enabled for the class, else versioning will be left disabled
for the class. bDeleteVersions indicates if existing historical versions for objects in the class
should be deleted or retained, however, this parameter is ignored unless version is already off
for this class or is being turned off by this call.
Disabling versioning can affect the existing objects in the class. If bDeleteVersions is true, all
objects in the class will be modified so that all non-published versions are deleted and the
remaining versions will be renumbered to version one. This can be a very lengthy operation. If
bDeleteVersions is false, all existing versions of data objects in the class will be retained. Any
new objects added to the class will be created without support of versioning.
Changing the data versioning support for a class will also change the versioning support for
any derived classes that have the class as their base class. A derived class's data versioning
support is always the same as that of the base class.
A Read call does not need to be done before this call, but in that case, either the class ID or
class GUID must be set.
Syntax:
HRESULT SetVersioning(
[in] VARIANT_BOOL bVersioningAllowed,
[in, optional] VARIANT_BOOL bDeleteVersions);
MetaRelationshipInfo Class
The IMetaRelationshipInfo interface of this class is used to create, read, modify or delete
CMetaRelationshipDesc objects. However, after the MetaRelationshipInfo object has been
created and its properties set to whatever values are appropriate, it is actually added to the
MDS repository via the IMetaModelInfo::AddRelationship routine with this object as that
routine's parameter. This means that all the "put" properties below are only setting inmemory values and as far as the MDS repository goes, they are useful only before the call to
AddRelationship or this class's Update routine.
See Chapter 12: AIM Classes for more detailed information.
Property
Type
Common Properties
394
Description
See Common Properties.
OriginClassID
Long
DestinationClassID
Long
Property
Type
Description
UniqueName
Short
PropagateDelete
Short
Common Properties
See Common Properties.
get_PropagateDelete
Purpose:
put_PropagateDelete
Purpose:
get_UniqueName
Purpose:
put_UniqueName
Purpose:
get_DestinationClassID
Purpose:
395
put_DestinationClassID
Purpose:
get_OriginClassID
Purpose:
put_OriginClassID
Purpose:
Delete
Purpose:
Use this method to delete the relationship description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
Read
Purpose:
Use this method to read the relationship description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Read method.
396
Update
Purpose:
Use this method to modify certain attributes of the MetaRelationshipInfo object after it has
been created. See the Microsoft Visual C++ Programmers Guide for attributes that can be
changed.
Syntax:
HRESULT Update();
MetaModelInfo Class
The IMetaModel interface is used to create, read, modify or delete a CMetaAIM class. See
CMetaAIM Class for more detailed information.
Property
Type
Common
Properties
Description
See Common Properties.
ClassList
IMetaClassInfoList
RelationshipList
IMetaRelationshipInfoList
Common Properties
See Common Properties.
get_RelationshipList
Purpose:
Must be proceeded by a Read(VARIANT_TRUE) call for the class, else the list will be empty.
Syntax:
HRESULT get_RelationshipList(
[out, retval] IMetaRelationshipInfoList * *pVal);
get_ClassList
Purpose:
397
Must be proceeded by a Read(VARIANT_TRUE) call for the class, else the list will be empty.
Syntax:
HRESULT get_ClassList(
[out, retval] IMetaClassInfoList * *pVal);
Delete
Purpose:
Use this method to delete the model description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
Read
Purpose:
Use this method to read the model description object from the MDS repository.
Description:
The Detail argument indicates whether to read the list of the classes and relationships for this
particular model. If the Detail is "true", the model's classes and relationships are read and are
available via the get_ClassList and get_RelationshipList properties. Otherwise, if the Detail is
"false", the classes and relationships for the model are not read and the two lists will be empty.
If not specified, the value is taken as "false".
Requirements:
The object identifier must be set before calling the Read method.
Syntax:
HRESULT Read(
[in, optional] VARIANT_BOOL Detail);
Create
Purpose:
Use this method to write the model description object to the MDS repository.
Syntax:
HRESULT Create();
398
Update
Purpose:
Use this method to modify certain attributes of the MetaRelationshipInfo object after it has
been created. See the Microsoft Visual C++ Programmers Guide for attributes that can be
changed.
Syntax:
HRESULT Update();
AddClass
Purpose:
Use this method to add a class description to the model. The model must have already been
created in the MDS repository.
Requirements:
The model must have already been created in the MDS repository.
Syntax:
HRESULT AddClass(
[in] IMetaClassInfo *lpClassInfo);
AddRelationship
Purpose:
Use this method to add a relationship description to the model. The model must have already
been created in the MDS repository.
Requirements:
The model must have already been created in the MDS repository.
Syntax:
HRESULT AddRelationship(
[in] IMetaRelationshipInfo *lpRelationshipInfo);
GetVersionSupport
Purpose:
Returns the current setting for the VersioningSupport property of a MetaModelInfo object.
For an existing AIM, this value is only meaningful after calling Read.
Description:
mdsNoVersioning - the AIM does not support data versioning, none of the existing classes
created by the AIM support versioning, and any new classes for the AIM will not support
versioning
mdsHadVersioning - the AIM does not support data versioning and any new classes for
the AIM will not support versioning. However, some of the classes in the AIM currently
399
retain multiple versions of data objects that existed when data versioning was disabled for
the AIM. Even though multiple versions may exist for a data object, WriteObject will never
create new versions for existing data objects; only the latest version for an object will be
modified.
mdsHasVersioning - the AIM supports data versioning and any new class for the AIM will,
by default, support versioning; existing classes may or may not support versioning.
Syntax:
HRESULT GetVersionSupport(
[out, retval] MetaVersionSupportLevel* level);
SetVersioning
Purpose:
MetaUserInfo Class
The IMetaUserInfo interface is used to create, update, read or delete a CMetaUser class. See
Chapter 13: Security Classes for more detailed information.
Property
Common Properties
400
Type
Description
See Common Properties.
Common Properties
See Common Properties.
Delete
Purpose:
Use this method to delete the user object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
Read
Purpose:
Use this method to read the user object from the MDS repository.
Requirements:
The object identifier must be set before calling the Read method.
Syntax:
HRESULT Read();
Write
Purpose:
Use this method to update or write the user object to the MDS repository.
Requirements:
The object identifier must be set before calling the Write method
Syntax:
HRESULT Write();
IsSuperUser
Purpose:
CreateSuperUser
Purpose:
Use this method to create an MDS administrator, also known as a super user.
401
This method is identical in effect to Write except that the user created is a "super user" (or
"administrator") - and has all the same privileges as the "metasu" built-in super user. The
Description may be empty.
Syntax:
HRESULT
[in]
[in]
[in,
CreateSuperUser(
BSTR Name,
BSTR Password,
optional] BSTR Description);
ChangePassword
Purpose:
If the logged-on user is an MDS Administrator, the OldPassword parameter value is not
required and can be NULL.
Syntax:
HRESULT ChangePassword(
[in] BSTR OldPassword,
[in] BSTR NewPassword);
MetaGroupInfo Class
The IMetaGroupInfo interface is used to create, update, read or delete a
CMetaApplicationGroup class. See Chapter 13: Security Classes for more detailed
information.
Property
Type
Common Properties
UserList
Description
See Common Properties.
IMetaUserInfoList
Common Properties
See all attributes from Common Properties except SecurityProfileID and OwnerID.
get_UserList
Purpose:
402
Delete
Purpose:
Use this method to delete the application group object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
Read
Purpose:
Use this method to read the application group object from the MDS repository.
Requirements:
The object identifier must be set before calling the Read method.
Syntax:
HRESULT Read();
Write
Purpose:
Use this method to update or write the application group object to the MDS repository.
Requirements:
The object identifier must be set before calling the Write method.
Syntax:
HRESULT Write();
AddUser
Purpose:
Use this method to add the specified user to the application group object.
Requirements:
The object identifier must be set before calling the AddUser method.
Syntax:
HRESULT AddUser(
[in] IMetaUserInfo *IpUser);
RemoveUser
Purpose:
Use this method to remove the specified user from the application group object.
403
The object identifier must be set before calling the RemoveUser method.
Syntax:
HRESULT RemoveUser(
[in] IMetaUserInfo *lpUser);
MetaSecProfInfo Class
The IMetaSecProfInfo interface is used to create, read, update, and delete a
CMetaSecurityProfile class, and the IMetaSecProfEntry and IMetaSecProfEntryList interfaces
are used to modify the permissions contained in a CMetaSecurityProfileEntry. Note that there
is no "Add" permission(s), only Update(s). The reason that there is no add function is that the
Update functions will add when the user(s) or group(s) identified are not already in the
Security Profile.
See Chapter 13: Security Classes for more detailed information.
Property
Type
Common Properties
Permissions
Description
See Common Properties.
IMetaSecProEntryList
Common Properties
See all attributes from Common Properties except SecurityProfileID and OwnerID.
RemovePermission
Purpose:
Removes the single user or group identified by the ObjectID, from the Security Profiles
permission list.
Requirements:
RemoveManyPermissions
Purpose:
Removes the user and/or groups identified by the ObjectIDs in the key-list. The Name
property of the key-list elements is ignored, so it does not need to be set. Note that the MDS
engine currently ignores any ids that are not currently in the permission list.
404
UpdatePermission
Purpose:
Updates the access of the user or group identified by the Permissions ObjectID property.
Requirements:
UpdateManyPermissions
Purpose:
Updates the current Security Profile Entry (MetaSecProfEntry) list for this Security Profile
(MetaSecProfInfo) object, with that in the input parameter. If the User/Group of an entry is
found in the current list for this Security Profile, it is updated with the entry's permission. If
the User/Group of an entry is not found, it is added to the list.
Requirements:
A Read for the MetaSecProfInfo object must be done before this call to get the current
MetaSecProfEntry list.
Must be followed by a Write to make the change in the MDS repository.
Syntax:
HRESULT UpdateManyPermissions(
[in] IMetaSecProfEntryList* PermissionList);
get_Permissions
Purpose:
Returns the permission list for the Security Profile in the form of the IMetaSecProfEntryList
collection object.
Syntax:
HRESULT get_Permissions(
[out, retval] IMetaSecProfEntryList* *PermissionList);
405
put_Permissions
Purpose:
Sets the permission list for the Security Profile using the IMetaSecProEntryList collection
object. The existing permission list, if any, is completely replaced by this new list.
Syntax:
HRESULT put_Permissions(
[in] IMetaSecProfEntryList *PermissionList);
Read
Purpose:
Reads the indicated Security Profile in from the MDS repository to this COM object,
including the Security Profile's permission list.
Requirements:
This call must be made before any calls that will be modifying the permission list for this
Security Profile object.
Syntax:
HRESULT Read();
Write
Purpose:
Write the Security Profile out to the MDS repository. This effectively commits the action of
any Remove/Update/Put permission calls that have been made for this object, to the MDS
repository.
Syntax:
HRESULT Write();
SetAIMsProfile
Purpose:
Sets all the AIM object IDs found in the ObjectID property of the key-list, to this Security
Profile. If Propagate is set to true, the Security Profile ID in all class, property and relationship
objects in the AIM will also be updated.
This call only needs the Security Profile object identified (ObjectID or ObjectGUID set, etc.)
to work, neither Read nor Write are needed.
Requirements:
You must be initialized as an MDS Administrator (super user) to use this function.
Syntax:
HRESULT SetAIMsProfile(
[in] IMetaInfoKeyList* AIMList,
[in] VARIANT_BOOL Propagate);
406
SetClassesProfile
Purpose:
This call only needs the Security Profile object identified (ObjectID or ObjectGUID set, etc.)
to work, neither Read nor Write are needed.
Syntax:
HRESULT SetClassesProfile(
[in] IMetaInfoKeyList *ClassesList,
[in] VARIANT_BOOL Propagate);
SetObjectsProfile
Purpose:
Sets all the Object object IDs found in the ObjectID property of each key in the key-list, to this
Security Profile. If Propagate is set to true, the Security Profile ID in all related objects will also
be updated.
This call only needs the Security Profile object identified (ObjectID or ObjectGUID set, etc.)
to work, neither Read nor Write are needed.
Requirements:
MetaSecProfEntry Class
The IMetaSecProfEntry interface is used to read, write, modify, and delete the properties of a
CMetaSecurityProfileEntry C++ class object. This interface is used only by the
IMetaSecProfInfo interface.
Property
Type
Description
IsUser
Boolean
ObjectID
Long
Access
AccessType
407
Property
Type
Description
accUpdate = MD_UPDATE,
accFull = MD_FULL
} AccessType;
SetEntryValues
Purpose:
Sets all the indicated values in one call. Can be used instead of the individual property calls.
Syntax:
HRESULT
[in]
[in]
[in]
SetEntryValues(
VARIANT_BOOL IsUser,
long ObjectID,
AccessType Access);
GetEntryValues
Purpose:
This call gets all the indicated values in one call. Can be used instead of the individual
property calls unless you are using a scripting language, e.g., VBScript. VBScript can accept
only one return value for a function, so you must use the property calls below for it.
Syntax:
HRESULT GetEntryValues(
[out] VARIANT_BOOL* IsUser,
[out] long* ObjectID,
[out] AccessType* Access);
get_IsUser
Purpose:
Sets the IsUser property -- "true" if the ObjectID property is that of a MDS user, "false" if it is
that if an MDS group.
Syntax:
HRESULT get_IsUser(
[out, retval] VARIANT_BOOL *pVal);
put_IsUser
Purpose:
408
get_ObjectID
Purpose:
Returns the ObjectID property for the Security Profile Entry, Can be an MDS User id or an
MDS Group ID.
Syntax:
HRESULT get_ObjectID(
[out, retval] long *pVal);
put_ObjectID
Purpose:
get_Access
Purpose:
Sets the access (permission) for the indicated MDS User/Group for this SP entry. See
Chapter 13: Security Classes for more detailed information.
Syntax:
HRESULT get_Access(
[out, retval] AccessType *pVal);
put_Access
Purpose:
409
Contained Interface
MetaInfoList
IMetaInfo
MetaInfoKeyList
IMetaInfoKey
MetaPropertyItemList
IMetaPropertyItem
MetaInfoClassKeyList
IMetaInfoClassKey
MetaBIZInfoList
IMetaBIZInfo
MetaFilterList
IMetaFilter
MetaPropertyInfoList
IMetaPropertyInfo
MetaClassInfoList
IMetaClassInfo
MetaRelationshipInfoList
IMetaRelationshipInfo
MetaModelInfoList
IMetaModelInfo
MetaSecProfInfoList
IMetaSecProfInfo
MetaSecProfEntryList
IMetaSecProfEntry
MetaGroupInfoList
IMetaGroupInfo
MetaUserInfoList
IMetaUserInfo
MetaVersionedInfoKeyList
IMetaVersionedInfoKey
MetaVersionedInfoClassKeyList
IMetaVersionedInfoClassKey
MetaLabelInfoKeyList
IMetaLabelInfoKey
MetaRelationInfoKeyList
IMetaRelationInfoKey
MetaRelationVersionedInfoKeyList
IMetaRelationversionedInfoKey
Several of these classes can be created only by specific calls to other COM class interface
methods or properties. These classes are:
410
MetaVersionedInfoKeyList
MetaVersionedInfoClassKeyList
Collection Properties
Count property
Purpose:
Item property
Purpose:
Given the index, this method returns an item in the collection. However, if the Index is of type
BSTR indicating the name of the object, this method returns an item in the collection with the
first matching name. The object name match is case-insensitive.
Syntax:
HRESULT get_Item(
[in] VARIANT Index,
[out, retval] IDispatch **pVal);
Collection Methods
Add
Purpose:
This method adds the pNewVal item to the end of the collection. The VARIANT should be of
IDispatch type and be the contained collection's interface.
Syntax:
HRESULT Add(
[in] VARIANT *pNewVal);
Remove
Purpose:
Sort
Purpose:
411
The list is sorted by the Name property in ascending order (the default) if Asc is true, and is
case-insensitive (the default) if CaseIns is true. Note that the sort is not done by Teradata, but
in memory on the Windows platform where the COM component is installed.
Syntax:
HRESULT Sort(
[in, optional] VARIANT_BOOL Asc,
[in, optional] VARIANT_BOOL CaseIns)
Example Code
This section provides information on developing Visual Basic and C++ programs to work
with MDS COM objects.
Example VB Code
The following code assumes you have used the References dialog from the Program menu
item to select the "MetaCOM 2.1 Type Library" for your VB project. You could then use
something similar to the following to set up a definition to your initial repository MetaActive
class object:
Public Repos As METACOMEXPORT21Lib.MetaActive
Alternatively, you could use the following if you were assured of no name-space collisions:
Public Repos As MetaActive
In either case, you would follow this up with the creation of the object by
Set Repos = new MetaActive
There are still other alternatives to this, such as using the "CreateObject" call with the ProgID.
See the Visual Basic documentation (or scripting reference if you are using VBScript of
JScript) for complete information.
Also, see the sample\vb directory installed with the MDS SDK for more example code.
412
Initialization
This section shows example code to connect an application to the MDS repository.
'/////////////////////////////////////////////////////////////////////
'
'
Initialize Repository
'
'
Sets up the connection to the repository using the global object
'
Repository
'
'/////////////////////////////////////////////////////////////////////
Function InitializeRepository () As Boolean
Set Repos = New MetaActive
Repos.Initialize userName, password
InitializeRepository = True
Exit Function
End Function
413
414
Dim
Dim
Dim
Dim
DisplayHeadingLine "MetaActive::AddManyToCollection"
'add to relationship using relationship GUID
key.ObjectID = Class1Obj1
keyList.Add key
key.ObjectID = Class1Obj2
keyList.Add key
Repos.AddManyToCollection DESTINATION, Class0Obj1, _
RelGUID_Class0Class1, 0, keyList
'add to relationship using relationshipID
keyList.Clear
Set testList = Nothing
key.ObjectID = Class1Obj3
keyList.Add key
key.ObjectID = Class1Obj4
keyList.Add key
Repos.AddManyToCollection DESTINATION, Class0Obj2, "", _
RelID_Class0Class1, keyList
' add to origin relationship
keyList.Clear
Set testList = Nothing
key.ObjectID = Class0Obj3
keyList.Add key
Repos.AddManyToCollection ORIGIN, Class1Obj5, RelGUID_Class0Class1, _
0, keyList
End Sub
415
filter.filter.name = name
filter.filter.value = value
filter.Logical = META_AND
filter.operator = EQUAL
filterList.Add filter
Set testList = Repos.GetCollectionsByProperty(DESTINATION, ObjectID, _
relGUID, relID, "", filterList, sortList)
Set filterList = Nothing
filter.operator = LESS_THAN
filterList.Add filter
Set testList = Repos.GetCollectionsByProperty(DESTINATION, ObjectID, _
relGUID, relID, "", filterList, sortList)
416
417
i As Integer
goodCount As Integer
lastdate As Date
info As MetaInfo
class2info As New MetaClassInfo
errorExpected As Boolean
testList As MetaInfoList
filterList As New MetaFilterList
sortList As New MetaInfoKeyList
filter As New MetaFilter
sortKey As New MetaInfoKey
418
errorExpected As Boolean
keyList As New MetaInfoKeyList
testList As MetaInfoKeyList
key As New MetaInfoKey
info As MetaInfoKey
key.ObjectID = Class1Obj1
keyList.Add key
key.ObjectID = Class1Obj2
keyList.Add key
key.ObjectID = Class1Obj3
419
key.ObjectID = Class2Obj7
keyList.Add key
key.ObjectID = Class2Obj8
keyList.Add key
Repos.RemoveManyFromCollection DESTINATION, Class1Obj5, _
"", RelID_Class1Class2, keyList, 0
Exit Sub
End Sub
Reading an Object
This section shows example code of reading an object.
'////////////////////////////////////////////////////////////////////////
'
'
ReadObject
'
'////////////////////////////////////////////////////////////////////////
Public Sub ReadObject (ObjectID As Long)
Dim info As New MetaInfo
info.ObjectID = ObjectID
Repos.ReadObject info
End Sub
420
to use a namespace of "tdmds" rather than "METACOMEXPORT21Lib", you would add the
following statement to your code:
#import "C:\Program Files\Teradata\Meta Data Services\bin\metacomexport21.dll" \
rename_namespace("tdmds")
From the TLI and TLH files that are generated, you can use the appropriate interface-class
smart pointers to declare interface classes, and make the property and method calls on those
interfaces.
Initialization
The following code declares and creates an IMetaActive interface pointer from the MetaActive
coclass object. It then makes a call to the Initialize and DeInitialize routines of the IMetaActive
interface.
// If you use "using namespace tdmds;" you could drop the scope-resolution
// qualifier "tdmds::" from the code below.
// The IMetaActivePtr "smart pointer" below is defined in the TLH file created
// as a result of the "import" statement.
tdmds::IMetaActivePtr ipRepos;
try {
HRESULT hr = ipRepos.CreateInstance(__uuidof(tdmds::MetaActive));
if ( FAILED(hr) ) _com_issue_error(hr);
ipRepos->Initialize(_bstr_t("metasu"), _bstr_t("metasu"));
// Other repository actions...
ipRepos->DeInitialize();
}
catch(_com_error& e)
{
// Handle the COM error...
}
421
422
423
424
425
426
CHAPTER 15
This chapter describes the MetaXML scripting interface. The scripting interface provides a
non-programmatic means for importing and updating meta data in the MDS repository.
The scripting interface uses the Extensible Markup Language (XML) as the method for
putting structured data in a text file. The World Wide Web Consortium (W3C) considers
XML to be the universal format for structured documents and data on the Web. The Meta
Data Coalition has defined XML as the standard format for the interchange of meta data for
the Meta Data Coalition Open Information Model.
This chapter contains the following information:
XML Overview
Since release 13.00, this MetaXML utility supports the export of metamodels or meta data
objects out of the repository.
To export repository objects (using -ocoll or -mcoll parameters), a supported version of the
Java JRE must be installed and have its JVM DLL path added to the user's PATH environment
variable through the Control Panel.
Supported Java Runtime Environments (JREs) are from Sun Microsystems: 1.5.0 update 6 or
later and 1.6.0 update 3 or later, and from IBM (WebSphere/Eclipse): 1.5.0.
The Sun Microsystems JVM DLL is located in JRE_HOME\bin\client and the IBM JVM DLL
is in JRE_HOME\bin\j9vm. Any one of these three JREs can be used but the JVM DLL should
come from the selected JRE_HOME of whichever one is being used.
The export results in an XML file that is valid against the schema and DTD that the "import"
uses. See Scripting Interface Steps on page 429 for more information.
This utility uses the MSXML 4.0 SP2 or 6.0 parser. These parsers support Unicode and all the
accompanying encodings. If you do not have this installed on your system, you will get an
error trying to run metaxml. Download the MSXML 4.0 or 6.0 parser from the Microsoft
download web site. It is not necessary to also install the SDK that comes with the download.
XML Overview
XML lets the designer define tags, used to mark up data to indicate what the data means. Tags
come in pairs a begin tag and an end tag. Each tag is enclosed by angle brackets. End tags are
named the same as their corresponding begin tags except that the end tags name is prefixed by
427
a slash. The content between a matching begin and end tag is called an element. For example,
an XML designer could define an address element to have a structure like
<address>
<name>Teradata Corporation</name>
<street>17095 Via Del Campo</street>
<city>San Diego</city>
<state>CA</state>
<zip>92127</zip>
</address>
The designer defines the names of the tags, what each tag contains (other tags, raw character
data, or a mixture), what order they appear in, whether they are required or optional, how
many occurrences of each are allowed, etc. This is basically the task of defining a grammar.
XML grammars are defined using a special syntax in a file called a document type definition
(DTD) that can be used by an XML parser to ensure that an XML input document conforms
to the grammar.
The XML governing bodies have recently defined a "schema definition", also known as an
XSD for XML Schema Definition. A schema definition is in XML format (the DTD has its
own unique format), and allows for more precise data definitions and specifications. As of the
6.1 release, MDS provides for a schema definition which is the equivalent of the DTD (which
is still provided). The DTD and schema files are installed in the %METAHOME%\bin
directory. The DTD is named metaxml21.dtd, and the schema is contained in two files:
metaxml21.xsd and its included file types21.xsd. The use may use either, but the schema file is
recommended due to its ability to more precisely describe the syntax. See the XML sample
files (or any XML documentation) for examples on how to include DTD or XSD definitions in
your XML file.
Like HTML tags, XML tags may have attributes. The DTD or XSD allows the designer to
specify attribute names, broad data types, default values, and whether or not individual
attributes are required or optional. XML attributes appear inside the tag to which they apply.
An example of an XML representation of a geometric shape that uses attributes is
<circle color=red,
xcoord=200,
ycoord=150,
radius=25>
</circle>
The first attribute is color, and it has the value red. The circle representation shown is an
example of an empty element, meaning there is no content between the begin and end circle
tags. For convenience, XML allows the abbreviation of empty elements with the syntax
<circle color=red,
xcoord=200,
ycoord=150,
radius=25/>
428
Create an XML script to import AIMs, MDS users, and application groups and import,
update or delete user-defined objects and collections.
Run the metaxml utility and specify the name of the XML script to import the data from
the script. The syntax is:
metaxml import mdsUser mdsPassword xml_filename
The usual MDS permissions apply to being able to import data into the MDS repository.
See the Teradata Meta Data Services Administrator Guide for more information on running
the metaxml utility.
To export objects from the repository with the MDS XML scripting interface:
Run the metaxml utility and identify the MDS metamodel name(s) or meta data objects
on the command-line as one of the parameters to the metaxml utility as part of the
"export" request.
metaxml export mdsUser mdsPassword {-ocoll <objectID> | -mcoll <AIM_name> | -model <name>}ofile <XML output file> [-v] [-l <label>]
Table 48: metaxml Export Input Parameters
Parameter
Description
export
mdsPassword
mdsUser
-ocoll objectID
-mcoll AIM_Name
-model name
Identifies the name of the meta model to export. All classes, class
properties and relationships of the named meta model will be
included in the resulting XML file
429
Parameter
Description
Identifies the XML file name into which the objects will be exported.
If the filename is not fully qualified, the file will be created in the
current directory.
If the file exists, it will be over-written without warning
-v
-l label
(Optional) Specifies the name of the label to use in finding the object
versions to export. When used, only the particular version of each
object in the destination collection which has the label applied, if any,
will be exported to the output file.
In a versioned repository, if the source object itself does not have the
label applied to any of its versions, no objects will be exported, and a
warning message will indicate this. When no label is specified, the
latest (or published) version of each object is exported.
Note: Parameter is ignored when exporting metamodels with the
-model parameter.
If only one metamodel is listed for the export, the resulting XML file has the same name as the
metamodel name adding an XML extension; if more than one metamodel is listed, the
resulting XML file is named mdsexport.xml. In either case, the file is placed in the same
directory from where the request is run. Also, the XSD file is added and assumed to be in the
standard location; this can be changed as necessary or desired, of course.
The usual MDS permissions apply to being able to export data out of the MDS repository.
See the Teradata Meta Data Services Administrator Guide for more information on running
the metaxml utility.
430
A sample XML file structure that specifies the XSD as the file metaxml21.xsd in the current
folder is shown below. The body of the XML script would be placed between the start and end
<METAXML> tags and can consist of any mixture of XML and aliased references conforming
to the MDS XML grammar.
<?xml version="1.0" encoding="UTF-8"?>
<METAXML version="6.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="metaxml21.xsd">
<!-- Body of XML script: -->
</METAXML>
METAUSERS - Enables creating one or more MDS users in the MDS repository.
METAGROUPS - Enables creating one or more MDS application groups in the MDS
repository.
PREFERENCES Enables the user to specify default settings for several attributes.
GUIDs are user-assignable and thus easily referenced across different XML scripts, and
GUIDs are unique across MDS repository instances and thus compatible with a future
implementation of XML export in MDS.
XML allows definition of aliases (called entities) for any string of text, enabling users to define
symbolic name aliases for GUIDs. In addition, the XML import interface processing of GUIDs
allows both upper- and lower-case hexadecimal digits (0-9, A-F, a-f) as well as embedded
hyphens and white space to make the GUIDs themselves more readable.
431
Entities can be referred by name anywhere in an XML file by prefixing the symbolic alias name
with an ampersand and suffixing it with a semicolon. Thus, the above GUID alias can be used
in the XML file via the syntax
&CLSGUID_MetaAIMClass;
DTD:
<!ELEMENT PREFERENCES EMPTY>
<!ATTLIST PREFERENCES
DefaultAction (traverse | add | remove | update) #IMPLIED
UpdateBehavior (upsert | strict | upsertVersion | strictVersion) #IMPLIED
DefaultTxn (no | yes) #IMPLIED
>
Description
PREFERENCES
DefaultAction
UpdateBehavior
DefaultTxn
432
Description
Traverse
This is the initial default for the file. It is intended to be used on alreadycreated objects for which no repository action is to be taken at this time.
The metaxml engine merely identifies that they exist, and continues on.
This is especially convenient for files that are re-used many times.
Existing objects can be left untouched while new ones are added, others
deleted and others updated. Objects that are not found will generate an
error message.
Add
This action will cause a new object to be added to the MDS repository.
For meta-model elements (MODELDESC, CLASSDESC, etc.) if an
object of the same name already exists in the class, this is an error.
However, for the meta-data element (OBJECT), addition of a new object
of the same name depends on whether or not the class or (for
relationships) collection class allows duplicate names. (This is different
from the 2.0 release where an action of "add" would also update an
existing object if found. As of the 2.1 release, this is a specific action of the
"update" setting.)
Update
To allow the user the more flexibility, this action comes in four behaviors
two of which are: "upsert" and "strict". The default behavior is "upsert"
which means that for object updates, the object will be looked for first,
and if found, updated. But if the object is not found, a new one will be
created. (This was the "add" action for the 2.0 release.) On the other
hand, if the behavior is set to "strict" and the action is "update", the object
must be found or an error will be generated. (The behavior can be set
only by the PREFERENCES DefaultBehavior attribute, q.v.) In a
repository with versioning enabled, "update" causes a new version of an
existing object to be created.
As of MDS 6.1, there is a variation to each of these two behaviors, that
applies to repositories with versioning enabled, and they are
"upsertVersion" and "strictVersion".
In a repository with versioning enabled, if an existing object is to be
updated, but the user wishes the current version be re-written rather than
a new version created, they must use one of these behaviors in place of
the two described above. This action effectively overrides the default
behavior of object updates for a versioned repository, which is to create a
new version of an object (with a new object id) anytime an object is
updated.
Note: The only objects in the repository that are versioned are meta data
objects, not metamodel objects (AIMs, classes, properties, relationships,
users, groups or security profiles).
Remove
This action setting will cause metaxml to attempt to remove the object
from the MDS repository. If it is not found, it will generate an error
message.
For repositories with versioning enabled, this means deleting all versions
of the object from the repository
433
An element's action attribute, if present, will always override the current default setting. In
this way, a DefaultAction can be set for a file that deals with most of the elements in the file,
while those elements that are to be dealt with differently can have their action set to whatever
is appropriate, and presumably, different from the default.
Elements for Importing AIMS
MODELDESC
The MODELDESC element enables importing an AIM into the MDS repository. This element
is a child of the MODELDESCS element. There can be more than one MODELDESC
contained within the MODELDESCS element.
Example XML script:
<MODELDESC>
<NAME>AutoWorld</NAME>
<DESCRIPTION>The World of Auto and AutoMakers</DESCRIPTION>
<CLASSDESC linkid="AM">
<NAME>AutoMaker</NAME>
<!- More elements -->
</CLASSDESC>
<CLASSDESC linkid="AU">
<NAME>Auto</NAME>
<!- More elements -->
</CLASSDESC>
<RELATIONSHIPDESC>
<NAME>ManufOfAutos</NAME>
<!- More elements -->
</RELATIONSHIPDESC>
<DERIVEDCLASSDESC>
<NAME>AutoEx</NAME>
<!- More elements -->
</DERIVEDCLASSDESC>
</MODELDESC>
DTD:
<!ELEMENT MODELDESCS (PREFERENCES*, MODELDESC)+>
<!ELEMENT MODELDESC (NAME, DESCRIPTION, OBJECTGUID?, OWNER?, VERSIONING?,
(SECURITYPROFILENAME |
SECURITYPROFILEREF)?, PREFERENCES*, CLASSDESC*, PREFERENCES*, RELATIONSHIPDESC*,
PREFERENCES*,DERIVEDCLASSDESC*)>
<!ATTLIST MODELDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
aimversion CDATA #IMPLIED
>
<!ELEMENT VERSIONING EMPTY>
<!ATTLIST VERSIONING
set (on | off) #REQUIRED
deleteObjects (no | yes) "no"
>
434
Description
MODELDESC
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
linkid
action
transaction
aimversion
435
Description
VERSIONING
CLASSDESC
RELATIONSHIPDESC
CLASSDESC
436
DTD:
<<!ELEMENT CLASSDESC (NAME, DESCRIPTION, OBJECTGUID?, UNIQUENAMING?, OWNER?, VERSIONING?,
(SECURITYPROFILENAME | SECURITYPROFILEREF)?, ROOTCLASS?, ABSTRACTCLASS?, SUPERCLASSES?,
PROPERTYDESC*)>
<!ATTLIST CLASSDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT ROOTCLASS EMPTY>
<!ATTLIST ROOTCLASS
type (no | yes) #REQUIRED
>
<!ELEMENT ABSTRACTCLASS EMPTY>
<!ATTLIST ABSTRACTCLASS
type (no | yes) #REQUIRED
>
<!ELEMENT OBJECTDESCS EMPTY>
<!ATTLIST OBJECTDESCS
required (no | yes) #REQUIRED
>
<!ELEMENT SUPERCLASSES (SUPERCLASS+)>
<!ELEMENT SUPERCLASS EMPTY>
<!ATTLIST SUPERCLASS
linkref IDREFS #IMPLIED
objid CDATA #IMPLIED
>
Description
CLASSDESC
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
UNIQUENAMING
ROOTCLASS
437
Description
linkid
ABSTRACTCLASS
OBJECTDESCS
438
SUPERCLASSES
action
transaction
Description
VERSIONING
PROPERTYDESC
PROPERTYDESC
439
DTD:
<!ELEMENT PROPERTYDESC (NAME, PROPERTYID, DESCRIPTION, SQLTYPE, VARIANTTYPE, OBJECTGUID?,
OWNER, (SECURITYPROFILENAME | SECURITYPROFILEREF)?, PROPSIZE?, DECIMALDIGIT?,
CHARACTERSET?)>
<!ATTLIST PROPERTYDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT DECIMALDIGIT (#PCDATA)>
<!ELEMENT PROPSIZE (#PCDATA)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT SQLTYPE EMPTY>
<!ATTLIST SQLTYPE
type (SQL_CHAR | SQL_NUMERIC | SQL_DECIMAL | SQL_INTEGER | SQL_SMALLINT |
SQL_FLOAT | SQL_REAL | SQL_DOUBLE | SQL_DATE | SQL_VARCHAR | SQL_BINARY |
SQL_VARBINARY | SQL_TINYINT | SQL_TIME | SQL_TIMESTAMP) #REQUIRED
>
<!ELEMENT VARIANTTYPE EMPTY>
<!ATTLIST VARIANTTYPE
type (VT_SHORT | VT_INTEGER | VT_DOUBLE | VT_STRING | VT_BOOL | VT_UCHAR |
VT_BINARY | VT_DATE | VT_BYTE) #REQUIRED
>
<!ELEMENT CHARACTERSET (#PCDATA)>
<!ELEMENT VALUEREQUIRED (#PCDATA)>
440
Description
PROPERTYDESC
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
PROPERTYID, SQLTYPE,
VARIANTTYPE, PROPSIZE,
DECIMALDIGIT,
CHARACTERSET
Description
VALUEREQUIRED
linkid
action
transaction
DERIVEDCLASSDESC
441
DTD:
<!ELEMENT DERIVEDCLASSDESC (NAME, DESCRIPTION, BASECLASSNAME, OBJECTGUID?, OWNER?,
(SECURITYPROFILENAME | SECURITYPROFILEREF)?, DERIVEDPROPERTYDESC*)>
<!ATTLIST DERIVEDCLASSDESC
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT BASECLASSNAME (#PCDATA)>
<!ATTLIST BASECLASSNAME
linkref IDREF #IMPLIED
>
Description
DERIVEDCLASSDESC
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
BASECLASSNAME
DERIVEDPROPERTYDESC
action
transaction
DERIVEDPROPERTYDESC
442
DTD
<!ELEMENT DERIVEDPROPERTYDESC (NAME, PROPERTYID, DESCRIPTION, OWNER?, OBJECTGUID?,
(SECURITYPROFILENAME | SECURITYPROFILEREF)?, BASEPROPERTYNAME, BASERELATIONSHIPNAME+)>
<!ATTLIST DERIVEDPROPERTYDESC
action (traverse | add | remove | update) #IMPLIED
>
<!ELEMENT BASEPROPERTYNAME (#PCDATA)>
<!ELEMENT BASERELATIONSHIPNAME (#PCDATA)>
<!ATTLIST BASERELATIONSHIPNAME
linkref IDREF #IMPLIED
>
Description
DERIVEDPROPERTYDESC
443
Description
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
PROPERTYID
BASEPROPERTYNAME
BASERELATIONSHIPNAME
action
RELATIONSHIPDESC
DTD:
<!ELEMENT RELATIONSHIPDESC (NAME, DESCRIPTION, ORIGINREF, DESTINATIONREF, OBJECTGUID?,
UNIQUENAMING?, PROPAGATEDELETE?, OWNER?, (SECURITYPROFILENAME | SECURITYPROFILEREF)?)>
<!ATTLIST RELATIONSHIPDESC
linkid ID #IMPLIED
444
Description
RELATIONSHIPDESC
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
ORIGINREF
DESTINATIONREF
linkmodel, linkclass
linkref
UNIQUENAMING
PROPAGATEDELETE
445
Description
linkid
action
transaction
The MODEL element identifies the AIM, which will be used to import the repository. If a
linkref is supplied for the model (referencing a MODELDESC linkid in this file), the
NAME element, while still required for the file to parse correctly, is ignored.
If any APPLYLABEL elements are present, the label(s) indicated will be applied after all CLASS
child elements have completed their actions, whatever they might be. You may look at the
labels as being applied at the time of the close of the MODEL element in the script. The result
of the APPLYLABEL is that the label identified in each APPLYLABEL element is applied to
every object of every class of the metamodel, regardless of whether a class (or any of its
objects) explicitly appears a child of the MODEL element. Also, propagate=yes is always the
default for the MODEL element, and will be ignored by the MDS engine even if set to no.
The label must already exist in the repository or an error will occur.
Example XML script:
<MODEL>
<NAME>AutoWorld</NAME>
<CLASS>
<NAME>AutoMaker</NAME>
<!- More elements identifying AutoMaker objects -->
</CLASS>
</MODEL>
DTD:
<!ELEMENT MODEL (NAME?, APPLYLABEL*, (PREFERENCES*, CLASS+)>
<!ATTLIST MODEL
linkref IDREF #IMPLIED
>
446
The CLASS element identifies the class of the data objects to be imported, updated or deleted.
If a linkref is supplied for the class (referencing a CLASSDESC linkid in this file), the
NAME element, while still required for the file to parse correctly, is ignored.
If any APPLYLABEL elements are present, the label(s) indicated will be applied after all
OBJECTLIST OBJECT elements have completed their actions, whatever they might be. You
may look at the labels as being applied at the time of the close of the CLASS element in the
script. The result of the APPLYLABEL is that the label identified in each APPLYLABEL
element is applied to every object in the class, regardless of whether an object explicitly
appears a child of the OBJECTLIST element. Also, the "propagate=yes" attribute value may be
used to propagate the label to all destination objects of the class's objects. The label must
already exist in the repository or an error will occur.
Example XML script:
<CLASS linkref="AU">
<!-The Name is provided, but the "AU" linkid is used to get the Auto class
object ID,saving the lookup of this object in the engine.
(This assumes the Auto class is already identified with a linkid of "AU"
set.)
-->
<NAME>Auto</NAME>
<OBJECTLIST>
<OBJECT>
<! More elements -->
</OBJECT>
<OBJECT>
<!- More elements -->
</OBJECT>
</OBJECTLIST>
</CLASS>
DTD:
<!ELEMENT CLASS (NAME, APPLYLABEL*, OBJECTLIST?)>
<!ATTLIST CLASS
linkref IDREF #IMPLIED
>
OBJECTLIST
The OBJECTLIST element is principally used to group lists of objects via the OBJECT
elements contained in it. For repositories which have versioning enabled, the optional
APPLYLABEL allows the user to apply the indicated label(s) to the list of child OBJECT
elements.
There are two thing to note about the APPLYLABEL element:
All labels indicated will be applied to the list of child elements after the object(s) are acted
on by metaxml. This means that if an object is being updated by the OBJECT element, it is
the updated version that will be labeled.
The label(s) are applied only to the immediate OBJECT child elements of the
OBJECTLIST element.
447
This means is that if some of the OBJECT elements, further identify objects via the
RELATIONSHIP/OBJECT set of elements, the objects of the RELATIONSHIP OBJECT child
elements will not be labeled. However, as with all cases where the APPLYLABEL element
occurs, the user may specify the "propagate=yes" attribute setting to achieve the same effect,
without having to include all those objects in RELATIONSHIP-OBJECT sublists.
DTD:
<!ELEMENT OBJECTLIST (PREFERENCES*, OBJECT*)+>
<!ELEMENT APPLYLABEL (#PCDATA)>
<!ATTLIST APPLYLABEL
propagate (no | yes) "no
>
OBJECT
The OBJECT element identifies the data objects to be imported, updated or deleted. This
element is a child element of the OBJECTLIST element. An OBJECT element will be needed
for each meta data object you want in the class.
The OBJECT element is the only one where the UpdateBehavior settings of "upsertVersion"
and "strictVersion" will be used. This should only be for exceptional cases. See the discussion
in Action Attribute Settings on page 432.
Since objects are typically mapped to or from other objects in other classes, it is natural to
expect that this OBJECT element would be the parent or child of a RELATIONSHIP element
to indicate this mapping.
An exception to this occurs if the relationship is inherited from a super class. In this case, the
proper class for the object cannot be determined (it may have come form any number of subclasses). The result is that, to add objects to relationships that are inherited, two steps need to
be performed:
1
The object needs to be created/identified the usual way in its class using the usual CLASS/
OBJECTLIST/OBJECT elements.
448
DTD:
<!ELEMENT OBJECTLIST (PREFERENCES*, OBJECT*)+>
<!ELEMENT OBJECT (NAME?, OBJECTGUID?, DESCRIPTION?, OWNER?, (SECURITYPROFILENAME |
SECURITYPROFILEREF)?, PROPERTIES?, RELATIONSHIP*)>
<!ATTLIST OBJECT
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
class CDATA #IMPLIED
transaction (no | yes) #IMPLIED
>
Description
OBJECT
NAME, DESCRIPTION,
OBJECTGUID, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFLEREF)
PROPERTIES
RELATIONSHIP
linkid
action
class
transaction
449
The PROPERTY element sets the value of an object property. This is a child of the OBJECT
element.
Example XML script:
<PROPERTY>
<NAME>Some New Property 1</NAME>
<VALUE type="VT_STRING">abcdef</VALUE>
</PROPERTY>
<PROPERTY>
<PROPERTYID>502</PROPERTYID>
<VALUE type="VT_INTEGER">100</VALUE>
</PROPERTY>
<!-- Running MetaXML to update an existing object... -->
<!-- Set the "StringProperty" value to NULL. (Without the null=yes
attribute, this would change the value to the empty string.)
Note that to "set" to a NULL value at object-create time,
simply do not include the PROPERTY element.
-->
<PROPERTY>
<NAME>StringProperty</NAME>
<VALUE type="VT_STRING" null="yes"/>
</PROPERTY>
<!-- Set the "BinaryProperty" value to NULL; null attribute not necessary.
Note that to "set" to a NULL value at object-create time,
simply do not include the PROPERTY element.
-->
<PROPERTY>
<NAME>BinaryProperty</NAME>
<VALUE type="VT_BINARY"/>
</PROPERTY>
DTD:
<!ELEMENT
<!ELEMENT
<!ELEMENT
<!ATTLIST
>
450
Description
NAME
PROPERTYID
StringLiteral
This attribute, when set to "yes", tells the MDS engine to send
the string to Teradata without adding enclosing quotes. It
implies the character data has some special meaning, such as
'date' or 'time'. The default is "no". It is silently ignored for noncharacter properties.
Description
null
VALUE
RELATIONSHIP
The RELATIONSHIP element adds or removes an object from a collection. This is a child of
the OBJECT element, and OBJECT elements can also be its children. In this way, one can
uniquely identify a repository object within a Class by using the Relationships for that Model.
There are two things to note about the "action" attribute for the Relationship element. First, to
provide compatibility with earlier releases, it is required -- its setting will always over-ride any
default set by the PREFERENCES element. And second, its behavior is slightly different than
other action attributes in that its MDS action is to add/remove the objects in the associated
OBJECTLIST to/from one of its collections. That is, it does not add/remove MDS objects
(though the objects in the list may be added/removed themselves), but works instead on its
indicated collection.
Limitations: While objects can be added or removed in the object list, it is not recommended
to do both at the same time. The issue is that the relationship action can only be one thing
(add/remove/traverse), so if child objects are BOTH added and others removed, no action
setting for the relationship is going to come out right.
Example XML script:
<OBJECT>
<NAME>American Autos</NAME
<RELATIONSHIP action="add">
<NAME>ManufOfAutos</NAME>
<OBJECT>
<NAME>Colt</NAME>
</OBJECT>
</RELATIONSHIP>
</OBJECT>
DTD:
<!ELEMENT RELATIONSHIP (NAME,(OBJECTREF|OBJECT)*)>
<!ATTLIST RELATIONSHIP
action (traverse | add | remove) #REQUIRED
type (origin | destination) #IMPLIED
linkref IDREF #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT OBJECTREF EMPTY>
451
Description
RELATIONSHIP
NAME
OBJECT
OBJECTREF
action
type
linkref
transaction
The METAUSER element enables creating and deleting MDS Users and changing MDS User
passwords.
Example XML script:
<METAUSER linkid="User1">
<NAME>User 1</NAME>
<PASSWORD>0xxxxxxxxxxxxxxx</PASSWORD>
<DESCRIPTION>This is the first user</DESCRIPTION>
</METAUSER>
DTD:
<!ELEMENT METAUSER (NAME,PASSWORD,DESCRIPTION?)>
<!ATTLIST METAUSER
452
Description
METAUSER
NAME
PASSWORD
DESCRIPTION
linkid
action
superuser
encrypt
METAGROUP
The METAGROUP element enables creating and deleting MDS Application Groups and
adding and removing users from the groups.
Example XML script:
<METAGROUP>
<NAME>Group 1</NAME>
<METAUSERREF linkref="User1" action="add"/>
</METAGROUP>
<METAGROUP>
<NAME>Group 2</NAME>
<METAUSERREF linkref="User1" action="add"/>
<METAUSERREF linkref="John.Doe" action="remove"/>
</METAGROUP>
DTD:
<!ELEMENT METAGROUP (NAME, DESCRIPTION?, METAUSERREF*)>
<!ATTLIST METAGROUP
action (traverse | add | remove | update) #IMPLIED
453
Description
METAGROUP
NAME
DESCRIPTION
action
transaction
METAUSERREF
linkname
linkref
SECURITYPROFILE
The SECURITYPROFILE element enables creating, updating and deleting MDS Security
Profiles. This element is a child element of the SECURITYPROFILES element. Security
Profiles are used by all other repository objects to identify who is allowed what type of access
to those objects. This element replaces the PERMISSION and APPLICATIONGROUP
elements from the 2.0 release.
Example XML script:
<SECURITYPROFILES>
<SECURITYPROFILE linkid="AMSecProf">
<NAME>AutoMaker Security Profile</NAME>
<DESCRIPTION>Desc</DESCRIPTION>
<SPENTRY access="SP_FULL">
<MDSUSER>user1</MDSUSER>
</SPENTRY>
<SPENTRY access="SP_READ">
<MDSGROUP>AutoWorld Group</MDSGROUP>
</SPENTRY>
</SECURITYPROFILE>
</SECURITYPROFILES>
DTD
<!ELEMENT SECURITYPROFILE (NAME, DESCRIPTION?, OBJECTGUID?, OWNER?, SPENTRY*)>
454
Description
SECURITYPROFILE
NAME, DESCRIPTION,
OBJECTGUID, OWNER
linkid
action
SPENTRY
MDSUSER
MDSGROUP
access
METALABEL
The METALABEL element is used to create, update or remove labels in the MDS repository.
This element is the only child element of the METALABELS element.
DTD:
<!-Labels are part of versioning; new as of 6.1
-->
<!ELEMENT METALABELS (METALABEL)+>
<!ATTLIST METALABELS
455
Description
METALABEL
NAME, OBJECTGUID,
DESCRIPTION, OWNER,
(SECURITYPROFILENAME |
SECURITYPROFILEREF)
action
CREATORNAME
Transactions
Ideally, the metaxml program would perform all actions in an XML file as one transaction.
With one transaction per XML file, either the entire content of the XML file would be applied
to the MDS repository or every action will be rolled back. Depending on the content and size
of the XML file, using one transaction can cause the following problems:
1
MDS objects can potentially be locked for a long period of time preventing other
applications from accessing the MDS repository.
Because the metaxml program is performing multiple MDS API calls, metaxml or other
MDS applications can potentially deadlock waiting for an object locked by metaxml.
By default, the metaxml program uses MDS implicit transactions, which commits changes
after each call to a MDS API. In the MDS DTD, the following element tags have a transaction
attribute: METAUSERS, METAGROUPS, SECURITYPROFILES, MODELDESC,
CLASSDESC, RELATIONSHIPDESC, PROPERTYDESC, DERIVEDCLASSDESC,
RELATION and OBJECT. If the element tag has a transaction attribute value to yes, then
metaxml will begin a MDS explicit transaction and end the transaction when the element
ends. For example:
<MODEL>
<NAME>Model 1</NAME>
<CLASS>Class 1
456
However,
There are several other sample XML scripting files in the sample\xml directory. They build on
the AutoWorld meta-model by using inheritance. Their names are AutoWorld_I Desc.xml and
AutoWorld_I Objects.xml, which illustrate simple examples of inheritance; and AutoWorld_IA
Desc.xml and AutoWorld_IA Objects.xml, which illustrate inheritance from an abstract class.
457
update). The action on the RELATIONSHIP elements should be set to traverse after the first
run also.
Remember that the PREFERENCES tag can be used in many different places. See the DTD file
for details.
Finally, note that the DTD file here is located on a WEB server (on the local host). Set the file
path for this file to whatever is appropriate for your environment (the DTD file is installed in
the %METAHOME%\bin folder).
458
CHAPTER 16
Error Messages
This chapter contains tables that list MDS Error Messages that can appear in the MDS Log.
The tables contain the probable cause, examples and suggested remedies.
Transaction Errors
Note: Beginning with MDS 6.0, the RelativePropID for a new class property must be greater
than 500. Property IDs from 1 to 500 are reserved for internal MDS use.
Message
Code
Probable Cause
META_SUCCESS
0x80000000
META_FAILURE
0x80007000
General API Error: General API error. See the MDS error log
for more details.
459
Message
Code
Probable Cause
META_E_INVALID_PARAMETER
0x80007001
META_E_CLASS_NAME_
ALREADY_EXISTS_IN_AIM
0x80007002
META_E_OBJECT_NOT_FOUND
0x80007003
META_E_INSUFFICIENT_ MEMORY
0x80007004
META_E_SERVER_NOT_ AVAILABLE
0x80007005
META_E_NO_ACCESS_RIGHTS
0x80007006
META_E_PROPERTY_NOT_ FOUND
460
0x80007008
Message
Code
Probable Cause
META_E_FATAL_ERROR
0x8000700A
META_E_REPOSITORY_NOT_
INITIALIZED
0x8000700B
META_E_AIM_NAME_
ALREADY_EXISTS
0x8000700C
META_E_MULTIPLE_OBJECTS_
FOUND
0x8000700D
META_E_MISSING_REQUIRED_
PARAMETER
0x8000700E
META_E_DATATYPE_MISMATCH
0x80007011
META_E_OBJ_NOT_IN_
CORRECT_RELATION_CLASS
0x80007012
GetDestCollection, AddToDestCollection,
AddManyToDestCollection: the object ID of the calling
object is not in the origin class of the specified relationship.
GetOrigCollection AddToOrigCollection,
AddManyToOrigCollection: the object ID of the calling
object is not in the destination class of the specified
relationship.
AddToDestCollection, AddManyToDestCollection: the
object IDs to add to the collection are not in the destination
class of the relationship.
AddToOrigCollection, AddManyToOrigCollection: the
object IDs to add to the collection are not in the origin class of
the relationship.
META_E_EXCEPTION
0x80007013
META_E_CLASS_NOT_FOUND
0x80007014
META_E_RELATIONSHIP_
NOT_FOUND
0x80007015
META_E_PROP_NAME_
ALREADY_EXISTS_IN_CLASS
0x80007016
461
Message
Code
Probable Cause
META_E_CLASS_OBJ_MISMATCH
0x80007017
META_E_NO_UNUSED_LOIDS
0x80007018
Out of Object IDs: MDS has run out of new objects IDs to
assign to new objects.
META_E_UNSUPPORTED_
VARIANT_TYPE
0x80007019
META_E_UNSUPPORTED_ SQL_TYPE
0x8000701A
META_E_DBACCESS_ERROR
0x8000701B
META_E_REGISTRY_LOOKUP_
FAILED
0x8000701D
META_E_DATABASE_CONNECT_FAIL
ED
0x8000701E
462
Message
Code
Probable Cause
META_E_NO_TERADATA_TYPE
0x8000701F
META_E_INVALID_DATATYPE_
MODIFIER
0x80007021
META_E_MODEL_NOT_CREATED
0x80007022
META_E_CLASS_NOT_CREATED
0x80007023
META_E_REL_NAME_ALREADY_EXIS
TS_IN_AIM
0x80007024
META_E_COLUMN_MISSING
0x80007025
META_E_INVALID_VARIANT_ TYPE
0x80007026
META_E_PROPERTY_TEMPLATE_MIS
SING
0x80007027
463
Message
Code
Probable Cause
META_E_COLNAME_EXCEEDS_
THIRTY_CHAR
0x80007028
META_E_NULL_OBJECT_ID
0x80007029
META_E_VARIANT_ T_EXCEPTION
0x8000702B
META_E_LOAD_IN_PROGRESS
0x8000702C
META_E_LOAD_INVALID_
PARMNUM
0x8000702D
META_E_OPENFILE_ERRROR
0x8000702E
META_E_NO_AIM_UPDATES
0x8000702F
META_E_REPOSITORY_
ALREADY_INITIALIZED
0x80007030
464
Message
Code
Probable Cause
META_E_INVOKE_FAILED
0x80007031
META_E_QUERY_INTERFACE_
FAILED
0x80007032
META_E_COCREATEINSTANCE_
FAILED
0x80007033
META_E_VARIANTTYPE_ MISMATCH
0x80007034
465
Message
Code
Probable Cause
META_E_REQUIRES_
UNIQUE_NAMES
0x80007035
META_E_UNIQUE_NAMES_
ARE_VIOLATED
0x80007036
META_E_REMOVE_FROM_
COLLECTION_FAILED
0x80007037
META_E_REQUIRES_UNIQUE_
PROPERTY_IDS
0x80007038
466
Message
Code
Probable Cause
META_E_UNIQUE_PROPERTY_
IDS_ARE_VIOLATED
0x80007039
META_E_BUFFER_TOO_SMALL
0x8000703A
META_E_UNKNOWN_USER
0x8000703B
META_E_INVALID_PASSWORD
0x8000703C
META_E_INVALID_ACCESS_ RIGHTS
0x8000703D
META_E_INVALID_FOREIGN_
KEY_VALUE
0x8000703E
META_E_APPLICATION_
GROUP_NOT_CREATED
0x8000703F
META_E_OWNER_INVALID
0x80007040
META_E_OBJECT_IN_USE
0x80007041
META_E_OBJECT_ALREADY_ EXISTS
0x80007042
META_E_CREATEPROPERTY_
NOT_ALLOWED
0x80007043
META_E_DATABASE_
TABLES_NOT_INITIALIZED
0x80007044
META_E_PASSWORD_TOO_
SHORT_OR_TOO_LONG
0x80007045
467
Message
Code
Probable Cause
META_E_MUST_BE_METASU_USER
0x80007046
META_E_DATABASE_TABLES_
ALREADY_INITIALIZED
0x80007047
META_E_NO_CHANGES_TO_
MDSMETAMODEL_OBJECTS_
ALLOWED
0x80007049
META_E_UNIQUENESS_
VIOLATION_OR_OBJECT_
NOT_FOUND
0x8000704A
META_E_INVALID_DATABASE_
USER_NAME
0x8000704B
META_E_INVALID_DATABASE_
PASSWORD
0x8000704C
META_E_INVALID_DATA_
SOURCE_NAME
0x8000704D
META_E_INSUFFICIENT_
DATABASE_ACCESS_ PERMISSIONS
0x8000704F
0x80007050
META_E_DATABASE_OR_USER_
ALREADY_EXISTS
0x80007051
META_E_CLASS_OR_
RELATIONSHIP_NOT_FOUND
0x80007052
META_E_TRANSACTION_
ABORTED_DUE_TO_DEADLOCK
0x80007053
468
Message
Code
Probable Cause
META_E_LOCK_HINT_CONFLICT
0x80007054
META_E_LOCK_HINT_
WRONG_API_SEQUENCE
0x80007055
META_E_NO_DELETE_
PROPAGATION_TO_AIM_
COMPONENTS
0x80007056
META_E_OBJECT_ALREADY_
IN_COLLECTION
0x80007057
META_E_DUPLICATE_UNIQUE_
PRIMARY_KEY
0x80007058
META_E_TOOL_TERMINATED_
ABNORMALLY
0x8000705A
469
Message
Code
Probable Cause
META_E_TOO_MANY_DIGITS_
AFTER_DECIMAL_POINT
0x8000705B
META_E_MIGRATION_REQUIRED
0x8000705C
META_E_LOAD_VIEWCOL_
DATATYPE_FAILED
0x8000705D
META_E_DATABASE_FULL
0x8000705E
META_E_NAME_NOT_FOUND
0x8000705F
META_E_INVALID_OR_
MISSING_DB_TAG
0x80007060
META_E_DSN_DOES_NOT_
MATCH_CONFIGURED_DSN
0x80007061
META_E_WARNING_ONLY_
BASE_TABLES_DROPPED
0x80007062
META_E_REPOSITORY_
0x80007063
CORRUPTED_NO_TABLES_ DROPPED
470
Message
Code
Probable Cause
META_E_SECONDARY_INDEX_
UNIQUENESS_VIOLATION
0x80007064
META_E_QUEUE_NOT_ATTACHED
0x800070A0
META_E_QUEUE_ALREADY_ATTACH
ED
0x800070A1
META_E_QUEUE_DOES_NOT_EXIST
0x800070A2
META_E_QUEUE_ALREADY_EXIST
0x800070A3
META_E_QUEUE_NO_MSG
0x800070A4
META_E_MDS_RESERVED_CLASS
0x80007100
META_E_UNKNOWN_
COMPARISON_OPERATOR
0x80007101
META_E_UNKNOWN_LOGICAL_OPE
RATOR
0x80007102
META_E_UNDERSPECIFIED_
PROPERTY
0x80007103
META_E_REGEX_COMPARISON_OPE
RATOR_REQUIRES_STRING_OPERAN
D
0x80007104
META_E_CREATE_GUID_FAILED
0x80007105
471
Message
Code
Probable Cause
META_E_UNSUPPORTED_TERADATA
_RELEASE
0x80007107
META_E_ANOTHER_ACTION_
PROCESSOR_IS_RUNNING
0x80007108
META_E_OBJECT_LOCKED_
AND_NOWAIT_SPECIFIED
0x80007109
META_E_XML_ERROR
0x8000710A
META_E_SYSTEM_NAME_NOT_
FOUND
0x8000710B
META_E_NO_DATABASES_ LOADED
0x8000710C
META_E_PROPAGATION_DELETE_LI
MIT_REACHED
0x8000710D
META_E_NAME_EXCEEDS_
THIRTY_CHAR
0x8000710E
META_E_RELPROPID_MUST_BE_GRE 0x8000710F
ATER_THAN_ZERO
META_E_USER_NOT_SIGNED_ON
0x80007110
META_E_TABLE_ALREADY_EXISTS
0x80007111
META_E_TIMEOUT_EXPIRED
0x80007112
Time out for SQL command: The maximum time set for a
SQL command expired and the command was aborted.
472
Message
Code
Probable Cause
META_E_METALOAD_SYSTEM_LOGI
N_NOT_SET
0x80007113
META_E_NO_DELETE_DIM_UPDATE
ABLE_SYSTEM
0x80007114
META_E_INVALID_SCRIPT_TYPE
0x80007115
META_E_BAD_ATTRIBUTE_INFO
0x80007116
META_E_NO_DATA_SOURCE
0x80007117
META_E_BAD_DEFINE_STMT
0x80007118
META_E_BAD_INSERT_STMT
0x80007119
META_E_BAD_OUTPUT_FILE_DATA
0x8000711A
META_E_NULL_THIS_PTR
0x8000711B
META_E_REPOSITORY_IS_CURRENT
_RELEASE
0x8000711C
META_E_DATABASE_DOES_NOT_EXI
ST
0x8000711D
META_E_METALOAD_CHILD_PROCE
SS_DIED
0x8000711E
473
Message
Code
Probable Cause
META_E_METALOAD_PARENT_PROC
ESS_DIED
0x8000711FL
META_E_SECURITY_PROFILE_IN
VALID
0x80007140
META_E_INTERNAL_ERROR
0x80007141
META_E_OBSOLETE_PROPERTY
0x80007142
0x80007143
META_E_DDL_PARSING_FAILED
0x80007144
META_E_UNKNOWN_DATABASE
S_FOR_DDL
0x80007145
META_E_DERIVED_CLASS_CON
FLICT
0x80007146
META_E_DERIVED_PROPERTY_
CONFLICT
0x80007147
META_E_DERIVED_CLASS_WRIT
ES_NOT_ALLOWED
0x80007148
META_E_DERIVED_PROPERTY_
RELATIONSHIP_ERROR
0x80007149
META_E_BASE_PROPERTY_NA
ME_NOT_FOUND
0x8000714A
META_E_MAX_SECPROFILE_PE
RMISSIONS_EXCEEDED
0x8000714B
META_E_INVALID_PROPERTYDE
SC_PTR
0x8000714C
474
Message
Code
Probable Cause
META_E_INVALID_CLASSDESC_ PTR
0x8000714D
META_E_INVALID_RELATIONSHI
PDESC_PTR
0x8000714E
META_E_DATABASE_NOT_LOAD ED
0x8000714F
META_E_COLUMN_DOES_NOT_
EXIST
0x80007150
META_E_CANNOT_ALTER_COLU MN 0x8000715
META_E_DEST_CANNOT_BE_A_
DERIVED_CLASS
0x80007152
META_E_ORIG_CANNOT_BE_A_
DERIVED_CLASS
0x80007153
META_E_UNBALANCED_PARENT
HESES
0x80007154
MET A_E_ALREADY_MIGRATED
0x80007155
META_E_NO_SPL_TEXT
0x80007156
META_E_BASECLASSID_IS_NOT_A_V
ALID_CLASS
0x80007157
META_E_BASECLASS_CANNOT_
BE_A_DERIVEDCLASS
0x80007158
META_E_INVALID_SP_VERSION
0x80007159
META_E_FETCH_NEXT_ROW_END_
OF_RESULTS
0x80007180
475
Message
Code
Probable Cause
META_E_MAX_PROPERTIES_PER_
CLASS_EXCEEDED
0x80007181
META_E_TERADATA_MAX_STRING_
SIZE_EXCEEDED
0x80007182
The value of a string size has been set too large. The Teradata
limit is 31000 bytes.
META_E_SECURITY_PROFILE_LIMIT
_EXCEEDED
0x80007183
META_E_A_ABSTRACT_CLASS_HAS_
NO_OBJECTS
0x80007184
META_E_CANNOT_DELETE_A_
SUPERCLASS
0x80007185
META_E_MACRO_DOES_NOT_EXIST
0x80007186
META_E_SUPERCLASS_CANNOT_BE_ 0x80007187
A_DERIVEDCLASS
META_E_SUPERCLASS_IS_NOT_A_
VALID_CLASS
0x80007188
META_E_MAX_ALLOWED_
SUPERCLASSES_EXCEEDED
0x80007189
META_E_CANNOT_DELETE_
INHERITED_PROPERTY
0x8000718A
META_E_CANNOT_ADD_
SUPERCLASS_WITH_PROPERTIES
0x8000718B
META_E_CANNOT_REMOVE_SUPER
CLASS_WITH_PROPERTIES
0x8000718C
META_E_UPGRADE_MDS_
SOFTWARE
0X80007194
META_E_UPGRADE_ODBC_DRIVER
0X80007195
MDS cannot use the current ODBC driver because the version
is incompatible with the repository. For MDS 13.0 and later,
the minimum acceptable ODBC driver version is 12.00.00.00
and later.
476
Message
Code
Probable Cause
META_E_RELPROPID_MUST_BE_GRE 0X80007196
ATER_THAN_500
META_E_UNKNOWN_KANJI_TRANSL 0X80007194
ATE_FUNCTION
META_E_MUST_BE_A_SUPERUSER
0x800071A0
META_E_OBJECT_FROZEN
0x800071A1
META_E_NO_MORE_VERSIONS
0x800071A2
META_E_NOT_CURRENT_VERSION
0x800071A3
The application has called an API that requires the local object
ID, also known as the loid, to specify the latest version of an
object. If you are adding a loid to a collection, i.e.
AddToDestCollection, AddToOrigCollection, etc., the origin
loid must be for the latest version of an object.
META_E_LABEL_NOT_DEFINED
0x800071A4
META_E_REPOSITORY_VERSIONING
_NOT_ENABLED
0x800071A5
477
Message
Code
Probable Cause
META_E_METAMODEL_VERSIONING 0x800071A6
_NOT_ENABLED
META_E_LABEL_NOT_USED
0x800071A7
META_E_UNIQUE_DEST_VERSIONS_
VIOLATED
0x800071A8
META_E_NO_VIRTUAL_CIRCUITS
0x800071A9
META_E_LABEL_IN_USE
0x800071AA
META_E_ROW_TOO_LONG
0x800071B0
META_E_DB_OUT_OF_SPOOL_SPACE 0x800071B1
The API call has failed because there is insufficient spool space
in the repository database to return the results of a query.
META_E_DORMANT_OBJECT
0x800071B2
META_E_DORMANT_OBJECTS_NOT_ 0x800071B3
SUPPORTED
META_E_SYSTEMNAME_EXCEEDS_
256_CHARS
0x800071C0
META_E_METALOAD_ABORT_
REQUESTED
0x800071C1
META_E_MDS_VIEWS_NOT_
INSTALLED
0x800071C2
META_E_MUST_BE_UNIX_ROOT_US
ER
0x800071C3
META_E_METALOAD_BUFFER_OVER
FLOW
0x800071C4
478
Message
Code
Probable Cause
META_E_METALOAD_RESYNC_NEED 0x800071C5
S_UTF16
META_E_MISSING_REQUIRED_DESC
RIPTION
0x800071D0
CMetaClassDesc::ChangeDescriptionRequired:
DescriptionRequired property for the class cannot be set to
true because one or more existing objects in the class do not
have descriptions.
META_E_REQUIRED_PROPERY_NOT
_ALLOWED_IN_MODEL
0x800071D1
META_E_MISSING_REQUIRED_PROP
ERTY
0x800071D2
META_E_PROPERTY_RENAME_NOT_
ALLOWED
0x800071D3
META_E_UPGRADE_MDS_VIEWS
0x800071D5
META_E_WRONG_VERSION_FOR_MI 0x800071D6
GRATION
META_E_MAY_NOT_UNLOAD_SYSU
DTLIB
0x800071DA
META_E_UDT_DOES_NOT_EXIST
0x800071DB
META_E_UDF_DOES_NOT_EXIST
0x800071DC
META_E_AMP_DOWN
0x800071DD
META_E_TERADATA_SQL_ERROR
0x800071E0
479
Transaction Errors
The following table lists transaction-specific error messages.
Table 50: Transaction-Specific Errors
Message
Code
Probable Cause
META_E_TX_ROLLED_BACK
0x80007400
META_E_TX_COMMIT_FAILED
0x80007402
META_E_TX_ROLLBACK_ FAILED
0x80007403
META_E_TX_ILLEGAL_ DDL_TYPE
0x80007404
META_E_TX_HAS_ERROR
0x80007405
META_E_TX_NO_
MATCHING_DDL_FOUND
0x80007406
META_E_TX_INDEX_OUT_
OF_RANGE
0x80007500L
480
Messages
Code
Probable Cause
META_E_GWYSOCKET_EINTR
0x80007800
META_E_GWYSOCKET_EAGAIN
0x80007801
META_E_GWYSOCKET_ENOMEM
0x80007802
META_E_GWYSOCKET_EINVAL
0x80007803
META_E_GWYSOCKET_ENFILE
0x80007804
META_E_GWYSOCKET_ENOSR
0x80007805
META_E_GWYSOCKET_EMSGSIZE
0x80007806
META_E_GWYSOCKET_EADDRINUSE
0x80007807
META_E_GWYSOCKET_EADDRNOTAV
AIL
0x80007808
META_E_GWYSOCKET_ENETDOWN
0x80007809
META_E_GWYSOCKET_EISCONN
0x8000780A
META_E_GWYSOCKET_ENOTCONN
0x8000780B
META_E_GWYSOCKET_ECONNREFUS
ED
0x8000780C
META_E_GWYSOCKET_EWOULDBLO
CK
0x8000780D
META_E_GWYSOCKET_EMFILE
0x8000780E
META_E_GWYSOCKET_GENERAL_FAI
LURE
0x8000780F
481
Messages
Code
Probable Cause
META_E_GWYSOCKET_CONNECTION
_LOST
0x80007810
META_E_GWYSOCKET_SOCKET_NOT
_READY
0x80007811
482
Message
Code
Probable Cause
META_E_XML_PARSING_FAILED
0x80008000
XML syntax error: The XML file specified for use by the
metaxml program contains an XML syntax error.
META_E_XML_APACHE_INITIALIZ
ATION_FAILED
0x80008001
META_E_XML_UNSUPPORTED_RE
POSITORY_RELEASE
0x80008002
Message
Code
Probable Cause
0x80007600
0x80007601
0x80007602
0x80007603
483
484
CHAPTER 17
This chapter contains illustrations and sample code for using MDS APIs. The two API
example codes are:
C++ Examples
All example programs can be found in the sample folder installed with the Meta Data
Development Kit. You can use either of the MDS APIs to:
Design your application data model defining classes, properties of each class, and the
relationships between the classes.
Create an application to load your model using the AIM API Classes.
Create applications that create, read, and modify objects and collections.
Collections
A1
ClassM
M1
RelAM
M3
M2
B Inherits
From A
N Inherits
From M
ClassB
A1
N1
ClassN
C Inherits
From B
O1
O Inherits
From N
ClassC
N3
N2
A1
RelAM
RelAM
O3
O2
ClassO
3047C014
C++ Examples
This section contains the following C++ examples:
485
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
Deleting Objects
486
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
pDivMakesAutosRel, // Relationship object
NMDIVMAKESAUTOS, //Name
_T("Relationship that links autos to divisions"), //Description
AutoDevisionClass->GetObjectID(), // Orig Classid
AutoClass->GetObjectID(), // Dest Classid
MD_NULL, // UniqueNames Flag
MD_PROPDEL, // Propagate Delete Flag
RELGUID_DivMakesAutos, // GUID
NULLLOID, // use default owner
NULLLOID // use default security profile
);
}
if (AutoDevisionClass)
delete AutoDevisionClass;
if (AutoClass)
delete AutoClass;
if (pProp)
delete pProp;
if (pDivMakesAutosRel)
delete pDivMakesAutosRel;
return (result);
}
487
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
_T("American Autos' Tortoise. A reliable sedan."), carId, 18545,
_T("1997-07-01"), 16.0, 55.1, 3350,
_T("Mid-priced Cars"), _T("AA's best-selling auto for those over 80."),
loidTortoise);
}
return(result)
}
////////////////////////////////////////////////////////////////////
// WriteNewObject function
//
// Writes a new object for a class that has only common properties.
////////////////////////////////////////////////////////////////////
HRESULT WriteNewObject(OBJECTID_t lclassid, TCHAR *name,
const GUID &goid,
TCHAR *description,
const OBJECTID_t lOwnerid,
OBJECTID_t &assignedLoid)
{
CMetaObjectobj;
// new object to write
HRESULT result = S_OK; // return value
// Set the object common properties
obj.SetClassID(lclassid);
obj.SetObjectName(name);
obj.SetObjectGUID(goid);
obj.SetDescription(description);
if (lOwnerid)
{
// If OwnerID is not set, the owner will be set to the
// initialized user
obj.SetOwnerID(lOwnerid);
}
// Write the new object
if (SUCCEEDED(result = obj.WriteObject()))
{
// Get the ObjectID of the new object
assignedLoid = obj.GetObjectID();
}
return (result);
} // WriteNewObject
///////////////////////////////////////////////////////////////
// WriteNewAuto function
//
// Write an Auto class object. This class has eight
// unique properties.
///////////////////////////////////////////////////////////////
HRESULT WriteNewAuto(OBJECTID_t lclassid, TCHAR *name,
const GUID &goid, TCHAR *description,
unsigned long carId, long basePrice,
TCHAR *designDate, double fuelTank,
double height, double weight,
TCHAR *vehicleType, TCHAR *review,
OBJECTID_t &assignedLoid)
{
CMetaObject obj;
HRESULT result = S_OK;
CMetaPropertyPropObj;
// Set common properties
obj.SetClassID(lclassid);
obj.SetObjectName(name);
obj.SetObjectGUID(goid);
obj.SetDescription(description);
// Set Unique Class Properties
// set CarId
result = PropObj.SetBinary(carId);
obj.SetPropertyValue(PID_AUTO_CARID, PropObj);
// set base price
PropObj.SetShort(basePrice);
obj.SetPropertyValue(PID_AUTO_BASEPRICE, PropObj);
// set design date
PropObj.SetString(designDate);
obj.SetPropertyValue(PID_AUTO_DESIGNDATE, PropObj);
// set fuel tank
PropObj.SetDbl(fuelTank);
obj.SetPropertyValue(PID_AUTO_FUELTANK, PropObj);
488
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
// set height
PropObj.SetDbl(height);
obj.SetPropertyValue(PID_AUTO_HEIGHT, PropObj);
// set weight
PropObj.SetInt(weight);
obj.SetPropertyValue(PID_AUTO_WEIGHT, PropObj);
// set vehicletype
PropObj.SetString(vehicleType);
obj.SetPropertyValue(PID_AUTO_VEHICLETYPE, PropObj);
// set review
PropObj.SetString(review);
obj.SetPropertyValue(PID_AUTO_REVIEW, PropObj);
// Call WriteObject
if (SUCCEEDED(result = obj.WriteObject()))
{
// Get the new Object ID
assignedLoid = obj.GetObjectID();
}
return (result);
} // WriteNewAuto
CMetaObject::AddToDestCollection
CMetaObject::AddToOrigCollection
CMetaObject::AddManyToDestCollection
////////////////////////////////////////////////////////////////////
// AddColl function
//
// Example of using the CMetaObject::AddToDestCollection function
////////////////////////////////////////////////////////////////////
HRESULT AddColl(CMetaRepository &repos)
{
HRESULT result = S_OK;
// return value
CMetaObject obj2;
OBJECTID_t
RelIDCorpHasDiv= NULLLOID,
loidBigGuy = NULLLOID,
loidAmericanAutos= NULLLOID;
// Get the ObjectIds of EuroDivision, Tornado, Hurrican and the
// DivMakesAutos relationship
result = repos.GetObjectID(OBJGUID_BigGuyMotors, &loidBigGuy);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_AmericanAutos, &loidAmericanAutos);
if (SUCCEEDED(result))
{
// Set the local object ObjectID to BigGuy
obj2.SetObjectID(loidBigGuy);
// Call AddToDestCollection to add AmericanAutos to the
// CorpHasDivisions collection of BigGuy
result = obj2.AddToDestCollection(loidAmericanAutos, NULLGUID,
RelIDCorpHasDiv);
}
return (result);
}
//////////////////////////////////////////////////////////////////
// AddOrigColl function
//
// Example of using the CMetaObject::AddToOrigCollection function
//////////////////////////////////////////////////////////////////
HRESULT AddOrigColl(CMetaRepository &repos)
{
HRESULT result = S_OK;
// return value
CMetaObject obj;
OBJECTID_t
RelIDDivMakesAutos= NULLLOID,
RelIDCorpHasDiv= NULLLOID,
loidEuroDiv = NULLLOID,
loidTurtle = NULLLOID;
489
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
490
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
491
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
// ReadByObjectID function
//
// Set ObjectID to Read object.
///////////////////////////////////////////////////////////////
void ReadByObjectID(CMetaRepository& repos)
{
OBJECTID_t
loidEuroDiv= NULLLOID,
loidTortoise= NULLLOID;
CMetaObjectobj7;
CMetaObjectobj8;
HRESULT result = S_OK;
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_EuroDivision, &loidEuroDiv);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Tortoise, &loidTortoise);
if (SUCCEEDED(result))
{
cout << endl << ">>> Read by ObjectID" << endl;
obj7.SetObjectID(loidEuroDiv);
PerformReadObject(obj7);
cout << endl << ">>> Read by ObjectID" << endl;
obj8.SetObjectID(loidTortoise);
PerformReadObject(obj8);
}
}
492
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
}
if (SUCCEEDED(result))
{
if (SUCCEEDED(result =
obj.GetPropertyValue(PID_AUTO_FUELTANK, PropObj)))
result = PropObj.GetFloat(FuelTank);
}
if (SUCCEEDED(result))
{
if (SUCCEEDED(result =
obj.GetPropertyValue(PID_AUTO_HEIGHT, PropObj)))
result = PropObj.GetDouble(Height);
}
if (SUCCEEDED(result))
{
if (SUCCEEDED(result =
obj.GetPropertyValue(PID_AUTO_WEIGHT, PropObj)))
result = PropObj.GetInt(Weight);
}
if (SUCCEEDED(result))
{
if (SUCCEEDED(result =
obj.GetPropertyValue(PID_AUTO_VEHICLETYPE, PropObj)))
result = PropObj.GetString(VehicleType);
}
if (SUCCEEDED(result))
{
if (SUCCEEDED(result =
obj.GetPropertyValue(PID_AUTO_REVIEW, PropObj)))
result = PropObj.GetString(Review);
}
return(result);
}
CMetaObject::GetDestCollection
CMetaObject::GetOrigCollection
CMetaObject::GetDestCollectionByProperty
The example also shows how to iterate through the returned vector of objects.
//////////////////////////////////////////////////////////////////
// GetDestColl function
//
// Example of using the CMetaObject::GetDestCollection function
//////////////////////////////////////////////////////////////////
HRESULT GetDestColl()
{
LLCMetaObjectobjectList; // returned set of collection objects
HRESULT
result = S_OK;
CMetaObjectobj;
obj.SetClassGUID(CLSGUID_AutoDiv);
obj.SetObjectName(_T("AmericanAutos"));
if (SUCCEEDED(result = obj.ReadObject()))
{
// Get collection of all Autos of the AmericanAutos
result = obj.GetDestCollection(objectList, RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Collection of all Autos of the AmericanAutos Division" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
// Get collection of all Autos of the AmericanAutos Division named Yearling
result = obj.GetDestCollection(objectList, RELGUID_DivMakesAutos,
0,_T("Yearling"));
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Collection of Autos of the AmericanAutos Division named Yearling";
493
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
cout << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
}
return (result);
}
////////////////////////////////////////////////////////////////////////////////
// GetOrigColl function
//
// Example of using the CMetaObject::GetOrigCollection function
////////////////////////////////////////////////////////////////////////////////
HRESULT GetOrigColl()
{
LLCMetaObjectobjectList; // returned set of collection objects
HRESULT
result = S_OK;
CMetaObjectobj;
obj.SetClassGUID(CLSGUID_Auto);
obj.SetObjectName(_T("Yearling"));
if (SUCCEEDED(result = obj.ReadObject()))
{
// Get collection of all Auto Divisions of Yearling
result = obj.GetOrigCollection(objectList, RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Collection of all Auto Divisions of Yearling" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
if (SUCCEEDED(result))
{
// Get collection of all Auto Divisions of Yearling
// by the name AmericanAutos
result = obj.GetOrigCollection(objectList, RELGUID_DivMakesAutos,
0,_T("AmericanAutos"));
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Collection of all Auto Divisions of Yearling " << endl;
cout << ">>> by the name AmericanAutos" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
}
}
return (result);
}
////////////////////////////////////////////////////////////////////////////
// GetCollectionByProperty function
//
// Read Auto Object and Get origin and destination collections by Property.
//
// Example of using the CMetaObject::GetDestCollectionByProperty function
////////////////////////////////////////////////////////////////////////////
HRESULT GetCollectionByProperty()
{
HRESULT
result = S_OK;
CMetaObjectobj;
LLCMetaObjectobjectList;
CMetaFilterInfo filterInfo;
// one property filter entry
CMetaObjectKeypropID;
MetaFilterInfoVectorpropFilter; // property filter specification
MetaObjectKeyVectorsortList;
// Read by ClassGUID and Name
obj.SetClassGUID(CLSGUID_AutoDiv);
obj.SetObjectName(_T("Euro Division"));
if (SUCCEEDED(result = obj.ReadObject()))
{
// search for objects in collection with Weight=3000
CLEARVECTOR(propFilter); filterInfo.Initialize();
filterInfo.value.SetName(NMWEIGHT);
filterInfo.SetComparisonOperator(EQUAL);
filterInfo.value.SetInt(3000);
propFilter.push_back(filterInfo);
// Sort By Name & Object ID
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
494
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
propID.SetObjectID(PID_CMN_LOID);
sortList.push_back(propID);
// Call GetDestCollectionByProperty
result = obj.GetDestCollectionByProperty(objectList,
propFilter, sortList, RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Objects in collection with Weight=3000" << endl;
PrintObjectList(objectList);
}
DisplayResult(result);
if (SUCCEEDED(result))
{
// return all objects in collection
CLEARVECTOR(propFilter); filterInfo.Initialize();
// Sort By Name
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
// Call GetDestCollectionByProperty
result = obj.GetDestCollectionByProperty(objectList,
propFilter, sortList, RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> All objects in Auto collection" << endl;
PrintObjectList(objectList);
}
DisplayResult(result);
}
if (SUCCEEDED(result))
{
// return objects in collection with a BasePrice < 12000
// or a BasePrice > 20000
CLEARVECTOR(propFilter); filterInfo.Initialize();
filterInfo.value.SetPropertyID(PID_AUTO_BASEPRICE);
filterInfo.SetComparisonOperator(LESS_THAN);
filterInfo.value.SetShort(12000);
filterInfo.SetLogicalOperator(META_OR);
propFilter.push_back(filterInfo);
filterInfo.Initialize();
filterInfo.value.SetPropertyID(PID_AUTO_BASEPRICE);
filterInfo.SetComparisonOperator(GREATER_THAN);
filterInfo.value.SetShort(20000);
propFilter.push_back(filterInfo);
// Sort By Name
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
// Call GetDestCollectionByProperty
result = obj.GetDestCollectionByProperty(objectList,
propFilter, sortList, RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Objects in collection with a " << endl;
cout << ">>> BasePrice < 12000 or a BasePrice > 20000" << endl;
PrintObjectList(objectList);
}
DisplayResult(result);
}
}
return result;
}
//////////////////////////////////////////////////////////////////
// PrintObjectList function
// Print a vector of CMetaObject objects.
//////////////////////////////////////////////////////////////////
void PrintObjectList(LLCMetaObject &objectList)
{
LICMetaObject pMetaObject;
if (objectList.size() > 0)
495
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
{
cout << "\nCOLLECTION BEGIN ";
pMetaObject = objectList.begin();
while(pMetaObject != objectList.end())
{
cout << endl;
PrintMetaObject(*pMetaObject);
pMetaObject++;
}
cout << "COLLECTION END " << endl;
}
else
{
cout << "EMPTY COLLECTION "
}
<< endl;
CMetaObject::GetDestCollectionKeys
CMetaObject::GetOrigCollectionKeys
The example code also shows how to iterate through the returned vector of object keys.
////////////////////////////////////////////////////////////////////
// GetDestCollKeys function
// Reads and print a collection of keys.
//
// Example of using the CMetaObject::GetDestCollectionKeys function
////////////////////////////////////////////////////////////////////
HRESULT GetDestCollKeys()
{
MetaObjectKeyVector objectKeys;
HRESULT
result = S_OK;
CMetaObjectobj;
obj.SetClassGUID(CLSGUID_AutoDiv);
obj.SetObjectName(_T("AmericanAutos"));
if (SUCCEEDED(result = obj.ReadObject()))
{
// Get collection of object keys (name and objectid)
// of all Autos of AmericanAutos
result = obj.GetDestCollectionKeys(objectKeys,
RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Collection of object keys (name and objectid) ";
cout << endl;
cout << ">>> of all Autos of AmericanAutos" << endl;
PrintKeyList(objectKeys);
CLEARVECTOR(objectKeys);
}
}
return(result);
}
/////////////////////////////////////////////////////////////////////
// GetOrigCollKeys function
// Reads and print a collection of keys.
//
// Example of using the CMetaObject::GetOrigCollectionKeys function
/////////////////////////////////////////////////////////////////////
HRESULT GetOrigCollKeys()
{
MetaObjectKeyVector objectKeys;
HRESULT
result = S_OK;
CMetaObjectobj;
obj.SetClassGUID(CLSGUID_Auto);
obj.SetObjectName(_T("Yearling"));
if (SUCCEEDED(result = obj.ReadObject()))
{
// Get collection of all Auto Divisions of Yearling
496
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
result = obj.GetOrigCollectionKeys(objectKeys,
RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Collection of all Auto Divisions of
PrintKeyList(objectKeys);
CLEARVECTOR(objectKeys);
}
}
return (result);
}
CMetaObject::GetClassObjects
CMetaObject::GetClassObjectKeys
CMetaObject::GetClassObjectsByProperty
///////////////////////////////////////////////////////////////////
// GetClassObjs function
// Reads and prints the objects in a class.
//
// Example of using the CMetaObject::GetClassObjects function
///////////////////////////////////////////////////////////////////
HRESULT GetClassObjs()
{
LLCMetaObjectobjectList;
HRESULT
result = S_OK;
CMetaObjectobj;
// Gets all the objects in the Auto Class
if (SUCCEEDED(result = obj.GetClassObjects(objectList,
CLSGUID_Auto)))
{
cout << endl << ">>> All auto class objects" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
DisplayResult(result);
// Gets all the objects in the Auto Division Class which
// have the name AmericanAutos
if (SUCCEEDED(result = obj.GetClassObjects(objectList,
CLSGUID_AutoDiv, 0, _T("AmericanAutos"))))
{
cout << endl;
cout << ">>> All auto division objects with name=AmericanAutos" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
DisplayResult(result);
return (result);
}
//////////////////////////////////////////////////////////////////////////
// GetClassObjKeys function
// Reads and prints the object keys in a class.
//////////////////////////////////////////////////////////////////////////
HRESULT GetClassObjKeys()
{
MetaObjectKeyVector keyList;
HRESULT
result = S_OK;
CMetaObjectobj;
// Gets all the object keys (name and ObjectID) of all
// objects in the Auto Class
if (SUCCEEDED(result = obj.GetClassObjectKeys(keyList,
CLSGUID_Auto)))
{
cout << endl;
497
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
cout << ">>> Object keys (name and ObjectID) of all " << endl;
cout << ">>> objects in the Auto Class" << endl;
PrintKeyList(keyList);
CLEARVECTOR(keyList);
}
DisplayResult(result);
return (result);
}
////////////////////////////////////////////////////////////////////////
// GetClassObjectsByProperty function
//
// Read Auto Object and Get class objects by Property.
//
// Example of using the CMetaObject::GetClassObjectsByProperty function
////////////////////////////////////////////////////////////////////////
HRESULT GetClassObjectsByProperty()
{
HRESULT
result = S_OK;
CMetaObject obj;
CMetaObjectKeypropID;
LLCMetaObjectobjectList;
CMetaFilterInfofilterInfo;
// one property filter entry
MetaFilterInfoVectorpropFilter; // property filter specification
MetaObjectKeyVectorsortList;
// Setup to search for autos with a vehicletype which
// ends with the value "Cars"
filterInfo.value.SetPropertyID(PID_AUTO_VEHICLETYPE);
filterInfo.SetComparisonOperator(REGEX);
filterInfo.value.SetString(_T("%Cars"));
propFilter.push_back(filterInfo);
// Sort By Autos' CARIDs
propID.SetObjectName(NMCARID);
sortList.push_back(propID);
// Call GetClassObjectsByProperty
result = obj.GetClassObjectsByProperty(objectList, propFilter,
sortList, CLSGUID_Auto);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Auto class objects: VehicleType=%Cars" << endl;
PrintObjectList(objectList);
}
CLEARVECTOR(objectList);
DisplayResult(result);
if(SUCCEEDED(result))
{
// Setup to search for autos with a name beginning with a T
// and a FuelTank less than 12
CLEARVECTOR(propFilter); filterInfo.Initialize();
filterInfo.value.SetPropertyID(PID_CMN_NAME);
filterInfo.SetComparisonOperator(REGEX);
filterInfo.value.SetString(_T("T%"));
filterInfo.SetLogicalOperator(META_AND);
propFilter.push_back(filterInfo);
filterInfo.Initialize();
filterInfo.value.SetName(_TEXT("FuelTank"));
filterInfo.SetComparisonOperator(LESS_THAN);
filterInfo.value.SetDouble(12.0);
propFilter.push_back(filterInfo);
// Sort By Name and ObjectID
CLEARVECTOR(sortList); propID.Initialize();
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
propID.SetObjectID(PID_CMN_LOID);
sortList.push_back(propID);
// Call GetClassObjectsByProperty
result = obj.GetClassObjectsByProperty(objectList, propFilter,
sortList, CLSGUID_Auto);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Auto class objects: name beginning with a T ";
cout << endl;
cout << ">>> and a FuelTank less than 12" << endl;
498
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
PrintObjectList(objectList);
}
CLEARVECTOR(objectList);
}
if(SUCCEEDED(result))
{
// Setup to search for autos with design date of 1997-03-30
// or have a baseprice >= 18000
CLEARVECTOR(propFilter); filterInfo.Initialize();
filterInfo.value.SetPropertyID(PID_AUTO_DESIGNDATE);
filterInfo.SetComparisonOperator(EQUAL);
filterInfo.value.SetString(_T("1997-03-30"));
filterInfo.SetLogicalOperator(META_OR);
propFilter.push_back(filterInfo);
filterInfo.Initialize();
filterInfo.value.SetPropertyID(PID_AUTO_BASEPRICE);
filterInfo.SetComparisonOperator(GREATER_THAN_OR_EQUAL);
filterInfo.value.SetShort(18000);
propFilter.push_back(filterInfo);
// Sort By BasePrice and Name
CLEARVECTOR(sortList); propID.Initialize();
propID.SetObjectID(PID_AUTO_BASEPRICE);
sortList.push_back(propID);
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
// Call GetClassObjectsByProperty
result = obj.GetClassObjectsByProperty(objectList, propFilter,
sortList, CLSGUID_Auto);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Autos with design date of 1997-03-30 " << endl;
cout << ">>> or have a baseprice >= 18000" << endl;
PrintObjectList(objectList);
}
CLEARVECTOR(objectList);
}
if(SUCCEEDED(result))
{
// Using derived class - search for autos with
// division name = Luxury Motors
CLEARVECTOR(propFilter); filterInfo.Initialize();
filterInfo.value.SetName(_T("DivisionName"));
filterInfo.SetComparisonOperator(EQUAL);
filterInfo.value.SetString(_T("LuxuryMotors"));
propFilter.push_back(filterInfo);
// Sort By Name
CLEARVECTOR(sortList); propID.Initialize();
propID.SetObjectID(PID_CMN_NAME);
sortList.push_back(propID);
// Call GetClassObjectsByProperty
result = obj.GetClassObjectsByProperty(objectList, propFilter,
sortList, CLSGUID_AutoEx);
if (SUCCEEDED(result))
{
cout << endl;
cout << ">>> Derived class where division name = LuxuryMotors" << endl;
PrintObjectList(objectList);
}
CLEARVECTOR(objectList);
}
return result;
}
499
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
///////////////////////////////////////////////////////////////////
// ReWrite function
//
///////////////////////////////////////////////////////////////////
HRESULT ReWrite(CMetaRepository &repos)
{
CMetaObjectobj;
HRESULT
result = S_OK;
CMetaPropertyPropObj;
unsigned longcarId = 0x1015aeff;
// Begin an explicit transaction
if (SUCCEEDED(repos.BeginTransaction()))
{
obj.SetClassGUID(CLSGUID_AutoDiv);
obj.SetObjectName(_T("AmericanAutos"));
// Read the object to fill in all existing properties
// and lock the object
if (SUCCEEDED(result = obj.ReadObjectWithLock()))
{
// set updated fields
obj.SetDescription(_T("New Description for AmericanAutos"));
// Write updated object
result = obj.WriteObject();
}
// Commit the changes
repos.Commit();
}
// Begin an explicit transaction
if (SUCCEEDED(repos.BeginTransaction()))
{
obj.Initialize();
obj.SetClassGUID(CLSGUID_Auto);
obj.SetObjectName(_T("Yearling"));
// Read the object to fill in all existing properties
if (SUCCEEDED(result = obj.ReadObjectWithLock()))
{
// set updated fields
if (SUCCEEDED(result = PropObj.SetBinary(carId)))
{
obj.SetPropertyValue(PID_AUTO_CARID, PropObj);
PropObj.SetShort(22000);
obj.SetPropertyValue(PID_AUTO_BASEPRICE, PropObj);
PropObj.SetString(_T("1965-04-25"));
obj.SetPropertyValue(PID_AUTO_DESIGNDATE, PropObj);
// Write updated object
result = obj.WriteObject();
}
}
// Commit the changes
repos.Commit();
}
return (result);
}
CMetaObject::RemoveFromDestCollection
CMetaObject::RemoveFromOrigCollection
CMetaObject::RemoveManyFromDestCollection
CMetaObject::RemoveManyFromOrigCollection
//////////////////////////////////////////////////////////////////////
// RemDestColl function
//
// Example of using the CMetaObject::RemoveFromDestCollection function
///////////////////////////////////////////////////////////////////////
HRESULT RemDestColl(CMetaRepository& repos)
{
HRESULT
result = S_OK;
500
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
CMetaObjectobj;
OBJECTID_t
RelIDDivMakesAutos= NULLLOID,
loidEuroDiv = NULLLOID,
loidTornado = NULLLOID;
// Get ObjectIDs of EuroDiv, Tornado and the ManufofAutos Relationship
result = repos.GetObjectID(OBJGUID_EuroDivision, &loidEuroDiv);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Tornado, &loidTornado);
if (SUCCEEDED(result))
result = repos.GetObjectID(RELGUID_DivMakesAutos,
&RelIDDivMakesAutos);
if (SUCCEEDED(result))
{
// Set local object ObjectID to EuroDivision
obj.SetObjectID(loidEuroDiv);
// Call RemoveFromDestCollection to remove Tornado from
// the collection of EuroDivision
result = obj.RemoveFromDestCollection(loidTornado, NULLGUID,
RelIDDivMakesAutos);
}
return (result);
} // RemDestColl
///////////////////////////////////////////////////////////////////////
// RemOrigColl function
//
// Example of using the CMetaObject::RemoveFromOrigCollection function
///////////////////////////////////////////////////////////////////////
HRESULT RemOrigColl(CMetaRepository& repos)
{
HRESULT
result = S_OK;
CMetaObjectobj;
OBJECTID_t
loidAA = NULLLOID,
loidYearling= NULLLOID;
// Get ObjectIDs of AmericanAutos and Yearling
result = repos.GetObjectID(OBJGUID_AmericanAutos, &loidAA);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Yearling, &loidYearling);
if (SUCCEEDED(result))
{
// Set local object ObjectID to Yearling
obj.SetObjectID(loidYearling);
// Call RemoveFromOrigCollection to remove AmericanAutos from
// the collection of Yearling
result = obj.RemoveFromOrigCollection(loidAA,
RELGUID_DivMakesAutos);
}
return (result);
} // RemOrigColl
//////////////////////////////////////////////////////////////////////////
// RemMnyDestColl function
//
// Example of using the CMetaObject::RemoveManyFromDestCollection function
//////////////////////////////////////////////////////////////////////////
HRESULT RemMnyDestColl(CMetaRepository& repos)
{
LLOBJECTID_tinLoids;
// list of loids to remove from a collection
HRESULT
result = S_OK;
CMetaObjectobj;
OBJECTID_t
RelIDDivMakesAutos= NULLLOID,
loidEuroDiv = NULLLOID,
loidTornado = NULLLOID,
loidHurricane= NULLLOID;
// Get the Object IDs of EuroDivison, Tornado, Hurricane and the ManufofAutos
// relationship
result = repos.GetObjectID(OBJGUID_EuroDivision, &loidEuroDiv);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Tornado, &loidTornado);
if (SUCCEEDED(result))
501
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
result = repos.GetObjectID(OBJGUID_Hurricane, &loidHurricane);
if (SUCCEEDED(result))
result = repos.GetObjectID(RELGUID_DivMakesAutos,
&RelIDDivMakesAutos);
if (SUCCEEDED(result))
{
// put ObjectIDs of Tornado and Hurricane on a list
inLoids.push_back(loidTornado);
inLoids.push_back(loidHurricane);
// set the local object ObjectID to EuroDivision
obj.SetObjectID(loidEuroDiv);
// Call RemoveManyFromDestCollection to remove Tornado and
// Hurricane from the collection of EuroDivision
result = obj.RemoveManyFromDestCollection(inLoids, NULLGUID,
RelIDDivMakesAutos);
}
CLEARVECTOR(inLoids);
return (result);
} // RemMnyDestColl
//////////////////////////////////////////////////////////////////////////
// RemMnyOrigColl function
//
// Example of using the CMetaObject::RemoveManyFromOrigCollection function
//////////////////////////////////////////////////////////////////////////
HRESULT RemMnyOrigColl(CMetaRepository& repos)
{
LLOBJECTID_tinLoids;
// list of loids to remove from a collection
HRESULT
result = S_OK;
CMetaObjectobj;
OBJECTID_t
loidAA = NULLLOID,
loidYearling= NULLLOID;
// Get the Object IDs of AmericanAutos and Yearling
result = repos.GetObjectID(OBJGUID_AmericanAutos, &loidAA);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Yearling, &loidYearling);
if (SUCCEEDED(result))
{
// Put the ObjectID of AmericanAutos on a list
inLoids.push_back(loidAA);
// Set the local object ObjectID to Yearling
obj.SetObjectID(loidYearling);
// Call RemoveManyFromOrigCollection to remove AmericanAutos
// from the collection of Yearling
result = obj.RemoveManyFromOrigCollection(inLoids,
RELGUID_DivMakesAutos);
}
CLEARVECTOR(inLoids);
return (result);
} // RemMnyOrigColl
CMetaObject::ReplaceDestCollection
CMetaObject::GetDestCollection
//////////////////////////////////////////////////////////////////////
// ReplaceCollection function
//
// Example of using the CMetaObject::ReplaceDestCollection and
// ReplaceOrigCollection functions
//////////////////////////////////////////////////////////////////////
HRESULT ReplaceCollection(CMetaRepository &repos)
{
LLCMetaObjectobjectList;
LLOBJECTID_t inLoids;
// list of loids
502
Chapter 17: Steps for Using the MDS APIs and Example Code
C++ Examples
HRESULT result = S_OK;
// return value
CMetaObject obj;
OBJECTID_t
loidEuroDiv = NULLLOID,
loidAmericanAutos= NULLLOID,
loidHurricane= NULLLOID,
loidYearling= NULLLOID,
loidTortoise= NULLLOID,
loidTurtle = NULLLOID;
// Get the ObjectIDs
result = repos.GetObjectID(OBJGUID_Hurricane, &loidHurricane);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Turtle, &loidTurtle);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_AmericanAutos, &loidAmericanAutos);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Yearling, &loidYearling);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_Tortoise, &loidTortoise);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_EuroDivision, &loidEuroDiv);
if (SUCCEEDED(result))
{
//add Hurricane and Turtle ObjectIDs to a list
inLoids.push_back(loidHurricane);
inLoids.push_back(loidTurtle);
// Set local object objectID to that of AmericanAutos
obj.SetObjectID(loidAmericanAutos);
// Call ReplaceDestCollection to replace the DivMakesAutos
// of AmericanAutos with Hurricane, Turtle
result = obj.ReplaceDestCollection(inLoids,
RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
// Get and display the Dest Collection to see results
result = obj.GetDestCollection(objectList,
RELGUID_DivMakesAutos);
if(SUCCEEDED(result))
{
cout << endl;
cout << ">>> AmericanAutos Collection after replace" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
}
}
if (SUCCEEDED(result))
{
// Initialize input list
CLEARVECTOR(inLoids);
//add AmericanAutos objectID to list.
inLoids.push_back(loidAmericanAutos);
// Initialize local object
obj.Initialize();
// Set local object objectID to that of Turtle
obj.SetObjectID(loidTurtle);
// Call ReplaceOrigCollection to replace the origin
// DivMakesAutos collection of Turtle from EuroDiv to AmericanAutos
result = obj.ReplaceOrigCollection(inLoids,
RELGUID_DivMakesAutos);
if (SUCCEEDED(result))
{
// Get and display the Orig Collection to see results
result = obj.GetOrigCollection(objectList,
RELGUID_DivMakesAutos);
if(SUCCEEDED(result))
{
cout << endl;
cout << ">>> EuroDivision collection after replace" << endl;
PrintObjectList(objectList);
CLEARVECTOR(objectList);
}
}
}
);
503
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
return result;
} // ReplaceCollection
Deleting Objects
This section shows example code to delete objects. The example code uses:
CMetaObject::Delete.
///////////////////////////////////////////////////////////////////
// DeleteObject function
//
// Example of using the CMetaObject::Delete function
///////////////////////////////////////////////////////////////////
HRESULT DeleteObject(CMetaRepository& repos)
{
CMetaObject obj;
HRESULT result = S_OK;
OBJECTID_t
loidAutoWorld= NULLLOID,
loidEuroDiv = NULLLOID,
loidAmericanAutos= NULLLOID;
// Get the ObjectIDs
result = repos.GetObjectID(OBJGUID_EuroDivision, &loidEuroDiv);
if (SUCCEEDED(result))
result = repos.GetObjectID(OBJGUID_AmericanAutos, &loidAmericanAutos);
if (SUCCEEDED(result))
result = repos.GetObjectID(MODELGUID_AW, &loidAutoWorld);
if (SUCCEEDED(result))
{
// Set the local object ObjectID
obj.SetObjectID(loidEuroDiv);
// Call Delete to delete EuroDiv
result= obj.Delete();
}
if (SUCCEEDED(result))
{
// Set the local object ObjectID
obj.SetObjectID(loidAmericanAutos);
// Call Delete to delete AmericanAutos
result= obj.Delete();
}
if (SUCCEEDED(result))
{
// Set the local object ObjectID
obj.SetObjectID(loidAutoWorld);
// Call Delete to delete AutoWorld
result= obj.Delete();
}
return (result);
}
504
Initialization
Creating an AIM
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
Reading an Object
See the sample vb folder installed with the MDS SDK for more example code.
Initialization
This section shows example code to connect an application to the MDS repository.
'////////////////////////////////////////////////////////////////////////////
'
'
Initialize Repository
'
'
Sets up the connection to the repository using the global object
'
Repository
'
'////////////////////////////////////////////////////////////////////////////
Function InitializeRepository () As Boolean
Set Repository = New MetaActive
Repository.Initialize userName, password
InitializeRepository = True
Exit Function
End Function
Creating an AIM
This section shows example code to create an AIM.
'////////////////////////////////////////////////////////////////////////////////
'
'
Meta_CreateModel
'
'
Adds the definition of a model with the name 'modelName' to the
'
repository. The owner and group names for the model are 'ownerName' and
'
'groupName', respectively.
'
'/////////////////////////////////////////////////////////////////////////////////
Public Sub Meta_CreateModel(modelName As String, _
groupName As String, _
ownerName As String, _
ErrorOK As Boolean)
Dim
Dim
Dim
Dim
item As ListItem
modelID, classID, relID As Long
model As New MetaModelInfo
keyList As New MetaInfoKeyList
Repository.BeginTransaction
model.name = modelName
model.Description = modelName & " Description"
model.ApplicationGroup = groupName
model.Owner = ownerName
model.Permission = 777
model.Create
model.Read 1
If modelName = CANNED_MODEL_NAME Then
ScriptingModelID = model.ObjectID
End If
' define ScriptingClass1 and its associated properties
Dim class As New MetaClassInfo
class.name = CANNED_CLASS_NAME1
class.Description = "Scripting Class Description"
model.AddClass class
ScriptingClass1 = class.ObjectID
Dim prop As New MetaPropertyInfo
prop.name = STRING_PROPERTY_NAME
prop.Identifier = 1
prop.Description = "Scripting Property Description"
prop.VARIANT_Type = vtString
prop.SQL_Type = sqlVarChar
505
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
prop.Length = 1024
class.AddProperty prop
Set prop = Nothing
Dim propInt As New MetaPropertyInfo
propInt.name = INTEGER_PROPERTY_NAME
propInt.Identifier = 2
propInt.Description = "Scripting Property Description"
propInt.VARIANT_Type = vtLong
propInt.SQL_Type = sqlInteger
propInt.Length = 1024
class.AddProperty propInt
Set propInt = Nothing
Dim relation As New MetaRelationshipInfo
relation.name = CANNED_CLASS1_CLASS2_RELATION
relation.Description = "Class0 contains Class1 relationship"
relation.OriginClassID = class.ObjectID
relation.DestinationClassID = Class1.ObjectID
model.AddRelationship relation
RelID_Class0Class1 = relation.ObjectID
RelGUID_Class0Class1 = relation.ObjectGUID
Repository.CommitTransaction
Exit Sub
End Sub
value.name = INTEGER_PROPERTY_NAME
value.value = intVal
info.PropertyItems.Add value
value.name = LONG_PROPERTY_NAME
value.value = longVal
info.PropertyItems.Add value
value.name = STRING_PROPERTY_NAME
value.value = stringName
info.PropertyItems.Add value
value.name = DATE_PROPERTY_NAME
value.value = dateVal
info.PropertyItems.Add value
value.name = DOUBLE_PROPERTY_NAME
value.value = doubleVal
info.PropertyItems.Add value
value.name = BOOLEAN_PROPERTY_NAME
value.value = boolVal
info.PropertyItems.Add value
info.classID = classID
info.Description = objectName
info.objectName = objectName
Repository.WriteObject info
506
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
AddOneClass1Object = info.ObjectID
Set value = Nothing
Set info = Nothing
Exit Function
End Function
507
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
' get destination objects via relationship GUID
Set testList = Repository.GetCollections(DESTINATION, Class0Obj1,
RelGUID_Class0Class1, 0)
Set testList = Nothing
'get destination object(s) via name
Set testList = Repository.GetCollections(DESTINATION, Class0Obj1, "",
RelID_Class0Class1, "Entry Six")
Set testList = Nothing
Set testList = Repository.GetCollections(DESTINATION, Class0Obj2, "",
RelID_Class0Class1, "Entry%")
Exit Sub
End Sub
'///////////////////////////////////////////////////////////////////////////////
'
' GetCollectionsByProperty
'
'///////////////////////////////////////////////////////////////////////////////
Function GetCollectionsByProperty (name As String, _
value As Variant, _
ObjectID As Long, _
relID As Long, _
relGUID As String) As Boolean
Dim
Dim
Dim
Dim
Dim
Dim
Dim
filter.filter.name = name
filter.filter.value = value
filter.Logical = META_AND
filter.operator = EQUAL
filterList.Add filter
Set testList = Repository.GetCollectionsByProperty(DESTINATION, ObjectID, relGUID,
relID, "", filterList, sortList)
Set filterList = Nothing
filter.operator = LESS_THAN
filterList.Add filter
Set testList = Repository.GetCollectionsByProperty(DESTINATION, ObjectID, relGUID,
relID, "", filterList, sortList)
Set filterList = Nothing
filter.operator = GREATER_THAN_OR_EQUAL
filterList.Add filter
Set testList = Repository.GetCollectionsByProperty(DESTINATION, ObjectID, relGUID,
relID, "", filterList, sortList)
' now do two values separated by OR
Set filterList = Nothing
Set testList = Nothing
filter.operator = LESS_THAN
filter.Logical = META_OR
filterList.Add filter
filter.operator = GREATER_THAN
filterList.Add filter
Set testList = Repository.GetCollectionsByProperty(DESTINATION, ObjectID, relGUID,
relID, "", filterList, sortList)
Exit Function
End Function
508
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
i As Integer
goodCount As Integer
lastdate As Date
info As MetaInfo
class2info As New MetaClassInfo
errorExpected As Boolean
testList As MetaInfoList
filterList As New MetaFilterList
sortList As New MetaInfoKeyList
filter As New MetaFilter
sortKey As New MetaInfoKey
DisplayHeadingLine "MetaActive::GetClassObjectsByProperty"
'get the definitions of the class
class2info.name = CANNED_CLASS_NAME1
class2info.ObjectID = ScriptingClass1
class2info.Read
' check multiple properties
' the condition used is: long >= 100 AND integer >= 100 AND date >= Jan 1, 1986
filter.filter.name = LONG_PROPERTY_NAME
filter.filter.value = 100
509
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
filter.operator = GREATER_THAN_OR_EQUAL
filter.Logical = META_AND
filterList.Add filter
filter.filter.name = INTEGER_PROPERTY_NAME
filterList.Add filter
filter.filter.name = DATE_PROPERTY_NAME
filter.filter.value = CDate(#1/1/1986#)
filterList.Add filter
Set testList = Repository.GetClassObjectsByProperty("", ScriptingClass1, "",
filterList, sortList)
status0 = "name pattern and property filters"
status1 = META_PASSED
filter.filter.name = LONG_PROPERTY_NAME
filter.filter.value = 100
filter.operator = GREATER_THAN_OR_EQUAL
filter.Logical = META_AND
filterList.Add filter
Set testList = Repository.GetClassObjectsByProperty("", ScriptingClass1, "E%e%",
filterList, sortList)
' request sorted results
DisplayStatus "sorted on one property"
filterList.Clear
filter.filter.name = LONG_PROPERTY_NAME
filter.filter.value = 100
filter.operator = GREATER_THAN_OR_EQUAL
filter.Logical = META_AND
filterList.Add filter
sortKey.name = STRING_PROPERTY_NAME
sortList.Add sortKey
Set testList = Repository.GetClassObjectsByProperty("", ScriptingClass1, "",
filterList, sortList)
' test fetching DIM objects
filterList.Clear
filter.filter.name = "SynchronizationLevel"
filter.filter.value = 1
filter.operator = GREATER_THAN_OR_EQUAL
filter.Logical = META_AND
filterList.Add filter
sortList.Clear
status1 = META_PASSED
Set testList = Repository.GetClassObjectsByProperty("", TableClassID, "",
filterList, sortList)
Exit Sub
End Sub
510
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
Reading an Object
This section shows example code of reading an object.
'////////////////////////////////////////////////////////////////////////
'
' ReadObject
'
'////////////////////////////////////////////////////////////////////////
Public Sub ReadObject (ObjectID As Long, valueString As String)
Dim info As New MetaInfo
info.ObjectID = ObjectID
Repository.ReadObject info
Exit Sub
End Sub
511
Chapter 17: Steps for Using the MDS APIs and Example Code
Visual Basic Examples
512
Glossary
A
application information metamodel (AIM) A metamodel that describes how a set of meta
data is stored in the MDS repository.
application programming interface (API) A set of routines used by an application program
to direct the performance of procedures by the computers operating system.
attribute A field represented by a column within an object (entity). An object may be a
table, view or report.
abstract class An abstract class is a class that can not have object instances. An abstract class
can have properties and can be the source or destination class in relationships. Abstract classes
are created to enable subclasses of the class to inherit the properties and relationships of the
abstract class.
B
business definition A definition that uses business terminology to describe a data object.
business rules
C
class In object-oriented terminology, a class defines a type of object. The definition
encapsulates both the data and the associated behaviors (executable code) that objects of the
class can perform.
client load metamodel (CLM). An MDS-defined metamodel for the Teradata client load
utilities. The CLM stores meta data for loading data into the Teradata system through the use
of the Teradata client load utilities.
client/server A distributed technology approach where the processing is divided by
function. The server performs shared functions -- managing communications, providing
database services, etc. The client performs individual user functions -- providing customized
interfaces, performing screen to screen navigation, offering help functions, etc.
collection Relationships map or link one or more objects from one class to one or more
objects in another class. The resulting mapping or linking is called a collection.
Class objects can be added to or removed from a collection. When a new version of an object
is created, MDS automatically assigns the new version the same collection states as its previous
version. Because the new version becomes the current version of the object, changes to
collections of an object are only reflected in the new version. The previous versions'
collections are frozen to retain historical information.
513
Glossary
A user must be assigned the appropriate access rights on objects to remove them from or add
them to collections. For example, to update an object, the user requires read access to the
object. To delete an object, the user requires collection privileges to remove the object from
existing collections. The types of access that can be assigned to a user or application group in a
security profile. See published state, security profile, versioning.
current In a repository with versioning on, the current version of an object is the most
recently written version as created by WriteObject, which writes new versions of objects to the
repository. See published state, inactive, dormant.
D
data Items representing facts, text, graphics, bit-mapped images, sound, analog, or digital
live-video segments. Data is the raw material of a system supplied by data producers and is
used by information consumers to create information.
database information metamodel (DIM) An application information metamodel (AIM)
that defines how a Teradata schema will be stored in the MDS repository.
database schema The logical and physical definition of a database structure.
data definition language (DDL). A language that defines all attributes and properties of a
database, especially record layouts, field definitions, key fields, file locations, and storage
strategy.
data dictionary A database about data and database structures. A catalog of all data
elements, containing their names, structures, and information about their usage. A central
location for meta data. Normally, data dictionaries are designed to store a limited set of
available meta data, concentrating on the information relating to the data elements, databases,
files and programs of implemented systems.
data element The most elementary unit of data that can be identified and described in a
dictionary or repository that cannot be subdivided.
data length The physical length of the column or field that stores the data. Example: 50
data type The physical types of data that are assigned by the database or file management
system. Examples are Integer, Decimal, Date, Character, VarChar.
data warehouse An implementation of an informational database used to store sharable
data sourced from an operational database-of-record. It is typically a subject database that
allows users to tap into a company's vast store of operational data to track and respond to
business trends and facilitate forecasting and planning efforts.
derived class A derived class is a base class and a set of derived properties. There are no
physical objects in a derived class. Derived class objects are created by joining properties in a
base class with properties in related classes. Derived class objects are read only. Derived classes
are similar to a view in an RDBMS.
514
Glossary
document type definition (DTD) In XML, a DTD defines the grammar expected by the
metaxml program necessary for importing data into the MDS repository. The XML parser
ensures that an XML input document conforms to the grammar.
dormant An object is dormant if it is not currently active in the repository when data
versioning is supported by the object class. See current, inactive, published state, versioning.
E
entity
extensible markup language (XML) A condensed form of SGML that lets information
developers and designers create customized tags, offering greater flexibility in organizing and
presenting information than is possible with the older HTML document coding system.
I
inactive An object is inactive or dormant if it is not currently active in the repository when
data versioning is supported by the object class. See current, dormant, published state,
versioning.
inheritance Inheritance is a feature that allows creation of a class that inherits the properties
and relationships from a previously defined class. A class that inherits from another class is
called a subclass. The class that the subclass "inherits from" is called the superclass.
interface An interface is a set of function definitions. An interface can inherit from any base
interface.
Internet information services (IIS) MDS software (MetaSurf) must be installed on the IIS
Web server if MDS users will be using their web browser to access the MDS repository.
L
label Part of versioning, labels are used to identify objects by assigning each a name,
description, creator name, object GUID, owner, security profile name, and security profile
reference. Only the name parameter is required. When unspecified, the owner defaults to the
MDS user running the script assigning the label. A default GUID is supplied by the MDS
engine. A default security profile is provided by MDSDefaultSecurityProfile.
M
metadata or meta data Meta data is information about data. Examples of meta data include
data element descriptions, data type descriptions, attribute/property descriptions, range/
domain descriptions, and process/method descriptions. Meta data includes things like the
name, length, valid values, business definitions, and description of a data element. Meta data
is stored in a repository. It insulates the data warehouse from changes in the schema of
operational systems.
515
Glossary
Meta Data Services (MDS) The Teradata Meta Data Services product provides a means of
storing, administering, and navigating meta data in a Teradata data warehouse. It is the only
meta data management system optimized for and integrated with the Teradata environment.
MDS repository
N
null A null value tells you the value for that row is either missing, unknown, not yet known
or inapplicable. Placing a zero in the row would not reflect the accurate state of the row,
because zero is a value. This way you can search for "missing" data and SQL supports the
notion of null values.
O
object A person, place, thing, or concept that has characteristics of interest to an
environment. In terms of an object-oriented system, an object is an entity that combines
descriptions of data and behavior.
object description All the properties and associations that describe a particular object.
open database connectivity (ODBC) A call-level interface that allows applications to access
data in any database for which there is an ODBC driver.
P
propagation delete
relationship description.
published state In a repository with versioning on, the published state is the state of the
most recently written version of an object. The state is created by WriteObject, which writes a
new version of an object to the repository. The new object has the same GUID as the current
version, but the LOID is different, and the version number is one greater than the current
version of the object. The write actually produces the new current or published version of the
object, replacing the previously current version, which goes into the inactive published state.
The highest numbered version of an object always has the published state of current. All other
versions are considered non-current or inactive. The state is a read-only property that cannot
be set by an application.
Q
query
R
RDBMS
redundancy
516
Glossary
Relay Services Gateway (RSG) The RSG is a Teradata VPROC which relays messages
between Teradata and the MDS DDL Gateway.
repository A database system used to store information. In data warehousing repositories
are most commonly used to store meta data.
S
schema The logical and physical definition of data elements, physical characteristics and
inter-relationships.
security profile A named object containing the permissions for a set of groups and users
that is assigned to each object in the repository. Access to the object is based on permissions
defined in the assigned profile. The profile ID is stored in a common property of each object.
server A service that provides standard functions for clients in response to standard
messages from clients. A commonly used definition of server also refers to the physical
computer from which services are provided.
structured query language (SQL) A database sublanguage used in querying, updating, and
managing relational databases the de facto standard for database products.
subclass A subclass is a class that inherits the properties and relationships from a previously
defined class. The class that the subclass "inherits from" is called the superclass. A subclass can
inherit from up to five superclasses.
superclass tA superclass is a defined class that a subclass inherits the properties and
relationships from.
T
TCP/IP (Transmission Control Protocol/Internet Protocol) A protocol developed by the
Department of Defense for communications between computers. It is built into the Linux
system and has become the de facto standard for data transmission over networks, including
the Internet.
V
valid values A list, definition, or example of the values that can be entered in a data element
(column/field/term). Examples of allowable values are: specifying the type of data - like
amounts; listing ranges of values; domain tables/lists.
versioning When an object is initially created, it is assigned version number 1. When a class
supports data versioning, and an application calls WriteObject() for an object in the class,
MDS creates a new version of the object and assigns it a version number incremented by 1. If
versioning is not supported by a class, WriteObject overwrites the current object. The new
version retains the unique property values of the previous version, except for those specifically
set in the CMetaObject object.
517
Glossary
518
Index
Symbols
< Operator function
CMetaObjectKey class 238
CMetaProperty class 228
CMetaVersionedObjectKey class 242
= Operator function
CMetaProperty class 228
== Operator function
CMetaObjectKey class 238
CMetaProperty class 228
CMetaVersionedObjectKey class 241
A
abstract class 36
access permissions
objects 97
action attribute settings, XML scripting interface 432
ActivateDormantObject function 321
adding
objects to collections
example code 414
objects to collections, example code 489, 507
users or groups to security profiles, example code 424
AddManyToDestCollection function
CMetaObject class 155
AddToDestCollection function
CMetaObject class 153
AddToOrigCollection function
CMetaObject class 152
AddUsertoApplicationGroup function
CMetaApplicationGroup class 298
AIM 33
class descriptions 33
components 33
security 102
creating an, example code 505
overview 33
property descriptions 34
relationship descriptions 34
AIM classes 381
CMetaAIM class 257
CMetaClassDesc class 257
CMetaPropertyDesc class 257
CMetaRelationshipDesc class 257
COM interfaces 381
application group security 96
applications
creating, to load metamodels, example code 486
authentication security 102
AutoWorldObjects.xml
XML example file 457
B
BeginTransaction function
CMetaRepository class 112
Business classes
and dormant objects 85
BusinessAttribute class
property descriptions 59
BusinessEntity class
property descriptions 59
BusinessRule class
property descriptions 60
C
C++ code examples 420, 485
initialization 421
read model classes and class properties 421
C++ project settings 105
code generation 106
include files 105
linking an MDS application 108
localization 105
ChangePassword function
CMetaUser class 302
Check class
property descriptions 52
class
getting all objects or object keys example 497
getting objects of a class, example 509
reading objects of a class, example 509
CLASS element, XML scripting interface 447
CLASSDESC element, XML scripting interface 436
classes
benefits of derived 38
Client Load Model (CLM)
class descriptions 73
class property descriptions 74
overview 72
relationship descriptions 76
closing
explicit transactions 88
519
Index
CMetaActive Class
ActivateDormantObject function
CMetaActive Class 321
DeInitialize function
CMetaActive Class 315
DeleteDormantObject function
CMetaActive Class 320
DeleteVersion function
CMetaActive Class 321
DeleteVersionRange function
CMetaActive Class 322
GetObjectIDfunction
CMetaActive Class 322
Initialize function
CMetaActive Class 315
ReadDormantObject function
CMetaActive Class 318
ReadObject function
CMetaActive Class 316
ReadObjectVersion function
CMetaActive Class 317
SignOfffunction
CMetaActive Class 316
SignOn function
CMetaActive Class 315
WriteObject function
CMetaActive Class 319
WriteObjectVersion function
CMetaActive Class 319
CMetaAIM class 258
constructors 259
CreateMDSClassDesc function 259
CreateMDSDerivedClass function 261
CreateMDSModel function 259
CreateMDSRelationshipDesc function 263
function list 258
GetClassDesc function 264
GetRelationshipDesc function 265
CMetaApplicationGroup class 297
AddUserToApplicationGroup function 298
constructors 298
CreateApplicationGroup function 298
function list 297
GetUserCollection function 299
Initialize function 299
ReadObject function 299
ReadVersion function 299, 303
RemoveUserFromApplicationGroup function 299
WriteObject function 300, 303
WriteVersion function 300, 303
CMetaClassDesc class 268
constructors 269
CreateMDSDerivedProperty function 274
CreatePropertyDesc function 270
520
Index
521
Index
522
Index
properties 81
CreateMDSClassDesc function
CMetaAIM class 259
CreateMDSDerivedClass function
CMetaAIM class 261
CreateMDSDerivedProperty function
CMetaClassDesc class 274
CreateMDSModel function
CMetaAIM class 259
CreateMDSRelationshipDesc function
CMetaAIM class 263
CreatePropertyDesc function
CMetaClassDesc class 270
CreateSuperuser function
CMetaUser class 301
CreateUser function
CMetaUser class 301
CSecurityProfile class 305
function list 305
GetObjectsUsingSecurityProfile function 305
GetPermissionList 306
PrintCMetaSecurityProfile function 306
RemoveManyPermissions function 306
RemovePermissions function 306
ReplacePermissions function 307
SetAIMSecurityProfile function 307
SetClassSecurityProfile function 308
SetObjectSecurityProfile function 308
SetSecurityProfile function 309
UpdateManyPermissions function 310
UpdatePermissions function 310
CSecurityProfileEntry class 303
D
data types
properties 102
Database class
property descriptions 45
Database Information Model (DIM) 39
DatabaseSystem class
property descriptions 43
DDL statements within transactions 91
DEBUG Mode Libraries 108
DeInitialize function 315
Deinitialize function
CMetaRepository class 116
delete propagation 93
DeleteDormantObject function 320
DeleteVersion function 321
DeleteVersionRange function 322
deleting objects, example code 504
derived classes
benefits 38
limitations 39
metamodel 37
overview 37, 38
properties 38
derived properties
overview 38
DERIVEDCLASSDESC element, XML scripting interface 441
DERIVEDPROPERTYDESC element, XML scripting
interface 442
description properties 80
DIM
class descriptions 41
classes 41
extending 69
property descriptions 43
relationship descriptions 65
DIMSecurityProfile 101
dormant objects 85, 132
and Business classes 85
and PublishState 86
and Retain Associated Business Information feature 132
enabling 85
generating 85
reactivating 86
DTD elements 431
DTD schema elements 431
E
error messages 459
Gateway communications error codes 483
Gateway socket error codes 480
transactions 480
XML scripting error codes 483
examples
C++ 485
code
CMetaFilterInfo class 225
COM interfaces 412
Visual Basic 504
explicit transactions 86, 87
closing 88
comitting 89
rollback 89, 91
F
Filter object
CMetaFilterInfo class 222
FindAllLabels function 166
FindAllOccurrences function 166
FindLabel function 165
Function class
property descriptions 60
functions
523
Index
ActivateDormantObject 321
CMetaAIM class 258
CMetaApplicationGroup class 297
CMetaClassDesc class 268
CMetaFilterInfo class 221
CMetaLabel class 251
CMetaObject class 131
CMetaObjectClassKey class 239
CMetaPersist class 121
CMetaProperty 227
CMetaProperty class 227
CMetaPropertyDesc class 285
CMetaRelationshipDesc class 292
CMetaRepository class 111
CMetaUser class 300
CSecurityProfile class 305
DeInitialize 315
DeleteDormantObject 320
DeleteVersion 321
DeleteVersionRange 322
FindAllLabels 166
FindAllOccurrences 166
FindLabel 165
GetCallerName 127
GetClassGUID 124
GetClassID 125
GetCreateTimestamp 126
GetDormantDIMClassObjectKeys 148
GetDormantDIMClassObjects 147
GetDormantDIMDestCollection 212
GetDormantDIMDestCollectionKeys 216
GetDormantDIMDestObject 149
GetDormantDIMOrigCollection 210
GetDormantDIMOrigCollectionKeys 214
GetLabelName 249
GetObjectGUID 123
GetObjectID 124, 322
GetObjectName 122
GetOwnerID 125
GetPublishState 128, 242, 249
GetSecurityProfileID 127
GetUpdateTimestamp 126
GetVersionNumber 128
Initialize 122, 315
IsDormant 129
IsFrozen 128
IsPublished 128, 249
ReactivateDIMObject 152
ReadDormantDIMObject 140
ReadDormantDIMObjectWithLock 140
ReadDormantObject 318
ReadObject 316
ReadObjectVersion 317
RetainBusinessObjectsSupported 118
524
SetCallerName 127
SetClassGUID 125
SetClassID 125
SetDescription 123
SetObjectGUID 123
SetObjectID 124
SetObjectName 122
SetOwnerID 126
SetPublishState 243
SetSecurityProfileID 128
SignOff 316
SignOn 315
Teradata 103
WriteObject 319
WriteObjectVersion 319
G
Gateway communications error codes 483
Gateway socket error codes 480
GetAccessPermissions function
CMetaPersist class 122
GetApplicationGrp function
CMetaPersist class 127
GetCallerName function 127
GetCharacterSetName function
CMetaPropertyDesc class 286
GetClassDesc function
CMetaAIM class 264
GetClassGUID function 124
CMetaPersist class 127
GetClassID function 125
CMetaObjectClassKey class 240
CMetaPersist class 125
CMetaVersionedObjectClassKey class 244
GetClassName function 240, 244
CMetaObjectClassKey class 240
CMetaVersionedObjectClassKey class 244
GetClassObjects function
CMetaObject class 142
GetClassObjectsByProperty function
CMetaObject class 171
GetClassObjectVersions function
CMetaObject class 143
GetClassObjectversionsByProperty function
CMetaObject class 172
GetCollection 85
GetComparisonOperator function
CMetaFilterInfo class 223
GetCreateTimestamp function 126
CMetaPersist class 126, 127
GetCreatorName function
CMetaLabel class 255
GetDescription function
Index
I
implicit transactions 86, 87
include files 105
Index class
property descriptions 51
IndexColumn class
property descriptions 52
inheritance 35, 135
initialization
C++ code example 421
of repository
525
Index
example 505
VB code example 413
Initialize function 122, 315
CMetaAIM class 259
CMetaApplicationGroup class 299
CMetaClassDesc class 270
CMetaFilterInfo class 222
CMetaLabel class 252
CMetaLabeledObjectKey class 248
CMetaObject class 136
CMetaObjectClassKey class 239
CMetaObjectKey class 237
CMetaPersist class 122
CMetaProperty class 230
CMetaRelationshipDesc class 293
CMetaRepository class 114
CMetaUser class 300
CMetaVersionedObjectClassKey class 244, 247
CMetaVersionedObjectKey class 241
internationalization
of MDS 105
IsDormant function 129
CMetaVersionedObjectClassKey class 246
CMetaVersionedObjectKey class 243
IsFrozen 81
IsFrozen function 128
CMetaVersionedObjectClassKey class 246
CMetaVersionedObjectKey class 243
IsPublished function 128
CMetaVersionedObjectClassKey class 246, 249
CMetaVersionedObjectKey class 243
IsSuperUser function
CMetaUser class 302
IsVersioningEnabled function
CMetaRepository class 117
L
labels 446, 455
linking an MDS application 108
locale settings 105
localization 105
locking protocol 93
for transaction management 93
log file
error messages 459
M
Macro class
property descriptions 56
MacroParameter class
property descriptions 57
MDS API, using 485
MDS DTD elements 431
526
MDS log
error messages 459
MDS scripting interface 427
MDSDefaultSecurityProfile 101
MDSMetaModelSecurityProfile 101
Meta Data Coalition 427
MetaActive class
COM interfaces 314
MetaClassInfo class
COM interfaces 388
MetaDIMInfo class
COM interfaces 369
MetaFilter class
COM interfaces 371
METAGROUP element, XML scripting interface 453
MetaGroupInfo class
COM interfaces 402
MetaIModelInfo class
COM interfaces 397
MetaInfo class
COM interfaces 361
common properties 357
MetaInfoKey class
COM interfaces 364
METALABEL element, XML scripting interface 455
MetaLabelInfo Class 377
MetaLabelInfoKey Class 380
MetaLoadType class
property descriptions 60
metamodels
creating applications to load, example code 486
MetaPropertyInfo class
COM interfaces 381
MetaPropertyItem class
COM interfaces 366
MetaRelationshipInfo class
COM interfaces 394
MetaSecProfEntry class
COM interfaces 407
MetaSecProfInfo class
COM interfaces 404
METAUSER element, XML scripting interface 452
MetaUserInfo class
COM interfaces 400
MetaVersionedInfoClassKey Class 377
MetaVersionedInfoKey class
COM interfaces 365
METAXML element
XML scripting interface 431
MODEL element, XML scripting interface 446
MODELDESC element, XML scripting interface 434
multithreaded applications 104
Index
N
Node class
property descriptions 53
NULL values 221
O
OBJECT element, XML scripting interface 448
object identifiers
XML scripting interface 431
ObjectKey Classes 237
objects
access permissions 97
adding to collections, example code 489, 507
and collections classes, COM interfaces 314
creating in a class 102
creating, example code 487, 506
delete propagation 93
deleting, example code 504
displaying, example code 491
getting collections, example code 493
getting in a collection, example 507
getting objects of a class, example 509
getting properties of, example 492
GUID
properties 80
ID
properties 80
keys
example of getting 497
keys, getting collections of, example code 496
modifying, example code 487
names
properties 79
of a class
examples 497
owner 96
reading objects of a class, example 509
reading, example code 487, 491, 511
removing from collections, example code 500, 511
replacing in collections, example code 502
repository root 103
security 96
updating, example 499
writing, example code 506
Operator < function 138
CMetaObject class 138
CMetaObjectKey class 238
CMetaProperty class 228
CMetaVersionedObjectKey class 242
Operator = function 247
CMetaObject class 137
CMetaProperty class 228
CMetaRelationshipKey class 247
P
permissions
access to objects 97
PREFERENCES element
XML scripting interface 432
PrintCMetaSecurityProfile function
CSecurityProfile class 306
PrintProperty function
CMetaProperty class 228
PrintValue function
CMetaProperty class 231
PrintValueType function
CMetaProperty class 231
product version numbers 4
product-related information 6
profile
security 99
project settings
C++ project settings 106
properties
constants 81
CreateDate/Time 81
data types 102
description 80
object GUID 80
object ID 80
object names 79
of objects, getting, example 492
owner ID 80
security profile ID 81
types 221
UpdateDate/Time 81
PROPERTY element, XML scripting interface 450
PROPERTYDESC element, XML scripting interface 439
publications related to this release 6
PublishState 81
and ReactivateDIMObject 86
domant objects 86
R
ReactivateDIMObject function 152
read model classes and class properties
C++ code example 421
ReadDormantDIMObject function 140
ReadDormantDIMObjectWithLock function 140
ReadDormantObject function 318
527
Index
reading
collections, example code 487
objects of a class, example 509
objects, example code 420, 487, 491, 511
ReadObject function 316
ReadObject()
and dormant objects 85
ReadObjectVersion function 317
Reference class
property descriptions 52
ReferenceColumn class
property descriptions 53
RELATIONSHIP element, XML scripting interface 451
RELATIONSHIPDESC element, XML scripting interface 444
RELEASE Mode Libraries 109
RemoveFromDestCollection function
CMetaObject class 157
RemoveManyFromOrigCollection function
CMetaObject class 158
RemoveManyPermissions function
CSecurityProfile class 306
RemovePermissions function
CSecurityProfile class 306
RemoveUserFromApplicationGroup function
CMetaApplicationGroup class 299
removing
objects from collections, example code 419, 500, 511
ReplaceDestCollection function
CMetaObject class 164
ReplaceOrigCollection function
CMetaObject class 162
ReplacePermissions function
CSecurityProfile class 307
replacing objects in collections, example code 419, 502, 511
repository
initialization, example 505
root object 103
Retain Associated Business Information feature 132
dormant objects 85
RetainBusinessObjectsSupported function
CMetaRepository class 118
RetryDDL function
CMetaRepository class 114
rollback
explicit transactions 89, 91
Rollback function
CMetaRepository class 114
S
Script class
property descriptions 74
scripting interface 427
steps for using 429
528
security
AIM components 102
application group 96
authentication 102
creating an object in a class 102
default profiles 100
DIMSecurityProfile 101
MDSDefaultSecurityProfile 101
MDSMetaModelSecurityProfile 101
object owner 96
objects 96
profile ID
properties 81
profiles 99, 100
default 100
super-user access 99
security classes 297
CMetaApplication Group class 297
CMetaUser class 300
CSecurityProfile class 305
CSecurityProfileEntry class 303
SECURITYPROFILE element, XML scripting interface 454
SetAccessPermissions function
CMetaPersist class 127
SetAIMLabel function
CMetaLabelclass 252
SetAIMSecurityProfile function
CSecurityProfile class 307
SetCallerName function 127
CMetaPersist class 127
SetCharacterSetName function
CMetaPropertyDesc class 286
SetClassGUID function 125
CMetaPersist class 128
SetClassID function 125
CMetaObjectClassKey class 240
CMetaPersist class 125
CMetaVersionedObjectClassKey class 245
SetClassName function
CMetaObjectClassKey class 240
CMetaVersionedObjectClassKey class 244
SetClassSecurityProfile function
CSecurityProfile class 308
SetComparisonOperator function
CMetaFilterInfo class 222
SetCreatorName function
CMetaLabel class 255
SetDescription function 123
CMetaPersist class 123
SetExplanation function
CMetaRelationshipKey class 247
SetLogicalOperator function
CMetaFilterInfo class 223
SetName function
Index
subclass 35
SubjectArea class
property descriptions 59
substring search 219
suggested project settings 106
superclass 35
super-user access
security 99
T
Table class
property descriptions 45
Target class
property descriptions 75
Teradata
functions 103
transactions
error messages 480
explicit 86, 87
closing 88
committing 89
rollback 89, 91
implicit 86, 87
locking protocol 93
with DDL statements 91
XML scripting interface 456
Trigger class
property descriptions 55
U
UNICODE DEBUG Mode Libraries 109
UNICODE RELEASE Mode Libraries 109
UpdateDate/Time
properties 81
UpdateManyPermissions function
CSecurityProfile class 310
UpdatePermissions function
CSecurityProfile class 310
updating
existing objects, example 499
user, group, and security profile classes
COM interfaces 400
V
ValidValues class
property descriptions 60, 63, 64
VB code examples 412
getting objects in a collection 415
getting objects of a class 417
initialization 413
reading an object 420
removing objects from collections 419
529
Index
W
World Wide Web Consortium (W3C) 427
WriteObject function 319
WriteObjectVersion function 319
writing objects
example code 506
VB code example 413
X
XML
example files
AutoWorldObjects.xml 457
XML scripting interface
action attribute settings 432
CLASS element 447
CLASSDESC element 436
DERIVEDCLASSDESC element 441
DERIVEDPROPERTYDESC element 442
error codes 483
example files 457
file structure 430
MDS DTD elements 431
MDS DTD schema elements 431
METAGROUP element 453
METALABEL element 455
METAUSER element 452
MODEL element 446
MODELDESC element 434
multiple superusers 427
OBJECT element 448
object identifiers 431
overview of XML 427
PREFERENCES element 432
PROPERTY element 450
PROPERTYDESC element 439
530