Class WarHelperImpl

java.lang.Object
org.alfresco.repo.module.tool.WarHelperImpl
All Implemented Interfaces:
WarHelper

public class WarHelperImpl extends Object implements WarHelper
Performs logic for the Module Management Tool.
Author:
Gethin James
  • Field Details

  • Constructor Details

    • WarHelperImpl

      public WarHelperImpl(LogOutput log)
  • Method Details

    • checkCompatibleVersion

      public void checkCompatibleVersion(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)
      Description copied from interface: WarHelper
      Checks to see if the module is compatible with the version of Alfresco.
      Specified by:
      checkCompatibleVersion in interface WarHelper
      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 - TFile
      installingModuleDetails - 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 war
      attributeName - 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:
      findManifest in interface WarHelper
      Parameters:
      war - the war
      Returns:
      Manifest
      Throws:
      ModuleManagementToolException
    • checkCompatibleEdition

      public void checkCompatibleEdition(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)
      Description copied from interface: WarHelper
      This 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:
      checkCompatibleEdition in interface WarHelper
      Parameters:
      war - a valid war file or exploded directory from a war
      installingModuleDetails - 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 - TFile
      installingModuleDetails - ModuleDetails
    • checkModuleDependencies

      public void checkModuleDependencies(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)
      Description copied from interface: WarHelper
      Checks the dependencies of this module
      Specified by:
      checkModuleDependencies in interface WarHelper
      Parameters:
      war - TFile
      installingModuleDetails - ModuleDetails
    • getModuleDetailsOrAlias

      public ModuleDetails getModuleDetailsOrAlias(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)
      Description copied from interface: WarHelper
      Gets the module details or an available alias
      Specified by:
      getModuleDetailsOrAlias in interface WarHelper
      Parameters:
      war - a valid war file or exploded directory from a war
      installingModuleDetails - ModuleDetails
      Returns:
      ModuleDetails
    • isShareWar

      public boolean isShareWar(de.schlichtherle.truezip.file.TFile warFile)
      Description copied from interface: WarHelper
      Indicates if the war file specified is a "Share" war. The default is FALSE Returns true if the Share war manifest states its a share war.
      Specified by:
      isShareWar in interface WarHelper
      Parameters:
      warFile - TFile
      Returns:
      boolean - true if it is a share war
    • listModules

      public List<ModuleDetails> listModules(de.schlichtherle.truezip.file.TFile war)
      Lists all the currently installed modules in the WAR
      Specified by:
      listModules in interface WarHelper
      Parameters:
      war - the war
      Returns:
      an unordered list of module details.
      Throws:
      ModuleManagementToolException
    • backup

      public String backup(de.schlichtherle.truezip.file.TFile file) throws IOException
      Backs up a given file or directory.
      Specified by:
      backup in interface WarHelper
      Parameters:
      file - the file to backup
      Returns:
      the absolute path to the backup file.
      Throws:
      IOException
    • getModuleDetails

      protected ModuleDetails getModuleDetails(de.schlichtherle.truezip.file.TFile war, String moduleId)
      Gets the module details for the specified module from the war.
      Parameters:
      war - a valid war file or exploded directory from a war
      moduleId - String
      Returns:
      ModuleDetails