Class SY_SDataDictionary

This class handles all dictionary access for SData. It caches information in memory for performance. To best take advantage of the caching, use the same instance of this class as much as possible. Since we are caching information, you'll want to delete and reinstantiate instances of this class whenever the dictionary changes.

Properties

LOCAL cColumnListBSZ=1024  
PROPERTY ChildInfoIOL$   * Read Only *
PROPERTY SpecialResourcesIOL$   * Read Only *
PROPERTY SpecialResourcesNumrec   * Read Only *

Methods

FUNCTION GetBusinessClass(tableName$, businessClass$)  

Gets the name of the primary business class associated with a table. This is based on both dictionary information and heuristics.

ParameterDescription
tableName$ [input, string] the name of the table
businessClass$ [output, string] the name of the primary business class associated with the table.
Returns [boolean] True if the primary business class for the table could be determined
FUNCTION GetChildInfo(resourceName$, childInfoRec$)  

Retrieves information for accessing a resource's children.

ParameterDescription
resourceName$ [input, string] The name of the resource whose children you're interested in.
childInfoRec$ [output, string] The information for resourceName$ serialized by ChildInfoIOL$. Null if not found.
Returns [boolean] True if all the information was found. False otherwise.
FUNCTION GetColumnList$(tableName$)  

Gets a list of all the columns in a table

ParameterDescription
tableName$ [input, string] the name of the table
Returns [string] comma delimited list of columns in the table, based on dictionary information. Empty string for tables that don't exist.
FUNCTION GetDefaultKeyValueExpression(tableName$, columnName$, prefix$, defaultKeyValueExpression$)  

Looks for a "Default Value" or a "Next Number Argument List" for the specified column in the dictionary. This is useful for assigning default values to primary key fields that aren't specified in a creation request. These mechanisms were implemented for Visual Integrator.

ParameterDescription
tableName$ [input, string] the name of the table in question
columnName$ [input, string] the name of the column in question, or the corresponding variablename with the trailing dollar sign
prefix$ [input, string] an optional record prefix that should be appended to variable references in the expression we return
defaultKeyValueExpression$ [output, string] if successful, an expression that can be executed to assign the default value to the column
Returns [boolean] True if a "Default Value" or a "Next Number Argument List" exists for the column in question.
FUNCTION GetKeyFields(tableName$, keyName$, keyFields$)  

Gets a comma delimited list of the columns in a specified key in the proper order and with ProvideX-friendly dollar signs on the ends of the field names.

ParameterDescription
tableName$ [input, string] the name of the table
keyName$ [input, string] the name of the key. Like "KPRIMARY" or "KDISPLAY"
primaryKeyFields$ [output, string] a comma delimited list of the columns in the specified key in the proper order and with ProvideX-friendly dollar signs on the ends of the field names.
Returns [boolean] True if the definition of the index could be retrieved
FUNCTION GetModuleCode(tableName$, moduleCode$)  

Gets the module code that a resource is associated with. For simple table resources, this is the dictionary group that the table belongs to. For special resources, we use the module code of the header element.

ParameterDescription
tableName$ [input, string] the name of the resource
moduleCode$ [output, string] the module code that the resource is associated with.
Returns [boolean] True if the module code could be determined - if a corresponding table definition existed in the dictionary
FUNCTION GetPrimaryKeyFields(tableName$, primaryKeyFields$)  

Gets a comma delimited list of the columns in the primary key in the proper order and with ProvideX-friendly dollar signs on the ends of the field names.

ParameterDescription
tableName$ [input, string] the name of the table
primaryKeyFields$ [output, string] a comma delimited list of the columns in the primary key in the proper order and with ProvideX-friendly dollar signs on the ends of the field names.
Returns [boolean] True if the definition of the table could be retrieved
FUNCTION GetResourceType(tableName$, resourceType$, topLevelBusinessClass$, topLevelTable$)  

Determines the "resource type" of a table. For example, simple tables, detail tables under header tables, and distribution tables are all different resource types because we must access each of them differently. There are lots of special cases too.

ParameterDescription
tableName$ [input, string] the name of the table in question
resourceType$ [output, string] an arbitrary constant that identifies how the resource should be accessed. See SY_SDataConstants for a list. Please begin the string with your Developer Code to avoid conflicts.
topLevelBusinessClass$ [output, string] the name of the business class that must be accessed initially to reach this table. For example, for a detail table this would be the business class of its header.
topLevelTable$ [output, string] the name of the table that must be accessed initially to reach this table. For example, ror a detail table this would be its header table.
Returns [boolean] True if the resource type could be determined
FUNCTION GetSDataType(tableName$, columnName$, sdataType$)  

The property strings that we use to pass information between the C# and ProvideX components of our SData provider use special codes to describe the data types. This method retrieves that data type code for a specific column in a table.

ParameterDescription
tableName$ [input, string] the name of the table
columnName$ [input, string] the name of the column
sdataType$ [output, string] the code that property strings should use to describe the data type for columnName$ in tableName$
Returns [boolean] True if the column description could be determined
FUNCTION GetSpecialResource(resourceName$, specialResourcesRec$)  

Reads the resourceName$ record from cSpecialResourcesFH

ParameterDescription
resourceName$ [input, string] The name of the resource you're looking for in cSpecialResources. The key of the file.
specialResourcesRec$ [output, string] The serialized contents of the cSpecialResourcesFH record, if found. Serialized by SpecialResourcesIOL$. Null if not found.
Returns [boolean] True if the record was found. False otherwise.
FUNCTION GetWhereClause$(tableName$, resourceType$, topLevelTable$)  

Determines the "where clause" that should appear in the schema definitions of special multi-tier resources in our contract file.

ParameterDescription
tableName$ [input, string] the name of the table in question
resourceType$ [input, string] resourceType$ for tableName$ as determined by GetResourceType.
topLevelTable$ [input, string] topLevelTable$ for tableName$ as determined by GetResourceType.
Returns [string] The "where clause" that our contract generator should use when describing the relationship between tableName$ and topLevelTable$. Empty string if this concept does not apply.
FUNCTION SelfTest(filePathAndName$)  

A diagnostic function. Calls our GetBusinessClass and GetResourceType method for each table in the dictionary and produces an HTML report.

ParameterDescription
filePathAndName$ [input, string] The full path and filename you'd like to store the HTML report in. File must not exist.
FUNCTION SpecialResourcesLoopInit()  

Sets the filepointer on cSpecialResourcesFH to the beginning of the file. Always use before starting a SpecialResourcesLoopNext loop.

Returns [boolean] True
FUNCTION SpecialResourcesLoopNext(specialResourcesRec$)  

Retrieves the key and data of the next record in cSpecialResourcesFH. Use as the loop condition on a WHILE loop to mimic SELECT behavior. Precede the loop with SpecialResourcesLoopInit.

ParameterDescription
specialResourcesRec$ [output, string] The serialized contents of the next cSpecialResourcesFH record. Serialized by SpecialResourcesIOL$. Null if it fails.
Returns [boolean] True if the next record in cSpecialResourcesFH was read. False if we hit the end of the file. Use as a looping condition.
FUNCTION TranslateIncomingResourceName$(resourceName$)  
FUNCTION TranslateOutgoingResourceName$(resourceName$)  

Methods inherited from: SY_SDataDictionaryOdd

BuildOddResourceTypeExpressions(), FindOddSpecialResources(), GetOddResourceType(), GetOddWhereClause$()