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:
  • Field Details

  • Constructor Details

    • ProjectTool

      public ProjectTool()
  • Method Details

    • getDiagrams

      public Collection<Diagram> getDiagrams()
      Return all existing diagrams stored in this Project.
      Returns:
      collection of Diagram instance.
    • getDiagrams

      public Collection<Diagram> getDiagrams(String type)
      Return existing diagrams of given type stored in Project.
      Parameters:
      type - the given diagrams type.
      Returns:
      collection of Diagram instance.
    • getPresentationDiagrams

      public Collection<DiagramPresentationElement> getPresentationDiagrams()
      Return all existing presentation diagrams stored in this Project.
      Returns:
      collection of diagram views.
    • getPresentationDiagrams

      public Collection<DiagramPresentationElement> getPresentationDiagrams(String type)
      Return existing presentation diagrams of given type stored in Project.
      Parameters:
      type - the given diagrams type.
      Returns:
      collection of diagram views.
    • getName

      public String getName()
      Return project name.
      Returns:
      project name.
    • getTitle

      public String getTitle()
      Return project title.
      Returns:
      project title
    • getExtension

      public String getExtension()
      Return project file extension.
      Returns:
      project file extension.
    • getDirectory

      public String getDirectory()
      Return project directory.
      Returns:
      project location directory.
    • getFileName

      @CheckForNull public String 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

      @CheckForNull public BaseElement getElementByID(String id)
      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

      public Collection<String> 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 @CheckForNull public Model 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

      @CheckForNull public Package getPrimaryModel()
      Returns the primary (main) model of the project (not including the ones from modules).
      Returns:
      Model
    • getAllModels

      public List<Package> 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

      public ProjectVersion getProjectVersion()
      Get current project version of current project
      Returns:
      a current ProjectVersion of current project
    • getVersions

      public List<ProjectVersion> 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

      public List<ProjectVersion> getVersions(String sortType)
      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

      public List<ProjectVersion> 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.
      Parameters:
      ascendingOrder - true to sort in ascending order
      Returns:
      List of ProjectVersion
    • getVersionList

      public List<ProjectVersion> getVersionList()
      Return a list of project version information from opened server project.
      Returns:
      List of ProjectVersion
    • getVersions

      public static List<ProjectVersion> getVersions(ProjectDescriptor projectDescriptor)
    • getVersion

      public long getVersion(ProjectModule projectModule)
      Get current version of project module
      Parameters:
      projectModule - a ProjectModule
      Returns:
      current version
    • getVersionList

      public List<ProjectVersion> getVersionList(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Return all project versions of attached project.
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      list of ProjectVersion of attached project
    • getVersionList

      public List<ProjectVersion> getVersionList(ProjectModule projectModule)
      Return all project versions of project module.
      Parameters:
      projectModule - a ProjectModule
      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 - an IAttachedProject
      Returns:
      current version
    • getProjectVersion

      public ProjectVersion getProjectVersion(ProjectModule projectModule)
      Get a project version of project module
      Parameters:
      projectModule - a ProjectModule
      Returns:
      a ProjectVersion of project module
    • getProjectVersion

      public ProjectVersion getProjectVersion(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Return project version of attached Project.
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      a ProjectVersion of specified attached project
    • getRepresentationString

      public String getRepresentationString(ProjectModule projectModule)
      Return user friendly representation string about given project module
      Parameters:
      projectModule - a ProjectModule
      Returns:
      user friendly project representation
    • getRepresentationString

      public String getRepresentationString(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Return user friendly representation string about given attached project
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      user friendly project representation
    • getUsedVersion

      public String getUsedVersion(ProjectModule projectModule)
      Get used version of project module
      Parameters:
      projectModule - a ProjectModule
      Returns:
      used version
    • getUsedVersion

      public String getUsedVersion(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Get used version of attached project
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      used version
    • getRequiredVersion

      public String getRequiredVersion(ProjectModule projectModule)
      Get required version of project module
      Parameters:
      projectModule - a ProjectModule
      Returns:
      required version
    • getRequiredVersion

      public String getRequiredVersion(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Get required version of attached project
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      required version
    • getLatestVersion

      public String getLatestVersion(ProjectModule projectModule)
      Get latest version of project module
      Parameters:
      projectModule - a ProjectModule
      Returns:
      required version
    • getLatestVersion

      public String getLatestVersion(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Get latest version of attached project
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      required version
    • getDescription

      public String getDescription()
      Get project description.
      Returns:
      project description
    • getDescription

      public String getDescription(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Get project description from specified attached project.
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      project description
    • getDescription

      public String getDescription(ProjectModule projectModule)
      Get project description from specified project module.
      Parameters:
      projectModule - projectModule ProjectModule
      Returns:
      project description
    • getSharedModule

      public Collection<ProjectModule> getSharedModule()
      Return a list of shared module from current project.
      Returns:
      a list of ProjectModule
    • getSharedModule

      public Collection<ProjectModule> getSharedModule(ProjectModule projectModule)
      Return a list of shared module from specified module.
      Parameters:
      projectModule - a ProjectModule
      Returns:
      a list of ProjectModule
    • getSharedModule

      public Collection<ProjectModule> getSharedModule(com.nomagic.ci.persistence.IAttachedProject attachedProject)
      Return a list of shared module ProjectModule from specified module.
      Parameters:
      attachedProject - an IAttachedProject
      Returns:
      a list of ProjectModule
    • getModuleList

      public Collection<ProjectModule> getModuleList()
      Get list of used local modules excluding auxiliary resource in the project.
      Returns:
      list of used server and local ProjectModule
    • getModuleList

      public Collection<ProjectModule> getModuleList(boolean includeAuxiliary)
      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

      public Collection<ProjectModule> getServerModule()
      Get list of used server modules in the project exclude auxiliary resource.
      Returns:
      list of used server modules ProjectModule
    • getServerModule

      public Collection<ProjectModule> getServerModule(boolean includeAuxiliary)
      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

      public Collection<ProjectModule> getLocalModule()
      Get list of used local modules in the project.
      Returns:
      list of used local ProjectModule
    • getLocalModule

      public Collection<ProjectModule> getLocalModule(boolean includeAuxiliary)
      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

      public Collection<ProjectModule> getAuxiliaryResource()
      Get list of auxiliary resource modules in the project.
      Returns:
      list of ProjectModule that are auxiliary resources.