Tabnine Logo
ModuleManagementTool.installModule
Code IndexAdd Tabnine to your IDE (free)

How to use
installModule
method
in
org.alfresco.repo.module.tool.ModuleManagementTool

Best Java code snippets using org.alfresco.repo.module.tool.ModuleManagementTool.installModule (Showing top 18 results out of 315)

origin: org.alfresco/alfresco-repository

/**
 * Installs a given AMP file into a given WAR file.  
 * 
 * @see ModuleManagementTool#installModule(String, String, boolean, boolean, boolean)
 * 
 * @param ampFileLocation   the location of the AMP file to be installed
 * @param warFileLocation   the location of the WAR file into which the AMP file is to be installed
 */
public void installModule(String ampFileLocation, String warFileLocation)
{
  installModule(ampFileLocation, warFileLocation, false, false, true);
}
 
origin: org.alfresco/alfresco-repository

private void installModules(java.io.File dir, String warFileLocation, boolean preview, boolean forceInstall, boolean backupWAR)
{
  java.io.File[] children =  dir.listFiles();
  if (children != null)
  {
    for (java.io.File child : children)
    {
      if (child.isFile() == true && child.getName().toLowerCase().endsWith(".amp") == true)
      {
        installModule(child.getPath(), warFileLocation, preview, forceInstall, backupWAR);
      }
      else
      {
        installModules(child, warFileLocation, preview, forceInstall, backupWAR);
      }
    }
  }
}
 
origin: Alfresco/alfresco-repository

private void installModules(java.io.File dir, String warFileLocation, boolean preview, boolean forceInstall, boolean backupWAR)
{
  java.io.File[] children =  dir.listFiles();
  if (children != null)
  {
    for (java.io.File child : children)
    {
      if (child.isFile() == true && child.getName().toLowerCase().endsWith(".amp") == true)
      {
        installModule(child.getPath(), warFileLocation, preview, forceInstall, backupWAR);
      }
      else
      {
        installModules(child, warFileLocation, preview, forceInstall, backupWAR);
      }
    }
  }
}
 
origin: Alfresco/alfresco-repository

/**
 * Installs a given AMP file into a given WAR file.  
 * 
 * @see ModuleManagementTool#installModule(String, String, boolean, boolean, boolean)
 * 
 * @param ampFileLocation   the location of the AMP file to be installed
 * @param warFileLocation   the location of the WAR file into which the AMP file is to be installed
 */
public void installModule(String ampFileLocation, String warFileLocation)
{
  installModule(ampFileLocation, warFileLocation, false, false, true);
}
 
origin: Alfresco/alfresco-sdk

