Class ProjectTool
java.lang.Object
java.util.Observable
com.nomagic.magicreport.engine.Tool
com.nomagic.magicdraw.magicreport.tools.ProjectTool
- All Implemented Interfaces:
com.nomagic.magicreport.engine.ITool
,com.nomagic.magicreport.IVariable
,Serializable
,Cloneable
@OpenApiAll
public class ProjectTool
extends com.nomagic.magicreport.engine.Tool
A MagicDraw project wrapper.
- Since:
- Dec 7, 2007
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.nomagic.magicreport.engine.ITool
com.nomagic.magicreport.engine.ITool.HTMLString, com.nomagic.magicreport.engine.ITool.RetainedString, com.nomagic.magicreport.engine.ITool.Void
-
Field Summary
Fields inherited from class com.nomagic.magicreport.engine.Tool
context, properties
Fields inherited from interface com.nomagic.magicreport.engine.ITool
VOID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the collection of all element id in the project.Returns a list of models in the project (the primary model of the project and all the models of the modules (attached projects)).Get list of auxiliary resource modules in the project.Get project description.getDescription
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Get project description from specified attached project.getDescription
(ProjectModule projectModule) Get project description from specified project module.Return all existing diagrams stored in this Project.getDiagrams
(String type) Return existing diagrams of given type stored in Project.Return project directory.getElementByID
(String id) Return the Element with given id.Return project file extension.Method returns file name of this project.getLatestVersion
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Get latest version of attached projectgetLatestVersion
(ProjectModule projectModule) Get latest version of project moduleGet list of used local modules in the project.getLocalModule
(boolean includeAuxiliary) Get list of used local modules in the project.getModel()
Deprecated.use ProjectTool#getPrimaryModel()Get list of used local modules excluding auxiliary resource in the project.getModuleList
(boolean includeAuxiliary) Get list of used server and local modules in the project.getName()
Return project name.Return all existing presentation diagrams stored in this Project.Return existing presentation diagrams of given type stored in Project.Returns the primary (main) model of the project (not including the ones from modules).Get current project version of current projectgetProjectVersion
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Return project version of attached Project.getProjectVersion
(ProjectModule projectModule) Get a project version of project modulegetRepresentationString
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Return user friendly representation string about given attached projectgetRepresentationString
(ProjectModule projectModule) Return user friendly representation string about given project modulegetRequiredVersion
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Get required version of attached projectgetRequiredVersion
(ProjectModule projectModule) Get required version of project moduleGet list of used server modules in the project exclude auxiliary resource.getServerModule
(boolean includeAuxiliary) Get list of used server modules in the project.Return a list of shared module from current project.getSharedModule
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Return a list of shared moduleProjectModule
from specified module.getSharedModule
(ProjectModule projectModule) Return a list of shared module from specified module.getTitle()
Return project title.getUsedVersion
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Get used version of attached projectgetUsedVersion
(ProjectModule projectModule) Get used version of project modulelong
Return project version number.long
getVersion
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Get current version of attached project.long
getVersion
(ProjectModule projectModule) Get current version of project moduleReturn a list of project version information from opened server project.getVersionList
(com.nomagic.ci.persistence.IAttachedProject attachedProject) Return all project versions of attached project.getVersionList
(ProjectModule projectModule) Return all project versions of project module.Return a list of project version information from opened server project.getVersions
(boolean ascendingOrder) Return a list of project version information from opened server project.
if ascendingOrder is true, the result will be sorted in ascending order.static List<ProjectVersion>
getVersions
(ProjectDescriptor projectDescriptor) getVersions
(String sortType) Return a list of project version information from opened server project.
The result will be sorted by specified sortType.int
Return the projects XMI version.boolean
isDirty()
Return true if this project was modified after last save/load.boolean
isRemote()
Return the remote or not remote state of the project.Methods inherited from class com.nomagic.magicreport.engine.Tool
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setProperties
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.nomagic.magicreport.engine.ITool
clearTool
-
Field Details
-
CONTEXT_NAME
Contains a context name.- See Also:
-
-
Constructor Details
-
ProjectTool
public ProjectTool()
-
-
Method Details
-
getDiagrams
Return all existing diagrams stored in this Project.- Returns:
- collection of Diagram instance.
-
getDiagrams
Return existing diagrams of given type stored in Project.- Parameters:
type
- the given diagrams type.- Returns:
- collection of Diagram instance.
-
getPresentationDiagrams
Return all existing presentation diagrams stored in this Project.- Returns:
- collection of diagram views.
-
getPresentationDiagrams
Return existing presentation diagrams of given type stored in Project.- Parameters:
type
- the given diagrams type.- Returns:
- collection of diagram views.
-
getName
Return project name.- Returns:
- project name.
-
getTitle
Return project title.- Returns:
- project title
-
getExtension
Return project file extension.- Returns:
- project file extension.
-
getDirectory
Return project directory.- Returns:
- project location directory.
-
getFileName
Method returns file name of this project. If file name is undefined returns project name.- Returns:
- file name of this project.
-
isRemote
public boolean isRemote()Return the remote or not remote state of the project.- Returns:
- true if project is a remote project, false otherwise.
-
isDirty
public boolean isDirty()Return true if this project was modified after last save/load.- Returns:
- true if this project was modified after last save/load.
-
getElementByID
Return the Element with given id.- Parameters:
id
- the id of the element.- Returns:
- the Element with given id or null if Element with such id is not registered in the project.
-
getAllElementId
Return the collection of all element id in the project.- Returns:
- the collection of all element id in the project.
-
getXmiVersion
public int getXmiVersion()Return the projects XMI version.- Returns:
- xmi version
-
getModel
Deprecated.use ProjectTool#getPrimaryModel()Returns the primary (main) model of the project (not including the ones from modules). This method should not be called anymore for Cameo Enterprise Data Warehouse projects, because the returned model does not include the root models of modules (attached projects).getPrimaryModel()
should be used instead as needed.- Returns:
- Model
-
getPrimaryModel
Returns the primary (main) model of the project (not including the ones from modules).- Returns:
- Model
-
getAllModels
Returns a list of models in the project (the primary model of the project and all the models of the modules (attached projects)).- Returns:
- models.
-
getVersion
public long getVersion()Return project version number.- Returns:
- project version number
-
getProjectVersion
Get current project version of current project- Returns:
- a current
ProjectVersion
of current project
-
getVersions
Return a list of project version information from opened server project. The result will be sorted in descending order.- Returns:
- List of
ProjectVersion
-
getVersions
Return a list of project version information from opened server project.
The result will be sorted by specified sortType.- Parameters:
sortType
- type of sorting. Specify "asc" sort in ascending order. Default is descending sort.- Returns:
- List of
ProjectVersion
-
getVersions
Return a list of project version information from opened server project.
if ascendingOrder is true, the result will be sorted in ascending order.- Parameters:
ascendingOrder
- true to sort in ascending order- Returns:
- List of
ProjectVersion
-
getVersionList
Return a list of project version information from opened server project.- Returns:
- List of
ProjectVersion
-
getVersions
-
getVersion
Get current version of project module- Parameters:
projectModule
- aProjectModule
- Returns:
- current version
-
getVersionList
public List<ProjectVersion> getVersionList(com.nomagic.ci.persistence.IAttachedProject attachedProject) Return all project versions of attached project.- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- list of
ProjectVersion
of attached project
-
getVersionList
Return all project versions of project module.- Parameters:
projectModule
- aProjectModule
- Returns:
- list of
ProjectVersion
of project module
-
getVersion
public long getVersion(com.nomagic.ci.persistence.IAttachedProject attachedProject) Get current version of attached project.- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- current version
-
getProjectVersion
Get a project version of project module- Parameters:
projectModule
- aProjectModule
- Returns:
- a
ProjectVersion
of project module
-
getProjectVersion
public ProjectVersion getProjectVersion(com.nomagic.ci.persistence.IAttachedProject attachedProject) Return project version of attached Project.- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- a
ProjectVersion
of specified attached project
-
getRepresentationString
Return user friendly representation string about given project module- Parameters:
projectModule
- aProjectModule
- Returns:
- user friendly project representation
-
getRepresentationString
Return user friendly representation string about given attached project- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- user friendly project representation
-
getUsedVersion
Get used version of project module- Parameters:
projectModule
- aProjectModule
- Returns:
- used version
-
getUsedVersion
Get used version of attached project- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- used version
-
getRequiredVersion
Get required version of project module- Parameters:
projectModule
- aProjectModule
- Returns:
- required version
-
getRequiredVersion
Get required version of attached project- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- required version
-
getLatestVersion
Get latest version of project module- Parameters:
projectModule
- aProjectModule
- Returns:
- required version
-
getLatestVersion
Get latest version of attached project- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- required version
-
getDescription
Get project description.- Returns:
- project description
-
getDescription
Get project description from specified attached project.- Parameters:
attachedProject
- anIAttachedProject
- Returns:
- project description
-
getDescription
Get project description from specified project module.- Parameters:
projectModule
- projectModuleProjectModule
- Returns:
- project description
-
getModuleList
Get list of used local modules excluding auxiliary resource in the project.- Returns:
- list of used server and local
ProjectModule
-
getModuleList
Get list of used server and local modules in the project.- Parameters:
includeAuxiliary
- if true, the auxiliary resources will be included.
Default value is False.- Returns:
- list of used server and local
ProjectModule
-
getServerModule
Get list of used server modules in the project exclude auxiliary resource.- Returns:
- list of used server modules
ProjectModule
-
getServerModule
Get list of used server modules in the project.- Parameters:
includeAuxiliary
- if true, the auxiliary resources will be included.
Default value is False.- Returns:
- list of used server
ProjectModule
-
getLocalModule
Get list of used local modules in the project.- Returns:
- list of used local
ProjectModule
-
getLocalModule
Get list of used local modules in the project.- Parameters:
includeAuxiliary
- if true, the auxiliary resources will be included.
Default value is False.- Returns:
- list of used local
ProjectModule
-
getAuxiliaryResource
Get list of auxiliary resource modules in the project.- Returns:
- list of
ProjectModule
that are auxiliary resources.
-