Namespace: Consultingwerk.BusinessEntityDesigner.Generator
Class 
BusinessEntityGenerator Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.BusinessEntityDesigner.Generator.IBusinessEntityGenerator

File:BusinessEntityGenerator
Purpose:Generator for Business Entity and Data Access classes
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Sun Oct 17 22:32:09 CEST 2010



Top Method Summary
Options Name Purpose
+ CHARACTER CaseKeywords (character) Returns the input string in the selected keyboard casing
+ CHARACTER CaseKeywords (character, character) Returns the input string in the selected keyboard casing
# LOGICAL CheckDirectoriesExist (logical) Verifies that all output directories exist
# LOGICAL CheckNotWriteProtected (logical, logical) Verifies if files are write protected and optionally prompts if files should be overwritten
# CHARACTER CheckTemplatePath (character) Locates a template file and throws an Error when the template cannot be located
# CHARACTER ChildTablesOf (character) Returns the child tables of the given temp-table
+ LOGICAL Compile (dataset) Complies the generated BusinessEntity, DataAcess and DatasetController classes
# CompileFile (character, character) Compiles a file
# EvaluateFolderNames () Evaluates the source and r-code folder names
+ org.prorefactor.core.JPNode FindValidateDataMethod (ParseUnit) Parses the Business Entity and returns the JPNode representing the ValidateData method
# CHARACTER GenerateBusinessEntity () Generates the Business Entity
+ LOGICAL GenerateCode (dataset) Generates the source code
# CHARACTER GenerateDataAccessObject () Generates ther Data Access Object
# GenerateDataAccessObjectDetails (longchar, longchar, longchar, longchar, longchar, CharacterDictionary) Generates the DataSource Object Details
# CHARACTER GenerateDataset () Generates the dataset include file
# CHARACTER GenerateDatasetController () Generates the dataset controller
+ CHARACTER GenerateFileAnnotation (character, character, character) Returns the source code for the @FILEANNOTATION@ based on the role of the file and the business entity
# CHARACTER GenerateTempTables () Generates the temp-table include files
# CHARACTER GenerateXmlSchema () Generates XML schema representation of the Dataset
# org.prorefactor.core.JPNode GetAnnotationNode (character, character) Locates the JPNode representing an Annotation in the source code
# org.prorefactor.core.JPNode GetAnnotationNode (character, character, ParseUnit) Locates the JPNode representing an Annotation in the source code
# GetAnnotationToFrom (character, character, character, character, integer, integer) Locates the lines a start and end annotation are contained in a source code unit
# CHARACTER GetFieldMapping (character, integer) Returns the field mapping pairs for the named temp-table
# CHARACTER GetTopNavBuffers () Returns the comma delimited list of the top-nav buffers of the generated dataset
+ CHARACTER GetUserName () Returns the current windows user name
+ LOGICAL HasValidations () Returns if the Business Entity design contains validations
# OnWriteFile (WriteFileEventArgs) Raises the WriteFile event
# OpenFilesInIDE (character) Opens the generated files in the IDE
# LOGICAL PromptForOverwrite (character) Prompts for overwriting an existing file
+ Consultingwerk.BusinessEntityDesigner.Generator.WriteFileEventArgs RaiseWriteFileEvent (character, character) Raises the WriteFile event from the Business Entity Dataset Controller
+ LOGICAL RegenerateCode (dataset) Re-generates the source code
# CHARACTER UnqualifiedTableNames (character) Returns a list of unqualified table names by removing the database prefix
# UpdateAttachDataSource (character) Updates the Attach Data Source Method
# CHARACTER UpdateBusinessEntity () Updates the Business Entity by merging the current source code with the model
# UpdateBusinessEntityValidation (character) Updates the Business Entity Validation
# CHARACTER UpdateDataAccessObject () Updates the Data Acess Object by merging the current source code with the model
# UpdateDataSourceDefinition (character) Updates the Data Source Definition
# UpdateDetachDataSource (character) Updates the Detach Data Source Method
# UpdateExistingSourceDefaultQuery (character) Updates the SourecDefault Method
# UpdateSourceColumn (character) Updates the SourceColumn Method
# UpdateSourceDefaultQuery (character) Updates the SourecDefault Method
# CHARACTER ValidABLIdentifier (character) Limits the length of an identifier to 32 characters (ABL maximum)
# ValidateDesign () Validates the Design information

Top Constructor Summary
Options Name Purpose
+ BusinessEntityGenerator () Constructor for the BusinessEntityGenerator class

Top Event Summary
Options Name Purpose
+ WriteFile (Object, WriteFileEventArgs) Raised when the Business Entity Designer writes to an output file

