Class OpenCmsModulePackager
java.lang.Object
com.mediaworx.opencms.moduleutils.packager.OpenCmsModulePackager
Packs module resources and the module's manifest.xml into an OpenCms module zip file.
-
Constructor Summary
ConstructorsConstructorDescriptioncreates a new module packager that can be used to pack module resources and the module's manifest.xml into an OpenCms module zip file -
Method Summary
Modifier and TypeMethodDescriptionpackageModule(String manifestRootPath, String vfsRootPath, String moduleZipTargetFolder) Creates the zip file for the module described in the manifest file at the givenmanifestRootPath.packageModule(String manifestRootPath, String vfsRootPath, String moduleZipTargetFolder, String moduleVersion) Creates the zip file for the module described in the manifest file at the givenmanifestRootPath.
-
Constructor Details
-
OpenCmsModulePackager
public OpenCmsModulePackager()creates a new module packager that can be used to pack module resources and the module's manifest.xml into an OpenCms module zip file
-
-
Method Details
-
packageModule
public String packageModule(String manifestRootPath, String vfsRootPath, String moduleZipTargetFolder) throws OpenCmsModulePackagerException Creates the zip file for the module described in the manifest file at the givenmanifestRootPath. The VFS files are retrieved from the givenvfsRootPath. The resulting zip file is placed at the givenmoduleZipTargetFolder.- Parameters:
manifestRootPath- path containing the module's manifest xml file (parent folder without the manifest's file name)vfsRootPath- root path under which the VFS files to be packaged are storedmoduleZipTargetFolder- target folder where the module zip is to be placed- Returns:
- the file name of the created module zip (containing the version), e.g. com.mycompany.mypackege.mymodule_1.0.zip
- Throws:
OpenCmsModulePackagerException- thrown in case of any error (e.g. xml parse exception, file write exception). The exception's message contains detailed information about what went wrong.
-
packageModule
public String packageModule(String manifestRootPath, String vfsRootPath, String moduleZipTargetFolder, String moduleVersion) throws OpenCmsModulePackagerException Creates the zip file for the module described in the manifest file at the givenmanifestRootPath. The VFS files are retrieved from the givenvfsRootPath. The resulting zip file is placed at the givenmoduleZipTargetFolder.- Parameters:
manifestRootPath- path containing the module's manifest xml file (parent folder without the manifest's file name)vfsRootPath- root path under which the VFS files to be packaged are storedmoduleZipTargetFolder- target folder where the module zip is to be placedmoduleVersion- module version to be used (overrides the module version in the manifest file), may benull(then the module version from the manifest file is used). If provided, the syntax must match[0-9]+(\.[0-9]+)?(e.g. "1" or "1.2"). Any String not matching this syntax will be replaced by "1.0".- Returns:
- the file name of the created module zip (containing the version), e.g. com.mycompany.mypackege.mymodule_1.4.zip
- Throws:
OpenCmsModulePackagerException- thrown in case of any error (e.g. xml parse exception, file write exception). The exception's message contains detailed information about what went wrong.
-