mmt.installModule(ampLocation.getAbsolutePath(),
    warLocation.getAbsolutePath(), false, // preview
origin: Alfresco/alfresco-repository

public void testWhiteSpaceInCustomMapping()
      throws Exception
{
  manager.setVerbose(true);
  
  String warLocation = getFileLocation(".war", "module/test.war");
  String ampLocation = getFileLocation(".amp", "module/test_v3.amp");
  
  // Initial install of module
  this.manager.installModule(ampLocation, warLocation, false, false, true);
  
  List<String> files = new ArrayList<String>(10);
  files.add("/WEB-INF/classes/alfresco/module/test/module.properties");
  files.add("/WEB-INF/classes/alfresco/module/test/modifications.install");
  files.add("/WEB-INF/lib/test.jar");
  files.add("/WEB-INF/classes/alfresco/module/test/module-context.xml");
  files.add("/images/test.jpg");
  files.add("/css/test.css");
  files.add("/extra.txt");
  checkForFileExistance(warLocation, files);   
}

origin: org.alfresco/alfresco-repository

manager.installModule(aepFileLocation, warFileLocation, previewInstall, forceInstall, backup);
origin: Alfresco/alfresco-repository

this.manager.installModule(testAmpV1Location, warLocation, false, false, false);
this.manager.installModule(testAmpDepV1Location, warLocation, false, false, false);
  this.manager.installModule(testAmpDepV2Location, warLocation, false, false, false);
  fail("Failed to detect inadequate dependency on the test amp");
this.manager.installModule(testAmpV2Location, warLocation, false, false, false);
this.manager.installModule(testAmpDepV2Location, warLocation, false, false, false);
origin: Alfresco/alfresco-repository

manager.installModule(aepFileLocation, warFileLocation, previewInstall, forceInstall, backup);
origin: Alfresco/alfresco-repository

public void testExistingFilesInWar() throws Exception
{
  manager.setVerbose(true);
  
  String warLocation = getFileLocation(".war", "module/test.war");   //Version 4.0.1
  String ampLocation = getFileLocation(".amp", "module/test_v4.amp");
  
  try
  {
   this.manager.installModule(ampLocation, warLocation, false, false, true);
  }
  catch(ModuleManagementToolException exception)
  {
    assertTrue(exception.getMessage().contains("will overwrite an existing file in the war"));
  }
  
  this.manager.installModule(ampLocation, warLocation, false, true, true);  //Now force it
  checkContentsOfFile(warLocation + "/jsp/relogin.jsp", "VERSIONONE");
  checkContentsOfFile(warLocation + "/css/main.css", "p{margin-bottom:1em;}");
  this.manager.installModule(ampLocation, warLocation, false, true, false); //install it again
}

origin: Alfresco/alfresco-repository

public void testNoWar() throws Exception 
{
  String noWar = "noWar";
  String ampLocation = getFileLocation(".amp", "module/test_v1.amp");
  try
  {
    this.manager.installModule(ampLocation, noWar,false,false, false);
  }
  catch (ModuleManagementToolException exception)
  {
    assertTrue(exception.getMessage().endsWith("does not exist."));
  }  
  try
  {
    this.manager.installModule(ampLocation, noWar,false,false, true);  //backup war
  }
  catch (ModuleManagementToolException exception)
  {
    assertTrue(exception.getMessage().endsWith("does not exist."));
  }       
}

origin: Alfresco/alfresco-repository

public void testPreviewInstall()
  throws Exception
{
  manager.setVerbose(true);
  
  String warLocation = getFileLocation(".war", "module/test.war");
  String ampLocation = getFileLocation(".amp", "module/test_v1.amp");
  
  // Initial install of module
  this.manager.installModule(ampLocation, warLocation, true, false, true);
  
  // TODO need to prove that the war file has not been updated in any way
}

origin: Alfresco/alfresco-repository

public void testUninstall()
  throws Exception
{
  manager.setVerbose(true);
  
  String warLocation = getFileLocation(".war", "module/test.war");
  String ampLocation = getFileLocation(".amp", "module/test_v1.amp");
  
  // Initial install of module
  this.manager.installModule(ampLocation, warLocation, false, false, false);
  this.manager.listModules(warLocation);
  this.manager.uninstallModule("test", warLocation, false, false);
  
  List<String> files = new ArrayList<String>(10);
  files.add("/WEB-INF/classes/alfresco/module/test/module.properties");
  files.add("/WEB-INF/classes/alfresco/module/test/modifications.install");
  files.add("/WEB-INF/lib/test.jar");
  files.add("/WEB-INF/classes/alfresco/module/test/module-context.xml");
  checkForFileNonExistance(warLocation, files);  
}

origin: Alfresco/alfresco-repository

  this.manager.installModule(ampLocation, warLocation, false, false, false); //not forced
  fail("Failed to detect existing files in the amp");
this.manager.installModule(ampLocation, warLocation, false, true, false); //install v1
this.manager.installModule(ampv2Location, warLocation, false, true, false); //install v2
warLocation = getFileLocation(".war", "module/alfresco-4.2.c.war");  //Get a new war file
String amp5Location = getFileLocation(".amp", "module/test_v7.amp");  //new amp that overides existing files
this.manager.installModule(ampLocation, warLocation, false, true, false);
this.manager.installModule(amp5Location, warLocation, false, true, false);
origin: Alfresco/alfresco-sdk

mmt.installModule(
    getSourceFile().getAbsolutePath(),
    destLocation.getAbsolutePath(),
origin: Alfresco/alfresco-repository

private void installerSharedTests(String warLocation, String ampLocation, String ampV2Location)
  this.manager.installModule(ampLocation, warLocation);
    this.manager.installModule(ampLocation, warLocation);
  this.manager.installModule(ampV2Location, warLocation);
    this.manager.installModule(ampLocation, warLocation);
origin: Alfresco/alfresco-repository

public void testBasicFolderInstall() throws Exception
{
  manager.setVerbose(true);
  String warDirectory = extractToDir(".war", "module/test.war");
  String ampDirectory = extractToDir(".amp", "module/test_v1.amp");
  String ampV2Directory = getFileLocation(".amp", "module/test_v2.amp");
  assertNotNull(warDirectory);
  assertNotNull(ampDirectory);  
  assertNotNull(ampV2Directory);         
  installerSharedTests(warDirectory, ampDirectory, ampV2Directory);
  
  //Now try it on share
  warDirectory = extractToDir(".war", "module/share-3.4.11.war");
  assertNotNull(warDirectory);
  assertNotNull(ampDirectory);  
  this.manager.installModule(ampDirectory, warDirectory);
  
  warDirectory = extractToDir(".war", "module/share-4.2.a.war");
  assertNotNull(warDirectory);
  String ampV2Location = getFileLocation(".amp", "module/test_v6.amp");
  this.manager.installModule(ampV2Location, warDirectory);
}

origin: Alfresco/alfresco-repository

assertEquals(details.size(), 0);
this.manager.installModule(ampLocation, warLocation);
assertEquals("1.0", aModule.getModuleVersionNumber().toString());
this.manager.installModule(ampV2Location, warLocation);
String testAmp7 = getFileLocation(".amp", "module/test_v7.amp");
this.manager.installModule(testAmpDepV2Location, warLocation, false, true, false);
this.manager.installModule(testAmp7, warLocation, false, true, false);
org.alfresco.repo.module.toolModuleManagementToolinstallModule

Javadoc

Installs a given AMP file into a given WAR file.

Popular methods of ModuleManagementTool

  • installModules
  • setVerbose
    Sets the verbose setting for the mangement tool
  • <init>
    Constructor
  • listModules
    Lists all the currently installed modules in the WAR
  • uninstallModule
    Cleans the WAR file of all files relating to the currently installed version of the the Module.
  • backupWar
    Backsup a given WAR file.
  • calculateChanges
  • calculateCopyToWar
    Copies a file from the AMP location to the correct location in the WAR, interating on directories wh
  • generateGuid
    Generates a GUID, avoiding undesired imports.
  • getCustomFileMappings
  • outputErrorMessage
    Outputs a message the console (in verbose mode).
  • outputMessage
    Outputs a message the console. Errors are always output, but others are only output in verbose mode.
  • outputErrorMessage,
  • outputMessage,
  • outputUsage,
  • outputVerboseMessage,
  • removeFile,
  • uninstallIfNecessary

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Reference (javax.naming)
  • JTable (javax.swing)
  • Join (org.hibernate.mapping)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now