Top Property Summary
Options Name Purpose
+ Consultingwerk.BusinessEntityDesigner.Generator.Generated Generated Returns a structure that contains the most recently generated file names
+ LOGICAL OpenFilesInIDE Attempt to open files in OpenEdge Architect / Progress Developer Studio for OpenEdge when done.
+ LOGICAL SilentMode Ignore status messages on completion
+ LOGICAL SilentModeUpdateDataAccess When SilentMode = TRUE this property gets and sets if the method UpdateDataAccessObject should be updating the Data Access object


Method Detail
Top

PUBLIC CHARACTER CaseKeywords (character)

Purpose: Returns the input string in the selected keyboard casing
Notes: See BusinessEntityDesignerSettings

Parameters:
pcString CHARACTER
The string value to fix the casing for
Returns CHARACTER
The string in the desired casing
Top

PUBLIC CHARACTER CaseKeywords (character, character)

Purpose: Returns the input string in the selected keyboard casing
Notes: See BusinessEntityDesignerSettings

Parameters:
pcString CHARACTER
The string value to fix the casing for
pcKeepCase CHARACTER
CHR(1) delimited list of strings contained in the pcString that should keep heir casing as provided in this parameter
Returns CHARACTER
The string in the desired casing
Top

PROTECTED LOGICAL CheckDirectoriesExist (logical)

Purpose: Verifies that all output directories exist
Notes:

Parameters:
plIncludeFilesOnly LOGICAL
Only verify the directories of the include files
Returns LOGICAL
Logical value indicating if the code generation should continue (FALSE will cancel the generator)
Top

PROTECTED LOGICAL CheckNotWriteProtected (logical, logical)

Purpose: Verifies if files are write protected and optionally prompts if files
should be overwritten
Notes:

Parameters:
plIncludeFilesOnly LOGICAL
Logical flag indicating if only the include files should be verified
plAskOverwrite LOGICAL
Logical flag indicating if the Business Entity Generator should prompt for overwriting files
Returns LOGICAL
Logical value indicating if no file is write protected
Top

PROTECTED CHARACTER CheckTemplatePath (character)

Purpose: Locates a template file and throws an Error when the template
cannot be located
Notes:

Parameters:
pcFileName CHARACTER
The relative name of the template file
Returns CHARACTER
Full pathname of the template
Top

PROTECTED CHARACTER ChildTablesOf (character)

Purpose: Returns the child tables of the given temp-table
Notes:

Parameters:
pcParentTable CHARACTER
The name of the parent table to return the child tables of
Returns CHARACTER
Comma delimited list of child temp-tables of the parent table
Top

PUBLIC LOGICAL Compile (dataset)

Purpose: Complies the generated BusinessEntity, DataAcess and DatasetController
classes
Notes:

Parameters:
dsBusinessEntity DATASET
The dataset with the Business Entity model
Returns LOGICAL
Logical value indicating the success of the operation
Top

PROTECTED CompileFile (character, character)

Purpose: Compiles a file
Notes:

Parameters:
pcFileName CHARACTER
The file name to compile
pcSaveInto CHARACTER
The directory to compile into
Top

PROTECTED EvaluateFolderNames ()

Purpose: Evaluates the source and r-code folder names
Notes: Variable cSourceFolder and cRCodeFolder

Top

PUBLIC org.prorefactor.core.JPNode FindValidateDataMethod (ParseUnit)

Purpose: Parses the Business Entity and returns the JPNode representing the
ValidateData method
Notes:

Parameters:
poParseUnit org.prorefactor.treeparser.ParseUnit
Returns org.prorefactor.core.JPNode
The JPNode representing the ValidateData method
Top

PROTECTED CHARACTER GenerateBusinessEntity ()

Purpose: Generates the Business Entity
Notes:

Returns CHARACTER
The name of the generated business entity
Top

PUBLIC LOGICAL GenerateCode (dataset)

Purpose: Generates the source code
Notes: This method will overwrite eventually existing source code

Parameters:
dsBusinessEntity DATASET
The dataset with the Business Entity model
Returns LOGICAL
Logical value indicating the success of the operation
Top

PROTECTED CHARACTER GenerateDataAccessObject ()

Purpose: Generates ther Data Access Object
Notes:

Returns CHARACTER
The name of the generated data access object
Top

PROTECTED GenerateDataAccessObjectDetails (longchar, longchar, longchar, longchar, longchar, CharacterDictionary)

Purpose: Generates the DataSource Object Details
Notes:

Parameters:
lcDefineDataSource LONGCHAR
The code block for the data source definition
lcAttachDataSource LONGCHAR
The code block for attaching the data sources
lcDetachDataSource LONGCHAR
The code block the detaching the data sources
lcSourceColumn LONGCHAR
The code block for the SourceColumn method
lcDefaultQuery LONGCHAR
The code block for the SourceDefaultQuery method
poDataSourceNames Consultingwerk.Framework.Collections.CharacterDictionary
The CharacterDictionary of data source names
Top

