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 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 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  IDiagramEditorFactory getDiagramEditorFactory()
          Create IDiagramEditorFactory.
abstract  IModelEditorFactory getModelEditorFactory()
          Create IModelEditorFactory.
abstract  IModel getProject()
          Get Model of project accessor.
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()
          Create ITransactionManager.
abstract  void importXMI(String projectName)
          Open astah* Project's XMI.
abstract  void importXMI(String projectName, boolean isIgnoreModelVersion)
          Open astah* Project's XMI.
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 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.

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

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

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()
Create ITransactionManager.

Returns:
The object that implements ITransactionManager

getModelEditorFactory

abstract IModelEditorFactory getModelEditorFactory()
Create IModelEditorFactory.

Returns:
The object that implements IModelEditorFactory

getDiagramEditorFactory

abstract IDiagramEditorFactory getDiagramEditorFactory()
Create 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.
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.
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.
Throws:
ProjectNotFoundException - Project doesn't exist