1 5 package xdoclet.modules.pramati.ejb; 6 7 import xdoclet.XDocletException; 8 import xdoclet.XDocletMessages; 9 import xdoclet.modules.ejb.dd.AbstractEjbDeploymentDescriptorSubTask; 10 import xdoclet.util.Translator; 11 12 19 public class PramatiSubTask extends AbstractEjbDeploymentDescriptorSubTask 20 { 21 private final static String PRAMATI_DEFAULT_TEMPLATE_FILE = "resources/pramati.xdt"; 22 23 private final static String PRAMATI_DD_FILE_NAME = "pramati-j2ee-server.xml"; 24 25 private final static String PRAMATI_OR_DEFAULT_TEMPLATE_FILE = "resources/pramati-or-map.xdt"; 26 27 private final static String PRAMATI_OR_DD_FILE_NAME = "pramati-or-map.xml"; 28 29 private String _version = "3.0"; 30 31 private String _dataSource = ""; 32 33 private String _jarName = ""; 34 35 40 public String getDatasource() 41 { 42 return _dataSource; 43 } 44 45 50 public String getVersion() 51 { 52 return _version; 53 } 54 55 60 public String getJarName() 61 { 62 return _jarName; 63 } 64 65 70 public void setDatasource(String new_data_source) 71 { 72 _dataSource = new_data_source; 73 } 74 75 80 public void setVersion(String version) 81 { 82 _version = version; 83 } 84 85 90 public void setJarName(String jarName) 91 { 92 this._jarName = jarName; 93 } 94 95 100 public void validateOptions() throws XDocletException 101 { 102 } 106 107 112 public void execute() throws XDocletException 113 { 114 setTemplateURL(getClass().getResource(PRAMATI_DEFAULT_TEMPLATE_FILE)); 115 setDestinationFile(PRAMATI_DD_FILE_NAME); 116 117 startProcess(); 118 119 if (atLeastOneCmpEntityBeanExists()) { 120 setTemplateURL(getClass().getResource(PRAMATI_OR_DEFAULT_TEMPLATE_FILE)); 121 setDestinationFile(PRAMATI_OR_DD_FILE_NAME); 122 startProcess(); 123 } 124 } 125 126 131 protected void engineStarted() throws XDocletException 132 { 133 if (getDestinationFile().equals(PRAMATI_DD_FILE_NAME)) { 134 System.out.println(Translator.getString(XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String []{PRAMATI_DD_FILE_NAME})); 135 } 136 else if (getDestinationFile().equals(PRAMATI_OR_DD_FILE_NAME)) { 137 System.out.println(Translator.getString(XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String []{PRAMATI_OR_DD_FILE_NAME})); 138 } 139 } 140 } 141 | Popular Tags |