PROTECTED CHARACTER GenerateDataset ()

Purpose: Generates the dataset include file
Notes:

Returns CHARACTER
The file name of the generated dataset include file
Top

PROTECTED CHARACTER GenerateDatasetController ()

Purpose: Generates the dataset controller
Notes:

Returns CHARACTER
The file name of the generated dataset controller
Top

PUBLIC CHARACTER GenerateFileAnnotation (character, character, character)

Purpose: Returns the source code for the @FILEANNOTATION@ based on the
role of the file and the business entity
Notes:

Parameters:
pcEntityPackage CHARACTER
The Business Entity package
pcEntityName CHARACTER
The Business Entity name
pcFileType CHARACTER
The file type
Returns CHARACTER
The source code for the @FILEANNOTATION@
Top

PROTECTED CHARACTER GenerateTempTables ()

Purpose: Generates the temp-table include files
Notes:

Returns CHARACTER
Comma-delimited list of the generated temp-table include files
Top

PROTECTED CHARACTER GenerateXmlSchema ()

Purpose: Generates XML schema representation of the Dataset
Notes: Uses DATASET:WRITE-XMLSCHEMA method

Returns CHARACTER
The file name of the generated xsd file
Top

PROTECTED org.prorefactor.core.JPNode GetAnnotationNode (character, character)

Purpose: Locates the JPNode representing an Annotation in the source code
Notes:

Parameters:
pcFileName CHARACTER
The file name to parse
pcAnnotation CHARACTER
The name of the annotation
Returns org.prorefactor.core.JPNode
The JPNode reference representing the first occurance of the given annotation
Top

PROTECTED org.prorefactor.core.JPNode GetAnnotationNode (character, character, ParseUnit)

Purpose: Locates the JPNode representing an Annotation in the source code
Notes:

Parameters:
pcFileName CHARACTER
The file name to parse
pcAnnotation CHARACTER
The name of the annotation
poParseUnit org.prorefactor.treeparser.ParseUnit
Output Parameter, the ParseUnit used
Returns org.prorefactor.core.JPNode
The JPNode reference representing the first occurance of the given annotation
Top

PROTECTED GetAnnotationToFrom (character, character, character, character, integer, integer)

Purpose: Locates the lines a start and end annotation are contained in a
source code unit
Notes:

Parameters:
pcFileName CHARACTER
The file name to parse
pcStartAnnotation CHARACTER
The name of the start annotation
pcEndAnnotation CHARACTER
The name of the end annotation
pcAnnotationFileName CHARACTER
OUTPUT The file name containing the annotations
piStart INTEGER
The line number of the starting annotation
piEnd INTEGER
The line number of the ending annotation
Top

PROTECTED CHARACTER GetFieldMapping (character, integer)

Purpose: Returns the field mapping pairs for the named temp-table
Notes:

Parameters:
pcTempTableName CHARACTER
The name of the temp-table to return the field mappings for
piSpaces INTEGER
The number of SPACE Characters (CHR(32)) to prefix each entry with
Returns CHARACTER
The list of the field mappings
Top

PROTECTED CHARACTER GetTopNavBuffers ()

Purpose: Returns the comma delimited list of the top-nav buffers of the generated dataset
Notes:

Returns CHARACTER
The comma delimited list of the top-nav buffers
Top

PUBLIC CHARACTER GetUserName ()

Purpose: Returns the current windows user name
Notes:

Returns CHARACTER
The Display name of the current windows user
Top

PUBLIC LOGICAL HasValidations ()

Purpose: Returns if the Business Entity design contains validations
Notes:

Returns LOGICAL
Logical value indicating if the Business Entity design contains validations
Top

PROTECTED OnWriteFile (WriteFileEventArgs)

Purpose: Raises the WriteFile event
Notes:

Parameters:
e Consultingwerk.BusinessEntityDesigner.Generator.WriteFileEventArgs
The WriteFileEventArgs with the data for the event
Top

PROTECTED OpenFilesInIDE (character)

Purpose: Opens the generated files in the IDE
Notes:

Parameters:
pcFileNames CHARACTER
The comma delimited list of file names to open in the IDE
Top

PROTECTED LOGICAL PromptForOverwrite (character)

Purpose: Prompts for overwriting an existing file
Notes:

Parameters:
pcFileName CHARACTER
The file name to be used in the prompt dialog
Returns LOGICAL
Logical value indicating the response of the current user
Top

