1 5 package xdoclet.modules.macromedia.jrun.ejb; 6 7 import xdoclet.XDocletException; 8 import xdoclet.XDocletMessages; 9 import xdoclet.modules.ejb.dd.AbstractEjbDeploymentDescriptorSubTask; 10 import xdoclet.util.Translator; 11 12 20 public class JRunSubTask extends AbstractEjbDeploymentDescriptorSubTask 21 { 22 private final static String JRUN_DD_FILE_NAME = "jrun-ejb-jar.xml"; 23 24 private final static String JRUN_DD_PUBLICID = "-//Macromedia, Inc.//DTD jrun-ejb-jar 4.0//EN"; 25 26 private final static String JRUN_DD_SYSTEMID = "http://jrun.macromedia.com/dtds/jrun-ejb-jar.dtd"; 27 28 private final static String JRUN_DTD_FILE_NAME = "resources/jrun-ejb-jar.dtd"; 29 30 private static String DEFAULT_TEMPLATE_FILE = "resources/jrun-ejb-jar-xml.xdt"; 31 32 private String _version = "4.0"; 33 34 private String _dataSource = "DefaultDataSource"; 35 36 private boolean _createTables = false; 37 38 43 public String getSource() 44 { 45 return _dataSource; 46 } 47 48 49 54 public String getVersion() 55 { 56 return _version; 57 } 58 59 60 65 public String getCreatetables() 66 { 67 return _createTables ? "True" : "False"; 68 } 69 70 71 76 public void setSource(String new_data_source) 77 { 78 _dataSource = new_data_source; 79 } 80 81 82 87 public void setVersion(String version) 88 { 89 _version = version; 90 } 91 92 93 98 public void setCreatetables(boolean flag) 99 { 100 _createTables = flag; 101 } 102 103 104 109 public void validateOptions() throws XDocletException 110 { 111 } 115 116 117 122 public void execute() throws XDocletException 123 { 124 setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE)); 125 setDestinationFile(JRUN_DD_FILE_NAME); 126 setPublicId(JRUN_DD_PUBLICID); 127 setSystemId(JRUN_DD_SYSTEMID); 128 setDtdURL(getClass().getResource(JRUN_DTD_FILE_NAME)); 129 130 startProcess(); 131 } 132 133 134 139 protected void engineStarted() throws XDocletException 140 { 141 if (getDestinationFile().equals(JRUN_DD_FILE_NAME)) { 142 System.out.println(Translator.getString(XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String []{JRUN_DD_FILE_NAME})); 143 } 144 } 145 } 146 | Popular Tags |