1 5 package xdoclet.modules.oracle.oc4j.ejb; 6 7 import xdoclet.XDocletException; 8 import xdoclet.XDocletMessages; 9 import xdoclet.modules.ejb.dd.AbstractEjbDeploymentDescriptorSubTask; 10 import xdoclet.util.Translator; 11 12 34 public class OC4JSubTask extends AbstractEjbDeploymentDescriptorSubTask 35 { 36 private final static String OC4J_DD_FILE_NAME = "orion-ejb-jar.xml"; 37 38 private final static String OC4J_DD_PUBLICID = "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN"; 39 40 private final static String OC4J_DD_SYSTEMID = "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"; 41 42 private final static String OC4J_DTD_FILE_NAME = "resources/orion-ejb-jar.dtd"; 43 44 private static String DEFAULT_TEMPLATE_FILE = "resources/oc4j.xdt"; 45 46 private String deploymentVersion = OC4JVersionTypes.VERSION_9_0_3; 47 48 51 public OC4JSubTask() 52 { 53 setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE)); 54 setDestinationFile(OC4J_DD_FILE_NAME); 55 setPublicId(OC4J_DD_PUBLICID); 56 setSystemId(OC4J_DD_SYSTEMID); 57 setDtdURL(getClass().getResource(OC4J_DTD_FILE_NAME)); 58 } 59 60 65 public String getVersion() 66 { 67 return this.deploymentVersion; 68 } 69 70 75 public void setVersion(OC4JVersionTypes deploymentVersion) 76 { 77 this.deploymentVersion = deploymentVersion.getValue(); 78 } 79 80 85 protected void engineStarted() throws XDocletException 86 { 87 88 if (getDestinationFile().equals(OC4J_DD_FILE_NAME)) { 89 System.out.println(Translator.getString(XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String []{OC4J_DD_FILE_NAME})); 90 } 91 92 } 93 94 98 public static class OC4JVersionTypes extends org.apache.tools.ant.types.EnumeratedAttribute 99 { 100 public final static String VERSION_9_0_3 = "9.0.3.0.0"; 101 public final static String VERSION_9_0_4 = "9.0.4.0.0"; 102 103 108 public String [] getValues() 109 { 110 return (new String []{VERSION_9_0_3, VERSION_9_0_4}); 111 } 112 } 113 } 114 | Popular Tags |