com.change_vision.jude.api.inf.project
Interface ProjectAccessor

com.change_vision.jude.api.inf.project.ProjectAccessor

public ProjectAccessor

Interface to Operate astah* project.


Field Summary
static int REFERENCE_PROJECT_STATUS_LATEST
           
static int REFERENCE_PROJECT_STATUS_NEED_UPDATE
           
static int REFERENCE_PROJECT_STATUS_NOT_FOUND
           
 
Method Summary
abstract  void addEntityEditListener(EntityEditListener listener)
          Add EntityEditListener.
abstract  void addProjectEventListener()
          Add ProjectEventListener.
abstract  void addReferenceProject(String path)
          Add Reference Project in astah* Project.
abstract  void changeReferenceProject(String fromPath, String toPath)
          Change Reference Project Path in astah* Project.
abstract  void clearReferenceProject(String path)
          Clear Reference Project in astah* Project.
abstract  void close()
          Close astah* Project.
abstract  void create(String projectPath, boolean useDefinedTaggedValues)
          Create astah* Project.
abstract  void create(String projectPath)
          Create astah* Project without loading the user defined tagged values.
abstract  void create()
          Create Astah project without loading the user defined tagged values.
abstract  void create(String projectPath, String templatePath, boolean useDefinedTaggedValue)
          Create astah* Project.
abstract  void create(String projectPath, String templatePath)
          Create astah* Project without loading the user defined tagged values.
abstract  void easyCompare(String path)
          Easy compare.
abstract  void easyMerge(String path, boolean isKeepBase)
          Merge a project into the current project.
abstract  void exportXMI(String fileName)
          Save astah* Project as parameter's xmi name.
abstract  INamedElement[] findElements(Class elementKind, String name)
          Search elements in an astah* model by element kind and element name.
abstract  INamedElement[] findElements(Class elementKind)
          Search elements in an astah* model by element kind.
abstract  INamedElement[] findElements(ModelFinder picker)
          Search elements in an astah* model by ModelPicker.
abstract  int getAstahAPIModelVersion()
          Obtain the model version of project created by astah* API
abstract  String getAstahAPIVersion()
          Obtain the version of astah* API
abstract  String getAstahEdition()
          Obtain the edition of astah* you currently use
abstract  String getAstahInstallPath()
          Obtain where the astah* installation path
abstract  int getAstahModelVersion()
          Obtain the model version of project created by this astah*
abstract  String getAstahVersion()
          Obtain the version of astah* you currently use
abstract  IDiagramEditorFactory getDiagramEditorFactory()
          Get IDiagramEditorFactory.
abstract  IEntity getEntity(String id)
          Returns IEntity that has special ID.
abstract  IModelEditorFactory getModelEditorFactory()
          Get IModelEditorFactory.
abstract  IModel getProject()
          Get Model of project accessor.
abstract  String getProjectPath()
          Obtain where the astah* project is saved
abstract  String[] getReferenceProjectPaths()
          Get Reference Project Paths in astah* Project.
abstract  int getReferenceProjectStatus(String path)
          Get Reference Project Status in astah* Project.
abstract  ITransactionManager getTransactionManager()
          Get ITransactionManager.
abstract  IViewManager getViewManager()
          Get IViewManager.
abstract  boolean hasProject()
          Get whether a project is open or not.
abstract  boolean hasSameElement(String name)
          hasSameElement
abstract  boolean hasSameElement(String name, Class clazz)
          hasSameElement
abstract  void importXMI(String projectName)
          Open astah* Project's XMI.
abstract  void importXMI(String projectName, boolean isIgnoreModelVersion)
          Open astah* Project's XMI.
abstract  boolean isProjectModified()
          isProjectModified
abstract  void open(String projectName)
          Open astah* Project.
abstract  void open(String projectName, boolean isIgnoreModelVersion)
          Open astah* Project.
abstract  void open(String projectName, boolean isIgnoreModelVersion, boolean lockMode, boolean allowReadOnly)
          Open astah* Project.
abstract  void open(InputStream in)
          Open astah* Project.
