Class DotSyntaxParser
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public class DotSyntaxParser
Constructors
DotSyntaxParser(IEnumerable<IArchiveExtender>)
Declaration
public DotSyntaxParser(IEnumerable<IArchiveExtender> baseExtenders)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IArchiveExtender> | baseExtenders |
Properties
TolerateBaseMismatches
If true, then dynamic columns that do not match their base will be tolerated (skipped); otherwise exceptions will be thrown if a dynamic column specifies an unknown base or foreign key
Declaration
public bool TolerateBaseMismatches { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
ConstructExtenderTree(string[])
Construct a (sub)tree of archive extenders based on the dot-syntax column names provided
Declaration
public IArchiveExtender ConstructExtenderTree(string[] columnNames)
Parameters
Type | Name | Description |
---|---|---|
string[] | columnNames |
Returns
Type | Description |
---|---|
IArchiveExtender |
Remarks
The following grammar defines what dot-syntax really is:
dotSyntax := <table>[<join>, ...].<field>
table := table name from database
field := field name from database, or column name defined by the module handling that table
join := <outerjoin> | <innerjoin> | <rightjoin>
outerjoin := .<fk_field>
innerjoin := :<fk_field>
rightjoin := .(<table>-><fk_field>)
fk_field := <foreign_key> | <field_name>[<table_name>] note the square brackets are literals here!
foreign_key := field name from database, where field must be defined as a foreign key in the dictionary
field_name := any field name in the current table that is of type int
table_name := target table, relation does not need to be defined in the dictionary in this case
Field names must follow this grammar, otherwise exceptions will be generated. Additionally, all join field and table names must be valid, by reference to the runtime dictionary; but note that right-joins as well as left-joins using the square-bracket syntax to specify target table do not need to correspond to relations declared in the dictionary.
Final field names can be anything, as long as the code handling that table recognizes the field name. If no specific code is found for a table, a generic (dynamic) extender will be used; this requires field names to match database field names. Note that we treat extenders through the IArchiveDynamicExtender as seldom as possible, and use plain IArchiveExtender wherever possible - the Dynamic part is supposed to be a minimalist add-on. It also enables us to do hybrid structures, where many parts are standard extenders.