com.infoengine.administration.packaging
Class AntPackager

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bycom.infoengine.administration.packaging.AntPackager
All Implemented Interfaces:
JarListener

public class AntPackager
extends org.apache.tools.ant.Task
implements JarListener

Ant task used to generate Info*Engine packages.

Example Ant Usage:

 <taskdef name="packager" classname="com.infoengine.administration.packaging.AntPackager">
   <classpath refid="cp"/>
 </taskdef>

 <packager
    packageName="Ted's Auto Store Extravaganza"
    packageDescription="Sample DCA Application"
    outputDir=".">
    <tasks dir="${wt.home}/tasks">
      <include name="com/ptc/autostore/"/>
    </tasks>
    <configspecs dir="${wt.home}/conf/dca">
      <include name="com/ptc/autostore/"/>
    </configspecs>
  </packager>
 

Parameters:

Description:

Generates an Info*Engine task archive (ptctar) or Windchill DCA archive (ptcdar) package file. The tag supports embedded tasks and configspecs tags which work like other ant path related tags. At a minimum an embedded tasks tag is required. If both tasks and configspecs are present then a ptcdar file will be generated. If only tasks is present then a ptctar file will be generated.

The metainf parameter can be used when more complex packages need to be generated. For example packages that require extra LDAP infrastructure other than what is described in the task root (e.g. schema, abstract type hierarchies, etc.). To do this the package manager UI should be used to generate the package once and extract the META-INF from there for use with this tag.


Field Summary
private  String archiveName
           
private  Vector cspecs
           
private  File metainf
           
private  File outputDir
           
private  String packageDescription
           
private  String packageName
           
private static String RESOURCE
           
private  Vector tasks
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
AntPackager()
           
 
Method Summary
 void addConfiguredConfigspecs(org.apache.tools.ant.types.FileSet specs)
           
 void addConfiguredTasks(org.apache.tools.ant.types.FileSet tsks)
           
private static void delTree(File dir)
           
private  boolean empty(Object o)
           
private  boolean emptyFileSets(Vector sets)
           
 void execute()
           
 void jarred(String path)
          called each time a file or directory is created in a jar
private  void move(File from, File to)
           
 void setArchivename(String s)
           
 void setMetainf(File f)
           
 void setOutputdir(File d)
           
 void setPackagedescription(String s)
           
 void setPackagename(String s)
           
private  Map toMap(Vector sets)
           
 void unjarred(File f, boolean overwritten)
          called each time a file or directory is created as a result of unjarring.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packageName

private String packageName

packageDescription

private String packageDescription

metainf

private File metainf

outputDir

private File outputDir

archiveName

private String archiveName

tasks

private Vector tasks

cspecs

private Vector cspecs

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values
Constructor Detail

AntPackager

public AntPackager()
Method Detail

setPackagename

public void setPackagename(String s)

setPackagedescription

public void setPackagedescription(String s)

setMetainf

public void setMetainf(File f)

setOutputdir

public void setOutputdir(File d)

setArchivename

public void setArchivename(String s)

addConfiguredTasks

public void addConfiguredTasks(org.apache.tools.ant.types.FileSet tsks)

addConfiguredConfigspecs

public void addConfiguredConfigspecs(org.apache.tools.ant.types.FileSet specs)

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

emptyFileSets

private boolean emptyFileSets(Vector sets)

toMap

private Map toMap(Vector sets)
           throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

delTree

private static void delTree(File dir)

move

private void move(File from,
                  File to)
           throws IOException
Throws:
IOException

jarred

public void jarred(String path)
Description copied from interface: JarListener
called each time a file or directory is created in a jar

Specified by:
jarred in interface JarListener
Parameters:
path - the path within the jar

unjarred

public void unjarred(File f,
                     boolean overwritten)
Description copied from interface: JarListener
called each time a file or directory is created as a result of unjarring.

Specified by:
unjarred in interface JarListener
Parameters:
f - the newly created file or directory

empty

private boolean empty(Object o)