Interface ProjectPersistenceManager

  • All Known Implementing Classes:
    ProjectsManager

    @OpenApiAll
    public interface ProjectPersistenceManager
    • Method Detail

      • loadProject

        void loadProject​(ProjectDescriptor descriptor,
                         ProgressStatus status)
        Loads given project
        Parameters:
        descriptor - project to load.
        status - status to display progress
      • saveProject

        boolean saveProject​(ProjectDescriptor descriptor,
                            ProgressStatus status,
                            boolean silent)
        Saves or commits project.
        Parameters:
        descriptor - descriptor of project to save.
        status - status to display operation status.
        silent - true if no gui should be shown durring save/commmit
        Returns:
        false if saving fails.
      • saveModule

        boolean saveModule​(Project project,
                           IAttachedProject module,
                           boolean displayDependenciesDialog,
                           ProgressStatus status)
        Saves module. Local module will be saved to the disk, teamwork committed. For teamwork module it is not recommended to use this method directly.
        Parameters:
        project - project
        module - module to save/commit.
        displayDependenciesDialog - displays dependencies dialog if there are bad dependencies. To turn off dependency checking
        status - progress status which display status of current operation. @return false if operation fails.
      • saveModule

        boolean saveModule​(Project project,
                           IAttachedProject module,
                           boolean displayDependenciesDialog,
                           ProgressStatus status,
                           boolean temporalSave)
        Saves module. Local module will be saved to the disk, teamwork committed. For teamwork module it is not recommended to use this method directly.
        Parameters:
        project - project
        module - module to save/commit.
        displayDependenciesDialog - displays dependencies dialog if there are bad dependencies. To turn off dependency checking
        status - progress status which display status of current operation. @return false if operation fails.
      • reloadModule

        void reloadModule​(Project project,
                          ProjectDescriptor projectDescriptor)
        Reloads module.
        Parameters:
        project - the project.
        projectDescriptor - the ProjectDescriptor of the module.
      • useModule

        boolean useModule​(Project prj,
                          ProjectDescriptor module)
        Loads module by reference into given project.
        Parameters:
        prj - the project.
        module - the ProjectDescriptor of the module.
        Returns:
        result of operation
      • unloadModule

        void unloadModule​(Project project,
                          ProjectDescriptor descriptor)
        Removes unreferenced elements from this module, and makes module not loaded.
        Parameters:
        project - project
        descriptor - module descriptor
      • exportModule

        void exportModule​(Project prj,
                          java.util.Collection packages,
                          java.lang.String description,
                          ProjectDescriptor module)
                   throws java.io.IOException,
                          ReadOnlyModuleException
        Exports given packages from project into given module.
        Parameters:
        prj - the project.
        packages - the packages from given project. These packages will become roots of the given module.
        description - the description of module(if null or zero length, description will not be generated).
        module - the ProjectDescriptor of the module. Current implementation supports only LocalProjectDescriptor.
        Throws:
        ReadOnlyModuleException - if trying export package which is already in module and this module is read only
        java.io.IOException
        java.lang.IllegalStateException - if given packages have dependencies.
      • importProject

        boolean importProject​(ProjectDescriptor pd)
        Imports given project into the current project by value. Does the same as File-Import MagicDraw Project
        Parameters:
        pd - Project descriptor to import.
        Returns:
        true if operation was successful.