abstract  void open(InputStream in, boolean isIgnoreModelVersion)
          Open astah* Project.
abstract  void removeEntityEditListener(EntityEditListener listener)
          Remove EntityEditListener.
abstract  void removeProjectEventListener()
          Remove ProjectEventListener.
abstract  void removeReferenceProject(String path)
          Delete Reference Project in astah* Project.
abstract  void save()
          Save astah* Project.
abstract  void saveAs(String projectName)
          Save astah* Project as parameter's name.
abstract  void updateReferenceProject(String path)
          Update Reference Project in astah* Project.
abstract  void validateProject()
          Find invalid models in astah* project
 

Field Detail

REFERENCE_PROJECT_STATUS_LATEST

static final int REFERENCE_PROJECT_STATUS_LATEST

REFERENCE_PROJECT_STATUS_NEED_UPDATE

static final int REFERENCE_PROJECT_STATUS_NEED_UPDATE

REFERENCE_PROJECT_STATUS_NOT_FOUND

static final int REFERENCE_PROJECT_STATUS_NOT_FOUND
Method Detail

open

abstract void open(String projectName)
Open astah* Project.

Parameters:
projectName - Project Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(String projectName,
                   boolean isIgnoreModelVersion)
Open astah* Project.

Parameters:
projectName - Project Name
isIgnoreModelVersion - Select if you need a Model Version Check
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(String projectName,
                   boolean isIgnoreModelVersion,
                   boolean lockMode,
                   boolean allowReadOnly)
Open astah* Project.

Parameters:
projectName - Project Name
isIgnoreModelVersion - Select if you need a Model Version Check
lockMode - Select if you lock a project file
allowReadOnly - Select if you open a project in ReadOnly mode when it has been locked.
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

saveAs

abstract void saveAs(String projectName)
Save astah* Project as parameter's name. If an argument is a relative path, save in the current directory.

Parameters:
fileName - File Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
IOException - input/output error
ProjectLockedException - Project file has been locked

importXMI

abstract void importXMI(String projectName)
Open astah* Project's XMI.

Parameters:
projectName - Project Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
InvalidUsingException - community version and UML version cannot use XMI API.

importXMI

abstract void importXMI(String projectName,
                        boolean isIgnoreModelVersion)
Open astah* Project's XMI.

Parameters:
projectName - Project Name
isIgnoreModelVersion - Select if you need a Model Version Check
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
InvalidUsingException - community version and UML version cannot use XMI API.

exportXMI

abstract void exportXMI(String fileName)
Save astah* Project as parameter's xmi name.

Parameters:
fileName - File Name
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
IOException - input/output error
InvalidUsingException - community version and UML version cannot use XMI API.

open

abstract void open(InputStream in)
Open astah* Project.

Parameters:
in - InputStream
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error
ProjectLockedException - Project file has been locked

open

abstract void open(InputStream in,
                   boolean isIgnoreModelVersion)
Open astah* Project.

Parameters:
in - InputStream
isIgnoreModelVersion - Select if you need a Model Version Check
Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
NonCompatibleException - Old Model Version (The version of API is older than the version of astah* this project has been last edited with)
ClassNotFoundException - Cannot read some models
IOException - input/output error

getProject

abstract IModel getProject()
Get Model of project accessor.

Returns:
Model

hasProject

abstract boolean hasProject()
Get whether a project is open or not.

Returns:
true: If a project is open.

close

abstract void close()
Close astah* Project.


create

abstract void create(String projectPath,
                     boolean useDefinedTaggedValues)
Create astah* Project.

Parameters:
projectPath - Project Path
useDefinedTaggedValues - Set if you need to load the user defined tagged values as creating the project
Throws:
IOException - input/output error

create

abstract void create(String projectPath)
Create astah* Project without loading the user defined tagged values.

Parameters:
projectPath - Project Path
Throws:
IOException - input/output error

create

abstract void create()
Create Astah project without loading the user defined tagged values. The path of the project should be specified by using saveAs().

Throws:
IOException - input/output error
Since:
6.6

create

