Package org.alfresco.repo.module.tool
Class WarHelperImpl
java.lang.Object
org.alfresco.repo.module.tool.WarHelperImpl
- All Implemented Interfaces:
WarHelper
Performs logic for the Module Management Tool.
- Author:
- Gethin James
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final StringFields inherited from interface org.alfresco.repo.module.tool.WarHelper
MODULE_CONFIG_IN_WAR, MODULE_NAMESPACE_DIR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackup(de.schlichtherle.truezip.file.TFile file) Backs up a given file or directory.voidcheckCompatibleEdition(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) This checks to see if the module that is being installed is compatible with the war.voidcheckCompatibleEditionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Checks to see if the module that is being installed is compatible with the war, (using the entry in the manifest).voidcheckCompatibleVersion(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Checks to see if the module is compatible with the version of Alfresco.protected voidcheckCompatibleVersionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Checks if the module is compatible using the entry in the manifest.voidcheckModuleDependencies(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Checks the dependencies of this modulefindManifest(de.schlichtherle.truezip.file.TFile war) Finds a single attribute from a war manifest file.protected StringfindManifestArtibute(de.schlichtherle.truezip.file.TFile war, String attributeName) Finds a single attribute from a war manifest file.protected ModuleDetailsgetModuleDetails(de.schlichtherle.truezip.file.TFile war, String moduleId) Gets the module details for the specified module from the war.getModuleDetailsOrAlias(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Gets the module details or an available aliasbooleanisShareWar(de.schlichtherle.truezip.file.TFile warFile) Indicates if the war file specified is a "Share" war.listModules(de.schlichtherle.truezip.file.TFile war) Lists all the currently installed modules in the WAR
-
Field Details
-
VERSION_PROPERTIES
- See Also:
-
MANIFEST_FILE
- See Also:
-
MANIFEST_SPECIFICATION_TITLE
- See Also:
-
MANIFEST_SPECIFICATION_VERSION
- See Also:
-
MANIFEST_IMPLEMENTATION_TITLE
- See Also:
-
MANIFEST_SHARE
- See Also:
-
MANIFEST_COMMUNITY
- See Also:
-
REGEX_NUMBER_OR_DOT
- See Also:
-
-
Constructor Details
-
WarHelperImpl
-
-
Method Details
-
checkCompatibleVersion
public void checkCompatibleVersion(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Description copied from interface:WarHelperChecks to see if the module is compatible with the version of Alfresco.- Specified by:
checkCompatibleVersionin interfaceWarHelper- Parameters:
war- a valid war file or exploded directory from a war
-
checkCompatibleVersionUsingManifest
protected void checkCompatibleVersionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Checks if the module is compatible using the entry in the manifest. This is more accurate and works for both alfresco.war and share.war, however valid manifest entries weren't added until 3.4.11, 4.1.1 and Community 4.2- Parameters:
war- TFileinstallingModuleDetails- ModuleDetails
-
findManifestArtibute
protected String findManifestArtibute(de.schlichtherle.truezip.file.TFile war, String attributeName) throws ModuleManagementToolException Finds a single attribute from a war manifest file.- Parameters:
war- the warattributeName- key name of attribute- Returns:
- attribute value
- Throws:
ModuleManagementToolException
-
findManifest
public Manifest findManifest(de.schlichtherle.truezip.file.TFile war) throws ModuleManagementToolException Finds a single attribute from a war manifest file.- Specified by:
findManifestin interfaceWarHelper- Parameters:
war- the war- Returns:
- Manifest
- Throws:
ModuleManagementToolException
-
checkCompatibleEdition
public void checkCompatibleEdition(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Description copied from interface:WarHelperThis checks to see if the module that is being installed is compatible with the war. If not module edition is specfied then it will just return. However, if an edition is specified and it doesn't match then an error is thrown.- Specified by:
checkCompatibleEditionin interfaceWarHelper- Parameters:
war- a valid war file or exploded directory from a warinstallingModuleDetails- ModuleDetails
-
checkCompatibleEditionUsingManifest
public void checkCompatibleEditionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Checks to see if the module that is being installed is compatible with the war, (using the entry in the manifest). This is more accurate and works for both alfresco.war and share.war, however valid manifest entries weren't added until 3.4.11, 4.1.1 and Community 4.2- Parameters:
war- TFileinstallingModuleDetails- ModuleDetails
-
checkModuleDependencies
public void checkModuleDependencies(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Description copied from interface:WarHelperChecks the dependencies of this module- Specified by:
checkModuleDependenciesin interfaceWarHelper- Parameters:
war- TFileinstallingModuleDetails- ModuleDetails
-
getModuleDetailsOrAlias
public ModuleDetails getModuleDetailsOrAlias(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails) Description copied from interface:WarHelperGets the module details or an available alias- Specified by:
getModuleDetailsOrAliasin interfaceWarHelper- Parameters:
war- a valid war file or exploded directory from a warinstallingModuleDetails- ModuleDetails- Returns:
- ModuleDetails
-
listModules
Lists all the currently installed modules in the WAR- Specified by:
listModulesin interfaceWarHelper- Parameters:
war- the war- Returns:
- an unordered list of module details.
- Throws:
ModuleManagementToolException
-
backup
Backs up a given file or directory.- Specified by:
backupin interfaceWarHelper- Parameters:
file- the file to backup- Returns:
- the absolute path to the backup file.
- Throws:
IOException
-
getModuleDetails
Gets the module details for the specified module from the war.- Parameters:
war- a valid war file or exploded directory from a warmoduleId- String- Returns:
- ModuleDetails
-