C# Class EAAddinFramework.Utils.Model

Afficher le fichier Open project: Helmut-Ortmann/EnterpriseArchitect_hoTools Class Usage Examples

Méthodes publiques

Méthode Description
ClipboardClear ( ) : void

Expose Clipboard.Clear()

ClipboardGetText ( ) : string

Expose Clipboard.SetText()

ClipboardGetText ( int textDataType ) : string

Exposes ClipboardGetText(TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;

ClipboardSetText ( object text ) : void

Expose Clipboard.SetText()

ClipboardSetText ( object text, object textDataType ) : void

Exposes ClipboardSetText(text, TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;

EscapeSqlString ( string sqlString ) : string

escapes a literal string so it can be inserted using sql

ExecuteSql ( string sqlString ) : bool

Execute SQL and catch Exception

FormatXPath ( string xpath ) : string

formats an xpath according to the type of database. For Oracle and Firebird it should be ALL CAPS

GetRepositoryType ( ) : RepositoryType

Gets the rep type for this model

Initialize ( EA rep ) : void

Initialize an rep Model object Intended to use from a scripting environment

MakeEaItemListFromQuery ( System.Xml.Linq.XDocument x ) : List

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML)

MakeEaXmlOutput ( System.Xml.Linq.XDocument x ) : string

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML). If nothing found or an error has occurred nothing is displayed.

MakeEaXmlOutput ( string x ) : string

Make EA XML output format from EA SQLQuery format (string)

Model ( ) : System

Create a model on the first running EA instance

Model ( EA repository ) : System

Create a Model

SearchRun ( string searchName, string searchTerm ) : void

Runs the search (EA search or hoTools SQL file if it's a *.sql file). It handles the exceptions. It converts wild cards of the <Search Term>.

SqlExecuteNative ( string sqlExecute ) : bool

EA Execute SQL: - formatSQL - runSQL - return SQL string

SqlExecuteWithException ( string sql ) : bool

Run EA SQL Query with Exception handling return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok

SqlQuery ( string sqlQuery ) : XmlDocument

EA SQL Query with: - formatSQL - runSQL - return SQL string as XmlDocument

SqlQueryNative ( string sqlQuery ) : string

EA SQL Query native with: - formatSQL - runSQL - return SQL string

SqlQueryWithException ( string query ) : string

Run EA SQL Query with Exception handling. It deletes the error file and reads it back to detect errors. return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok

SqlRun ( string sql, string searchText ) : void

Run an SQL string and if query output the result in EA Search Window. If update, insert, delete execute SQL. - replacement of macros - run query - format to output

Private Methods

Méthode Description
EmptyQueryResult ( ) : string

Empty Query Result

FormatSql ( string sqlQuery ) : string

sets the correct wild cards depending on the database type. changes '%' into '*' if on ms access and _ into ? on msAccess

FormatSqlFunctions ( string sqlQuery ) : string

Operation to translate SQL functions in there equivalents in different sql syntaxes supported functions: - lcase -> lower in T-SQL (SqlSvr and Asa)

FormatSqlTop ( string sqlQuery ) : string

limiting the number of results in an sql query is different on different platforms.

This operation will replace the SELECT TOP N by the appropriate sql syntax depending on the repository type

FormatSqldBspecific ( string sql ) : string

Format DB specific by removing unnecessary DB specific string parts.

ReplaceSqlWildCards ( string sqlQuery ) : string

Replace the wild cards in the given sql query string to match either MSAccess or ANSI syntax. It works for: % or * or #WC# Any character _ or ? a single character '^' or '!' a shortcut for XOR

Method Details

ClipboardClear() public méthode

Expose Clipboard.Clear()
public ClipboardClear ( ) : void
Résultat void

ClipboardGetText() public méthode

Expose Clipboard.SetText()
public ClipboardGetText ( ) : string
Résultat string

ClipboardGetText() public méthode

Exposes ClipboardGetText(TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;
public ClipboardGetText ( int textDataType ) : string
textDataType int
Résultat string

ClipboardSetText() public méthode

Expose Clipboard.SetText()
public ClipboardSetText ( object text ) : void
text object
Résultat void

ClipboardSetText() public méthode

Exposes ClipboardSetText(text, TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;
public ClipboardSetText ( object text, object textDataType ) : void
text object
textDataType object
Résultat void

EscapeSqlString() public méthode

escapes a literal string so it can be inserted using sql
public EscapeSqlString ( string sqlString ) : string
sqlString string the string to be escaped
Résultat string

ExecuteSql() public méthode

Execute SQL and catch Exception
public ExecuteSql ( string sqlString ) : bool
sqlString string
Résultat bool

FormatXPath() public méthode

formats an xpath according to the type of database. For Oracle and Firebird it should be ALL CAPS
public FormatXPath ( string xpath ) : string
xpath string the xpath to format
Résultat string

GetRepositoryType() public méthode

Gets the rep type for this model
public GetRepositoryType ( ) : RepositoryType
Résultat RepositoryType

Initialize() public méthode

Initialize an rep Model object Intended to use from a scripting environment
public Initialize ( EA rep ) : void
rep EA
Résultat void

MakeEaItemListFromQuery() public méthode

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML)
public MakeEaItemListFromQuery ( System.Xml.Linq.XDocument x ) : List
x System.Xml.Linq.XDocument Output from EA SQLQuery
Résultat List

MakeEaXmlOutput() public méthode

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML). If nothing found or an error has occurred nothing is displayed.
public MakeEaXmlOutput ( System.Xml.Linq.XDocument x ) : string
x System.Xml.Linq.XDocument Output from EA SQLQuery
Résultat string

MakeEaXmlOutput() public méthode

Make EA XML output format from EA SQLQuery format (string)
public MakeEaXmlOutput ( string x ) : string
x string
Résultat string

Model() public méthode

Create a model on the first running EA instance
public Model ( ) : System
Résultat System

Model() public méthode

Create a Model
public Model ( EA repository ) : System
repository EA
Résultat System

SearchRun() public méthode

Runs the search (EA search or hoTools SQL file if it's a *.sql file). It handles the exceptions. It converts wild cards of the <Search Term>.
public SearchRun ( string searchName, string searchTerm ) : void
searchName string EA Search name or SQL file name (uses path to find absolute path)
searchTerm string
Résultat void

SqlExecuteNative() public méthode

EA Execute SQL: - formatSQL - runSQL - return SQL string
public SqlExecuteNative ( string sqlExecute ) : bool
sqlExecute string
Résultat bool

SqlExecuteWithException() public méthode

Run EA SQL Query with Exception handling return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok
public SqlExecuteWithException ( string sql ) : bool
sql string
Résultat bool

SqlQuery() public méthode

EA SQL Query with: - formatSQL - runSQL - return SQL string as XmlDocument
public SqlQuery ( string sqlQuery ) : XmlDocument
sqlQuery string
Résultat System.Xml.XmlDocument

SqlQueryNative() public méthode

EA SQL Query native with: - formatSQL - runSQL - return SQL string
public SqlQueryNative ( string sqlQuery ) : string
sqlQuery string
Résultat string

SqlQueryWithException() public méthode

Run EA SQL Query with Exception handling. It deletes the error file and reads it back to detect errors. return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok
public SqlQueryWithException ( string query ) : string
query string
Résultat string

SqlRun() public méthode

Run an SQL string and if query output the result in EA Search Window. If update, insert, delete execute SQL. - replacement of macros - run query - format to output
public SqlRun ( string sql, string searchText ) : void
sql string
searchText string Search Text to replace 'Search Term' macro
Résultat void