abstract void create(String projectPath,
                     String templatePath,
                     boolean useDefinedTaggedValue)
Create astah* Project.

Parameters:
projectPath - Project Path
templatePath - Template Path
useDefinedTaggedValues - Set if you need to load the user defined tagged values as creating the project
Throws:
IOException - input/output error
ProjectNotFoundException - Project cannot be found

create

abstract void create(String projectPath,
                     String templatePath)
Create astah* Project without loading the user defined tagged values.

Parameters:
projectPath - Project Path
templatePath - Template Path
Throws:
IOException - input/output error
ProjectNotFoundException - Project cannot be found

save

abstract void save()
Save astah* Project.

Throws:
LicenseNotFoundException - License cannot be found
ProjectNotFoundException - Project cannot be found
IOException - input/output error
ProjectLockedException - Project has been locked

validateProject

abstract void validateProject()
Find invalid models in astah* project

Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist

addReferenceProject

abstract void addReferenceProject(String path)
Add Reference Project in astah* Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys: 
      ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in astah* community. 
      PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values: 
      Error messages for exceptions.

removeReferenceProject

abstract void removeReferenceProject(String path)
Delete Reference Project in astah* Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys: 
      ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in astah* community. 
      PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values: 
      Error messages for exceptions.

updateReferenceProject

abstract void updateReferenceProject(String path)
Update Reference Project in astah* Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys: 
      ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in astah* community. 
      PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values: 
      Error messages for exceptions.

clearReferenceProject

abstract void clearReferenceProject(String path)
Clear Reference Project in astah* Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys: 
      ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in astah* community. 
      PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values: 
      Error messages for exceptions.

changeReferenceProject

abstract void changeReferenceProject(String fromPath,
                                     String toPath)
Change Reference Project Path in astah* Project.

Parameters:
fromPath - Original Reference Project Path. Absolute/Relative Path can be specified.
toPath - New Reference Project Path Absolute/Relative Path can be specified.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys: 
      ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in astah* community. 
      PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values: 
      Error messages for exceptions.

getReferenceProjectPaths

abstract String[] getReferenceProjectPaths()
Get Reference Project Paths in astah* Project.

Returns:
Reference Project Paths. Absolute or Relative Path.
Throws:
ProjectNotFoundException - Project doesn't exist

getReferenceProjectStatus

abstract int getReferenceProjectStatus(String path)
Get Reference Project Status in astah* Project.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
Returns:
reference project status.
 ProjectAccessor.REFERENCE_PROJECT_STATUS_LATEST:Latest 
 ProjectAccessor.REFERENCE_PROJECT_STATUS_NEED_UPDATE :Need Update 
 ProjectAccessor.REFERENCE_PROJECT_STATUS_NOT_FOUND   :Not Found
Throws:
ProjectNotFoundException - Project doesn't exist

easyMerge

abstract void easyMerge(String path,
                        boolean isKeepBase)
Merge a project into the current project. It should be called out of transaction, or InvalidEditingException throws.

Parameters:
path - Reference Project Path. Absolute/Relative Path can be specified.
isKeepBase - When differences found, keep current or overwrite with reference.
Throws:
ProjectNotFoundException - Project doesn't exist
InvalidEditingException - Invalid models exist
Keys: 
      ILLEGAL_VERSION_ERROR_KEY - if Editing API is used in astah* community. 
      CAN_NOT_MERGE_IN_TRANSACTION_KEY - if a file is merged in transaction. 
      CAN_NOT_MERGE_WHEN_CURRENT_HAS_REFERENCE_PROJRCT_KEY - if a file is merged to the current project with reference models. 
      PARAMETER_ERROR_KEY - if a parameter is not set properly.
Values: 
      Error messages for exceptions.

getTransactionManager

abstract ITransactionManager getTransactionManager()
Get ITransactionManager.

Returns:
The object that implements ITransactionManager

getModelEditorFactory

abstract IModelEditorFactory getModelEditorFactory()
Get IModelEditorFactory.

Returns:
The object that implements IModelEditorFactory

getDiagramEditorFactory

