Interface ProjectStorage
public interface ProjectStorage
FIRSTspirit
Project
management.- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateProject
(Project project) Activates a deactivated project.checkProject
(Project project) Checks if a project needs to be migrated to current server version.@NotNull Project
createProject
(String name, String description) Create a new Project.void
deactivateProject
(Project project) Deactivates a project.void
deleteExportFile
(ExportFile exportFile) Delete export file on server.downloadExportFile
(ExportFile exportFile) Download a export file.getFontUsages
(String name) Returns a list ofprojects
using the font specified by the given name.getInstalledExportFiles
(long projectId) Get filename list of installed exports and backups.int
Returns maximum number of allowed projects (possible license restriction).@Nullable Project
getProject
(long id) Returns the project by id, regardless whether it's active or not.@Nullable Project
getProject
(String name) Returns the project by name, regardless whether it's active or not.getProjectInfo
(ExportFile exportFile) Parse info out of ExportFile contentsProject[]
Returns all (active and inactive) projects.Project[]
getProjects
(boolean active) Returns either all active or inactive projects.getUnmappedLayers
(long projectId, String snapshotFileName, List<ExportFile> backups) Get unmapped layer information for installing backup files.List incremental, differential and snapshot backup files.List all export files on server.void
rebuildReferences
(Project project) Deprecated.void
rebuildSearchIndex
(Project project) Since FirstSpirit v5 this starts the project schedule entry with the name "Rebuild search index".void
rebuildSearchIndex
(IDProvider element) Refreshes the search index for the givenelement
.void
Resets the cache of the project listvoid
removeProject
(Project project) Removes a project from server.void
removeProject
(Project project, boolean cleanDB) Removes a project from server and deletes the connected database too if cleanDB is set to truestartDifferentialBackup
(BackupParameters backupParameters) Start differential project repository backup export.startExport
(ExportParameters exportParameters) Start project export.startImport
(ImportParameters importParameters) Start project import.startIncrementalBackup
(BackupParameters backupParameters) Start incremental project repository backup export.startPartialInstall
(long projectId, Map<String, String> layerMappings, List<ExportFile> backups) Install incremental or differential backup file into a existing project.startProjectRevert
(long projectId, String snapshotFileName) Revert a project to a state after a snapshot has been installed.startSnapshotExport
(BackupParameters backupParameters) Start project snapshot export.void
updateVersionInfo
(Project project) Updates the project information to match the current server version.uploadExportFile
(String fileName, InputStream fileData) Upload single export file or last part of files to server.void
uploadExportFilePart
(String name, InputStream fileData) Upload a part of a splitted export file.
-
Method Details
-
createProject
Create a new Project.- Parameters:
name
- the name of the projectdescription
- the unique description of the project- Returns:
- the new created project
- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
getProject
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
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
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
Removes a project from server.- Parameters:
project
- the project to remove- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
removeProject
Removes a project from server and deletes the connected database too if cleanDB is set to true- Parameters:
project
- the project to removecleanDB
- also clean the database and delete all connected tables- Throws:
SecurityException
- if the user isn't theserver 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
Checks if a project needs to be migrated to current server version.- Since:
- 4.0
-
activateProject
Activates a deactivated project.- Parameters:
project
- to activate.- Throws:
AccessRuntimeException
- if the project couldn't be activated, e.g. in case of missing project directorySecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
deactivateProject
Deactivates a project. Project needs to belocked
. CallingLockable.save()
isn't necessary.- Parameters:
project
- to deactivate.- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
updateVersionInfo
Updates the project information to match the current server version.- Parameters:
project
- the project to update.- Since:
- 4.0
-
rebuildReferences
Deprecated.since 5.2.301, useProjectReferencesAgent.rebuildReferences()
.Starts reference rebuilding for the givenproject
with it'slatest revision
.- Parameters:
project
- which references should be rebuilded.- Since:
- 4.0
-
rebuildSearchIndex
Since FirstSpirit v5 this starts the project schedule entry with the name "Rebuild search index".- Since:
- 4.0
-
rebuildSearchIndex
Refreshes the search index for the givenelement
. Supports all FirstSpirit element types, particularlyMedia
andDataset
objects.- Since:
- 5.0.313
-
refreshProjects
void refreshProjects()Resets the cache of the project list- Since:
- 4.0
- See Also:
-
uploadExportFilePart
Upload a part of a splitted export file. If the file exists, data is appended. UsedeleteExportFile(ExportFile)
to delete export files on server.- Throws:
IOException
- Since:
- 4.0
-
uploadExportFile
Upload single export file or last part of files to server. If the file exists, data is appended. UsedeleteExportFile(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 all export files on server.- Throws:
IOException
- Since:
- 4.0
-
deleteExportFile
Delete export file on server.- Throws:
FileNotFoundException
- Since:
- 4.0
-
getProjectInfo
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 theserver admin
IOException
- Since:
- 4.0
-
downloadExportFile
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 aproject admin
of the projectIOException
- Since:
- 4.0
-
getFontUsages
Returns a list ofprojects
using the font specified by the given name.- Since:
- 4.2.34
- See Also:
-
startSnapshotExport
Start project snapshot export.- Returns:
- exportId handle
- Throws:
SecurityException
- if the user isn't aproject admin
of the project- Since:
- 4.1.25
-
listBackupFiles
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 aproject 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 aproject admin
of the project- Since:
- 4.1.25
-
startPartialInstall
ServerActionHandle<ImportProgress,Boolean> startPartialInstall(long projectId, Map<String, String> layerMappings, List<ExportFile> backups) throws IOExceptionInstall 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 aproject admin
of the projectIOException
- 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 idsnapshotFileName
- The snapshot the backups are based onbackups
- The backup files to install- Throws:
IOException
- Since:
- 4.2.450
-
getInstalledExportFiles
Get filename list of installed exports and backups.- Parameters:
projectId
- The project id- Throws:
IOException
- Since:
- 4.2.5
-
ProjectReferencesAgent.rebuildReferences()
.