Community
Participate
Working Groups
Currently, you can create an EJB project without the EJBDoclet facet enable and still execute the new "XDoclet Enterprise JavaBean" action (the action will allow you to configure xdoclet and will automatically add the ejb xdoclet builder to the project). In order to allow other facet constraints to function correctly, EJB xdoclet functionality should only work on an EJB project when the EJBDoclet facet is enabled.
Rob is this relate to https://bugs.eclipse.org/bugs/show_bug.cgi?id=121621, or do you just mean, check for the existence of the doclet facet in the action? I waiting (hoping) for the capability to "filter" actions in the plugin xml based on the presence of facets. There was a bug (I think) open for this but I could not locate it. Maybe kosta knows. What I mean is smt like this: <filter name="facet" value="jst.web.xdoclet"/>. This way the action will not even show up unless the facet is added. i.e: <extension point="org.eclipse.ui.popupMenus"> <objectContribution adaptable="true" objectClass="org.eclipse.core.resources.IProject" nameFilter="*" id="org.eclipse.jst.j2ee.ejb.annotations.xdoclet"> <filter name="nature" value="org.eclipse.wst.common.project.facet.core.nature"/> <filter name="facet" value="jst.web.xdoclet"/> <action label="%action.runxdoclet" class="org.eclipse.jst.j2ee.ejb.annotations.internal.xdoclet.action.RunXDocletAction" menubarPath="additions" enablesFor="+" id="org.eclipse.jst.j2ee.ejb.annotations.internal.xdoclet.action.RunXDocletAction"/> </objectContribution> </extension>
hi Naci - exactly; the ideal solution is to filter the action contributions in the plugin.xml using facets; until that support is added, I was hoping that the action would just check for the existence of the xdoclet facet
Naci, the bug you were looking for is https://bugs.eclipse.org/bugs/show_bug.cgi?id=126223. I just "fixed" it by implementing a property tester fo facets. I updated the "Run XDoclet" action contribution and used it as a test case. I committed the change, but didn't tag/release it. I hope you don't mind.
Kosta the change is fine. ı will release it for M6
Adding an Xdoclet EJB now adds the EJBDoclet facet to the project if it is not added already
hi Naci - The popup menu action is being correctly filtered now, however, I'm going to reopen the bug because I think the behavior of allowing a user to add an XDoclet EJB via other UI mechanisms (i.e. New->XDoclet Enterprise JavaBean) even when the facet is missing and then automatically adding the facet represents the same underlying issue. I think users should have to explicitly enable the facet before they add XDoclet EJBs.
fixed in 1.5
Reopening; tested this with 1.5.1; the ejb xdoclet facet is no longer auto-enabled, however, I am still able to launch the new XDoclet EJB wizard and target an EJB project that does not have the xdoclet facet - this should be checked by the wizard and the action should be blocked.
This problem is valid for us as adopters. We are currently rebuilding our Java EE 5 support on top of the new facet versions in WTP 2.0. It is the case that the 'XDoclet Enterprise JavaBean' action item appears for the EJB 3.0 project. This is nonsense, because EJB 3.0 now uses Java annotations and XDoclet annotation are no more needed. We need the 'XDoclet Enterprise JavaBean' action item to be limitted to appear only for EJB project with version up to 2.1.
Kaloyan, your bug request is valid (XDoclet < EJB 3.0 facets) but please open a new bug for it because it is not related to this bug. Robert, Your comment is valid. XDoclet wizard should not let you select a project without a facet.
Bug 179715 created.
Created attachment 62225 [details] patch to enable xdoclet action item only if jst.ejb.xdoclet is available It appears the the 'XDoclet Enterprise JavaBean' action is enabled for project with facet jst.ejb. In my opinion it is more appropriate the enablement to be done over the jst.ejb.xdoclet facet. This patch fixes exactly this. Now when you right-click an EJB project without XDoclet facet the 'XDoclet Enterprise JavaBean' action does not appear. Of course, this still does not prevent the user to execute the wizard via "New->Other->XDoclet Enterprise JavaBean".
Will drop to fix to the next build
Created attachment 62468 [details] patch for xdoclet wizard The patch modifies the XDoclet bean creation wizard. In the Project combo box are only listed project with jst.ejb.xdoclet facet enabled.
Patches tested and relased to HEAD build v200704020600
Closing as part of mass query to clean up old resolved bugs in untargetted milestones.
Verified with S-2.0M6-200704040045.