abstract IDiagramEditorFactory getDiagramEditorFactory()
Get IDiagramEditorFactory.

Returns:
The object that implements IDiagramEditorFactory

findElements

abstract INamedElement[] findElements(Class elementKind,
                                      String name)
Search elements in an astah* model by element kind and element name. Presentations won't be searched.

Parameters:
elementKind - Element kind. API Class name is used for element kind, like IClass.
name - Element name.If name is null,Search elements in an astah* model by element kind.
Returns:
INamedElement[] Elements to be retrieved in any order.
Throws:
ProjectNotFoundException - Project doesn't exist

findElements

abstract INamedElement[] findElements(Class elementKind)
Search elements in an astah* model by element kind. Presentations won't be searched.

Parameters:
elementKind - Element kind. API Class name is used for element kind, like IClass.
Returns:
INamedElement[] Elements to be retrieved in any order.
Throws:
ProjectNotFoundException - Project doesn't exist

findElements

abstract INamedElement[] findElements(ModelFinder picker)
Search elements in an astah* model by ModelPicker. Presentations won't be searched.

Parameters:
ModelFinder - ModelFinder contains conditions searching models.Searching conditions should be implemented.
Returns:
INamedElement[] Elements to be retrieved in any order.
Throws:
ProjectNotFoundException - Project doesn't exist

getAstahEdition

abstract String getAstahEdition()
Obtain the edition of astah* you currently use

Returns:
edition of astah* "professional", "UML", "community" or "think"

getAstahVersion

abstract String getAstahVersion()
Obtain the version of astah* you currently use

Returns:
version of astah*

getProjectPath

abstract String getProjectPath()
Obtain where the astah* project is saved

Returns:
where the astah* project is saved
Throws:
ProjectNotFoundException - Project cannot be found

getAstahModelVersion

abstract int getAstahModelVersion()
Obtain the model version of project created by this astah*

Returns:
model version of project created by this astah*

getAstahAPIVersion

abstract String getAstahAPIVersion()
Obtain the version of astah* API

Returns:
version of astah* API

getAstahAPIModelVersion

abstract int getAstahAPIModelVersion()
Obtain the model version of project created by astah* API

Returns:
Model version of project created by astah* API

getViewManager

abstract IViewManager getViewManager()
Get IViewManager.

Returns:
The object that implements IViewManager

addProjectEventListener

abstract void addProjectEventListener()
Add ProjectEventListener.

Parameters:
listener - ProjectEventListener

removeProjectEventListener

abstract void removeProjectEventListener()
Remove ProjectEventListener.

Parameters:
listener - ProjectEventListener

addEntityEditListener

abstract void addEntityEditListener(EntityEditListener listener)
Add EntityEditListener.

Parameters:
listener - EntityEditListener

removeEntityEditListener

abstract void removeEntityEditListener(EntityEditListener listener)
Remove EntityEditListener.

Parameters:
listener - EntityEditListener

getEntity

abstract IEntity getEntity(String id)
Returns IEntity that has special ID. This will search model elements or diagram elements that have special from projects that you currently open. If the search was unable in any reasons such as no project is open, null will be returned.

Parameters:
id - ID string of the IEntity you'd like to search
Returns:
Found IEntity object

getAstahInstallPath

abstract String getAstahInstallPath()
Obtain where the astah* installation path

Returns:
where the astah* installation path
Since:
6.6.4

easyCompare

abstract void easyCompare(String path)
Easy compare.

Parameters:
path - path
Throws:
ProjectNotFoundException
InvalidEditingException
Since:
6.6.4

isProjectModified

abstract boolean isProjectModified()
isProjectModified

Returns:
true is Project modified.
Since:
6.6.4

hasSameElement

abstract boolean hasSameElement(String name)
hasSameElement

Parameters:
name - Name.
Returns:
True has same element.
Since:
6.7.0

hasSameElement

abstract boolean hasSameElement(String name,
                                Class clazz)
hasSameElement

Parameters:
name - Name.
clazz - Class.
Returns:
True has same element.
Since:
6.7.0