Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
1. Drawing codes are composed of components, each of which (generally) has a meaning) | 1. Drawing codes are composed of components, each of which (generally) has a meaning. |
Line 5: | Line 5: |
* Maps may be direct (to reference tables) or via drawing code map tables (see below) | * Maps may be direct (to reference tables) or indirect, e.g. via drawing code map tables (see below). |
Line 7: | Line 7: |
* Drawing codes are specified in app/settings/DrawingCode.php * And their functionality is implemented in app/lib/DrawingCodeBase.php |
* Drawing codes structures are defined in '''app/settings/DrawingCode.php''' * Drawing code functionality is implemented in '''app/lib/DrawingCodeBase.php''' == Drawing Code Definition == The drawing code definition is defined in: 1. The database table '''DrawingCodeTypeRef''', where an id, code and name for each drawing code type is defined. 1. The configuration file '''app/settings/DrawingCode.php''', which defines all the components of each drawing code. == Drawing Code Component Definition == The drawing codes are defined in the '''$_CFG''' settings array. Each Drawing Code has two parts: 1. '''DrawingCode''' - defines each drawing code component and separator 2. '''RevisionCode''' - defines: * each revision code component * revision numbering rules (starting revision number, are gaps allowed) * file storage rules for the publish and source files (how the files are named internally) === Top-Level Configuration === {{{ $_CFG[ 'DrawingCodeDefinitions' ] = array( DrawingCodeTypeRef_DC1 => array( // KEJV: 14-C-9.99.999 'name' => 'KEJV', 'drawingCode' => array( // KEJV Drawing code definition 'components' => array( ... ) ), 'revisionCode' => array( // KEJV Revision code definition 'components' => array( ... ) ... ), ), DrawingCodeTypeRef_DC2 => array( // ... ... ), ), }}} === Component Definition === == Drawing Code Maps == Drawing code maps allow classification (and other) fields to be directly set based on drawing code components. This is main mechanism for automatically setting classification fields based on a drawing code. There are two kinds of maps: 1. '''Direct maps''' - map a drawing code component value directly to the code of the target field 1. '''Indirect maps''' - which use DrawingCodeMap tables to map from a drawing code component value to one (or more) target field/values pairs. ---- = Examples = |
Line 18: | Line 84: |
== Example == | == Examples == |
Line 20: | Line 86: |
Example component ''languageCode'' for a MET drawing code: | === Example component ''languageCode'' for the MET Drawing Code === |
Line 34: | Line 100: |
=== Example: Mapping Projektphase (c) to ProjectPhaseRef in Axpo/NOK DrawingCode === === Example: Mapping a Subset of Fachbereich (cc) to CategoryRef in Axpo/NOK DrawingCode === The problem is to map a subset of the Fachbereich (CategoryRef table) from a drawing code component to the Fachbereich |
Drawing Code Handling
- Drawing codes are composed of components, each of which (generally) has a meaning.
- The drawing code components can be mapped to classification (and other fields) in the Drawings record.
- Maps may be direct (to reference tables) or indirect, e.g. via drawing code map tables (see below).
There is a complex syntax described in SomePage (?)
Drawing codes structures are defined in app/settings/DrawingCode.php
Drawing code functionality is implemented in app/lib/DrawingCodeBase.php
Drawing Code Definition
The drawing code definition is defined in:
The database table DrawingCodeTypeRef, where an id, code and name for each drawing code type is defined.
The configuration file app/settings/DrawingCode.php, which defines all the components of each drawing code.
Drawing Code Component Definition
The drawing codes are defined in the $_CFG settings array.
Each Drawing Code has two parts:
DrawingCode - defines each drawing code component and separator
RevisionCode - defines:
- each revision code component
- revision numbering rules (starting revision number, are gaps allowed)
- file storage rules for the publish and source files (how the files are named internally)
Top-Level Configuration
$_CFG[ 'DrawingCodeDefinitions' ] = array( DrawingCodeTypeRef_DC1 => array( // KEJV: 14-C-9.99.999 'name' => 'KEJV', 'drawingCode' => array( // KEJV Drawing code definition 'components' => array( ... ) ), 'revisionCode' => array( // KEJV Revision code definition 'components' => array( ... ) ... ), ), DrawingCodeTypeRef_DC2 => array( // ... ... ), ),
Component Definition
Drawing Code Maps
Drawing code maps allow classification (and other) fields to be directly set based on drawing code components. This is main mechanism for automatically setting classification fields based on a drawing code.
There are two kinds of maps:
Direct maps - map a drawing code component value directly to the code of the target field
Indirect maps - which use DrawingCodeMap tables to map from a drawing code component
- value to one (or more) target field/values pairs.
Examples
Mapping from Drawing Code Components to Classifications
- Uses the following tables:
DrawingCodeMapRef - Defines a drawing code component map (basically its name and id)
DrawingCodeMapCodes - Defines the code values allowed for the drawing code component
DrawingCodeMapValues - Defines mapping from the drawing code component values to classification id values
Examples
Example component ''languageCode'' for the MET Drawing Code
In DrawingCodeMapRef:
- id=1002, name='Language Code'
In DrawingCodeMapCodes:
- EN - English
- EH - English/Hungarian
- HU - Hungarian
In DrawingCodeMapValues, if these codes mapped to a classification (which currently they do not), we
can put (nultiple) mappings of target (field, value) tuples. Note that the field refers to the form (? check this)
HU --> Drawings.languageId, 3 (3=Hungarian)
Note that this is not yet implemented for V12.x, e.g. for aspect based classifications.
Example: Mapping Projektphase (c) to ProjectPhaseRef in Axpo/NOK DrawingCode
Example: Mapping a Subset of Fachbereich (cc) to CategoryRef in Axpo/NOK DrawingCode
The problem is to map a subset of the Fachbereich (CategoryRef table) from a drawing code component to the Fachbereich