Interface ProjectStorage


public interface ProjectStorage
FIRSTspirit Project management.
Since:
4.0
  • Method Details

    • createProject

      @NotNull @NotNull Project createProject(String name, String description)
      Create a new Project.
      Parameters:
      name - the name of the project
      description - the unique description of the project
      Returns:
      the new created project
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • getProject

      @Nullable @Nullable Project getProject(String name)
      Returns the project by name, regardless whether it's active or not.
      Parameters:
      name - project name.
      Returns:
      project or null if it doesn't exist.
      Since:
      4.0
    • getProject

      @Nullable @Nullable Project getProject(long id)
      Returns the project by id, regardless whether it's active or not.
      Parameters:
      id - project id.
      Returns:
      project or null if it doesn't exist.
      Since:
      4.0
    • getProjects

      Project[] getProjects()
      Returns all (active and inactive) projects.
      Returns:
      active and inactive projects
      Since:
      4.0
    • getProjects

      Project[] getProjects(boolean active)
      Returns either all active or inactive projects.
      Parameters:
      active - true for active, false for inactive projects.
      Returns:
      either active or inactive projects.
      Since:
      4.0
    • removeProject

      void removeProject(Project project)
      Removes a project from server.
      Parameters:
      project - the project to remove
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • removeProject

      void removeProject(Project project, boolean cleanDB)
      Removes a project from server and deletes the connected database too if cleanDB is set to true
      Parameters:
      project - the project to remove
      cleanDB - also clean the database and delete all connected tables
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      5.2.210903
    • getMaxProjects

      int getMaxProjects()
      Returns maximum number of allowed projects (possible license restriction).
      Returns:
      maximum number of allowed projects.
      Since:
      4.0
    • checkProject

      String checkProject(Project project)
      Checks if a project needs to be migrated to current server version.
      Since:
      4.0
    • activateProject

      void activateProject(Project project) throws AccessRuntimeException
      Activates a deactivated project.
      Parameters:
      project - to activate.
      Throws:
      AccessRuntimeException - if the project couldn't be activated, e.g. in case of missing project directory
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • deactivateProject

      void deactivateProject(Project project)
      Deactivates a project. Project needs to be locked. Calling Lockable.save() isn't necessary.
      Parameters:
      project - to deactivate.
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • updateVersionInfo

      void updateVersionInfo(Project project)
      Updates the project information to match the current server version.
      Parameters:
      project - the project to update.
      Since:
      4.0
    • rebuildReferences

      @Deprecated void rebuildReferences(Project project)
      Deprecated.
      Starts reference rebuilding for the given project with it's latest revision.
      Parameters:
      project - which references should be rebuilded.
      Since:
      4.0
    • rebuildSearchIndex

      void rebuildSearchIndex(Project project)
      Since FirstSpirit v5 this starts the project schedule entry with the name "Rebuild search index".
      Since:
      4.0
    • rebuildSearchIndex

      void rebuildSearchIndex(IDProvider element)
      Refreshes the search index for the given element. Supports all FirstSpirit element types, particularly Media and Dataset objects.
      Since:
      5.0.313
    • refreshProjects

      void refreshProjects()
      Resets the cache of the project list
      Since:
      4.0
      See Also:
    • uploadExportFilePart

      void uploadExportFilePart(String name, InputStream fileData) throws IOException
      Upload a part of a splitted export file. If the file exists, data is appended. Use deleteExportFile(ExportFile) to delete export files on server.
      Throws:
      IOException
      Since:
      4.0
    • uploadExportFile

      ExportFile uploadExportFile(String fileName, InputStream fileData) throws IOException
      Upload single export file or last part of files to server. If the file exists, data is appended. Use deleteExportFile(ExportFile) to delete export files on server.
      Parameters:
      fileName - the file name of the uploaded file (e.g. export.tar.gz)
      Throws:
      IOException
      Since:
      4.0
    • listExportFiles

      List<ExportFile> listExportFiles() throws IOException
      List all export files on server.
      Throws:
      IOException
      Since:
      4.0
    • deleteExportFile

      void deleteExportFile(ExportFile exportFile) throws FileNotFoundException
      Delete export file on server.
      Throws:
      FileNotFoundException
      Since:
      4.0
    • getProjectInfo

      ProjectInfo getProjectInfo(ExportFile exportFile) throws IOException
      Parse info out of ExportFile contents
      Parameters:
      exportFile -
      Throws:
      IOException
      Since:
      4.0
    • startImport

      ServerActionHandle<ImportProgress,Boolean> startImport(ImportParameters importParameters) throws IOException
      Start project import.
      Parameters:
      importParameters - The import parameters
      Returns:
      importId handle
      Throws:
      SecurityException - if the user isn't the server admin
      IOException
      Since:
      4.0
    • downloadExportFile

      InputStream downloadExportFile(ExportFile exportFile) throws IOException
      Download a export file.
      Throws:
      IOException
      Since:
      4.0
    • startExport

      ServerActionHandle<ExportProgress,Boolean> startExport(ExportParameters exportParameters) throws IOException
      Start project export.
      Parameters:
      exportParameters - The export parameters
      Returns:
      exportId handle
      Throws:
      SecurityException - if the user isn't a project admin of the project
      IOException
      Since:
      4.0
    • getFontUsages

      List<Project> getFontUsages(String name)
      Returns a list of projects using the font specified by the given name.
      Since:
      4.2.34
      See Also:
    • startSnapshotExport

      ServerActionHandle<ExportProgress,Boolean> startSnapshotExport(BackupParameters backupParameters)
      Start project snapshot export.
      Returns:
      exportId handle
      Throws:
      SecurityException - if the user isn't a project admin of the project
      Since:
      4.1.25
    • listBackupFiles

      List<ExportFile> listBackupFiles() throws IOException
      List incremental, differential and snapshot backup files.
      Throws:
      IOException
      Since:
      4.1.16
    • startIncrementalBackup

      ServerActionHandle<ExportProgress,Boolean> startIncrementalBackup(BackupParameters backupParameters) throws IllegalStateException
      Start incremental project repository backup export. All changed data since last snapshot export or incremental backup will be exported. If no snapshot export or incremental backup exists in this project, a IllegalStateException will be thrown.
      Throws:
      IllegalStateException - Thrown if no snapshot or incremental backup tag was found in this project.
      SecurityException - if the user isn't a project admin of the project
      Since:
      4.1.25
    • startDifferentialBackup

      ServerActionHandle<ExportProgress,Boolean> startDifferentialBackup(BackupParameters backupParameters) throws IllegalStateException
      Start differential project repository backup export. All changed data since last snapshot export will be exported. If no snapshot export exists in this project, a IllegalStateException will be thrown.
      Throws:
      IllegalStateException - Thrown if no snapshot tag was found in this project.
      SecurityException - if the user isn't a project admin of the project
      Since:
      4.1.25
    • startPartialInstall

      ServerActionHandle<ImportProgress,Boolean> startPartialInstall(long projectId, Map<String,String> layerMappings, List<ExportFile> backups) throws IOException
      Install incremental or differential backup file into a existing project.
      Parameters:
      backups - The backup files to install
      Throws:
      IOException
      Since:
      4.1.20
    • startProjectRevert

      ServerActionHandle<ImportProgress,Boolean> startProjectRevert(long projectId, String snapshotFileName) throws IOException
      Revert a project to a state after a snapshot has been installed. Project will be deactivated during revert process. All newer files will be deleted, no backup is made!
      Parameters:
      snapshotFileName - The snapshot file name to revert the project to
      Throws:
      SecurityException - if the user isn't a project admin of the project
      IOException
      Since:
      4.2.3
    • getUnmappedLayers

      List<Properties> getUnmappedLayers(long projectId, String snapshotFileName, List<ExportFile> backups) throws IOException
      Get unmapped layer information for installing backup files.
      Parameters:
      projectId - The project id
      snapshotFileName - The snapshot the backups are based on
      backups - The backup files to install
      Throws:
      IOException
      Since:
      4.2.450
    • getInstalledExportFiles

      List<String> getInstalledExportFiles(long projectId) throws IOException
      Get filename list of installed exports and backups.
      Parameters:
      projectId - The project id
      Throws:
      IOException
      Since:
      4.2.5