Interface IEncyclopedia
-
public interface IEncyclopedia
Enables access to the encyclopedia's attributes and methods.This interface is not intended to be implemented by clients.
- Since:
- 2.2.0
- See Also:
SAApplication.getEncyclopedia()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
closeUnLock(LockMode mode)
Closes the encyclopedia lock.IDefinition
createDefinition(String name, long type)
Creates an instance of the definition class with a specified definition name and definition type.IDiagram
createDiagram(String name, long type)
Creates an instance of the diagram class with a specified diagram name and diagram type.void
exportXML(File file)
Exports the encyclopedia's XML content into a valid xml file.SAApplication
getApplication()
The application object returns the parent application object of the current encyclopedia object.IEncyclopediaConnection
getConnection()
Returns the information required to connect to an encyclopedia.IDiagram
getCurrentDiagram()
Returns the currently open diagram.IDefinition
getDefinitionById(long id)
Returns a definition from its specified identity.IDefinition
getDefinitionByName(String name, long type)
Returns a definition from its specified name.List<IDefinition>
getDefinitions()
Returns all definitions in the encyclopedia.List<IDefinition>
getDefinitions(String pattern, long type)
Returns a filtered definition collection of an encyclopedia.IDiagram
getDiagramById(long id)
Returns a diagram from its specified identity.IDiagram
getDiagramByName(String name, long type)
Returns a diagram from its specified identity.List<IDiagram>
getDiagrams()
Returns all diagrams in the encyclopedia.List<IDiagram>
getDiagrams(String pattern, long type)
Returns a filtered diagram collection of an encyclopedia.String
getFullName()
Returns the name of the current encyclopedia including the full path.IMetaModel
getMetaModel()
Returns the MetaModel Class.String
getName()
Returns the name of the current encyclopedia.String
getPath()
Returns the path of the current encyclopedia.void
importXML(File xmlFile, CollisionMode collisionMode)
Imports an xml file into the encyclopedia.void
importXML(InputSource source, CollisionMode collisionMode)
Imports an xml file into the encyclopedia.boolean
isOpenObjectsAsReadOnly()
Determines whether all objects from the Object model are to be opened as Read-only.boolean
openLock(LockMode mode)
The OpenLock and CloseUnlock methods control the lock status of the current System Architect encyclopedia.void
setOpenObjectsAsReadOnly(boolean value)
Sets whether all objects from the Object model are to be opened as Read-only.
-
-
-
Method Detail
-
getApplication
SAApplication getApplication()
The application object returns the parent application object of the current encyclopedia object.- Returns:
- the parent application object of the current encyclopedia.
-
getFullName
String getFullName()
Returns the name of the current encyclopedia including the full path.- Returns:
- the name of the current encyclopedia including the full path.
-
getName
String getName()
Returns the name of the current encyclopedia.- Returns:
- the name of the current encyclopedia.
-
getPath
String getPath()
Returns the path of the current encyclopedia.- Returns:
- the path of the current encyclopedia.
-
getConnection
IEncyclopediaConnection getConnection()
Returns the information required to connect to an encyclopedia.- Returns:
- the information required to connect to an encyclopedia.
-
getMetaModel
IMetaModel getMetaModel()
Returns the MetaModel Class. If facilitates access to all the MetaModel attributes.- Returns:
- the MetaModel Class.
-
isOpenObjectsAsReadOnly
boolean isOpenObjectsAsReadOnly()
Determines whether all objects from the Object model are to be opened as Read-only.- Returns:
true
if all objects from the Object model are to be opened as Read-only,false
otherwise.
-
setOpenObjectsAsReadOnly
void setOpenObjectsAsReadOnly(boolean value)
Sets whether all objects from the Object model are to be opened as Read-only.- Parameters:
value
-true
if all objects from the Object model are to be opened as Read-only,false
otherwise.
-
openLock
boolean openLock(LockMode mode)
The OpenLock and CloseUnlock methods control the lock status of the current System Architect encyclopedia. This determines whether the encyclopedia is locked for read-only, read-write or update access while operations are taking place.
If an OpenLock is executed in a particular mode then a CloseUnlock must be executed in the same mode later in the code.
OpenLock and CloseUnlock methods can be operated multiple times in code if different levels of locking are required on the encyclopedia.
If OpenLock and CloseUnlock methods are not executed in the code then System Architect will perform it's own locking when required each time an Object Model method is issued. This can affect the performance of the code.
- Parameters:
mode
- lock status of current System Architect Encyclopedia.- Returns:
true
if the method was successful,false
otherwise.- See Also:
closeUnLock(LockMode)
-
closeUnLock
boolean closeUnLock(LockMode mode)
Closes the encyclopedia lock.- Parameters:
mode
- lock status of current System Architect Encyclopedia.- Returns:
true
if the method was successful,false
otherwise.- See Also:
openLock(LockMode)
-
createDefinition
IDefinition createDefinition(String name, long type)
Creates an instance of the definition class with a specified definition name and definition type.Refer to the DEFNS.BAS file in the System Architect directory for a complete listing of all definitions and their internal numbers.
- Parameters:
name
- name of new definition.type
- type of System Architect definition that is being created.- Returns:
- the created definition.
-
getDefinitions
List<IDefinition> getDefinitions()
Returns all definitions in the encyclopedia.- Returns:
- all definitions in the encyclopedia.
-
getDefinitions
List<IDefinition> getDefinitions(String pattern, long type)
Returns a filtered definition collection of an encyclopedia.Refer to the DEFNS.BAS file in the System Architect directory for a complete listing of all definitions and their internal numbers.
- Parameters:
pattern
- filter criteria (e.g."C*"
means all definitions starting with"C"
). The pattern is case sensitive.type
- type of System Architect definition that is being retrieved .- Returns:
- all definitions matching the specified criteria.
-
getDefinitionById
IDefinition getDefinitionById(long id)
Returns a definition from its specified identity.All definitions stored in System Architect are uniquely identified internally by the use of a data dictionary identifier.
- Parameters:
id
- the definition identifier.- Returns:
- the definition matching the specified identifier,
null
if there is no match.
-
getDefinitionByName
IDefinition getDefinitionByName(String name, long type)
Returns a definition from its specified name.Refer to the DEFNS.BAS file in the System Architect directory for a complete listing of all definitions and their internal numbers.
- Parameters:
name
- the definition name.type
- type of System Architect definition.- Returns:
- the definition matching the specified name,
null
if there is no match.
-
createDiagram
IDiagram createDiagram(String name, long type)
Creates an instance of the diagram class with a specified diagram name and diagram type.Refer to the DIAGRAMS.BAS file in the System Architect directory for a complete listing of all diagrams and their internal numbers.
- Parameters:
name
- name of new diagram.type
- type of System Architect diagram that is being created.- Returns:
- the created diagram.
-
getDiagrams
List<IDiagram> getDiagrams()
Returns all diagrams in the encyclopedia.- Returns:
- all diagrams in the encyclopedia.
-
getDiagrams
List<IDiagram> getDiagrams(String pattern, long type)
Returns a filtered diagram collection of an encyclopedia.Refer to the DIAGRAMS.BAS file in the System Architect directory for a complete listing of all diagrams and their internal numbers.
- Parameters:
pattern
- filter criteria (e.g."C*"
means all diagrams starting with"C"
). The pattern is case sensitive.type
- type of System Architect diagram that is being retrieved .- Returns:
- all diagrams matching the specified criteria.
-
getDiagramById
IDiagram getDiagramById(long id)
Returns a diagram from its specified identity.All diagrams stored in System Architect are uniquely identified internally by the use of a data dictionary identifier.
- Parameters:
id
- the diagram identifier.- Returns:
- the diagram matching the specified identifier,
null
if there is no match.
-
getDiagramByName
IDiagram getDiagramByName(String name, long type)
Returns a diagram from its specified identity.Refer to the DIAGRAMS.BAS file in the System Architect directory for a complete listing of all diagrams and their internal numbers.
- Parameters:
name
- the diagram name.type
- type of System Architect diagram.- Returns:
- the diagram matching the specified identifier,
null
if there is no match.
-
getCurrentDiagram
IDiagram getCurrentDiagram()
Returns the currently open diagram.- Returns:
- the currently open diagram.
-
importXML
void importXML(File xmlFile, CollisionMode collisionMode)
Imports an xml file into the encyclopedia.- Parameters:
xmlFile
- a valid xml file name, from which System Architect is importing the XML code.collisionMode
- determines how to handle conflicts.
-
importXML
void importXML(InputSource source, CollisionMode collisionMode) throws IOException
Imports an xml file into the encyclopedia.- Parameters:
source
- a source containing XML data, from which System Architect is importing the XML code.collisionMode
- determines how to handle conflicts.- Throws:
IOException
- if reading the character stream of byte stream throws an error.
-
exportXML
void exportXML(File file)
Exports the encyclopedia's XML content into a valid xml file.Preconditions:
- There must not be any diagram open in the application.
- Parameters:
file
- a valid xml file name to which System Architect will export the encyclopedia's xml content.
-
-