Professional Documents
Culture Documents
Foils
Exercises
Solutions
Appendixes
VPM Programming
Version 1 Release 3
June 2000
FOR-E-APVPP-03-AL
VPM Programming
DO NOT
COPY
i-2
Menu
VPM Programming
Table of Contents
Appendix 1 - DB2 Main Instructions .................................................................... 9
Appendix 2 - Oracle Main Instructions ............................................................... 11
Appendix 3 - DB table structure .......................................................................... 13
Appendix 4 - Environment Table Administration ............................................... 63
Appendix 5 - C++ Reminder ............................................................................... 67
Appendix 6 - Headers .......................................................................................... 71
CATDMUsrMethod.h ................................................................................. 71
CATVpmAFUsrMethod.h .......................................................................... 87
CATVpmPEUsrMethod.h ........................................................................... 92
CATVpmSCUsrManager.h ......................................................................... 94
CATVpmPEUsrManager ............................................................................ 97
CATVpmSCUsrLogin.h ............................................................................. 99
CATCfgInterfaces.h .................................................................................. 101
CATVPMFilter.h ...................................................................................... 125
CATVPMFilterManager.h ........................................................................ 126
CATVPMNode.h ...................................................................................... 128
CATLnkAPI.h ........................................................................................... 129
CATVpmPubSubUsrAdmin.h .................................................................. 134
CATVpmPubSubUsrManager.h ............................................................... 138
CATDMUsrInstance.h .............................................................................. 143
CATDMUsrMethodContext.h .................................................................. 150
CATDMUSRSelect.h ................................................................................ 152
CATDMUSRUpsate.h .............................................................................. 154
CATDMUSRCatia.h ................................................................................. 156
CATDMUSRResultPanel.h ...................................................................... 157
CATcdm.h ................................................................................................. 158
CATUnicodeString.h ................................................................................ 160
Appendix 7 - APIs and VPM version ................................................................ 177
i-3
Menu
VPM Programming
i-4
Menu
VPM Programming
Preface
Course objectives
At the end of the VPM Programming course, participants will be capable of managing VPM
possibilities for customization:
Consequently, the user will be able to:
Understand the data structure in the data base
Implement the User Exit provided to customize the functionalities of:
the BOM product
the AFL product
the P&O product
the CFG product
the STEP product
Create Data Base triggers
Create new tools or methods to the PSN or VPMA, using the API for Configuration,
Database Access, P&O, MML management or Publish/Subscribe.
Prerequisites
To take full advantage of this instruction, participants are expected to be familiar with UNIX
commands and text editors, C++ programmation, VPM user functionalities and VPM
Administration course.
CATIA-related publications
VPM Administration Users Guide
Reference documentation
Moreover, VPM online documentation can be accessed by selecting the item Main, Contents or
Index in the Help menu in VPMA.
i-5
Menu
VPM Programming
Course schedule
VPM Programmation training is a 4-day course. Each half-day comprises :
a theoretical talk with foils
exercises allowing the participants to apply the concepts covered in the lesson.
Morning
Afternoon
Day 1
Chapter 1: Introduction
Exercise 1: CDM profile customization
Chapter 2: User Exit Miscellaneous
Chapter 3: User Exit - Action Flow
Exercise 2: AFL Customization
Day 2
Day 3
Chapter 9: Filter
Exercise 10: Filter
Chapter 10: P&O API
Exercise 11: P&O API
Day 4
i-6
Menu
VPM Programming
Readers Comments
We would very much appreciate your comments on this guide. Please specify the pages and
lines to which they apply. All comments (concerning the general presentation, terminology,
step-by-step procedures, examples, methodology and / or your overall evaluation, etc.) will be
carefully examined by the authors of this documentation.
Please send your comments including your name and address to:
DASSAULT SYSTEMES
Training Department
CSM / STT
9, quai Marcel Dassault
92156 SURESNES Cedex (FRANCE)
Fax: (33-1) 40.99.43.76
i-7
Menu
VPM Programming
i-8
Menu
VPM Programming
db2
List database(s)
list db directory
connect to DataBaseName
Creating Objects
Database creation
Table creation
create table owner.table (AttributeName AttributeType NOT NULL)
View creation
create view owner.view as select AttibuteList from owner.table where Query
Index creation
create unique index owner.index on owner.table (AttributeList)
Creation of a new column
alter table owner.table add AttributeName attribute_type
Insertion of a new row in a table
insert into owner.table (AttributeList) values (ValueList)
1-9
Menu
VPM Programming
Updating Objects
Update an object
Note : The Statement without query is applied for all the objects in the table.
Deleting Objects
Deleting a db
drop db DataBaseName
Deleting a table
Deleting a view
Deleting an index
1-10
Menu
VPM Programming
Table structure
desc owner.table;
Creating Objects
Table creation
create table owner.table (AttributeName AttributeType NOT NULL);
View creation
create view owner.view as select AttibuteList from owner.table where Query;
Index creation
create unique index owner.index on owner.table (AttributeList);
Creation of a new column
alter table owner.table add AttributeName attribute_type;
Insertion of a new row in a table
insert into owner.table (AttributeList) values (ValueList);
Updating Objects
Update an object
Note : The Statement without query is applied for all the objects in the table.
1-11
Menu
VPM Programming
Deleting Objects
Deleting a table
Deleting a view
Deleting an index
1-12
Menu
VPM Programming
Note : In every following table description, the Type name CHARACTER* means RAW for ORACLE data base
and CHAR for DB2 data base
1-13
Menu
VPM Programming
1-14
Menu
VPM Programming
not used
PART_EFFLINK_
Action (owner: Administrator)
Action_
application_
not used
Category_
not used
Config_
not used
data_item_
not used
driver_
not used
DicoEntity_
not used
Document_
not used
EFF_FOR_PART_
not used
filter_unit_
Part_
not used
PLANNED_EFF_
Rep_
not used
site_
not used
RDB_DOCUMENT
1-15
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER**
$COMPID
CHARACTER**
S_.........
..............;
STATUS
CHARACTER**
PART_DESCRIPTION
CHARACTER**
C_PART_VERSION
CHARACTER**
C_MATURITY
CHARACTER**
D_TOOL
CHARACTER*
not used
D_PARM
CHARACTER*
not used
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_CREATE
TIMESTAMP
C_CREATE_USER
CHARACTER*
C_LASTMOD
TIMESTAMP
C_LASTMOD_USER
CHARACTER*
C_VERSION
INTEGER
1-16
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
S_.........
.................
MODEL_DESCRIPTION
CHARACTER*
STATUS
CHARACTER*
C_REVISION
CHARACTER*
C_MATURITY
CHARACTER*
D_TOOL
CHARACTER*
not used
D_PARM
CHARACTER*
not used
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_CREATE
TIMESTAMP
C_CREATE_USER
CHARACTER*
C_LASTMOD
TIMESTAMP
C_LASTMOD_USER
CHARACTER*
C_VERSION
INTEGER
C_COMPID_DATA
CHARACTER*
C_INTFORM
SMALLINT
equal to 1
C_COMPNAME_DATA
VARCHAR
C_SOFT_VER
VARCHAR
C_NICKNAME
VARCHAR
DOUBLE
C_SIZE
DOUBLE
C_LAST_REPOSITORY
VARCHAR
1-17
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
S_.........
.................
NOTES
VARCHAR
not used
C_REVISION
CHARACTER*
C_MATURITY
CHARACTER*
D_TOOL
CHARACTER*
D_PARM
CHARACTER*
D_PATH
CHARACTER*
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_CREATE
TIMESTAMP
C_CREATE_USER
CHARACTER*
C_LASTMOD
TIMESTAMP
C_LASTMOD_USER
CHARACTER*
C_VERSION
INTEGER
C_COMPID_DATA
CHARACTER*
C_COMPNAME_DATA
VARCHAR
C_SOFT_VER
VARCHAR
C_TYPE_REP
VARCHAR
C_LAST_REPOSITORY
VARCHAR
C_INTFORM
SMALLINT
1-18
Menu
VPM Programming
CATIA_PLOT
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER
$COMPID
CHARACTER
S_.........
D_TOOL
CHARACTER
D_PARM
CHARACTER
C_REVISION
CHARACTER
C_MATURITY
CHARACTER
C_NICKNAME
VARCHAR
C_LAST_REPOSITORY
VARCHAR
C_X
DOUBLE
C_Y
DOUBLE
C_ANGLE
SMALLINT
C_UNIT
DOUBLE
C_RESPONSIBLE
CHARACTER
C_ORG_RESPONSIBLE
CHARACTER
C_CREATE
TIMESTAMP
C_CREATE_USER
CHARACTER
C_LASTMOD
TIMESTAMP
C_LASTMOD_USER
CHARACTER
C_VERSION
INTEGER
C_COMPID_DATA
CHARACTER
C_COMPNAME_DATA
VARCHAR
C_SOFT_VER
VARCHAR
C_INTFORM
SMALLINT
1-19
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
$SITE
CHARACTER*
$CONAME
VARCHAR
$COMPNAME
VARCHAR
$COID_REF
CHARACTER*
$COMPID_REF
CHARACTER*
$COMPID_FATHER
CHARACTER*
$COMPNAME_FATHER
VARCHAR
$TYPE
CHARACTER*
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_VERSION
INTEGER
DISCI_COID
CHARACTER*
DISCI_COMPID
CHARACTER*
C_LASTMOD
TIMESTAMP
C_MML_TS
TIMESTAMP
CATMML_STATUS
CHARACTER*
EXPORT_ID
CHARACTER*
$USER1
VARCHAR
XMIN, XMAX......
DOUBLE
C_MAT01, C_MAT02........
DOUBLE
1-20
Menu
VPM Programming
$EXT_LF (Table managing the links between an object and its repository)
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
$TYPE
CHARACTER*
$COMPID_FATHER
CHARACTER*
$CUR_ACC_MET
CHARACTER*
$CUR_ACC_MET_DATA
VARCHAR
REPRES_TYPE
VARCHAR
Type of representation
Note:
$CUR_ACC_MET :
- DBLFCDM
- DBLFAIX
- DBLFCAT
$CUR_ACC_MET_DATA is equal to :
Repository table name followed by the $coid$compid of the object within the repository table for DBLFCDM access
method. For instance :VPMENV.LF00001
$COID$COMPID
Repository information defined in the REPOSITORY field of the insert panel for DBLFAIX access method. For
instance : BIN PATH /tmp/xxxxxx
Repository directory in case of DBLFCAT
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
$RECNO
INTEGER
Record number
$SEQNO
INTEGER
Sequence number
$DATA
1-21
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
$LOCKTYPE
CHARACTER*
$COMPREF
CHARACTER*
C_COMPNAME
VARCHAR
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_CREATE
TIMESTAMP
DURATION
VARCHAR
COMMENTS
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
REF_XMIN, REF_XMAX....
DOUBLE
ASS_XMIN, ASS_XMAX.....
DOUBLE
Sub-assembly volume
TYPE
CHARACTER*
VALID
CHARACTER*
V or ^
$DATA
1-22
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
S_TYPEOFCALC
INTEGER
S_CLEARANCEVALUE
DOUBLE
TYPEOFRESULT
INTEGER
MINIMALDISTANCE
DOUBLE
INSTANCE_1_COMPID
CHARACTER*
INSTANCE_2_COMPID
CHARACTER*
PART_PTR table
STATUS
INTEGER
COMMENTITF
CHARACTER*
comments
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_LASTMOD
TIMESTAMP
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
NAME
VARCHAR
instance name
NB_LINK
INTEGER
OID
CHARACTER*
C_COID_PART
CHARACTER*
C_ENV_PART
CHARACTER*
C_RESPONSIBLE
CHARACTER*
C_ORG_RESPONSIBLE
CHARACTER*
C_USED_CLASH
CHARACTER*
C_USED_ASSY
CHARACTER*
DOUBLE
1-23
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
S_ZONE_NAME
CHARACTER*
XMIN, XMAX..........
DOUBLE
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
Component identifier
$CREATOR
CHARACTER*
$OBJ
VARCHAR
$COR_NAME
VARCHAR
$PARM
VARCHAR
$COND
CHARACTER*
$PRIORITY
SMALLINT
Priority
$WHEN
CHARACTER*
$PGMNAME
CHARACTER*
$ATTRIBUTES
VARCHAR
$EDBS_FLAG
CHARACTER*
Note: $COR_NAME
- To declare a PART_LIST:
ROOT : required when creating a new complex object ( PART_LIST )
CO_COMPONENT: an object is declared as component of a complex object
VCO_ALL_COMPONENT: This specific view must be defined for each new object
1-24
Menu
VPM Programming
CDM.MACRO_LIST (table in which all the BOM profiles (aka CDMA profile) are
stored)
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
MACRO_NAME
VARCHAR
Profile name
SEQNO
SMALLINT
MACRO_TEXT
VARCHAR
Profile text
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
Same
USER_NAME
CHARACTER*
ENV
CHARACTER*
MACRO_NAME
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
Environment name
S_CONAME
VARCHAR
1-25
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
$COMPID
CHARACTER*
S_PROJECT
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------$COID
CHARACTER*
Product id
$COMPID
CHARACTER*
S_COID_REF
CHARACTER*
S_ENV_REF
CHARACTER*
S_TABLE_REF
CHARACTER*
U_PRODNAM
CHARACTER*
Not used
Type name
Explanation
---------------------------------------------------------------------------------------------------------------EVENT_OID
CHARACTER*
EVENT_NAME
VARCHAR
FATHER_OID
CHARACTER*
PSTYPE_OWNER
VARCHAR
Not used
PSTYPE_NAME
VARCHAR
Not used
1-26
Menu
VPM Programming
EXP_SUBSCRIBERS (subscribers)
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------SUBSCRIBER_OID
CHARACTER*
PUBLISHER_OID
CHARACTER*
EVENT_OID
CHARACTER*
SYNC_DATE
TIMESTAMP
Publish date
SUBSCRIBER_TYPE
VARCHAR
Not used
ACTION_TYPE
VARCHAR
ACTION
VARCHAR
ACTION_DATA
VARCHAR
SUB_NICKNAME
VARCHAR
PUB_NICKNAME
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------PUBLISHER_OID
CHARACTER*
EVENT_OID
CHARACTER*
PUBLISH_DATE
TIMESTAMP
Publish date
Type name
Explanation
---------------------------------------------------------------------------------------------------------------OID_DOC
VARCHAR
DOC_USAGE
VARCHAR
DESCRIPTION
VARCHAR
data description
DOC_APPLICATION
VARCHAR
DOC_FORMAT
CHARACTER*
ACC_MET
CHARACTER*
1-27
Menu
VPM Programming
All tables (except the three Pub-Sub tables) have six comon attributs :
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------OID
VARCHAR
Object Id
VIRTUAL_OID
VARCHAR
Not used
TYPE
VARCHAR
Object type
OID_DOC
VARCHAR
LAST_MODIFIER_ID
CHARACTER*
LAST_UPDATE_DATE
TIMESTAMP
Type name
Explanation
organization_
Column name
---------------------------------------------------------------------------------------------------------------id
CHARACTER*
Organizations Id
name
CHARACTER*
description
VARCHAR
address
VARCHAR
relating_org
VARCHAR
relating_org_
VARCHAR
manager_
VARCHAR
manager
VARCHAR
Type name
Explanation
role_
Column name
---------------------------------------------------------------------------------------------------------------name
CHARACTER*
description
VARCHAR
description
belongs_to_
VARCHAR
belongs_to
VARCHAR
relating_role
VARCHAR
relating_role_
VARCHAR
1-28
Menu
VPM Programming
person_
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------id
CHARACTER*
id of the person
last_name
VARCHAR
first_name
VARCHAR
belongs_to
VARCHAR
belongs_to_
VARCHAR
phone_number
CHARACTER*
Phone_number
address
VARCHAR
address
VARCHAR
current_role
VARCHAR
current_role_
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------id
CHARACTER*
someone
VARCHAR
owner
VARCHAR
application
VARCHAR
func
VARCHAR
command
VARCHAR
workspace
VARCHAR
authorization
INTEGER
data_in
VARCHAR
data_out
VARCHAR
link on profile
1-29
Menu
VPM Programming
data_group_
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------name
VARCHAR
group_type
VARCHAR
owner
VARCHAR
description
VARCHAR
usage
VARCHAR
not used
Type name
Explanation
process_
Column name
---------------------------------------------------------------------------------------------------------------application
VARCHAR
func
VARCHAR
command
VARCHAR
owner
VARCHAR
description
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------id
VARCHAR
id of configuration item
description
VARCHAR
design
VARCHAR
owner
VARCHAR
not used
status
VARCHAR
not used
released
INTEGER
not used
1-30
Menu
VPM Programming
effectivity_
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------id
VARCHAR
effectivity id
description
VARCHAR
not used
status
VARCHAR
released
INTEGER
Not used
start_range
INTEGER
start range
end_range
INTEGER
end range
start_program
VARCHAR
start_id
VARCHAR
end_program
VARCHAR
end_id
VARCHAR
start_date
INTEGER
start date
end_date
INTEGER
end date
lot_id
VARCHAR
lot_size
VARCHAR
modif_id
VARCHAR
action_type
VARCHAR
validation
VARCHAR
not used
oldlink
VARCHAR
optional modification
option_id
VARCHAR
option name
option_type
VARCHAR
option_start
INTEGER
option_end
INTEGER
option_lot_id
VARCHAR
not used
pack_type
VARCHAR
pack_start
INTEGER
pack_end
INTEGER
pack_lot_id
VARCHAR
pack_name
VARCHAR
1-31
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------id
VARCHAR
CUR_DATE
VARCHAR
description
VARCHAR
apply
VARCHAR
UID product
status
VARCHAR
not used
owner
VARCHAR
flag_frozen
INTEGER
not used
released
INTEGER
not used
organization
VARCHAR
visibility
VARCHAR
Type name
Explanation
---------------------------------------------------------------------------------------------------------------PARTID
VARCHAR
ALLOWED_TYPE
INTEGER
Type name
Explanation
---------------------------------------------------------------------------------------------------------------PART_ID
VARCHAR
PART_CHILD
VARCHAR
1-32
Menu
VPM Programming
Action_
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------nbr
INTEGER
action number
name
VARCHAR
secondary_id
VARCHAR
action_type
VARCHAR
description
VARCHAR
abstract
creator
VARCHAR
id of the creator
owner
VARCHAR
id of the owner
organization
VARCHAR
priority
VARCHAR
status
VARCHAR
start_date
VARCHAR
end_date
VARCHAR
various
VARCHAR
working_eff
VARCHAR
applicability_0001
VARCHAR
applicability_opt
VARCHAR
applicability_min
INTEGER
applicability_max
INTEGER
proposed_eff_type
VARCHAR
proposed_eff_opt
VARCHAR
proposed_eff_min
INTEGER
proposed_eff_max
INTEGER
product
VARCHAR
1-33
Menu
VPM Programming
Type name
Explanation
---------------------------------------------------------------------------------------------------------------cfg_itm_
VARCHAR
cfg_itm
VARCHAR
eff_type
VARCHAR
eff_val1
INTEGER
eff_val2
INTEGER
eff_str1
VARCHAR
option name
eff_str2
VARCHAR
not used
date_fu
INTEGER
eff_str3
VARCHAR
eff_str4
VARCHAR
eff_str5
VARCHAR
eff_source
INTEGER
Type name
Explanation
---------------------------------------------------------------------------------------------------------------ACTION_NAME
VARCHAR
EFF_TYPE
VARCHAR
date/range
BOT
INTEGER
TOP
INTEGER
OPTION_NAME
VARCHAR
BOT_PROGRAM
VARCHAR
BOT_ID
VARCHAR
TOP_PROGRAM
VARCHAR
TOP_ID
VARCHAR
1-34
Menu
VPM Programming
MILESTONE
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------ID
VARCHAR
Milestone ID
PROGRAM
VARCHAR
Program Name
PRODUCT
VARCHAR
Part Reference
DESCRIPTION
VARCHAR
Milestone Description
PROGRAM_STEP
VARCHAR
PHASE
VARCHAR
MILESTONE_TYPE
VARCHAR
Date / Range
MILESTONE_VALUE
INTEGER
Milestone Value
VALUE_MIN
INTEGER
VALUE_MAX
INTEGER
FROZEN
INTEGER
STATUS
VARCHAR
OWNER
VARCHAR
ORGANIZATION
VARCHAR
Organization
Type name
Explanation
Frozen Status
MML_ENTITY
Column name
---------------------------------------------------------------------------------------------------------------OBJECT_CATAB
VARCHAR
OBJECT_COID
CHARACTER
Model Coid
OBJECT_COMPID
CHARACTER
Model Compid
ENTITY_ID_1
CHARACTER
ENTITY_ID_2
CHARACTER
ENTITY_KEY
CHARACTER
Entity Key
ENTITY_NICKNAME
VARCHAR
Not Used
TS
TIMESTAMP
Entity Timestamp
UBIT
CHARACTER
UBIT
1-35
Menu
VPM Programming
MML_LINK
Column name
Type name
Explanation
---------------------------------------------------------------------------------------------------------------OBJECT_CATAB
VARCHAR
Model Table
OBJECT_COID
CHARACTER
Model Coid
OBJECT_COMPID
CHARACTER
Model Compid
ENTITY_ID_1
CHARACTER
ENTITY_ID_2
CHARACTER
ENTITY_KEY
CHARACTER
Entity Key
TYPE
CHARACTER
Link Type
TS
TIMESTAMP
Link Timestamp
STATUS
CHARACTER
Link Status
UBIT
CHARACTER
UBIT
1-36
Menu
VPM Programming
Index
1-37
Menu
VPM Programming
1-38
Menu
VPM Programming
1-39
Menu
VPM Programming
1-40
Menu
VPM Programming
1-41
Menu
VPM Programming
1-42
Menu
VPM Programming
1-43
Menu
VPM Programming
1-44
Menu
VPM Programming
1-45
Menu
VPM Programming
1-46
Menu
VPM Programming
BOM: Lock
1-47
Menu
VPM Programming
1-48
Menu
VPM Programming
BOM: Zone
1-49
Menu
VPM Programming
1-50
Menu
VPM Programming
Effectivity view
1-51
Menu
VPM Programming
1-52
Menu
VPM Programming
Dictionaries
1-53
Menu
VPM Programming
Milestones
1-54
Menu
VPM Programming
1-55
Menu
VPM Programming
1-56
Menu
VPM Programming
Security
1-57
Menu
VPM Programming
Security view
1-58
Menu
VPM Programming
Action
Action
1-59
Menu
VPM Programming
Action
1-60
Menu
VPM Programming
Publish - Subscribe
1-61
Menu
VPM Programming
1-62
Menu
VPM Programming
VPPARCUS
*COMMAND
*RUN
VPPARPRO
*COMMAND
ASSIGN 00000000 TO GLOBAL_T ;
ASSIGN T TO GLOBAL_VARIABLE_NAME ;
RUN OID_TO_HEXA ;;
EXECUTE IMMEDIATEINSERT INTO &DICOCATI.PROJECT
($COID, $COMPID, S_PROJECT)
VALUES
(&COID_PROJX, &TX, ProjectName);;
EXECUTE IMMEDIATE
COMMIT WORK ;;
*RUN
2. Change the value of catcdm.c_stream in USRENV.dcls to reference the directory where the
command stream file is located.
3. Test that this directory is referenced as first directory by using the catpath command:
catpath -l -A catcdm.c_stream
4. Run the dbcdmb command
dbcdmb CreateProject -u DbAdmin -p DbAdminPassword
1-63
Menu
VPM Programming
Deleting a Profile
This is done in three steps:
1. Remove the link Role / Profile (only for specific profiles declared in P&O):
With P&O: delete the proper row in the tab Privilege
2. Remove the link Profile / Environment (only for specific profiles declared in P&O):
Two possibilities
a. With P&O: delete the proper objects in the tab Profile
b. In the Data Base with the following instruction:
db2: delete from PROFILE.PROFILE_USER where MACRO_NAME = ProfileName
Oracle: delete from PROFILE.PROFILE_USER where MACRO_NAME = ProfileName;
3. Remove the physical data of the profile in the Data Base
db2: delete from CDM.MACRO_LIST where MACRO_NAME = ProfileName
Oracle: delete from CDM.MACRO_LIST where MACRO_NAME = ProfileName;
Deleting an Environment
This is done in five steps:
1. Identify the profiles (other than the default profiles) belonging to the environment. Two
possibilities:
a. With P&O: in the tab Profile
b. In the Data Base with the following instruction:
db2: select MACRO_NAME from PROFILE.PROFILE_USER where ENV = EnviromentName
Oracle: select MACRO_NAME from PROFILE.PROFILE_USER where ENV = EnviromentName;
2. Remove all the specific and default profile in the database
Note : See former paragraph.
1-64
Menu
VPM Programming
Deleting a Project
This is done in three steps:
1. List the environments belonging to the project:
db2: select S_CONAME from CATIA.CONAME where $COID = $COIDofProject
Oracle: select S_CONAME from CATIA.CONAME where $COID = $COIDofProject;
2. Remove these associated environments:
Note : You can in one shot delete the declarations of all environments belonging to the project. The third step
of the former paragraph will be completed for all the environments using the following instructions:
1-65
Menu
VPM Programming
1-66
Menu
VPM Programming
String Management
The following functionalities are available in stdlib.h
1. String copy:
char * strcpy (char * Targ, const char * Source);
Copies Source, including the termination null chracter \0, to the location specified by
Targ, and returns Targ. No overflow checking is performed when strings are copied or
appended.
char * strncpy (char * Targ, const char * Source, unsigned Count);
Copies the initial Count characters of Source to Targ, and returns Targ. If Count is less
than or equal to the length of Source, a null character is not automatically appended to
the copied string.
2. String concatenation:
char * strcat (char * Left, const char * Right);
Appends Right to Left and terminates the resulting string with a null character. No
overflow checking is performed when strings are copied or appended.
char * strncat (char * Left, const char * Right, unsigned Count);
Appends, at most, the first Count characters of Right to Left.
1-67
Menu
VPM Programming
3. String comparison:
char * strcmp (const char * Str1, const char * Str2);
Compares the two string Str1 and Str2.
The return value for each of these functions indicates the lexicographic relation of Str1
to Str2.
Value
Relationship of Str1 to Str2
<0
Str1 less than Str2
0
Str1 identical Str2
>0
Str1 greater than Str2
char * strncmp (const char * Str1, const char * Str2, unsigned Count );
Compares, at most, the first Count characters in Str1 and Str2.
char * strcimp (const char * Str1, const char * Str2);
Same as strcmp but does not differentiate lower and upper cases.
char * strnicmp (const char * Str1, const char * Str2, unsigned Count );
Same as strncmp but does not differentiate lower and upper cases.
%f
%lf
%g
1-68
Menu
VPM Programming
File Management
Instructions available in fstream.h
char *
Buffer1
= new char[50];
char *
Buffer2
= new char[50];
char *
FileName = new char[50];
fstream
File; // Object created to open a connection
strcpy (FileName, Test.txt);
// Test.txt: toto tutu
File.open(FileName, ios::in );
// Open the file FileName in read mode
/* File.open(FileName, ios::out );
Open the file FileName in write mode */
/* File.open(FileName, ios::in | ios::out);
Open the file FileName in R/W mode */
if (!File)
cout << The file does not exit. << endl;
else
{
File >> Buffer1; // The value of Buffer1 is toto
File >> Buffer2; // The value of Buffer2 is tutu
}
File.close(); // Close the connection
delete Buffer1[];
delete Buffer2[];
delete FileName[];
UNIX Interface
This functionality is available in stdlib.h
char * getenv (char *);
Can be used under UNIX in oder to get the value of an environment declarative variable.
Example: char * User = getenv(USER);
1-69
Menu
VPM Programming
1-70
Menu
VPM Programming
Appendix 6 - Headers
CATDMUsrMethod.h
libLV0XUSR.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1997
//=============================================================================
//
// CATDMUsrMethod:
// Contains all the user exits related to BOM
//
//=============================================================================
// Usage Notes:
//
//=============================================================================
// Sep. 97 Creation
//=============================================================================
#ifndef CATDMUsrMethod_h
#define CATDMUsrMethod_h
#include <time.h>
// Modification types for commit
enum ModificationType {
ADDLINK=1,
REMOVELINK=2,
MOVELINK=4,
REPLACELINK=8,
MOVEREPLACELINK=4+8,
RENAMELINK=16,
ADDLINKTOCONF=32+1
};
// Action types for versioning
enum RevVerAction
{
ACTION_NEW,
ACTION_UPDATE
};
// Actions for config-handlers control
enum CHAction
{
CH_CREATE,
CH_RENAME,
CH_DUPLICATE,
CH_DELETE,
CH_EDIT_CONTENT, // editer la definition(contenu) du CH
CH_EDIT_LINK, // editer les liens du CH (CHs children et brothers)
CH_CHANGE_OWNER
};
1-71
Menu
VPM Programming
#ifndef PartAsmID_def
#define PartAsmID_def
typedef struct PartAsmId_ {
char coid[8];
char compid[8];
char caenv[8];
char catab[18];
char clien[8]; // link COMPID (towards father)
double xmat[12]; // transformation matrix
int level;
} PartAsmID;
#endif
#ifndef ObjID_def
#define ObjID_def
typedef struct
{
char Xcoid[17]; // Coid (hexadecimal notation)
char Xcompid[17]; // Compid (hexadecimal notation)
double coid;
// Coid (binary)
double compid; // Compid (binary)
char caenv[9];
char catab[19];
} ObjID;
#endif
#ifndef EffParam_def
#define EffParam_def
typedef struct
{
char Type[40]; // Type of the effectivity:
// modif, date, range, option_undef, pack_undef,
// option_date, option_range, pack_date, pack_range
char Modif[40]; // Modification name (Type=modif)
char Option[40]; // Option name (Type=option_XXX)
int NbOpt;
// Nb options in OptList (Type=pack_XXX)
char** OptList; // Options (combined with AND operator) (Type=pack_XXX)
int BotRange; // Bottom value for range (Type=range, XXX_range)
int TopRange; // Top value for range (Type=range, XXX_range)
time_t BegDate;
// Start value for date (Type=date, XXX_date)
time_t EndDate;
// End vallue for date (Type=date, XXX_date)
} EffParam;
#endif
#ifndef Error_def
#define Error_def
typedef struct
{
int Ier;
// Error code
char* ShortMsg; // Short message (deleted by VPM if not NULL and if Ier!=0)
char* LongMsg; // Long message (deleted by VPM if not NULL and if Ier!=0)
} Error;
#endif
/**
1-72
Menu
VPM Programming
* Note:<BR>
*
* Following convention is used for naming parameters: parameter names prefixed by:
* <dl>
* <dd> <tt>i</tt> are input parameters
* <dd> <tt>o</tt> are ouput parameters
* <dd> <tt>io</tt> are input/output parameters
* </dl>
*/
class CATDMUsrMethod
{
public:
//---------------------------------------// Additional tools and methods management
//---------------------------------------static Error ExecuteUsrMethod(const char *iMethodName,
const int &iNbSelectedInstances,
ObjID *iSelectedObjects);
static Error OpenPSNWithUsrMethod(const char* iMethodName,
const int& iNbSelectedInstances,
int* iDepthArray,
PartAsmID** iObjArray,
double** iComputedXmatArray);
1-73
Menu
VPM Programming
/**
* Allows user to validate keyed flag versus current modifications.
*
* @param iModificationFlag
* flag which is going to be used in order to save following modifications
* @param iModificationFlag
* number of modifications
* @param iTypeOfModifications
* types of the modifications
* @param iAddedLinks
* list of added links
* @param iRemovedLinks
* list of removed links
*
* @return
* If method return an error, another modification flag must
* be keyed or commit canceled.
*/
static Error IsAValidFlagForCommit(const char* iModificationFlag,
const int iNbModifications,
int* iTypeOfModifications,
ObjID* iAddedLinks,
ObjID* iRemovedLinks);
/**
* User exit called when saving Product Structure modifications
* @return
* <tt>1</tt> Action flow will test whether the current user/role has the right to
*
write the modifications (maintenance phase)<BR>
* <tt>0</tt> Action flow wont be called when saving the modifications
*
(development phase)
*/
static int ActionFlowCheck(const char *iModificationFlag,
const char *iUser);
static Error SuccessfullyCommitInGraph(const char* iModificationFlag,
const int iNbModifications,
int* iTypeOfModifications,
ObjID* iAddedLinks,
ObjID* iRemovedLinks);
static void SuccessfullyRollBackInGraph();
//------------------------// Modifications management
//------------------------/**
* User exit called when validating action and commiting PSN graph modifications
* @param iModif
* Modification to validate
* @param oType
* Type of the validation (option, range, date, pack, option_range, option_date,
* pack_range, pack_date)
* @param oOptListSize
1-74
Menu
VPM Programming
1-75
Menu
VPM Programming
1-76
Menu
VPM Programming
/**
* Checks autorisation before saving model in CATIA V4.
*
* @return
* 0
means save is authorized in CATIA V4
* not 0 it is an error code :
*
=> save in CATIA will not be performed
*
*/
static int AuthorizedCATIASave(const ObjID& iObj);
// Change maturity
static Error AuthorizedPromotion(const ObjID& iObj,
const char* iOldStatus,
const char* iNewStatus);
/**
* User exit called when changing ownership.
*
* @return
* If Error.Ier equals 0 modification is allowed, else error message is
* displayed.
*/
static Error AuthorizedReassign(const ObjID& iObj,
const char iUser[9],
const char iOrg[11]);
1-77
Menu
VPM Programming
1-78
Menu
VPM Programming
* @param iCatab
* Name of the table into which the object is being written
* @param iSource
* Where the LF (long field) comes from :<BR>
* <tt>1</tt> File<BR>
* <tt>2</tt> CATIA V4<BR>
* <tt>3</tt> New one (empty)<BR>
* <tt>4</tt> Object in database<BR>
* <tt>5</tt> Document<BR>
* <tt>7</tt> DENEB product
* @param ioPath
* Significant only when <tt>iSource</tt> is equal to File (1).<BR>
* It is the full path of the file.
* @param ioObj
* Significant only when <tt>iSource</tt> is equal to Object in database (4).<BR>
* @param ioRepository
* Where the LF is going to be written
*
* @return
* The method must return 0 if the operation is accepted or error code
* if it is refused. In such a case, an error message is displayed in an
* error notification panel and the operation is canceled.
*/
static Error CheckLFBeforeWrite(const char* const iCaenv,
const char* const iCatab,
const int iSource,
char **ioPath,
ObjID *ioObj,
char** ioRepository);
//---------------------------// Version/revision management
//---------------------------/**
* Provides a list of proposed values upon creation/update of a
* version.<BR>
* If number of values is greater than 0, the values will be
* displayed in a list inside input panel.
*<p>
* Note : <b>used in NEW revisioning mode</b>
*
* @param iobj
* object from which we want to create a new version
* @param iMaturity
* maturity of the object
* @param iLastRev
* last existing version number
* @param iCurRev
* version number of the object being handled
* @param oNbVerValues
* number of values returned
* @param oVerValues
* list of values (memory has to be allocated within the user
* exit ; it is freed by the caller)
* @param oAuthorized
1-79
Menu
VPM Programming
/**
* Checks the validity of the keyed value for revision .
*<p>
* Note : <b>used in NEW revisioning mode</b>
* @param iObj
* object from which we want to create a new version
* @param iMaturity
* maturity of the object
* @param iPrevVer
* previous version number of the object
* @param iNewVer
* new version number
* @param iAction
* create or update operation
1-80
Menu
VPM Programming
* @return
* The method must return an Error with Ier=0 if the operation is
* accepted or error code if it is refused.
* In such a case, an error message is displayed in an error
* notification panel .
*/
static Error IsAValidNewVersion(const ObjID&
iObj ,
const char*
iMaturity,
const char*
iPrevVer ,
const char*
iNewVer ,
const RevVerAction iAction );
/**
* Checks the validity of the keyed value for revision.
*<p>
* Note : <b>used in NEW revisioning mode</b>
*
* @param iObj
* object from which we want to create a new revision
* @param iMaturity
* maturity of the object
* @param iPrevRev
* previous revision number of the object
* @param iNewRev
* new revision number
* @param iAction
* create or update operation
*
* @return
* The method must return an Error with Ier=0 if the operation is
* accepted or error code if it is refused.
* In such a case, an error message is displayed in an error
*
notification panel.
*/
static Error IsAValidNewRevision(const ObjID&
iObj ,
const char*
iMaturity,
const char*
iPrevRev ,
const char*
iNewRev ,
const RevVerAction iAction );
/**
* Checks the validity of the keyed value for revision duplication
* when versioning a part.
*<p>
* Note : <b>used in NEW revisioning mode when declarative
*
CATCDMA.VPM.VERSION.SELECTREVISION.INPUT is set to TRUE</b>
*
* @param iObj
* object from which we want to create a new revision
* @param iPrevRev
* previous revision number of the object
* @param iNewRev
* new revision number
*
* @return
* The method must return an Error with Ier=0 if the operation is
1-81
Menu
VPM Programming
/**
* Checks the validity of the keyed value for version or revision.
*<p>
* Note : <b>used in OLD revisioning mode </b>
* @param iObj
* object from witch we want to create a new version or revision
* @param iVersion
* version of the part
* @param iOldVerRev
* version or revision of iobj
* @param iNewVerRev
* version or revision keyed
*
* @return
* The method must return an Error with Ier=0 if the operation is
* accepted or error code if it is refused.
* In such a case, an error message is displayed in an error
* notification panel.
*/
static Error IsAValidRevisionVersion(const ObjID& iObj
,
const char iVersion[4] ,
const char iOldVerRev[4],
const char iNewVerRev[4]);
/**
* Called before creating new part version.
*<p>
* Note : <b>used in BOTH revisioning mode</b>
*
* @param iObj
* object from which we want to create a new version
* @param iNewPartNumber
* <tt>0</tt> same part number<BR>
* <tt>1</tt> new part number
*/
static Error AuthorizedNewVersion(const ObjID& iObj
const int iNewPartNumber);
/**
* Called before creating new representation revision.
*<p>
* Note : <b>used in BOTH revisioning mode</b>
*
* @param iObj
* object from which we want to create a new revision
*/
static Error AuthorizedNewRevision(const ObjID& iObj);
1-82
Menu
VPM Programming
1-83
Menu
VPM Programming
//-----------------------//
//----------------------/**
* Allows user to perform specific action before object creation.
*
* @param iCaenv
* Environment into which the object is going to be created
* @param iObject
* Object (type) to be created
*
* @return
* If the method return an error, the creation is canceled
* and an error message will be displayed in an error
* notification panel.
*/
static Error BeforeCreateUserAction(const char* const iCaenv, const char* const iObject);
//-----------------------//
//----------------------/**
* Allows user to perform specific action after write.
*
* @param iObj
* object created
*
* @return
* If the method return an error, a rollback will be performed
* and an error message will be displayed in an error
* notification panel.
*/
static Error AfterWriteUserAction(const ObjID& iObj);
//-----------------------//
//----------------------/**
* Allows user to perform specific action after commit.
*
* @param iObj
* object created
*
* @return
* If the method return an error, a rollback will be performed
* and an error message will be displayed in an error
* notification panel.
*/
static Error AfterCommitUserAction();
//-----------------------//
//-----------------------
1-84
Menu
VPM Programming
/**
* Allows user to perform specific action after rollback.
*/
static void AfterRollbackUserAction();
//--------------------//
//-------------------/**
* User exit called when user print result panel.
*
* @return
* an HTML color (for instance : #FFFFFF) <BR>
* returned char* will be deleted by VPM
*/
static char* GetBGColorForPrint(const char* iCatab,
const char* iAttribute,
const char* iValue);
/**
* Called when user select OK in New config-handler panel.
* Allows to format the config-handler Id.
*
* @param iObj
* object (product) associated to the config-handler.
* @param iCHUserId
* user config-handler Id
* @param oCHNewId
* updated (formatted) config-handler Id
*
* @return
* If the method return an error, the creation will not be performed
* and an error message will be displayed in an error
* notification panel.
*/
static Error FormatConfigHandlerId(const ObjID& iObj,
const char* iCHUserId,
char **oCHNewId);
/**
* Called when display option selection box.
* Allows to change options available.
*
* @param iUser
* user ID.
* @param iRole
* user role.
* @param iOrg
* user organization.
* @param iObj
* object (product) of current dictionary.
* @param ioNbOpt
* number of proposed/returned options.
* @param ioOptNameList
1-85
Menu
VPM Programming
static Error ConfigHandlerControl(const char *iUser, const char *iRole, const char *iOrg,
const ObjID& iProduct,
const char* iCHName,
const CHAction iAction);
};
#endif
1-86
Menu
VPM Programming
CATVpmAFUsrMethod.h
libVX0AFUSR.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1997
//========================================================================
//
// CATVpmAFUsrMethod:
// Contains all the user exits related to ActionFlow
//
//========================================================================
// Usage Notes:
//
//========================================================================
// Sep. 97 Creation
//========================================================================
#ifndef CATVpmAFUsrMethod_h
#define CATVpmAFUsrMethod_h
#include CATDMUsrMethod.h
//========================================================================
// Type definitions
//========================================================================
//
// Structure representing an action
//
typedef struct
{
char*
identifier;
char*
secondid;
char*
type;
char*
owner;
char*
priority;
char*
status;
char*
product;
} Action;
1-87
Menu
VPM Programming
//========================================================================
// User Methods
//========================================================================
/**
* This class regroups the user exits for Action Flow.
* These user exits are static methods called by the Action Flow component,
* and which content can be modified by the customer to suit their specific
* needs.
*/
class CATVpmAFUsrMethod
{
public :
//---------------------------------------------------------------// Static data members
//---------------------------------------------------------------static Action _CurrentAction;
static ObjID _CurrentActionProduct; // Added VPM1.3
//---------------------------------------------------------------// Status Graph Customization
//---------------------------------------------------------------/**
* <b>Status Graph customization :</b>
* <br>Executes a user command related to a Status Graph transition.
* <p>
* @param iCommandName
* command name as defined in the Status Graph
* @param iNbParam
* number of command parameters
* @param iParamList
* command parameters passed as a <tt>iNbParam</tt> sized array of strings
* @return error object
*/
static Error ExecuteUsrCommand (const char * iCommandName,
const int & iNbParam,
char
** iParamList);
1-88
Menu
VPM Programming
/**
* <b>Status Graph customization :</b>
* <br>Retrieves the person identifier relating to a :Notify generic command,
* <br>using the :EXT parameter - i.e. the recipient of the notification.
* <p>
* @param iOperationName
* operation name as defined in the Status Graph
* @param oPersonId
* person identifier of the notification recipient
* @return error object
*/
static Error GetNewUsrPersonId (const char * iOperationName,
char
** oPersonId);
/**
* <b>Status Graph customization :</b>
* <br>Retrieves the message relating to a :Notify generic command.
* <p>
* @param iOperationName
* operation name as defined in the Status Graph
* @param oMessageTitle
* title (subject) of the message
* @param oMessageText
* full message text
* @return error object
*/
static Error GetUsrMessageText (const char * iOperationName,
char
** oMessageTitle,
char
** oMessageText);
/**
* <b>Status Graph customization :</b>
* <br>Checks a user condition associated to a status change transition :
* <br>if an error is returned, (i.e. Ier != 0), the condition is false,
* <br>otherwise it is true and the operation which it applies to is executed.
* <p>
* @param iConditionName
* condition name as defined in the Status Graph
* @param iOperationName
* operation name as defined in the Status Graph, which the condition applies to
* @return error object
*/
static Error CheckUsrCondition (const char * iConditionName,
const char * iOperationName);
1-89
Menu
VPM Programming
// ---------------------------------------------------------------/**
* <b>Action Property Editor customization :</b>
* <br>Checks access to an external file when trying to associate it to the action
* <br>(by reference) : if an error is returned (i.e. Ier != 0), the file is
* <br>not accessible and therefore, the file is not associated while
* <br>the error message is displayed.
* <br>Also retrieves an updated pathname for this file where accessible.
* <p>
* @param iCurrentFullFileName
* full pathname of the selected file
* @param oNewFullFileName
* full pathname of the accessible file (if NULL, the input name is used)
* @return error object
*/
static Error CheckUsrLibraryAccess (const char * iCurrentFullFileName,
char
** oNewFullFileName);
/**
* <b>Action Property Editor customization :</b>
* <br>Retrieves action secondary id when creating a new action in
* <br>secondary id mode.
* <br>NOTE : this user exit is not called any more and has just been
* <br>maintained in this header for compatibility reasons (see
* <br>ModifySecondaryId method).
* <p>
* @param oSecondId
* action secondary id
* @param oModifiable
* indicates if the action name (i.e. secondary id) can be edited from
* within the Action Property Editor window :
* Y : yes, the action name can be edited
* otherwise : the action name cannot be modified
* @return error object
*/
static Error GetUsrSecondaryId (char ** oSecondId,
char & oModifiable);
1-90
Menu
VPM Programming
/**
* <b>Action Property Editor customization :</b>
* <br>Retrieves action secondary id when user modifies action type or id in
* <br>secondary id mode.
* <p>
* @param iTypePrefix
* action type prefix
* @param iTypeName
* action type name
* @param iCurrentId
* action current secondary id (since last modified)
* @param iClashMode
* = Y if save attempt has been made and resulted in a clash due to an existing action with the same
id
* @param ioModifiable
* indicates if the action name (i.e. secondary id) can be edited from
* within the Action Property Editor window :
* Y : yes, the action name can be edited
* otherwise : the action name cannot be modified
* @param oNewId
* action secondary id
* @return error object
*/
iTypePrefix,
static Error ModifySecondaryId (const char*
const char*
iTypeName,
const char*
iCurrentId,
char
iClashMode,
char&
ioModifiable,
char**
oNewId);
};
#endif
1-91
Menu
VPM Programming
CATVpmPEUsrMethod.h
libVX0PEUSR.a
// COPYRIGHT DASSAULT SYSTEMES 1997
//=============================================================================
/**
* CATVpmPEUsrMethod.h:
* <b>People & Security</b> user exit interface.
**/
//=============================================================================
/**
* <u>Usage Notes:</u>
* Overwrite your own CATVpmPEUsrMethod using code/sample files;
* Then compile and link using code/command/mkVX0PEUSR.sh script shell.
**/
//=============================================================================
#ifndef CATVpmPEUsrMethod_h
#define CATVpmPEUsrMethod_h
// ============================================================================ //
// defines.
// ============================================================================ //
// --> The following defines determine basic test conditions for the application,
// CATVpmPasswdPan
// --------------#define MIN_USERID_LENGTH 2
#define MAX_USERID_LENGTH 8
#define MIN_PASSWD_LENGTH 4
#define MAX_PASSWD_LENGTH 8
// ============================================================================ //
// User Methods
// ============================================================================ //
class CATVpmPEUsrMethod
{
public :
/**
* LoginVpmSession ( person, org, role_name, role_org )
* Called at the end login time, when the user succeeded in login.
* Returns 0 when ok.
**/
static int LoginVpmSession ( const char* iPersonId,
const char* iOrgId,
const char* iRoleName,
const char* iRoleOrgId ) ;
/**
* EndVpmSession ()
* Called at the end of interactive applications
* No return value.
**/
static void EndVpmSession () ;
1-92
Menu
VPM Programming
/**
* UpdatePasswordPermitted ()
* Determines that the user exit to change the password can be called
* and is functional.
*
* Returns the following values:
* 0 = Update of password is NOT permitted.
* 1 = Update of password is permitted, but original password is NOT
*
required.
* 2 = Update of password is permitted, AND original password IS
*
required.
**/
static int ChangePasswordEnabled() ;
/**
* ChangePassword ()
* Modifies the password of customer specific VPM components.
*
* Returns the following values.
* -1 = Original password is incorrect.
* 0 = General failure of password change.
* 1 = Password modification successful.
**/
static int ChangePassword ( const char* iPersonId,
const char* iCurrentPasswd,
const char* iNewPasswd ) ;
/**
* ValidateUserId( char *iUserId )
* ValidatePassword( char *iPassword )
* Level of validation is implementation specific. Only basic checking is
* managed here.
*
* Return values are as follows:
* 1 = Validated OK.
* 0 = General Failure.
* -1 = Too short.
* -2 = Too long.
* -3 = Combination of alpha and numeric characters required.
* -4 = Password and user id cannot be the same.
**/
static int ValidateUserId ( const char *iUserId ) ;
static int ValidatePassword ( const char *iPassword ) ;
};
#endif
1-93
Menu
VPM Programming
CATVpmSCUsrManager.h
libVX0PEMNG.a
// COPYRIGHT DASSAULT SYSTEMES 1999
//========================================================================
//
// <b>CATVpmSCUsrManager</b> :
// VPM Security Manager customer class.
//
//========================================================================
// Usage Notes:
// This class provides :
// - information on current VPM user (ID, role) ;
// - access check methods on privileges and data owner.
//
// Any program or library including this header should be linked with module
// VX0PEMNG
//========================================================================
// Nov. 99 Creation
JIC
//========================================================================
#ifndef _CATVpmSCUsrManager_h_
#define _CATVpmSCUsrManager_h_
class CATVpmSCUsrManager
{
public:
/**
* ---------------------------------------------------------------------* <u>GetLoginUserId</u>()
* Get the ID of the VPM user currently logged in.
*
* @return
* ID of the VPM user (NULL if not found).
* Memory disallocation is in charge of the calling method.
* ---------------------------------------------------------------------**/
static const char* GetLoginUserId();
/**
* ---------------------------------------------------------------------* <u>GetLoginRoleName</u>()
* Get the name of the VPM role used by the current user to log in.
*
* @return
* Name of the VPM role (NULL if not found).
1-94
Menu
VPM Programming
1-95
Menu
VPM Programming
* @param iOrganization
* User and organization owners.
*
* @return
* >0 if access is granted.
* ---------------------------------------------------------------------**/
static int CheckDataAccess(const char* const iApplication ,
const char* const iFunction ,
const char* const iCommand ,
const char* const iUser
,
const char* const iOrganization);
protected:
private:
CATVpmSCUsrManager();
~CATVpmSCUsrManager();
};
#endif
1-96
Menu
VPM Programming
CATVpmPEUsrManager
libVX0PEMNG.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1999
//
=========================================================================
====
//
// <b>CATVpmPEUsrManager</b> :
// VPM People Manager customer class.
//
//
=========================================================================
====
// Usage Notes:
// This class provides information on VPM users.
//
// Any program or library including this header should be linked with module
// VX0PEMNG
//
=========================================================================
====
// Nov. 99 Creation
JIC
//
=========================================================================
====
#ifndef _CATVpmPEUsrManager_h_
#define _CATVpmPEUsrManager_h_
1-97
Menu
VPM Programming
class CATVpmPEUsrManager
{
public:
/**
* ---------------------------------------------------------------------* <u>GetUserEmail</u>()
* Get the e-mail address of a VPM user.
*
* @param iUserId
* ID of the VPM user.
*
* @return
* E-mail address of the VPM user, if it exists (NULL if not found).
* Memory disallocation is in charge of the calling method.
* ---------------------------------------------------------------------**/
static const char* GetUserEmail(const char* const iUserId);
/**
* ---------------------------------------------------------------------* <u>GetUserOrganizationId</u>()
* Get the organization ID a VPM user.
*
* @param iUserId
* ID of the VPM user.
*
* @return
* ID of the organization the user belongs to (NULL if not found).
* Memory disallocation is in charge of the calling method.
* ---------------------------------------------------------------------**/
static const char* GetUserOrganizationId(const char* const iUserId);
protected:
private:
CATVpmPEUsrManager();
~CATVpmPEUsrManager();
};
#endif
1-98
Menu
VPM Programming
CATVpmSCUsrLogin.h
libVX0PEMNG.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 2000
//=======================================================================//
// <b>CATVpmSCUsrLogin</b> :
// VPM Security Login customer class.
//
//======================================================================//
Usage Notes:
// This class provides login services for the VPM application.
//
// Any program or library including this header should be linked with module
// VX0PEMNG
//======================================================================//
Apr. 00 Creation
JIC
//=======================================================================//
#ifndef _CATVpmSCUsrLogin_h_
#define _CATVpmSCUsrLogin_h_
class CATVpmSCUsrLogin
{
public:
/**
* <u>Login</u>()
* All-in-one login method.
*
* @param iUserId
* ID of the VPM user.
* @param iPassword
* User password ; ignored when not in server authentication mode.
* @param iRoleName
* Role name to log on with.
* @param iRoleOrganizationId
* ID of the organization to which belongs the role.
*
* @return
* 0 when successful, error code otherwise (see file :
* <i>CATVpmLoginError.h</i>).
**/
static int Login(const char* const iUserId
,
const char* const iPassword
,
const char* const iRoleName
,
const char* const iRoleOrganizationId);
1-99
Menu
VPM Programming
protected:
private:
CATVpmSCUsrLogin();
~CATVpmSCUsrLogin();
};
#endif
1-100
Menu
VPM Programming
CATCfgInterfaces.h
libLV012MET.a
#ifndef CATCfgInterfaces_h
#define CATCfgInterfaces_h
#include CATDMUsrMethod.h
#include <time.h>
#include CATVPMExpandDec.h
class CATVPMVolume;
class CATCfgInterfaces {
public:
// Get database id of a part identified by PART_NUMBER and PART_VERSION
// Input
// ----// iCaenv :
Part environment
// iPartNumberAttrName : Name of the attribute containing the part number
//
(S_PART_NUMBER with a default installation)
// iPartNumber :
Part number
// iPartVersion :
Part version
//
// Output
// -----// oDbId : database id of the part
// Error.Ier:
//
0 : OK
//
-1 : No part with this part number and part version
//
-2 : more than one part with this part number and part_version
static Error GetDbID(const char *iCaenv, const char *iPartNumberAttrName, const char
*iPartNumber, const char *iPartVersion, ObjID &oDbId);
// Get the number of config handler for a part
static Error GetCfgHandler(const ObjID &iPartID, int &oNbCfgHnd);
// Get a config handler by its number (from 1 to oNbCfgHandler)
static Error GetCfgHandler(const ObjID &iPartID, const int &iCfgHndIndex, char oCfgHndId[40],
char oCfgHndDesc[255]);
// Expand a tree into a file (only parts with model are printed)
static Error Expand (const ObjID &iPartID, const char *iCfgHandler, const char *iFileName,
const CATVPMSaveMode SaveSessionMode = Text);
// Expand a tree into a step file for batch export
static Error ExpandSTEP (const ObjID &iPartID, const char *iFileName,
const CATUnicodeString &ExportMode,
const CATUnicodeString &ActionName );
1-101
Menu
VPM Programming
// Expand a tree into a file (only parts with model are printed)
// filter result by a given bounding box
static Error ExpandWithCSB (
const ObjID &iPartID,
const char *iCfgHandler,
const char *iFileName,
const CATVPMSaveMode SaveSessionMode,
CATVPMVolume & iCSBFilter);
// Expand a tree into a step file for batch export
// filter result by a given bounding box
static Error ExpandSTEPWithCSB (const ObjID &iPartID,
const char *iFileName,
const CATUnicodeString &ExportMode,
const CATUnicodeString &ActionName,
CATVPMVolume & iCSBFilter);
//
// --- Set a part configurable
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Allowed effectivity types:
// iRange(integer):
=1 allowed ; =0 not allowed
// iDate(integer):
=1 allowed ; =0 not allowed
// iOption(integer):
=1 allowed ; =0 not allowed
// iModification(integer): =1 allowed ; =0 not allowed
//
// Error: return-code for error management
//
static Error SetConfigurable(const char *iEnv, double iCoid, double iCompid,
int iRange, int iDate, int iOption, int iModification);
1-102
Menu
VPM Programming
//
// --- Unset a part configurable
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Error: return-code for error management
//
static Error UnsetConfigurable(const char *iEnv, double iCoid, double iCompid);
//
// --- Create Modification effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name of effectivity
//
// Error: return-code for error management
//
static Error CreateModifEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification);
//
// --- Create Current-date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Error: return-code for error management
//
static Error CreateCurDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification);
1-103
Menu
VPM Programming
//
// --- Create Date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iBegDate(time_t): beginning date of effectivity
// iEndDate(time_t): ending date of effectivity
//
0 -> infinity
//
// Error: return-code for error management
//
static Error CreateDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, time_t iBegDate, time_t iEndDate=0);
//
// --- Create Date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iBegDate(string): beginning date of effectivity (format: YYYY-MM-DD)
// iEndDate(string): ending date of effectivity (format: YYYY-MM-DD)
//
NULL -> infinity
//
// Error: return-code for error management
//
static Error CreateDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, const char *iBegDate, const char *iEndDate=NULL);
1-104
Menu
VPM Programming
//
// --- Create Range effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iBotRange(integer): bottom range of effectivity
// iTopRange(integer): top range of effectivity
//
// Error: return-code for error management
//
static Error CreateRangeEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, unsigned int iBotRange, unsigned int iTopRange);
//
// --- Create Option effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iOption(string): option name of effectivity
//
// Error: return-code for error management
//
static Error CreateOptEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, const char *iOptionName);
1-105
Menu
VPM Programming
//
// --- Create complex-option effectivity on a link (options combined with AND operator)
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iNbOpt(integer): number of options in iOptList
// iOptList(string): list of options for effectivity
//
// Error: return-code for error management
//
static Error CreateOptEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, int iNbOpt, const char **iOptList);
//
// --- Create Option-date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iOption(string): option name of effectivity
// iBegDate(time_t): beginning date of effectivity
// iEndDate(time_t): ending date of effectivity
//
0 -> infinity
//
// Error: return-code for error management
//
static Error CreateOptDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, const char *iOptionName, time_t iBegDate, time_t iEndDate=NULL);
1-106
Menu
VPM Programming
//
// --- Create Option-date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iOption(string): option name of effectivity
// iBegDate(string): beginning date of effectivity (format: YYYY-MM-DD)
// iEndDate(string): ending date of effectivity (format: YYYY-MM-DD)
//
NULL -> infinity
//
// Error: return-code for error management
//
static Error CreateOptDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, const char *iOptionName, const char *iBegDate, const char *iEndDate=NULL);
//
// --- Create complex-option-date effectivity on a link (options combined with AND operator)
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iNbOpt(integer): number of options in iOptList
// iOptList(string): option list for effectivity
// iBegDate(time_t): beginning date of effectivity
// iEndDate(time_t): ending date of effectivity
//
0 -> infinity
//
// Error: return-code for error management
//
static Error CreateOptDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, int iNbOpt, const char **iOptList, time_t iBegDate, time_t iEndDate=0);
1-107
Menu
VPM Programming
//
// --- Create complex-option-date effectivity on a link (combined with AND operator)
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iNbOpt(integer): number of options in iOptList
// iOptList(string): option list for effectivity
// iBegDate(string): beginning date of effectivity (format: YYYY-MM-DD)
// iEndDate(string): ending date of effectivity (format: YYYY-MM-DD)
//
NULL -> infinity
//
// Error: return-code for error management
//
static Error CreateOptDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, int iNbOpt, const char **iOptList, const char *iBegDate, const char
*iEndDate=NULL);
//
// --- Create Option-range effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iOption(string): option name of effectivity
// iBotRange(integer): bottom range of effectivity
// iTopRange(integer): top range of effectivity
//
// Error: return-code for error management
//
static Error CreateOptRangeEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, const char *iOptionName, unsigned int iBotRange, unsigned int iTopRange);
1-108
Menu
VPM Programming
//
// --- Create complex-option-range effectivity on a link (options combined with AND operator)
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// iModification: modification name for history of effectivity
//
// Effectivity parameters:
// iNbOpt(integer): number of options in iOptList
// iOptList(string): option list for effectivity
// iBotRange(integer): bottom range of effectivity
// iTopRange(integer): top range of effectivity
//
// Error: return-code for error management
//
static Error CreateOptRangeEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iModification, int iNbOpt, const char **iOptList, unsigned int iBotRange, unsigned int iTopRange
);
//
// --- Delete option effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iOption(string): option name of effectivity
//
// Error: return-code for error management
//
static Error DeleteOptEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iOptionName);
1-109
Menu
VPM Programming
//
// --- Delete option-date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iOption(string): option name of effectivity
// iBegDate(time_t): beginning date of effectivity
// iEndDate(time_t): ending date of effectivity
//
0 -> infinity
//
// Error: return-code for error management
//
static Error DeleteOptDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iOptionName, time_t iBegDate, time_t iEndDate=0);
//
// --- Delete option-date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iOption(string): option name of effectivity
// iBegDate(tring): beginning date of effectivity
// iEndDate(string): ending date of effectivity
//
NULL -> infinity
//
// Error: return-code for error management
//
static Error DeleteOptDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iOptionName, const char *iBegDate, const char *iEndDate=NULL);
1-110
Menu
VPM Programming
//
// --- Delete option-range effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iOption(string): option name of effectivity
// iBotRange(integer): bottom range of effectivity
// iTopRange(integer): top range of effectivity
//
// Error: return-code for error management
//
static Error DeleteOptRangeEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iOptionName, unsigned int iBotRange, unsigned int iTopRange);
//
// --- Delete date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iBegDate(time_t): beginning date of effectivity
// iEndDate(time_t): ending date of effectivity
//
0 -> infinity
//
// Error: return-code for error management
//
static Error DeleteDateEffectivity(const char *iEnv, double iCoid, double iCompid, time_t iBegDate,
time_t iEndDate=0);
1-111
Menu
VPM Programming
//
// --- Delete date effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iBegDate(string): beginning date of effectivity
// iEndDate(string): ending date of effectivity
//
NULL -> infinity
//
// Error: return-code for error management
//
static Error DeleteDateEffectivity(const char *iEnv, double iCoid, double iCompid, const char
*iBegDate, const char *iEndDate=NULL);
//
// --- Delete range effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iBotRange(integer): bottom range of effectivity
// iTopRange(integer): top range of effectivity
//
// Error: return-code for error management
//
static Error DeleteRangeEffectivity(const char *iEnv, double iCoid, double iCompid, unsigned int
iBotRange, unsigned int iTopRange);
1-112
Menu
VPM Programming
//
// --- Replace link with other one for Current-date effectivity
//
// Source link identification:
// iEnv1(string): environment
// iCoid1(double): coid of the source link
// iCompid1(double): compid of the source link
//
// Destination link identification:
// iEnv2(string): environment
// iCoid2(double): coid of the destination link
// iCompid2(double): compid of the destination link
//
// iModification: modification name for history
//
// Error: return-code for error management
//
static Error CurDateReplace(const char *iEnv1, double iCoid1, double iCompid1,
const char *iEnv2, double iCoid2, double iCompid2,
const char *iModification);
//
// --- Create an option dictionary on a configurable product
// --- If iCoid and iCompid are zero then a corporate dictionary is created
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Error: return-code for error management
//
static Error CreateDictionary(const char *iEnv, double iCoid, double iCompid);
//
// --- Delete an option dictionary on a product
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Error: return-code for error management
//
static Error DeleteDictionary(const char *iEnv, double iCoid, double iCompid);
1-113
Menu
VPM Programming
//
// --- Add a category to the dictionary associated to the configurable product
// --- If iCoid and iCompid are zero then the category is added to the corporate dictionary
//
// Dictionary identification (the part to which the dictionary is attached):
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Category parameters:
// iName(string):
category name
// iDesc(string):
description of the category
// iMutuallyExcl(int): is option selection within the category mutually exclusive
// iMandatory(int): is option selection within the category mandatory
//
// Error: return-code for error management
//
50074 = Category with this name already exists
//
static Error AddCategoryToDictionary(const char *iEnv, double iCoid, double iCompid,
const char *iName, const char *iDesc,
const int iMutuallyExcl, const int iMandatory);
//
// --- Add an option to the dictionary associated to the configurable product
// --- If iCoid and iCompid are zero then the option is added to the corporate dictionary
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Option parameters:
// iName(string):
option name
// iCategory(string): category to which the option belongs
// iDesc(string):
description of the option
// iDefaultOption:
is this the default option in the category
// iDefaultReplaceable: can the default be changed by the user
//
// Error: return-code for error management
//
50073 = Option with this name already exists in the category
//
static Error AddOptionToDictionary(const char *iEnv, double iCoid, double iCompid,
const char *iName, const char *iCategory, const char *iDesc,
const int iDefaultOption=0, const int iDefaultReplaceable=1);
1-114
Menu
VPM Programming
//
// --- Remove an option from the dictionary associated to the configurable product
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Option parameters:
// iName(string): option name
//
// Error: return-code for error management
//
static Error RemoveOptionFromDictionary(const char *iEnv, double iCoid, double iCompid,
const char *iName);
//
// --- Add an if then rule or package rule to the dictionary associated to
// --- the configurable product
// --- If iCoid and iCompid are zero then the rule is added to the corporate dictionary
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Option parameters:
// iRuleId(string): the rule identifier
// iRuleString(string): the rule
// iRuleType(int):
=1, if then type
//
=2, package
// iDesc(string):
description of the rule
//
// Error: return-code for error management
//
50075 = Rule already exists in the dictionary
//
static Error AddRuleToDictionary(const char *iEnv, double iCoid, double iCompid,
const char* iRuleId, const char *iRuleString,
const int iRuleType, const char *iDesc);
1-115
Menu
VPM Programming
//
// --- Add a compatibility matrix (initially only a definition) to the dictionary associated to
// --- the configurable product
// --- If iCoid and iCompid are zero then the matrix is added to the corporate dictionary
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Option parameters:
// iName(string):
matrix name
// iDesc(string):
description of the matrix
// iNbCategories(int):
number of categories in definition
// iCategories(string array) : categories in definition (must already exist)
//
// Error: return-code for error management
//
50076 = Matrix already exists in the dictionary
//
50086 = Invalid category in matrix definition
//
static Error AddCompatibilityMatrixToDictionary(const char *iEnv, double iCoid, double iCompid,
const char* iName, const char* iDesc,
int iNbCategories, const char **iCategories);
//
// --- Add a compatibility rule to the matrix
// --- If iCoid and iCompid are zero then the rule is added to a matrix in the corporate dictionary
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Option parameters:
// iMatrix(string): matrix to which rule is to be added
// iRuleId(string): the rule identifier
// iRuleString(string): rule to be added (must be consistent with matrix definition)
//
// Error: return-code for error management
//
50075 = Rule already exists in the matrix
//
50087 = The matrix has not been defined
//
static Error AddCompatibilityRuleToMatrix(const char *iEnv, double iCoid, double iCompid,
const char* iMatrix,
const char* iRuleId, const char* iRuleString);
1-116
Menu
VPM Programming
//
// --- Get the number of options in the dictionary associated to the configurable product
//
// Product identification:
// iEnv(string): environment
// iCoid(double): coid of the product
// iCompid(double): compid of the product
//
// Result:
// oNbOpt(integer): number of options in the dictionary
//
// Error: return-code for error management
//
static Error GetOptFromDictionary(const char *iEnv, double iCoid, double iCompid, int &oNbOpt);
//
// --- Get one option from the dictionary associated to the configurable product
//
// Product identification:
// iEnv(string): environment
// iCoid(double): coid of the product
// iCompid(double): compid of the product
//
// Option parameters:
// iOptIndex(integer): index of the option to get parameters (from 1 to NbOpt)
// oName(string):
option name
// oCateg(string): category of the option
// oDesc(string):
description of the option
// oUsed(integer): flag to know if the option is used in the assembly
//
(=1 used ; =0 not used)
//
// Error: return-code for error management
//
static Error GetOptFromDictionary(const char *iEnv, double iCoid, double iCompid, int iOptIndex,
char oName[40], char oCateg[40], char oDesc[255], int &oUsed);
1-117
Menu
VPM Programming
//
// --- Create a config-handler on a configurable product
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Config-handler parameters:
// iCHId(string): config-handler Id
// iCHDesc(string): description of the config-handler
// iBotRange(integer): bottom range of the config-handler (=0 No range)
// iTopRange(integer): top range of the config-handler (=0 Infinity)
// iCurDateFlag(integer): flag to set(=1) or unset(=0) current date
// iBegDate(time_t): beginning date of the config-handler (=0 No date)
// iEndDate(time_t): ending date of the config-handler (=0 Infinity)
// iNbOpt(integer): number of options in iOptList (=0 No option)
// iOptList(list of string): selected options of the config-handler
// iNbModif(integer): number of modifications in iModifList (=0 No modif)
// iModifList(list of string): selected modifications of the config-handler
//
// Error: return-code for error management
//
static Error CreateConfigHandler(const char *iEnv, double iCoid, double iCompid,
const char *iCHId, const char *iCHDesc,
unsigned int iBotRange, unsigned int iTopRange,
const int iCurDateFlag, time_t iBegDate, time_t iEndDate,
const int iNbOpt, char **iOptList,
const int iNbModif, char **iModifList);
1-118
Menu
VPM Programming
//
// --- Create a config-handler on a configurable product
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Config-handler parameters:
// iCHId(string): config-handler Id
// iCHDesc(string): description of the config-handler
// iBotRange(integer): bottom range of the config-handler (=0 No range)
// iTopRange(integer): top range of the config-handler (=0 Infinity)
// iCurDateFlag(integer): flag to set(=1) or unset(=0) current date
// iBegDate(string): beginning date of the config-handler (format: YYYY-MM-DD)
// iEndDate(string): ending date of the config-handler (format: YYYY-MM-DD)
// iNbOpt(integer): number of options in iOptList (=0 No option)
// iOptList(list of string): selected options of the config-handler
// iNbModif(integer): number of modifications in iModifList (=0 No modif)
// iModifList(list of string): selected modifications of the config-handler
//
// Error: return-code for error management
//
static Error CreateConfigHandler(const char *iEnv, double iCoid, double iCompid,
const char *iCHId, const char *iCHDesc,
unsigned int iBotRange, unsigned int iTopRange,
const int iCurDateFlag, const char *iBegDate, const char *iEndDate,
const int iNbOpt, char **iOptList,
const int iNbModif, char **iModifList);
1-119
Menu
VPM Programming
//
// --- Add an option to an existing config-handler
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Config-handler parameters:
// iOptName(string): option name to add in the config-handler
//
// Error: return-code for error management
//
static Error AddOptionToConfigHandler(const char *iEnv, double iCoid, double iCompid,
const char *iCHId, const char *iOptName);
//
// --- Remove an option from a config-handler
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Config-handler parameters:
// iOptName(string): option name to remove
//
// Error: return-code for error management
//
static Error RemoveOptionFromConfigHandler(const char *iEnv, double iCoid, double iCompid,
const char *iCHId, const char *iOptName);
1-120
Menu
VPM Programming
//
// --- Make a config-handler child of another existing config-handler
//
// Identification of the father config-handler:
// iFatherEnv(string): environment of the associated part
// iFatherCoid(double): coid of the associated part
// iFatherCompid(double): compid of the associated part
// iFatherCHId(string): config-handler Id
//
// Identification of the child config-handler:
// iChildEnv(string): environment of the associated part
// iChildCoid(double): coid of the associated part
// iChildCompid(double): compid of the associated part
// iChildCHId(string): config-handler Id
//
// Error: return-code for error management
//
static Error AddChildToConfigHandler (const char *iFatherEnv, double iFatherCoid, double
iFatherCompid,
const char *iFatherCHId,
const char *iChildEnv, double iChildCoid, double iChildCompid,
const char *iChildCHId);
//
// --- Remove link between two existing config-handler
//
// Identification of the father config-handler:
// iFatherEnv(string): environment of the associated part
// iFatherCoid(double): coid of the associated part
// iFatherCompid(double): compid of the associated part
// iFatherCHId(string): config-handler Id
//
// Identification of the child config-handler:
// iChildEnv(string): environment of the associated part
// iChildCoid(double): coid of the associated part
// iChildCompid(double): compid of the associated part
// iChildCHId(string): config-handler Id
//
// Error: return-code for error management
//
static Error RemoveChildFromConfigHandler (const char *iFatherEnv, double iFatherCoid, double
iFatherCompid,
const char *iFatherCHId,
const char *iChildEnv, double iChildCoid, double iChildCompid,
const char *iChildCHId);
1-121
Menu
VPM Programming
//
// --- Make a config-handler brother of another existing config-handler
//
// Part identification:
// iEnv(string): environment of the associated part
// iCoid(double): coid of the associated part
// iCompid(double): compid of the associated part
//
// Identification of the father config-handler:
// iFatherCHId(string): config-handler Id
//
// Identification of the brother config-handler:
// iBrotherCHId(string): config-handler Id
//
// Error: return-code for error management
//
static Error AddBrotherToConfigHandler (const char *iEnv, double iCoid, double iCompid,
const char *iFatherCHId, const char *iBrotherCHId);
//
// --- Delete a config-handler
//
// Product identification:
// iEnv(string): environment
// iCoid(double): coid of the product
// iCompid(double): compid of the product
//
// Identification of the config-handler:
// iCHId(string): config-handler Id
//
// Error: return-code for error management
//
static Error DeleteConfigHandler(const char *iEnv, double iCoid, double iCompid,
const char *iCHId);
1-122
Menu
VPM Programming
//
// --- Set Action-Flow mode to modify assembly structure
//
// Part identification:
// iEnv(string): environment
// iCoid(double): coid of the part
// iCompid(double): compid of the part
//
// Action-Flow mode:
// iAFMode(integer): =1 Need an open Action to modify assembly structure
//
=0 No Action needed
//
// Error: return-code for error management
//
static Error SetAFMode(const char *iEnv, double iCoid, double iCompid, int iAFMode);
//
// --- Get the number of effectivities on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Result:
// oNbEff(integer): number of effectivities on the link
//
// Error: return-code for error management
//
static Error GetEffectivityForLink(const char *iEnv, double iCoid, double iCompid, int &oNbEff);
//
// --- Get one effectivity for a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
// iEffIndex(integer): index of the effectivity to get parameters (from 1 to NbEff)
// oEff(EffParam): parameters of the effectivity
//
// Error: return-code for error management
//
static Error GetEffectivityForLink(const char *iEnv, double iCoid, double iCompid, int iEffIndex,
EffParam &oEff);
1-123
Menu
VPM Programming
//
// --- Delete one effectivity on a link
//
// Link identification:
// iEnv(string): environment
// iCoid(double): coid of the link
// iCompid(double): compid of the link
//
// Effectivity parameters:
//
iEffIndex(integer): index of the effectivity to delete (from 1 to NbEff using
GetEffectivityForLink)
//
// Error: return-code for error management
//
static Error DeleteEffectivity(const char *iEnv, double iCoid, double iCompid, int iEffIndex);
//
// --- Update a product dictionary with effectivities of its associated assembly
//
// Product identification:
// iEnv(string): environment
// iCoid(double): coid of the product
// iCompid(double): compid of the product
//
// Options:
// iStopAtDico(integer): if =1 (default) scanning each branch until dictionary encountered
//
else until leaves.
//
if =0 scanning until leaves even if dictionary encountered
//
(so the options of child dictionaries are duplicated in
//
father/current dictionary).
//
// Error: return-code for error management
//
static Error UpdateDictionaryFromAssembly(const char *iEnv, double iCoid, double iCompid,
const int iStopAtDico=1);
};
#endif
1-124
Menu
VPM Programming
CATVPMFilter.h
libLV0PSBAS.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1998
//========================================================================
//
// CATVPMFilter:
//
//
//========================================================================
// Usage Notes:
//
//========================================================================
// 98 Creation
Pierre-yves BISSON
//========================================================================
#ifndef CATVPMFilter_h
#define CATVPMFilter_h
#include CATListOfCATVPMNode.h
class SdaiEntityInstance;
class CATVPMFilter
{
public:
virtual void StartExpand(SdaiEntityInstance *iPart) const = 0;
virtual void EndExpand() const = 0;
virtual int Filter(CATVPMNode *iFather, const CATListOfCATVPMNode &iProposedNodes,
CATListOfCATVPMNode &oValid, CATListOfCATVPMNode &oNotValid) const = 0;
};
#endif
1-125
Menu
VPM Programming
CATVPMFilterManager.h
libLV0PSCFG.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1999
//========================================================================
//
// CATVPMFilterManager:
// Manage filters used during PSN expand
//
//========================================================================
// Usage Notes:
//
//========================================================================
// July 99 Creation
Marc MONTERGOUS
//========================================================================
#ifndef CATVPMFilterManager_H
#define CATVPMFilterManager_H
/**
* Manage filters used during PSN expand
* <BR>
* Usage Note:<BR>
* Add library LV0PSCFG as prereq for link
*/
class CATVPMFilterManager
{
public:
CATVPMFilterManager();
int GetNbFilter() const;
//***********************
//* Retrieve information
//***********************
const char *GetFiltername(const int iNum);
const char *GetFilterLibrary(const int iNum);
const char *GetFilterClass(const int iNum);
1-126
Menu
VPM Programming
//***********************
//* Add filter
//***********************
/**
* Adds a new filter. It will be executed after all filters already declared.
* @return
* <tt>1</tt> filter is added
* <tt>0</tt> filter already exists (not added)
*/
int AddFilter(const char *iName, const char *iLibrary, const char * iClassName);
/**
* Adds a new filter.
* @return
* <tt>1</tt> filter is added
* <tt>0</tt> filter already exists (not added)
*/
int InsertFilter(const int iNum,const char*iName, const char *iLibrary, const char *iClassName);
//***********************
//* Remove filter
//***********************
/**
* @return
* <tt>1</tt> filter is removed
* <tt>0</tt> filter does not exist (=> not removed)
* <tt>-1</tt> it is forbidden to remove this filter
*/
int RemoveFilter(const char *iName);
/**
* @return
* <tt>1</tt> filter is removed
* <tt>0</tt> filter does not exist (=> not removed)
* <tt>-1</tt> it is forbidden to remove this filter
*/
int RemoveFilter(const int iNum);
};
#endif
1-127
Menu
VPM Programming
CATVPMNode.h
libLV012MET.a
#ifndef CATVPMNode_h
#define CATVPMNode_h
#include CATListOfCATVPMNode.h
class SdaiEntityInstance;
class CATPSNNodeDatas;
class CATVPMBatchGraph;
class CATListPtrSdaiEntityInstance;
enum CATVPMChildrenOption
{
All,
Leaves,
AllParts,
PartLeaves
}
class CATVPMNode
{
friend class CATVPMBatchGraph;
public:
virtual CATVPMNode *GetRoot() = 0;
virtual void GetPath(CATLISTP(SdaiEntityInstance) &oPath) = 0;
virtual CATPSNNodeDatas *GetNodeDatas() const = 0;
virtual void SetNodeDatas(CATPSNNodeDatas *iData) = 0;
virtual int IsNodeDataValuated() const = 0;
virtual CATVPMNode *GetFather() const = 0;
virtual void GetChildren(CATListOfCATVPMNode &oChildren, CATVPMChildrenOption
iOption = All, int NbLevels = 1) const = 0;
// Lien pointant sur le noeud
virtual SdaiEntityInstance *Link() = 0;
// Piece sous jacente
virtual SdaiEntityInstance *Instance() = 0;
virtual void Select () = 0;
virtual void Deselect () = 0;
};
#endif
1-128
Menu
VPM Programming
CATLnkAPI.h
libVX0MMODL.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1999
//========================================================================
//
// CATLnkAPI:
// Contains all public methods related to MML
//
//========================================================================
// Usage Notes:
//
//========================================================================
// Nov. 99 Creation
//========================================================================
#ifndef CATLnkAPI_h
#define CATLnkAPI_h
#include CATUnicodeString.h
#include CATListOfCATUnicodeString.h
#define MML_BITMASK_SYNCHRO 1
#define MML_BITMASK_TYPE 2
#define MML_MODE_FULL
1
#define MML_MODE_DISPLAY 2
#define MML_MODE_SYNTHESE 3
1-129
Menu
VPM Programming
typedef struct
{
char Xcoid[17]; // Coid (hexadecimal notation)
char Xcompid[17]; // Compid (hexadecimal notation)
double coid;
// Coid (binary)
double compid;
// Compid (binary)
char caenv[9];
char catab[19];
} ObjID;
#endif
1-130
Menu
VPM Programming
/**
* Return MML links between two objects.
* <BR>
* @param iImpacted
* ObjID of the impacted object.
* @param iImpacting
* ObjID of the impacting model.
* @param oLinkTypes
* List of link types between those models.
* @param oLinkInfo
* List of informations flag related to the links.
* BIT b0, flag MML_BITMASK_SYNCHRO :
*
0 the link is not synchronised.
*
1 the link is synchronized.
* BIT b1, flag MML_BITMASK_TYPE (VPM1.2 and above only) :
*
0 the link is of type object-to-object ($EXT)
*
1 the link is of type element-to-element (MML_LINK)
* @param iMode
* Mode of the returned information, either : <BR>
* MML_MODE_FULL
get all e2e and m2m links individualy<BR>
* MML_MODE_DISPLAY get links the way they would be displayed in the
*
MML graph (MML_BITMASK_TYPE is then useless)<BR>
* MML_MODE_SYNTHESIS get only one synthetic link, only MML_BITMASK_SYNCHRO
*
conveys information (oLinkTypes is senseless)<BR>
* @return
* Error status.
*/
// !!!! Only mode MML_MODE_FULL works for the moment !!!
static int GetLinksBetween (const ObjID & iImpacted, const ObjID & iImpacting,
CATListOfCATUnicodeString & oLinkTypes, CATListOfInt & oLinkInfos, int iMode =
MML_MODE_FULL);
/**
* Send back the number of MML entities associated to the given object.
* <BR>
* This function is the one used in the internal VPM code to provide
* information about the number of entities.
* @param iInst
* Objects we want to know the number of entities of.
* @return
* Number of entities. Can be zero.
*/
static int GetEntityCount (const ObjID & iInst);
1-131
Menu
VPM Programming
/**
* This function deletes from the database all MML_LINK links related to the
* given Object (representing a model).<BR>
* This function is the one used in the internal VPM code to delete
* links belonging to a model on its deletion.
* <BR>
* @param iInst
* Object on which to delete links.
*/
static void DeleteLinks (const ObjID & iInst);
/**
* This function deletes from the database all MML_ENTITY entities related to the
* given Object (representing a model).<BR>
* This function is the one used in the internal VPM code to delete
* entities belonging to a model on its deletion.
* <BR>
* @param iInst
* Object on which to delete entities.
*/
static void DeleteEntities (const ObjID & iInst);
/**
* Checks if this model is pointed by other ones (if it impacts on
* other one). Checks both $EXT and MML_LINK.<BR>
* This function is the one used in the internal VPM code to check
* links on a model before deletion.
* <BR>
* @param iInst
* Object on which to check MML links.
* @return
* 1 if the model is pointed or zero if not.
*/
static int IsPointedModel (const ObjID & iInst);
1-132
Menu
VPM Programming
/**
* This function checks if this part contains models pointed by other ones.
* Checks both $EXT and MML_LINK.<BR>
* This function is the one used in the internal VPM code to check
* links on a part before deletion.
* <BR>
* @param iInst
* Object of the part on the models of which we want to check MML links.
* @param oNameList
* On succes (return 1), contains an array of CATUnicodeString, being the
* name of the pointed models. This array has to be deleted by the caller.
* It is used for display purpose only.
* @return
* 1 if this part contains pointed models or zero if not.
*/
static int IsPointedPart (const ObjID & iInst, CATUnicodeString & oNames);
/**
* Computes the list of all environments containing MML link tables.
* According to the parameter, sends back environments for $EXT or
* MML_LINK tables.<BR>
* This function is the one used in the internal VPM code.
* <BR>
* @param iRelationType
* either MML_LINK_EXT or MML_LINK_ENTITY or MML_LINK_BOTH
* @return
* the environment list
*/
static CATListOfCATUnicodeString ComputeRelationEnvironments (int iRelationType);
};
#endif
1-133
Menu
VPM Programming
CATVpmPubSubUsrAdmin.h
libPR0PUBSUB.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1999
//========================================================================
//
// <b>CATVpmPubSubUsrAdmin</b> :
// Publish/Subscribe administration customer class
//
//========================================================================
// Usage Notes :
// This class provides publish/subscribe adminstration tools for events, and
// should not be used in interactive programs.
// The manager provides connection open/close method, which have to be used
// accordingly by the caller. Modifications arent reported to database as long
// as the manager isnt asked to commit.
//
// Event naming :
// Custom event names must begin with the string Extern..
//========================================================================
// Nov. 99 Creation
JIC
//========================================================================
#ifndef _CATVpmPubSubUsrAdmin_h_
#define _CATVpmPubSubUsrAdmin_h_
class CATVpmPubSubUsrAdmin
{
public:
/**
* Note : All following method will return -1 if internal publish/subscribe
*
manager cannot be found.
**/
/**
* ---------------------------------------------------------------------* <u>OpenConnection</u>()
* Open a connection to the publish/subscribe database.
* All the other methods require an opened connection.
*
* Returns 0 if successful, 1 otherwise.
* ---------------------------------------------------------------------**/
static int OpenConnection();
1-134
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>CloseConnection</u>()
* Close the connection to the publish/subscribe database.
*
* Returns 0 if successful, 1 otherwise.
* ---------------------------------------------------------------------**/
static int CloseConnection();
/**
* ---------------------------------------------------------------------* <u>Commit</u>()
* Commit changes to the publish/subscribe database.
*
* Returns 0 if successful, 1 otherwise.
* ---------------------------------------------------------------------**/
static int Commit();
/**
* ---------------------------------------------------------------------* <u>Commit</u>()
* Rollback any changes made in the publish/subscribe database.
*
* Returns 0 if successful, 1 otherwise.
* ---------------------------------------------------------------------**/
static int Rollback();
/**
* ---------------------------------------------------------------------* <u>GetRootEvents</u>()
* Find root publish/subscribe events, e.g. events with no father.
*
* Returns size of output array.
* Memory desallocation is in charge of the calling method.
* ---------------------------------------------------------------------**/
static int GetRootEvents(char**& oEvents);
1-135
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>GetEvent</u>()
* Find a publish/subscribe event from its name.
*
* Returns 0 if event was found, 1 otherwise.
* ---------------------------------------------------------------------**/
static int GetEvent(const char* const iName);
/**
* ---------------------------------------------------------------------* <u>GetEventChildren</u>()
* Find the children events of a publish/subscribe event from its name.
*
* Returns size of output array.
* Memory desallocation is in charge of the calling method.
* ---------------------------------------------------------------------**/
static int GetEventChildren(const char* const iFatherName,
char**&
oEvents );
/**
* ---------------------------------------------------------------------* <u>CreateEvent</u>()
* Creates a new publish/subscribe event in the database.
*
* Returns 0 if successful, 1 otherwise.
* ---------------------------------------------------------------------**/
,
static int CreateEvent(const char* const iName
const char* const iFatherName);
/**
* ---------------------------------------------------------------------* <u>DeleteEvent</u>()
* Deletes an existing publish/subscribe event from the database.
* Note : all children events, and associated subscriptions and publica* tions are also deleted.
*
* Returns 0 if successful, 1 otherwise.
* ---------------------------------------------------------------------**/
static int DeleteEvent(const char* const iEventName);
protected:
1-136
Menu
VPM Programming
private:
CATVpmPubSubUsrAdmin();
~CATVpmPubSubUsrAdmin();
};
#endif
1-137
Menu
VPM Programming
CATVpmPubSubUsrManager.h
libPR0PUBSUB.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1999
//========================================================================
//
// <b>CATVpmPubSubUsrManager</b> :
// Publish/Subscribe management customer interface class
//
//========================================================================
// Usage Notes :
// This class provides publish/subscribe method for querying, subscribing to,
// and publishing events.
// It reads data from the database and caches it into memory as long as it is
// not asked to synchronize or write its contents into the database.
//
// Objects identifiers :
// Subscribers are referred to by their user name.
// Publishers are referred to by their internal identifiers ($COID, $COMPID,
// on 16 bytes) when BOM objects, and by their name when actions (16 bytes
// max.).
//========================================================================
// Nov. 99 Creation
JIC
//========================================================================
#ifndef _CATVpmPubSubUsrManager_h_
#define _CATVpmPubSubUsrManager_h_
// Publish/subscribe
#include CATVpmPSActionType.h
class CATVpmPubSubUsrManager
{
public:
/**
* Note : All following methods will return :
*
-1 if access to publish/subscribe is not authorized by security.
*
-2 if database connection is not opened.
*
-3 if internal publish/subscribe manager cannot be found.
*
-4 if any input argument is null.
*
-5 if the input event name doesnt refer to any existing event.
*
-6 if an internal error occured.
**/
1-138
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>Subscribe</u>()
*
* @param iSubscriberOID
* ID of the subscriber (e.g. user) requiring a subscription.
* @param iEvent
* Publish/subscribe event to subscribe to.
* @param iPublisherOID
* ID of the publisher (e.g. object) for which the event is subscribed
* to.
* @param iActionType
* @param iAction
* @param iActionData
* Type, contents and related data of the action to be executed when
* the event is raised.
* @param iSubscriberNickname
* Nickname of the subscribing user (e-mail address, for example).
* @param iPublisherNickname
* Nickname of the publisher object.
* @param oErrorMessage
* Internal error message when -6 is returned.
* Memory disallocation is in charge of the calling method.
*
* @return
* 0 if successful,
* -7 when subscriber is beyond users sphere of influence,
* non-zero otherwise.
* ---------------------------------------------------------------------**/
iSubscriberOID ,
static int Subscribe(const char* const
const char* const
iEvent
,
const char* const
iPublisherOID
,
const CATVpmPSActionType iActionType
,
const char* const
iAction
,
const char* const
iActionData
,
const char* const
iSubscriberNickname,
const char* const
iPublisherNickname ,
char*&
oErrorMessage
);
1-139
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>UnSubscribe</u>()
* Remove existing subscription(s).
* First method removes all existing subscriptions, regardless of asso* ciated action.
*
* @param iSubscriberOID
* ID of the subscriber (e.g. user) that made a subscription.
* @param iEvent
* Publish/subscribe event that was subscribed to.
* @param iPublisherOID
* ID of the publisher (e.g. object) for which the event was subscri* bed to.
* @param iActionType
* Type of the action associated to the subscription.
* @param iActionType
* Action associated to the subscription.
* @param oErrorMessage
* Internal error message when -6 is returned (null otherwise).
* Memory disallocation is in charge of the calling method.
*
* @return
* 0 if successful,
* -7 when subscriber is beyond users sphere of influence,
* -8 if subscription couldnt be found,
* non-zero otherwise.
* ---------------------------------------------------------------------**/
iSubscriberOID,
static int UnSubscribe(const char* const
const char* const
iEvent
,
const char* const
iPublisherOID ,
char*&
oErrorMessage );
iSubscriberOID,
static int UnSubscribe(const char* const
const char* const
iEvent
,
const char* const
iPublisherOID ,
const CATVpmPSActionType iActionType ,
const char* const
iAction
,
char*&
oErrorMessage );
1-140
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>IsSubscriber</u>()
* Checks if given subscriber has subscribed to a given event for.
*
* @param iSubscriberOID
* ID of the subscriber (e.g. user) that made a subscription.
* @param iEvent
* Publish/subscrib event that was subscribed to.
* @param iPublisherOID
* Publisher ID (object) on which iEvent was subscribed.
* @param oErrorMessage
* Internal error message when -6 is returned (null otherwise).
* Memory disallocation is in charge of the calling method.
*
* @return
* 1 if subscription exists, 0 or error code otherwise.
* ---------------------------------------------------------------------**/
static int IsSubscriber(const char* const iSubscriberOID,
const char* const iEvent
,
const char* const iPublisherOID ,
char*&
oErrorMessage );
/**
* ---------------------------------------------------------------------* <u>PublishedEvent</u>()
* Publish an event, e.g. raise all the subscriptions registered on that
* event for a given publisher object.
*
* @param iEvent
* Publish/subscribe event to be raised.
* @param iPublisherOID
* Publisher raising the event, e.g. ID of the object for which iEvent
* occurred.
* @param oErrorMessage
* Internal error message when -6 is returned (null otherwise).
* Memory disallocation is in charge of the calling method.
*
* @return
* 0 if successful, non-zero otherwise.
* ---------------------------------------------------------------------**/
,
static int PublishEvent(const char* const iEvent
const char* const iPublisherOID,
char*&
oErrorMessage);
1-141
Menu
VPM Programming
protected:
private:
/**
* ---------------------------------------------------------------------* <u>CATVpmPubSubUsrManager</u>()
* Default destructor - use forbidden by implementation.
* ---------------------------------------------------------------------**/
CATVpmPubSubUsrManager();
/**
* ---------------------------------------------------------------------* <u>~CATVpmPubSubUsrManager</u>()
* Destructor.
* ---------------------------------------------------------------------**/
~CATVpmPubSubUsrManager();
};
#endif
1-142
Menu
VPM Programming
CATDMUsrInstance.h
libLV003DBA.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1999
//========================================================================
//
// <b>CATDMUsrInstance</b> :
// VPM BOM instance customer interface class.
//
// This class provides customer with access to VPM data management functions.
// It can be used in customer-written code (user-exits, typically) in order to
// perform specific actions on database objects.
//
// Current features :
// - Retrieval of values
// - Maturity management (get/set object maturity, promote/demote).
//
//========================================================================
// Usage Notes:
//
// Object identification :
// Database objects are referred to through <b>ObjID</b> structure (see
// <i>CATDMUsrMethod.h</i>), containing database environment (owner) and table
// names as well as internal object identifiers ($COID, $COMPID attributes).
//
// Security management :
// Security checks are performed whenever required, as in standard VPM interac// tive functions.
//
// Data persistency :
// All persistent functions (e.g., the ones that perform modifications in the
// database), are automatically commited on success (otherwise the operation is
// rollbacked).
//
// Memory issues :
// All methods return an <b>Error</b> structure (see <i>CATDMUsrMethod.h</i>),
// containing the error code and messages when processing didnt end correctly,
// and the contents of which are to be freed by the caller when not empty.
// When method ends successfully, Error structure contains a zeroed error code
// and null message strings, so they need not be disallocated.
//
// Whenever memory has to be allocated for value return (pointers, typically),
// disallocation is also the responsability of the caller.
//
// Building & linking a custom library :
// Any module including this file should be linked with the LV003DBA library,
1-143
Menu
VPM Programming
// Database access
#include CATDMUsrMethod.h
class CATDMUsrInstance
{
public:
/**
* ---------------------------------------------------------------------* <u>CATDMUsrInstance</u>()
* Build an object instance from a given environment and table, with gi* ven identifier attributes.
*
* @param iCaenv
* Database environment.
* @param iCatab
* Database table.
* @param iCoid
* Object $COID identifier in hexadecimal format.
* @param iCompid
* Object $COMPID identifier in hexadecimal format.
* ---------------------------------------------------------------------**/
CATDMUsrInstance(const chariCaenv [ 9],
const char iCatab [19],
const char iCoid [17],
const char iCompid[17]);
1-144
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>CATDMUsrInstance</u>()
* Build an object instance from a given environment and table, with gi* ven identifier attributes.
*
* @param iCaenv
* Database environment.
* @param iCatab
* Database table.
* @param iCoid
* Object $COID identifier in decimal format.
* @param iCompid
* Object $COMPID identifier in decimal format.
* ---------------------------------------------------------------------**/
CATDMUsrInstance(const char iCaenv [ 9],
const char iCatab [19],
const double iCoid
,
const double iCompid );
/**
* ---------------------------------------------------------------------* <u>CATDMUsrInstance</u>()
* Build an instance object from another one.
*
* @param iInstance
* Object instance to build from.
* ---------------------------------------------------------------------**/
CATDMUsrInstance(const CATDMUsrInstance& iInstance);
/**
* ---------------------------------------------------------------------* <u>~CATDMUsrInstance</u>()
* Destructor.
* ---------------------------------------------------------------------**/
~CATDMUsrInstance();
1-145
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>operator=</u>()
* Assignment operator.
* Assign an instance object to another one.
*
* @param iInstance
* Object instance to build from.
*
* @return
* Assigned object.
* ---------------------------------------------------------------------**/
CATDMUsrInstance& operator=(const CATDMUsrInstance& iInstance);
/**
* ---------------------------------------------------------------------* <u>operator==</u>()
* Equality operator.
* Compare an object instance to another one according to their internal
* identifiers.
*
* @param iInstance
* Object instance to compare with.
*
* @return
* 1 if objects are identical, 0 otherwise.
* ---------------------------------------------------------------------**/
int operator==(const CATDMUsrInstance& iInstance) const;
/**
* ---------------------------------------------------------------------* <u>operator!=</u>()
* Inequality operator.
* Compare an object instance to another one according to their internal
* identifiers.
*
* @param iInstance
* Object instance to compare with.
*
* @return
* 1 if objects are different, 0 otherwise.
* ---------------------------------------------------------------------**/
int operator!=(const CATDMUsrInstance& iInstance) const;
1-146
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>GetValue</u>()
* Get the value of an attribute.
*
* @param iAttribute
* Attribute for which the value is to be retrieved.
* @param oValue
* Value of the attribute.
*
* @return
* Error code and messages.
* ---------------------------------------------------------------------*/
Error GetValue(const char* const iAttribute,
char*&
oValue ) const;
/**
* ---------------------------------------------------------------------* <u>GetRevision</u>()
* Get the revision number of an object.
*
* @param oRevision
* Output revision number.
*
* @return
* Error code and messages.
* ---------------------------------------------------------------------**/
Error GetRevision(char*& oRevision) const;
/**
* ---------------------------------------------------------------------* <u>GetMaturity</u>()
* Get the maturity of an object.
*
* @param oMaturity
* Output maturity string.
* @param oIsLocked
* If not null, contains the lock status of the object
*
* @return
* Error code and messages.
* ---------------------------------------------------------------------**/
Error GetMaturity(char*& oMaturity ,
int* oIsLocked=NULL) const;
1-147
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>SetMaturity</u>()
* Set the maturity of an object to a new value.
* Input value must belong to the list of authorized maturity values in
* use for the object.
*
* @param iObjectID
* Object identifier.
* @param iMaturity
* New maturity string.
*
* @return
* Error code and messages.
* ---------------------------------------------------------------------**/
Error SetMaturity(const char* const iMaturity);
/**
* ---------------------------------------------------------------------* <u>Promote</u>()
* Promotes an object to the next maturity, e.g. sets its maturity to the
* next higher value in the authorized maturity list
*
* @param iObjectID
* Object identifier.
*
* @return
* Error code and messages.
* ---------------------------------------------------------------------**/
Error Promote();
1-148
Menu
VPM Programming
/**
* ---------------------------------------------------------------------* <u>Demote</u>()
* Demotes an object to the previous maturity, e.g. sets its maturity to
* the next lower value in the authorized maturity list.
*
* @param iObjectID
* Object identifier.
*
* @return
* Error code and messages.
* ---------------------------------------------------------------------**/
Error Demote();
protected:
private:
/**
* ---------------------------------------------------------------------* <u>CATDMUsrInstance</u>()
* Default destructor - use forbidden by implementation.
* ---------------------------------------------------------------------**/
CATDMUsrInstance();
CATDMInstance* _instance;
};
#endif
1-149
Menu
VPM Programming
CATDMUsrMethodContext.h
libLV002DLG.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1997
//========================================================================
//
// <b>CATDMUsrMethodContext</b>:
// Information on the context of the current operation, e.g. is whether VPM
// performing a part duplication, check-out, etc.
//
//========================================================================
// Usage Notes:
//
// Use CATDMUsrMethodContext::GetTaskCaller() within user-exits to check cur// rent context, so it is possible to perform different actions according to
// its value.
//
//========================================================================
// Sep. 97 Creation
//========================================================================
#ifndef CATDMUsrMethodContext_h
#define CATDMUsrMethodContext_h
// <b>TaskType</b>
// Definition of possible contexts
enum TaskType
{
CATDMNoContext
CATDMQuery
CATDMImport
CATDMDuplicate
CATDMNewVersionDPN
CATDMNewVersionSPN
CATDMNewRevision
CATDMUpdateVersionRevision
CATDMCheckOut
CATDMCreate
CATDMRename
CATDMDelete
CATPSNDuplicate
CATPSNCreate
)
};
= 0,
= 1,
= 2,
= 3,
= 4,
= 5,
= 6,
= 7,
= 8,
= 9,
=10,
=11,
=12,
=13
// No current context
// Query panel
// Import panel
// Duplicate an object from VPM-Access
// Create new version with different part number
// Create new version with same part number
// Create new revision
// Update version/revision
// Check-out a part
// Create an object (Create&Save icon, Extract/Save...)
// Update an object (Update icon)
// Deletion
// Duplicate from Graph
// Create from Graph (Associate new part...
1-150
Menu
VPM Programming
1-151
Menu
VPM Programming
CATDMUSRSelect.h
libLV003DBA.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1997
//=======================================================================//
// CATDMUSRSelect:
// Basic service to perform queries against the database
//
//======================================================================//
Usage Notes:
//
//======================================================================//
Sep. 97 Creation
//========================================================================
#ifndef CATDMUSRSelect_H
#define CATDMUSRSelect_H
#include CATDMListResultLine.h
class CATDMSelect;
/**
* Basic service to perform queries against the database<BR>
* <BR>
* Usage Note:<BR>
* Add library LV003DBA as prereq for link
*/
class CATDMUSRSelect
{
public:
/**
* @param i_select_order
*
<b>ORDER HAVE TO BE IN UPPER CASE</b> (for instance : SELECT FROM WHERE
LIKE).
* @param o_ier
* Return code
* @param i_nbfetchmax
* if i_nbfetchmax<0 fetch without limit<BR>
* else use this value as limitation during fetch
*/
CATDMUSRSelect(const CATUnicodeString& i_select_order,
int *o_ier,const int i_nbfetchmax=-1);
~CATDMUSRSelect();
1-152
Menu
VPM Programming
/**
* Returns the result of the query.
*/
virtual void GetSelectResult(CATDMListResultLine* o_result,int *o_ier);
/**
* Returns number of hints.
*/
virtual int GetSelectCount(int *o_ier);
private:
CATDMSelect* catdmselect;
};
#endif
1-153
Menu
VPM Programming
CATDMUSRUpsate.h
libLV003DBA.a
/* -*-c++-*-*/
// COPYRIGHT DASSAULT SYSTEMES 1997
//
=========================================================================
====
//
// CATDMUSRUpdate:
// Basic service to update attributes into the database
//
//
=========================================================================
====
// Usage Notes:
//
//
=========================================================================
====
// Sep. 97 Creation
//
=========================================================================
====
#ifndef CATDMUSRUpdate_H
#define CATDMUSRUpdate_H
#include <CATUnicodeString.h>
#include <CATListOfCATUnicodeString.h>
class CATDMUpdate;
/**
* Basic service to update attributes into the database<BR>
* <BR>
* Usage Note:<BR>
*
* Add library LV003DBA as prereq for link
*/
class CATDMUSRUpdate
{
public:
/**
* @param i_dbname
* Database name
1-154
Menu
VPM Programming
* @param catenv
* Environment
* @param catab
* Table
* @param coid
* $COID
* @param compid
* $COMPID
* @param iUseSecurityView
* <tt>0</tt> : security view is not used<BR>
* <tt>1</tt> : security view is used
*/
CATDMUSRUpdate(const CATUnicodeString& i_dbname,
const CATUnicodeString& catenv,
const CATUnicodeString& catab,
const double coid,
const double compid,
const int iUseSecurityView=1);
virtual ~CATDMUSRUpdate();
/**
* Defines the SET CLAUSE.<BR>
* @param i_att
* Contains all the attributes name which are going to be updated.
* @param i_val
* Contains all the values (in string format).<BR>
* Single quotes are added automatically (when necessary).
*/
virtual void SetSetClause(const CATListOfCATUnicodeString &i_att,
const CATListOfCATUnicodeString &i_val);
/**
* Performs update
*/
virtual int Update();
private:
CATDMUpdate *catdmupdate;
};
#endif
1-155
Menu
VPM Programming
CATDMUSRCatia.h
libLV003DBA.a
#ifndef CATDMUSRCATIA_H
#define CATDMUSRCATIA_H
// IN MODULE: LV003DBA
#include <CATUnicodeString.h>
class CATDMUSRCatia
{
public:
//Connect to an environment
//default=dernier environement
static int ConnectEnvironment(const CATUnicodeString &i_caenv=);
//Return current environment
static int GetCurrentEnv(CATUnicodeString &o_caenv);
// 001122334455667788 => double
static double HexaToDouble(const CATUnicodeString &i_hexcoid);
// double => 001122334455667788
static CATUnicodeString DoubleToXHexa(double i_coid);
};
#endif
1-156
Menu
VPM Programming
CATDMUSRResultPanel.h
libLV005CDA.a
#ifndef CATDMUSRRESULTPANEL_H
#define CATDMUSRRESULTPANEL_H
// IN MODULE: LV005CDA
class CATDMUSRResultPanel
{
public:
//Refresh all result panels.
static void RefreshObjectsInPanels();
};
#endif
1-157
Menu
VPM Programming
CATcdm.h
libLV003DBA.a
#ifndef _CATCDM_H_
#define _CATCDM_H_
//========================================================================
//
CDM HEADER FILE
//
// This is the CDM header file. It includes all that CDM needs
// to know about CDM.
//
//========================================================================
//
// Includes
//#include <CATcdm_const.h>
#include <string.h>
//========================================================================
//
// Debug
//
extern int une_fois;
extern int debug1;
extern int debug2;
/* flag dinit
*/
/* 1: TRUE 0: FALSE
/* 1: TRUE 0: FALSE
*/
*/
enum column_type {
NOT_NULL_CHAR=452,
NULL_CHAR=453,
NOT_NULL_VARCHAR=448,
NULL_VARCHAR=449,
NOT_NULL_LONG_VARCHAR=456, NULL_LONG_VARCHAR=457,
NOT_NULL_INTEGER=496,
NULL_INTEGER=497,
NOT_NULL_SMALLINT=500,
NULL_SMALLINT=501,
NOT_NULL_DECIMAL=484,
NULL_DECIMAL=485,
NOT_NULL_FLOAT=480,
NULL_FLOAT=481,
NOT_NULL_DATE=384,
NULL_DATE=385,
NOT_NULL_TIME=388,
NULL_TIME=389,
NOT_NULL_TIMESTAMP=392,
NULL_TIMESTAMP=393
};
//========================================================================
//
// CLASS cdm
// Centralizes some definitions and general methods
1-158
Menu
VPM Programming
//
class CATcdm {
public:
static int dbcopw (const char* par_name, const char* par_value, int len);
static int dbconn (const char* cdmenv);
static int dbquin ();
static char * dbqucn ();
static const char* dbcsta ();
static int dbfin ();
static int commit ();
static int rollback ();
static int execute (const char* sql_order, int number_of_params=0, ...);
static char * getDBCA ();
static int
static int
static int
static int
static int
1-159
Menu
VPM Programming
CATUnicodeString.h
libNS0S3STR.a
/* -*-C++-*- */
// COPYRIGHT DASSAULT SYSTEMES 1997
//=======================================================================//
// CATUnicodeString:
// Class for character string support in a SBCS, DBCS, or MBCS environment
//
//======================================================================//
Considerations of usage:
// CATUnicodeString has to be used whenever a character string is
// needed, ie either seen, entered, or manipulated by the
// end user. In this way, the application is shielded from
// implementation details regarding language, locale, bytecoding
// of characters, etc. The application thus becomes portable from a
// geographical standpoint.
//
// For other strings, not seen by the user but internally manipulated
// by the application, the CATString type (from the System framework)
// is mandatory, instead of the raw type char*.
//
//
========================================================================//
// February 96 Creation from dsString and TEMPOSTRING O Fresse
//
//========================================================================
#ifdef _WINDOWS_SOURCE
#ifdef __NS0S3STR
#define ExportedByNS0S3STR __declspec(dllexport)
#else
#define ExportedByNS0S3STR __declspec(dllimport)
#endif
#else
#define ExportedByNS0S3STR
#endif
#ifndef CATUnicodeString_H
#define CATUnicodeString_H
#include <stdlib.h>
#include CATUnicodeChar.h
#include CATI18NTypes.h
#include CATBaseUnknown.h
#include CATBSTR.h
class CATInterUnicodeString ;
1-160
Menu
VPM Programming
class CATString ;
class istream;
//------------------------------------------------------------------/**
* CATUnicodeString is the class to use whenever a character string
* is to be manipulated by your application, instead of the CATString class,
* or worse, a char*.
* <p>
* CATUnicodeString has to be used whenever a character string is
* needed, ie either seen, entered, or manipulated by the
* end user. In this way, the application is shielded from
* implementation details regarding language, locale, bytecoding
* of characters, and so forth. Applications thus become portable
* since they can handle character strings expressed in any language.
* <p>
* For other strings, not seen by the user but internally manipulated
* by the application, the CATString class from the System framework
* is required, instead of the raw type char* you should never use.
*
* @see CATString
*/
class ExportedByNS0S3STR CATUnicodeString : public CATBaseUnknown
{
// Class utilities: marshalling, type management
friend class CATMarshallableUnicodeString;
CATDeclareClass;
public :
//------------// Ctors, Dtors
//------------/**
* Constructs an empty CATUnicodeString instance.
*/
CATUnicodeString(); // Creates an empty string
/**
* Copy constructor.
* Constructs a CATUnicodeString instance from another CATUnicodeString.
*/
CATUnicodeString(const CATUnicodeString& iString);
// From a char*
/**
1-161
Menu
VPM Programming
//-------------------// Pseudoconstructors
//-------------------// The following methods recycle an existing CATUnicodeString instance by
// changing their contents using a new source, as opposed to deleting
1-162
Menu
VPM Programming
1-163
Menu
VPM Programming
1-164
Menu
VPM Programming
* @return
* The input stream.
*/
istream& BuildFromStream( istream& iStreamToRead,
int iSkipWhite = 1); // White lines skipped if != 0
// Building from STEP Standard (ISO 10133) Express strings
/**
* Recycles an existing CATUnicodeString instance from a STEP character string
* encoded using the Express format.
* @param iExpressString
* Pointer to the Express-encoded character string.
* @return
* 0 is the CATUnicodeString instance is successfully recycled and -1
* otherwise.
*/
int BuildFromSTEP(const char *iExpressString);
// Refer to STEP part 21 for details on Express encoding of strings
// Building from the UTF8 format
/**
* Recycles an existing CATUnicodeString instance from a UTF-8 encoded
* character string.
* @param iUTF8Data
* Pointer to the UTF-8 encoded character string.
* @param iNbBytes
* Length of <tt>iUTF8Data</tt> in bytes.
* @return
* 0 is the CATUnicodeString instance is successfully recycled and a negative
* value otherwise.
*/
int BuildFromUTF8(const char *iUTF8Data, size_t iNbBytes);
// Building from the BSTR format
/**
* Recycles an existing CATUnicodeString instance from a BSTR-encoded character
* string.
* A BSTR is a Basic string, or binary string, ie a pointer to a wide
* character string.
* @param iBSTR
* Pointer to the BSTR-wide character string.
* @return
* 0 is the CATUnicodeString instance if successfully recycled and a negative
* value otherwise.
*/
int BuildFromBSTR(const CATBSTR &iBSTR);
1-165
Menu
VPM Programming
//---------// Operators
//---------// Assignment
/**
* Assignment operator from a char*.
* @param iPtrToCharToCopy
* Pointer to the char* character string to be copied.
*/
CATUnicodeString &operator =(const char
*iPtrToCharToCopy);
/**
* Assignment operator from a CATUnicodeString instance.
* @param iStringToCopy
* CATUnicodeString instance to copy.
*/
CATUnicodeString &operator =(const CATUnicodeString &iStringToCopy) ;
// Comparison
//
CAUTION: the locale is taken into account when comparing.
//
As a consequence, comparing two instances with different
//
locales can lead to non-significant results.
/**
* Equality operator.
*/
int operator == ( const CATUnicodeString &iStringToCompare ) const ;
/**
* Inequality operator.
*/
int operator != ( const CATUnicodeString &iStringToCompare ) const ;
/**
* Less-than operator.
*/
int operator < ( const CATUnicodeString &iStringToCompare ) const ;
/**
* Less-than or equal operator.
*/
int operator <= ( const CATUnicodeString &iStringToCompare ) const ;
/**
* Greater-than or equal operator.
1-166
Menu
VPM Programming
*/
int operator >= ( const CATUnicodeString &iStringToCompare ) const ;
/**
* Greater-than operator.
*/
int operator > ( const CATUnicodeString &iStringToCompare ) const ;
// Table-like access
/**
* Subscripting operator.
*/
CATUnicodeChar operator[](size_t iPos) const;
// Bound checks are performed.
// C-mode indexing: the first char in string is at index 0
//----------------// Pseudooperators
//----------------// Compares two CATUnicodeString with extended diagnostics.
/**
* Compares CATUnicodeString instances
* @return
* 2 if the strings are identical, 1 if only case differences are
* found (<tt>Hello == hello</tt>), and 0 otherwise.
*/
int Compare(const CATUnicodeString &iStringToCompare) const;
// Return value: 2: strictly equal
//
1: equal, but case may be different (Hello == hello)
//
0: different
// Concatenation
/**
* Concatenates CATUnicodeString instances.
* The string passed as a parameter is appended to the current string.
* For example:
* <pre>
* CATUnicodeString Hello(Hello);
* CATUnicodeString Goodbye(Goodbye);
* Hello.Append(Goodbye);
// Hello now contains HelloGoodbye
* </pre>
*/
CATUnicodeString& Append( const CATUnicodeString &iStringToAppend );
// CATUnicodeString Hello(Hello);
// Hello.Append(Goodbye); // Hello now contains HelloGoodbye
1-167
Menu
VPM Programming
// Capitalization
/**
* Converts the current string to uppercase characters.
*/
void ToUpper() ; // Turns The string into THE STRING
/**
* Converts the current string to lowercase characters.
*/
void ToLower() ; // Turns The string into the string
// Substring extraction
/**
* Returns a substring extracted from the current string.
* @param iStartPos
* The first character to be extracted.
* @param iNbCharsToExtract
* The number of characters to be extracted.
*/
CATUnicodeString SubString ( int iStartPos,
int iNbCharsToExtract ) const ;
1-168
Menu
VPM Programming
*/
int ConvertToNum(unsigned long *oValue, const char *iFormat=%uld) const;
/**
* Converts the current string to a double returned as the first parameter.
*/
int ConvertToNum(double
*oValue, const char *iFormat=%le) const;
/**
* Converts the current string to a long double returned as the first parameter.
*/
int ConvertToNum(long double *oValue, const char *iFormat=%le) const;
// Example :
//
CATUnicodeString stringToConvert;
//
long value;
//
int isConvertOK = ConvertToNum(&value);
// These subroutines return the number of successfully matched and assigned
// input items
// To STEP Standard (ISO 10133) Express string encoding scheme
// Refer to STEP part 21 for details on Express encoding of chars
/**
* Converts the current string to an EXPRESS-encoded string for STEP.
*/
void ConvertToSTEP( char *oExpressString) const;
// To UTF8 format
/**
* Converts the current string to an UTF-8 encoded string.
*/
void ConvertToUTF8( char *oUTF8Data, size_t *oNbBytes) const;
// oUTF8Data should be allocated as a table of
// 4*(this->GetLengthInChar()) elements
// To CATBSTR format
/**
* Converts the current string to a BSTR (basic string for OLE).
*/
void ConvertToBSTR( CATBSTR *oBSTR) const;
// To characters
/**
* Converts the current string to a char* returned.
*/
const char
*ConvertToChar() const;
/**
* Converts the current string to a CATUC2Bytes character encoded string
* returned.
*/
1-169
Menu
VPM Programming
1-170
Menu
VPM Programming
// Substring replacement
/**
* Replaces a character substring by another one.
* @param iStringToReplace
* Character string to be replaced in the current character string.
* @param iReplacingString
* Replacing character substring.
* @return
* The position of the first character of <tt>iStringToReplace</tt> in the
* current characer string if the replacement succeeds, and -1 otherwise.
*/
int ReplaceSubString(const CATUnicodeString &iStringToReplace,
const CATUnicodeString &iReplacingString);
/**
* Replaces several subsequent characters by a character string.
* @param iFirstCharToReplace
* Position of the first character to be replaced in the character string.
* @param iNbCharsToReplace
* Number of characters to be replaced.
* @param iStringToInsert
* Character string to be inserted in place of the <tt>iNbCharsToReplace</tt>
* characters.
*/
void ReplaceSubString(int
iFirstCharToReplace,
int
iNbCharsToReplace,
const CATUnicodeString &iStringToInsert);
/**
* Replaces several subsequent characters by the first nth characters of
* a given character string.
* @param iFirstCharToReplace
* Position of the first character to be replaced in the character string.
* @param iNbCharsToReplace
* Number of characters to be replaced.
* @param iStringToInsert
* Character string to be inserted in place of the <tt>iNbCharsToReplace</tt>
* characters.
*/
void ReplaceSubString(int
iFirstCharToReplace,
int
iNbCharsToReplace,
const CATUnicodeString &iStringToInsert,
1-171
Menu
VPM Programming
int
iNbCharToTake) ;
// CATUnicodeString testString(Coca Cola);
// testString.Replace(6, 4, Coca);
// testString == Coca Coca
// testString.Replace(6, 4, Colargol, 4); // testString == Coca Cola
// testString.Replace(Coca, Pepsi); // testString == Pepsi Cola
// Removing iNbCarsToRemove characters after iStartPos index
/**
* Removes several subsequent characters.
* @param iFirstCharToRemove
* Position of the first character to be removed.
* @param iNbCharsToRemove
* Number of characters to be removed.
*/
void Remove(int iFirstCharToRemove, int iNbCharsToRemove=1) ;
// Inserting iStringToInsert after iStartPos index
/**
* Inserts a character string.
* @param iFirstCharToInsert
* Position of the first character to be inserted.
* @param iStringToInsert
* Character string to be inserted.
*/
void Insert(int iFirstCharToInsert, const CATUnicodeString &iStringToInsert) ;
//----------------// String stripping
//----------------// Where to look for chars to strip
/**
* Character string stripping mode.
* @param CATStripModeLeading
* Requests leading characters only to be stripped.
* @param CATStripModeTrailing
* Requests trailing characters only to be stripped.
* @param CATStripModeBoth
* Requests both leading and trailing characters to be stripped.
* @param CATStripModeAll
* Requests all characters found to be stripped.
*/
enum CATStripMode {CATStripModeLeading = 0x1, // head of string
CATStripModeTrailing = 0x2, // tail of string
CATStripModeBoth = 0x3, // head & tail
CATStripModeAll =
0x4};// Everywhere within string
1-172
Menu
VPM Programming
1-173
Menu
VPM Programming
1-174
Menu
VPM Programming
1-175
Menu
VPM Programming
1-176
Menu
VPM Programming
VPM 1.0 R1
OpenPSNWithUsrMethod
VPM 1.0 R1
GetConfNameHistory
VPM 1.0 R1
IsAValidFlagForCommit
VPM 1.0 R1
ActionFlowCheck
VPM 1.0 R1
SuccessfullyCommitInGraph
VPM 1.0 R1
SuccessfullyRollBackInGraph
VPM 1.0 R1
DefaultModValidation
VPM 1.2 GA
AuthorizedModValidation
VPM 1.0 R1
AuthorizedModPromote
VPM 1.0 R1
AuthorizedModDemote
VPM 1.0 R1
AuthorizedModDelete
VPM 1.0 R1
ModCreateOwner
VPM 1.0 R1
AuthorizedCut
VPM 1.0 R1
AuthorizedMove
VPM 1.0 R1
AuthorizedPaste
VPM 1.0 R1
AuthorizedCheckIn
VPM 1.0 R1
AuthorizedCheckOut
VPM 1.0 R1
AuthorizedDelete
VPM 1.0 R1
AuthorizedCreate
VPM 1.0 R1
AuthorizedUpdate
VPM 1.0 R1
AuthorizedReplace
VPM 1.3 GA
AuthorizedCATIASave
VPM 1.0 R1
AuthorizedPromotion
VPM 1.0 R1
AuthorizedReassign
VPM 1.0 R1
1-177
Menu
VPM Programming
GetInputListOfValues
VPM 1.0 R1
ComputeValuesBeforeWrite
VPM 1.0 R1
CheckLFBeforeWrite
VPM 1.2 GA
GetNewVersionListOfValues
GetNewVersionListOfValues
GetNewRevisionListOfValues
GetNewRevisionListOfValues
IsAValidNewVersion
IsAValidNewRevision
IsAValidDuplicatedRevision
VPM 1.2 GA
IsAValidRevisionVersion
VPM 1.0 R1
AuthorizedNewVersion
VPM 1.0 R1
AuthorizedNewRevision
VPM 1.0 R1
BeforeCreateUserAction
VPM 1.0 R1
AfterWriteUserAction
VPM 1.0 R1
AfterCommitUserAction
VPM 1.0 R1
AfterRollbackUserAction
VPM 1.0 R1
GetBGColorForPrint
VPM 1.0 R1
FormatConfigHandlerId
VPM 1.0 R1
OptionListToDisplay
VPM 1.2 GA
AuthorizedEffModification
VPM 1.3
ConfigHandlerControl
1-178
Menu
VPM Programming
CATVpmAFUsrMethod.h
ExecuteUsrCommand
VPM 1.0 R1
GetNewUsrPersonId
VPM 1.0 R1
GetUsrMessageText
VPM 1.0 R1
CheckUsrCondition
VPM 1.0 R1
CheckUsrLibraryAccess
VPM 1.0 R1
GetUsrSecondaryId
VPM 1.0 R1
ModifySecondaryId
VPM 1.2 GA
1-179
Menu
VPM Programming
CATVpmPEUsrMethod.h
LoginVpmSession
VPM 1.0 R1
EndVpmSession
VPM 1.0 R1
ChangePasswordEnabled
VPM 1.0 R1
ChangePassword
VPM 1.0 R1
ValidateUserId
VPM 1.0 R1
ValidatePassword
VPM 1.0 R1
1-180
Menu
VPM Programming
CATVpmSCUsrManager.h
GetLoginUserId
GetLoginRoleName
GetLoginRoleOrganizationId
CheckAccess
CheckDataAccess
1-181
Menu
VPM Programming
CATCfgInterfaces.h
GetDbID
GetCfgHandler
GetCfgHandler
Expand
ExpandSTEP
ExpandWithCSB
ExpandSTEPWithCSB
SetConfigurable
UnsetConfigurable
CreateModifEffectivity
CreateCurDateEffectivity
CreateDateEffectivity
CreateDateEffectivity
CreateRangeEffectivity
CreateOptEffectivity
CreateOptEffectivity
CreateOptDateEffectivity
CreateOptDateEffectivity
CreateOptDateEffectivity
CreateOptDateEffectivity
CreateOptRangeEffectivity
CreateOptRangeEffectivity
DeleteOptEffectivity
DeleteOptDateEffectivity
VPM 1.3 GA
DeleteOptDateEffectivity
VPM 1.3 GA
DeleteOptRangeEffectivity
VPM 1.3 GA
1-182
Menu
VPM Programming
DeleteDateEffectivity
VPM 1.3 GA
DeleteDateEffectivity
VPM 1.3 GA
DeleteRangeEffectivity
VPM 1.3 GA
CurDateReplace
CreateDictionary
VPM 1.2 GA
DeleteDictionary
AddCategoryToDictionary
VPM 1.3 GA
AddOptionToDictionary
VPM 1.2 GA
RemoveOptionFromDictionary
VPM 1.3 GA
AddRuleToDictionary
VPM 1.3 GA
AddCompatibilityMatrixToDictionary
VPM 1.3 GA
AddCompatibilityRuleToMatrix
VPM 1.3 GA
GetOptFromDictionary
GetOptFromDictionary
CreateConfigHandler
VPM 1.2 GA
CreateConfigHandler
VPM 1.2 GA
AddOptionToConfigHandler
RemoveOptionFromConfigHandler
AddChildToConfigHandler
RemoveChildFromConfigHandler
VPM 1.3 GA
AddBrotherToConfigHandler
DeleteConfigHandler
SetAFMode
GetEffectivityForLink
VPM 1.3 GA
GetEffectivityForLink
VPM 1.3 GA
DeleteEffectivity
VPM 1.3 GA
UpdateDictionaryFromAssembly
1-183
Menu
VPM Programming
CATVPMFilter.h
Filter
VPM 1.2 GA
CATVPMFilterManager.h
AddFilter
VPM 1.2 GA
InsertFilter
VPM 1.2 GA
RemoveFilter
VPM 1.2 GA
RemoveFilter
VPM 1.2 GA
1-184
Menu
VPM Programming
CATLnkAPI.h
GetImpactedBy
GetImpactingOn
GetLinksBetween
GetEntityCount
DeleteLinks
DeleteEntities
IsPointedModel
IsPointedPart
ComputeRelationEnvironments
1-185
Menu
VPM Programming
CATVpmPEUsrManager.h
GetUserEmail
GetUserOrganizationId
1-186
Menu
VPM Programming
CATVpmPubSubUsrAdmin.h
OpenConnection
CloseConnection
Commit
Rollback
GetRootEvents
GetEvent
GetEventChildren
CreateEvent
DeleteEvent
1-187
Menu
VPM Programming
CATVpmPubSubUsrManager.h
Subscribe
UnSubscribe
UnSubscribe
IsSubscriber
PublishEvent
1-188
Menu
VPM Programming
CATDMUsrInstance.h
CATDMUsrInstance
VPM 1.3 GA
~CATDMUsrInstance
VPM 1.3 GA
operator=
VPM 1.3 GA
operator==
VPM 1.3 GA
operator!=
VPM 1.3 GA
GetValue
VPM 1.3 GA
GetRevision
VPM 1.3 GA
GetMaturity
VPM 1.3 GA
SetMaturity
VPM 1.3 GA
Promote
VPM 1.3 GA
Demote
VPM 1.3 GA
1-189
Menu
VPM Programming
CATVpmSCUsrLogin.h
Login
CATDMUsrMethodContext.h
GetTaskCaller
CATDMUSRSelect.h
CATDMUSRUpdate.h
CATDMUSRCatia.h
CATDMUSRResultPanel.h
CATCDM.h
CATUnicodeString.h
These headers and their methods are available for every version of VPM
1-190
Menu