User: rinkrank Date: 02/06/12 18:17:30 Modified: modules/bea/src/xdoclet/modules/bea/wls/ejb WebLogicSubTask.java XDocletModulesBeaWlsEjbMessages.java Log: Fixed bug #524003 (I hope) Revision Changes Path 1.6 +37 -24 xdoclet/modules/bea/src/xdoclet/modules/bea/wls/ejb/WebLogicSubTask.java Index: WebLogicSubTask.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/bea/src/xdoclet/modules/bea/wls/ejb/WebLogicSubTask.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- WebLogicSubTask.java 12 Jun 2002 23:37:28 -0000 1.5 +++ WebLogicSubTask.java 13 Jun 2002 01:17:30 -0000 1.6 @@ -8,6 +8,7 @@ import xdoclet.XDocletMessages; import xdoclet.modules.ejb.XDocletModulesEjbMessages; import xdoclet.modules.ejb.dd.AbstractEjbDeploymentDescriptorSubTask; +import xdoclet.util.LogUtil; import xdoclet.util.Translator; /** @@ -16,7 +17,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Aslak Hellesøy </a> * @created Sept 11, 2001 * @ant.element display-name="WebLogic Server" name="weblogic" parent="xdoclet.modules.ejb.EjbDocletTask" - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ public class WebLogicSubTask extends AbstractEjbDeploymentDescriptorSubTask { @@ -46,11 +47,14 @@ private final static String WEBLOGIC_CMP20_DTD_FILE_NAME = "resources/weblogic-rdbms20-persistence-600.dtd"; + private final static String DEFAULT_PERSISTENCE = "weblogic"; + private String version = "6.1"; private String dataSource = ""; private boolean createTables = false; + private String persistence = DEFAULT_PERSISTENCE; /** * Gets the Datasource attribute of the WebLogicSubTask object @@ -82,17 +86,10 @@ return createTables ? "True" : "False"; } -// public WebLogicSubTask() { - // register all the tag handlers we need. No need to specify it in xdoclet.xml or - // in tagmappings.properties (which will go away) -// try { -// System.out.println("Registering handlers"); -// TemplateEngine.getEngineInstance().setTagHandlerFor("WlEjbRel", new WeblogicRelationTagsHandler()); -// } catch( TemplateException e ) { -// // Any way we could make setTagHandlerFor _not_ throw TE? -// e.printStackTrace(); -// } -// } + public String getPersistence() + { + return persistence; + } /** * Sets the Datasource attribute of the WebLogicSubTask object @@ -115,6 +112,17 @@ } /** + * Sets the persistence type to use. Useful if you're using a different persistence manager like MVCSoft + * + * @param persistence + * @ant.required No, default is "weblogic" + */ + public void setPersistence(String persistence) + { + this.persistence = persistence; + } + + /** * Sets the Createtables attribute of the WebLogicSubTask object * * @param flag The new Createtables value @@ -140,6 +148,7 @@ startProcess(); if (atLeastOneCmpEntityBeanExists()) { + if (DEFAULT_PERSISTENCE.equals(getPersistence())) { setTemplateURL(getClass().getResource(WEBLOGIC_CMP_DEFAULT_TEMPLATE_FILE)); setDestinationFile(WEBLOGIC_CMP_DD_FILE_NAME); if (getContext().getConfigParam("EjbSpec").equals("1.1")) { @@ -154,6 +163,10 @@ } else { throw new XDocletException(Translator.getString(XDocletModulesEjbMessages.class, XDocletModulesEjbMessages.UNSUPPORTED_EJB_SPEC, new String[]{getContext().getConfigParam("EjbSpec").toString()})); + } + } + else { + LogUtil.getLog(getClass(), "execute").warn(Translator.getString(XDocletModulesBeaWlsEjbMessages.class, XDocletModulesBeaWlsEjbMessages.NON_WEBLOGIC_PERSISTENCE, new String[]{getPersistence()})); } startProcess(); 1.3 +11 -3 xdoclet/modules/bea/src/xdoclet/modules/bea/wls/ejb/XDocletModulesBeaWlsEjbMessages.java Index: XDocletModulesBeaWlsEjbMessages.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/bea/src/xdoclet/modules/bea/wls/ejb/XDocletModulesBeaWlsEjbMessages.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- XDocletModulesBeaWlsEjbMessages.java 2 Jun 2002 22:44:13 -0000 1.2 +++ XDocletModulesBeaWlsEjbMessages.java 13 Jun 2002 01:17:30 -0000 1.3 @@ -7,17 +7,25 @@ /** * @author Ara Abrahamian ([EMAIL PROTECTED]) * @created May 31, 2002 - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public final class XDocletModulesBeaWlsEjbMessages { /** - * @msg:bundle msg="You should only specify weblogic:relation join-table-name=\"blabla\" in one of the methods defining the relationship." + * @msg:bundle msg="You should only specify weblogic:relation join-table-name=\"blabla\" in one of the methods + * defining the relationship." */ public final static String JOIN_TABLE_NAME_ONLY_ONE_SIDE = "JOIN_TABLE_NAME_ONLY_ONE_SIDE"; /** - * @msg:bundle msg="The relation {0} seems to be many-to-many (m:n). You should therefore specify weblogic:relation join-table-name=\"blabla\"." + * @msg:bundle msg="The relation {0} seems to be many-to-many (m:n). You should therefore specify + * weblogic:relation join-table-name=\"blabla\"." */ public final static String JOIN_TABLE_NAME_NEEDED = "JOIN_TABLE_NAME_NEEDED"; + + /** + * @msg:bundle msg="Using a different persistence engine than weblogic's own: {0}" + */ + public final static String NON_WEBLOGIC_PERSISTENCE = "NON_WEBLOGIC_PERSISTENCE"; + }
_______________________________________________________________ Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel