C# Class TSF.UmlToolingFramework.Wrappers.EA.Model

Inheritance: TSF.UmlToolingFramework.UML.UMLModel
Show file Open project: GeertBellekens/Enterprise-Architect-Add-in-Framework Class Usage Examples

Public Methods

Method Description
Model ( ) : System
Model ( global eaRepository ) : System
SQLQuery ( string sqlQuery ) : XmlDocument
addTab ( string title, string fullControlName ) : UserControl
addTaggedValueType ( string tagName, string tagDescription, string tagDetail ) : void
addWindow ( string title, string fullControlName ) : UserControl
adviseChange ( TSF.UmlToolingFramework.UML element ) : void
escapeSQLString ( string sqlString ) : string

escapes a literal string so it can be inserted using sql

executeSQL ( string SQLString ) : void
formatXPath ( string xpath ) : string

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

getAttributeByID ( int attributID ) : Attribute

gets the Attribute with the given ID

getAttributeTagByGUID ( string GUID ) : AttributeTag
getAttributeTagsWithValue ( string value ) : List
getAttributeWrapperByGUID ( string GUID ) : AttributeWrapper

gets the Attribute with the given GUID

getAttributesByQuery ( string SQLQuery ) : List
getCurrentRootPackage ( ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Package
getDiagramByGUID ( string diagramGUID ) : Diagram
getDiagramByID ( int diagramID ) : Diagram
getDiagramsByQuery ( string sqlGetDiagrams ) : List
getElementByGUID ( string GUIDstring ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Element
getElementTagByGUID ( string GUID ) : ElementTag
getElementTagsWithValue ( string value ) : HashSet
getElementWrapperByGUID ( string GUID ) : ElementWrapper

Finds the EA.Element with the given GUID and returns an EAElementwrapper wrapping this element.

getElementWrapperByID ( int id ) : ElementWrapper
getElementWrapperByPackageID ( int packageID ) : ElementWrapper
getElementWrappersByQuery ( string sqlQuery ) : List

returns the elementwrappers that are identified by the Object_ID's returned by the given query

getItemFromFQN ( string FQN ) : TSF.UmlToolingFramework.UML.Extended.UMLItem
getItemFromGUID ( string guidString ) : TSF.UmlToolingFramework.UML.Extended.UMLItem

finds the item with the given guid

getOperationByGUID ( string guid ) : Operation
getOperationByID ( int operationID ) : Operation
getOperationTagByGUID ( string GUID ) : OperationTag
getOperationTagsWithValue ( string value ) : List
getOperationsByQuery ( string SQLQuery ) : List
getParameterByGUID ( string GUID ) : ParameterWrapper

gets the parameter by its GUID. This is a tricky one since EA doesn't provide a getParameterByGUID operation we have to first get the operation, then loop the pamarameters to find the one with the GUID

getParameterTagByGUID ( string GUID ) : ParameterTag
getParameterTagsWithValue ( string value ) : List
getParametersByQuery ( string SQLQuery ) : List
getQuickSearchResults ( string searchText, int maxResults, bool elements, bool operations, bool attributes, bool diagrams ) : List

returns the first [maxresults] items who's name starts with the given searchText

getRelationByGUID ( string relationGUID ) : ConnectorWrapper
getRelationByID ( int relationID ) : ConnectorWrapper
getRelationTagByGUID ( string GUID ) : RelationTag
getRelationTagsWithValue ( string value ) : List
getRelationsByQuery ( string SQLQuery ) : List
getRepositoryType ( ) : RepositoryType

Gets the Repository type for this model

getRoootPackage ( TSF.UmlToolingFramework.UML item ) : RootPackage
getTaggedValuesWithValue ( string value ) : HashSet
getUserSelectedElement ( List allowedTypes ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Element

Lets the user select an element from the model and return that

getUserSelectedPackage ( ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Package

Show a dialog to the user that allows him to select a package from the model

initialize ( global eaRepository ) : void

(re)initialises this model with the given ea repository object

openProperties ( TSF.UmlToolingFramework.UML item ) : void

opens the properties dialog for this item

refreshDiagram ( Diagram diagram ) : void
reloadDiagrams ( ) : void

reload the open diagrams

saveDiagram ( TSF.UmlToolingFramework.UML diagram ) : void
saveElement ( TSF.UmlToolingFramework.UML element ) : void
saveOpenedDiagram ( TSF.UmlToolingFramework.UML diagram ) : void

saves unsaved changes to an opened diagram

selectDiagram ( Diagram diagram ) : void
showTab ( string title ) : void
showWindow ( string title ) : void
taggedValueTypeExists ( string tagName ) : bool

checks if a tagged value type with the given name exists in the current model

toArrayList ( IEnumerable collection ) : ArrayList
toObject ( object someObject ) : Object

Private Methods

Method Description
convertFromEANotes ( string EANotes, string newFormat ) : string
convertToEANotes ( string externalNotes, string externalFormat ) : string
formatSQL ( string sqlQuery ) : string

sets the correct wildcards 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. "SELECT TOP N" is used on SQLSVR ADOJET ASA OPENEDGE ACCESS2007 "WHERE rowcount <= N" is used on ORACLE "LIMIT N" is used on MYSQL POSTGRES This operation will replace the SELECT TOP N by the appropriate sql syntax depending on the repositorytype

replaceSQLWildCards ( string sqlQuery ) : string

replace the wildcards in the given sql query string to match either MSAccess or ANSI syntax

Method Details

Model() public method

public Model ( ) : System
return System

Model() public method

public Model ( global eaRepository ) : System
eaRepository global
return System

SQLQuery() public method

public SQLQuery ( string sqlQuery ) : XmlDocument
sqlQuery string
return System.Xml.XmlDocument

addTab() public method

public addTab ( string title, string fullControlName ) : UserControl
title string
fullControlName string
return System.Windows.Forms.UserControl

addTaggedValueType() public method

public addTaggedValueType ( string tagName, string tagDescription, string tagDetail ) : void
tagName string
tagDescription string
tagDetail string
return void

addWindow() public method

public addWindow ( string title, string fullControlName ) : UserControl
title string
fullControlName string
return System.Windows.Forms.UserControl

adviseChange() public method

public adviseChange ( TSF.UmlToolingFramework.UML element ) : void
element TSF.UmlToolingFramework.UML
return void

escapeSQLString() public method

escapes a literal string so it can be inserted using sql
public escapeSQLString ( string sqlString ) : string
sqlString string the string to be escaped
return string

executeSQL() public method

public executeSQL ( string SQLString ) : void
SQLString string
return void

formatXPath() public method

formats an xpath accordign 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
return string

getAttributeByID() public method

gets the Attribute with the given ID
public getAttributeByID ( int attributID ) : Attribute
attributID int the attribute's ID
return Attribute

getAttributeTagByGUID() public method

public getAttributeTagByGUID ( string GUID ) : AttributeTag
GUID string
return AttributeTag

getAttributeTagsWithValue() public method

public getAttributeTagsWithValue ( string value ) : List
value string
return List

getAttributeWrapperByGUID() public method

gets the Attribute with the given GUID
public getAttributeWrapperByGUID ( string GUID ) : AttributeWrapper
GUID string the attribute's GUID
return AttributeWrapper

getAttributesByQuery() public method

public getAttributesByQuery ( string SQLQuery ) : List
SQLQuery string
return List

getCurrentRootPackage() public method

public getCurrentRootPackage ( ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Package
return TSF.UmlToolingFramework.UML.Classes.Kernel.Package

getDiagramByGUID() public method

public getDiagramByGUID ( string diagramGUID ) : Diagram
diagramGUID string
return Diagram

getDiagramByID() public method

public getDiagramByID ( int diagramID ) : Diagram
diagramID int
return Diagram

getDiagramsByQuery() public method

public getDiagramsByQuery ( string sqlGetDiagrams ) : List
sqlGetDiagrams string
return List

getElementByGUID() public method

public getElementByGUID ( string GUIDstring ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Element
GUIDstring string
return TSF.UmlToolingFramework.UML.Classes.Kernel.Element

getElementTagByGUID() public method

public getElementTagByGUID ( string GUID ) : ElementTag
GUID string
return ElementTag

getElementTagsWithValue() public method

public getElementTagsWithValue ( string value ) : HashSet
value string
return HashSet

getElementWrapperByGUID() public method

Finds the EA.Element with the given GUID and returns an EAElementwrapper wrapping this element.
public getElementWrapperByGUID ( string GUID ) : ElementWrapper
GUID string the GUID of the element
return ElementWrapper

getElementWrapperByID() public method

public getElementWrapperByID ( int id ) : ElementWrapper
id int
return ElementWrapper

getElementWrapperByPackageID() public method

public getElementWrapperByPackageID ( int packageID ) : ElementWrapper
packageID int
return ElementWrapper

getElementWrappersByQuery() public method

returns the elementwrappers that are identified by the Object_ID's returned by the given query
public getElementWrappersByQuery ( string sqlQuery ) : List
sqlQuery string query returning the Object_ID's
return List

getItemFromFQN() public method

public getItemFromFQN ( string FQN ) : TSF.UmlToolingFramework.UML.Extended.UMLItem
FQN string
return TSF.UmlToolingFramework.UML.Extended.UMLItem

getItemFromGUID() public method

finds the item with the given guid
public getItemFromGUID ( string guidString ) : TSF.UmlToolingFramework.UML.Extended.UMLItem
guidString string the string with the guid
return TSF.UmlToolingFramework.UML.Extended.UMLItem

getOperationByGUID() public method

public getOperationByGUID ( string guid ) : Operation
guid string
return Operation

getOperationByID() public method

public getOperationByID ( int operationID ) : Operation
operationID int
return Operation

getOperationTagByGUID() public method

public getOperationTagByGUID ( string GUID ) : OperationTag
GUID string
return OperationTag

getOperationTagsWithValue() public method

public getOperationTagsWithValue ( string value ) : List
value string
return List

getOperationsByQuery() public method

public getOperationsByQuery ( string SQLQuery ) : List
SQLQuery string
return List

getParameterByGUID() public method

gets the parameter by its GUID. This is a tricky one since EA doesn't provide a getParameterByGUID operation we have to first get the operation, then loop the pamarameters to find the one with the GUID
public getParameterByGUID ( string GUID ) : ParameterWrapper
GUID string the parameter's GUID
return ParameterWrapper

getParameterTagByGUID() public method

public getParameterTagByGUID ( string GUID ) : ParameterTag
GUID string
return ParameterTag

getParameterTagsWithValue() public method

public getParameterTagsWithValue ( string value ) : List
value string
return List

getParametersByQuery() public method

public getParametersByQuery ( string SQLQuery ) : List
SQLQuery string
return List

getQuickSearchResults() public method

returns the first [maxresults] items who's name starts with the given searchText
public getQuickSearchResults ( string searchText, int maxResults, bool elements, bool operations, bool attributes, bool diagrams ) : List
searchText string the first part of the name to match
maxResults int the number of results required
elements bool indicates whether elements should be selected
operations bool indicates whether operations should be selected
attributes bool indicates whether attributes should be selected
diagrams bool indicates whether diagrams should be selected
return List

getRelationByGUID() public method

public getRelationByGUID ( string relationGUID ) : ConnectorWrapper
relationGUID string
return ConnectorWrapper

getRelationByID() public method

public getRelationByID ( int relationID ) : ConnectorWrapper
relationID int
return ConnectorWrapper

getRelationTagByGUID() public method

public getRelationTagByGUID ( string GUID ) : RelationTag
GUID string
return RelationTag

getRelationTagsWithValue() public method

public getRelationTagsWithValue ( string value ) : List
value string
return List

getRelationsByQuery() public method

public getRelationsByQuery ( string SQLQuery ) : List
SQLQuery string
return List

getRepositoryType() public method

Gets the Repository type for this model
public getRepositoryType ( ) : RepositoryType
return RepositoryType

getRoootPackage() public method

public getRoootPackage ( TSF.UmlToolingFramework.UML item ) : RootPackage
item TSF.UmlToolingFramework.UML
return RootPackage

getTaggedValuesWithValue() public method

public getTaggedValuesWithValue ( string value ) : HashSet
value string
return HashSet

getUserSelectedElement() public method

Lets the user select an element from the model and return that
public getUserSelectedElement ( List allowedTypes ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Element
allowedTypes List the subtypes of UML.Classes.Kernel.Element that should be used as a filter
return TSF.UmlToolingFramework.UML.Classes.Kernel.Element

getUserSelectedPackage() public method

Show a dialog to the user that allows him to select a package from the model
public getUserSelectedPackage ( ) : TSF.UmlToolingFramework.UML.Classes.Kernel.Package
return TSF.UmlToolingFramework.UML.Classes.Kernel.Package

initialize() public method

(re)initialises this model with the given ea repository object
public initialize ( global eaRepository ) : void
eaRepository global the ea repository object
return void

openProperties() public method

opens the properties dialog for this item
public openProperties ( TSF.UmlToolingFramework.UML item ) : void
item TSF.UmlToolingFramework.UML the item to open the properties dialog for
return void

refreshDiagram() public method

public refreshDiagram ( Diagram diagram ) : void
diagram Diagram
return void

reloadDiagrams() public method

reload the open diagrams
public reloadDiagrams ( ) : void
return void

saveDiagram() public method

public saveDiagram ( TSF.UmlToolingFramework.UML diagram ) : void
diagram TSF.UmlToolingFramework.UML
return void

saveElement() public method

public saveElement ( TSF.UmlToolingFramework.UML element ) : void
element TSF.UmlToolingFramework.UML
return void

saveOpenedDiagram() public method

saves unsaved changes to an opened diagram
public saveOpenedDiagram ( TSF.UmlToolingFramework.UML diagram ) : void
diagram TSF.UmlToolingFramework.UML the diagram that is currently opened
return void

selectDiagram() public method

public selectDiagram ( Diagram diagram ) : void
diagram Diagram
return void

showTab() public method

public showTab ( string title ) : void
title string
return void

showWindow() public method

public showWindow ( string title ) : void
title string
return void

taggedValueTypeExists() public method

checks if a tagged value type with the given name exists in the current model
public taggedValueTypeExists ( string tagName ) : bool
tagName string the name of the tagged value type
return bool

toArrayList() public method

public toArrayList ( IEnumerable collection ) : ArrayList
collection IEnumerable
return ArrayList

toObject() public method

public toObject ( object someObject ) : Object
someObject object
return Object