PUBLIC Consultingwerk.BusinessEntityDesigner.Generator.WriteFileEventArgs RaiseWriteFileEvent (character, character)

Purpose: Raises the WriteFile event from the Business Entity Dataset Controller
Notes:

Parameters:
pcFilePurpose CHARACTER
The purpose of the file being written
pcFileName CHARACTER
The name of the file being written
Returns Consultingwerk.BusinessEntityDesigner.Generator.WriteFileEventArgs
The WriteFileEventArgs with the result of the event
Top

PUBLIC LOGICAL RegenerateCode (dataset)

Purpose: Re-generates the source code
Notes: Currently this will only re-generate the dataset and temp-table
definitions, but leave the business entity and data access code
untouched

Parameters:
dsBusinessEntity DATASET
The dataset with the Business Entity model
Returns LOGICAL
Logical value indicating the success of the operation
Top

PROTECTED CHARACTER UnqualifiedTableNames (character)

Purpose: Returns a list of unqualified table names by removing the database prefix
Notes:

Parameters:
pcQualifiedTableNames CHARACTER
A comma delimited list of potentially DB qualified table names
Returns CHARACTER
The list of unqualified table names by removing the database prefix
Top

PROTECTED UpdateAttachDataSource (character)

Purpose: Updates the Attach Data Source Method
Notes:

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED CHARACTER UpdateBusinessEntity ()

Purpose: Updates the Business Entity by merging the current source code
with the model
Notes: Using Proparse to parse the file

Returns CHARACTER
The file name of the Business Entity
Top

PROTECTED UpdateBusinessEntityValidation (character)

Purpose: Updates the Business Entity Validation
Notes: Replaces source code within @GeneratedValidationStart. and
@GeneratedValidationEnd. annotations.

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED CHARACTER UpdateDataAccessObject ()

Purpose: Updates the Data Acess Object by merging the current source code
with the model
Notes: Using Proparse to parse the file

Returns CHARACTER
The file name of the Data Access Object
Top

PROTECTED UpdateDataSourceDefinition (character)

Purpose: Updates the Data Source Definition
Notes:

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED UpdateDetachDataSource (character)

Purpose: Updates the Detach Data Source Method
Notes:

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED UpdateExistingSourceDefaultQuery (character)

Purpose: Updates the SourecDefault Method
Notes:

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED UpdateSourceColumn (character)

Purpose: Updates the SourceColumn Method
Notes:

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED UpdateSourceDefaultQuery (character)

Purpose: Updates the SourecDefault Method
Notes: This method adds new SourceDefaultQuery CASE branches. The method
UpdateExistingSourceDefaultQuery verifies existing CASE branches.

Parameters:
pcFileName CHARACTER
The name of the Data Access source code
Top

PROTECTED CHARACTER ValidABLIdentifier (character)

Purpose: Limits the length of an identifier to 32 characters (ABL maximum)
Notes: Avoid error: Identifier was left blank or is more than 32 characters. (1700)

Parameters:
pcIdentifier CHARACTER
The intended ABL identifier
Returns CHARACTER
The identifier name rduced to 32 characters
Top

PROTECTED ValidateDesign ()

Purpose: Validates the Design information
Notes: Throws errors when there are issues in the Design



Constructor Detail
Top

PUBLIC BusinessEntityGenerator ()

Purpose: Constructor for the BusinessEntityGenerator class
Notes:



Event Detail
Top

PUBLIC WriteFile (Object, WriteFileEventArgs)

Purpose: Raised when the Business Entity Designer writes to an output file
Notes: Cancelable event, that can cancel the write of a single file. To
Cancel the whole business entity generation, event handlers should
throw an error

Parameters:
sender Progress.Lang.Object
The object that raised the WriteFile event
e Consultingwerk.BusinessEntityDesigner.Generator.WriteFileEventArgs
The WriteFileEventArgs with the data for the event


Property Detail
Top

PUBLIC Consultingwerk.BusinessEntityDesigner.Generator.Generated Generated

Purpose: Returns a structure that contains the most recently generated file
names
Notes:

Returns Consultingwerk.BusinessEntityDesigner.Generator.Generated
Top

PUBLIC LOGICAL OpenFilesInIDE

Purpose: Attempt to open files in OpenEdge Architect / Progress Developer Studio
for OpenEdge when done.
Notes:

Returns LOGICAL
Top

PUBLIC LOGICAL SilentMode

Purpose: Ignore status messages on completion
Notes:

Returns LOGICAL
Top

PUBLIC LOGICAL SilentModeUpdateDataAccess

Purpose: When SilentMode = TRUE this property gets and sets if the method
UpdateDataAccessObject should be updating the Data Access object
Notes:

Returns LOGICAL


©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:25:44