Class ProjectArchiverHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.archive.ProjectArchiverHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
Helper for operations related to exporting or import project.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classInner class to leverage the logic from UnitaryImporter -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolverthe ametys object resolverprotected ResourcesArchiverHelperthe resource archiver helperstatic final Stringthe Avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexportProject(Project project, ZipOutputStream zos, String prefix) Export the project to the zip archiveimportProjects(javax.jcr.Node pluginNode, Path zipPath, String baseImportProjectsPath, Merger merger) Import archived projects data.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
the Avalon role -
_resolver
the ametys object resolver -
_resourcesArchiverHelper
the resource archiver helper
-
-
Constructor Details
-
ProjectArchiverHelper
public ProjectArchiverHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
exportProject
Export the project to the zip archive- Parameters:
project- the project to exportzos- the zip output streamprefix- the prefix use for the path of all zip entry of the project- Throws:
IOException- if an error occurred
-
importProjects
public ImportReport importProjects(javax.jcr.Node pluginNode, Path zipPath, String baseImportProjectsPath, Merger merger) throws IOException Import archived projects data.- Parameters:
pluginNode- the plugin node where the new projects node will be addedzipPath- the path to the ZIP containing the databaseImportProjectsPath- the path in the ZIP where the projects data are locatedmerger- the merger- Returns:
- the import report
- Throws:
IOException- if an error occurs
-