com.arsdigita.apm
Class Apm

java.lang.Object
  |
  +--com.arsdigita.apm.Apm

public class Apm
extends java.lang.Object

This is the main entry point to the arsdigita package manager. Instances of this class do all the legwork of installing, building, and upgrading packages. This class is a bit long, but it's structure is very regular, so at this point I don't think there is any benefit from splitting it up, also there are no obvious lines along which to split the functionality. The main method of this class uses introspection to make every public method that accepts an array of strings as arguments available on the command line. Usage documentation is generated using the static usages data structures. This means that any of the command line functionality of apm is available to Java programs to use internally.


Constructor Summary
Apm(java.util.Properties props)
          Creates an instance of the Apm class using the properties specified in props to configure itself.
Apm(java.util.Properties props, java.io.PrintStream out, java.io.PrintStream err)
          Creates an instance of the Apm class using the properties specified in props to configure itself.
 
Method Summary
 void bootstrap(java.lang.String[] args)
          Rebuilds the bootstrap.jar file that contains the Apm itself.
 void build(java.lang.String[] args)
          Rebuilds .java and .acsj files.
 void clean(java.lang.String[] args)
          Removes all files generated during the build process.
 void create(java.lang.String[] args)
          Creates an apm given a package key.
 void install(java.lang.String[] args)
          Installs the packages specified in the args array.
 void installAcs(java.lang.String[] args)
          Does a complete acs install.
 void installApm(java.io.File apmFile)
          Installs a package from an apm archive.
 void installPackage(java.io.File infoFile)
          Installs a package from the filesystem.
 void javadoc(java.lang.String[] args)
          Invokes javadoc.
 void loadJava(java.io.File file)
          Loads its argument as a Java class with loadjava.
static void main(java.lang.String[] args)
          This is the entry point for the apm binary.
 void sourceSql(java.io.File file)
          Sources its argument as a sql file using sqlplus.
 void translatePages(java.lang.String[] args)
          Precompiles all .ajp files in the www/ and packages/ directories into .generated.jsp files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Apm

public Apm(java.util.Properties props,
           java.io.PrintStream out,
           java.io.PrintStream err)
Creates an instance of the Apm class using the properties specified in props to configure itself. Uses out and err to display output. Props should contain the same properties that the acs.properties file does.
Parameters:
props - A properties object for configuring this apm.
out - A PrintStream on which to display output.
err - A PrintStream on which to display errs.

Apm

public Apm(java.util.Properties props)
Creates an instance of the Apm class using the properties specified in props to configure itself. Uses System.out and System.err to display output.
Parameters:
props - A properties object for configuring this apm.
Method Detail

sourceSql

public void sourceSql(java.io.File file)
               throws ApmException
Sources its argument as a sql file using sqlplus.
Parameters:
file - The file to source.
Throws:
ApmException - When an error occurs sourcing the file.

loadJava

public void loadJava(java.io.File file)
              throws ApmException
Loads its argument as a Java class with loadjava.
Parameters:
file - The single Java file to load into Oracle with loadjava
Throws:
ApmException - When an error occurs sourcing the file.

installPackage

public void installPackage(java.io.File infoFile)
                    throws ApmException
Installs a package from the filesystem.
Parameters:
infoFile - The package specification file.
Throws:
ApmException - Thrown when there is an error during the installation.

installApm

public void installApm(java.io.File apmFile)
                throws ApmException
Installs a package from an apm archive.
Parameters:
apmFile - The archive.
Throws:
ApmException - Thrown when there is an error.

install

public void install(java.lang.String[] args)
             throws ApmException
Installs the packages specified in the args array. The args array should contain filenames, and they may point to .apm files or .info files. It is expected that any .info files specified are part of the standard package directory structure.
Parameters:
args - The packages to install.

bootstrap

public void bootstrap(java.lang.String[] args)
               throws com.arsdigita.build.BuildException
Rebuilds the bootstrap.jar file that contains the Apm itself. This should be used with caution if you don't know what you're doing since you may be left without a way to rebuild yourself if you construct a faulty bootstrap.jar. In this case the old bootstrap.jar should be retrieved from the CVS repository.
Parameters:
args - This is ignored.

build

public void build(java.lang.String[] args)
           throws com.arsdigita.build.BuildException
Rebuilds .java and .acsj files. If args is empty then all packages are rebuilt. Otherwise only those packages specified in args are rebuilt.
Parameters:
args - The set of package keys to rebuild.

translatePages

public void translatePages(java.lang.String[] args)
                    throws com.arsdigita.build.BuildException
Precompiles all .ajp files in the www/ and packages/ directories into .generated.jsp files.
Parameters:
args - ignored

javadoc

public void javadoc(java.lang.String[] args)
             throws com.arsdigita.build.BuildException
Invokes javadoc. If args is empty then javadoc is run over all the files. If args contains any number of package keys, then javadoc is invoked only on those packages.
Parameters:
args -  

clean

public void clean(java.lang.String[] args)
           throws com.arsdigita.build.BuildException
Removes all files generated during the build process.
Parameters:
args - This is ignored.

create

public void create(java.lang.String[] args)
            throws com.arsdigita.build.BuildException,
                   ApmException
Creates an apm given a package key. The first argument is the apm file you wish to create and the second argument is the package key of the package you which to put in the apm.
Parameters:
args - The command line arguments.

installAcs

public final void installAcs(java.lang.String[] args)
                      throws ApmException,
                             com.arsdigita.build.BuildException
Does a complete acs install.
Parameters:
args - The command line arguments. Since there are none this is ignored.

main

public static final void main(java.lang.String[] args)
This is the entry point for the apm binary. It constructs an instance of the Apm class using the properties in acs.properties, and uses the first command line argument to dispatch to a method of that instance. The remaing args are copied into a String[] and passed to the method. This is done with introspection, so new public methods that accept an array of strings as arguments are automatically available from the command line.
Parameters:
args - The command line arguments.