This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 126090 - Should only be able to add an XDoclet EJB to a project if EJBDoclet facet is enabled
Summary: Should only be able to add an XDoclet EJB to a project if EJBDoclet facet is ...
Status: CLOSED FIXED
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Naci Dai CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-01 15:30 EST by Rob Frost CLA
Modified: 2007-04-04 03:59 EDT (History)
3 users (show)

See Also:


Attachments
patch to enable xdoclet action item only if jst.ejb.xdoclet is available (759 bytes, patch)
2007-03-28 09:53 EDT, Kaloyan Raev CLA
no flags Details | Diff
patch for xdoclet wizard (4.45 KB, patch)
2007-03-30 04:49 EDT, Kaloyan Raev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Frost CLA 2006-02-01 15:30:33 EST
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.
Comment 1 Naci Dai CLA 2006-02-11 11:27:58 EST
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>
Comment 2 Rob Frost CLA 2006-02-13 11:02:43 EST
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

Comment 3 Konstantin Komissarchik CLA 2006-02-13 14:03:25 EST
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.
Comment 4 Naci Dai CLA 2006-03-02 14:20:51 EST
Kosta the change is fine.  &#305; will release it for M6
Comment 5 Naci Dai CLA 2006-05-04 06:56:38 EDT
Adding an Xdoclet EJB now adds the EJBDoclet facet to the project if it is not added already
Comment 6 Rob Frost CLA 2006-06-22 10:02:59 EDT
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.
Comment 7 Naci Dai CLA 2006-08-24 06:46:27 EDT
fixed in 1.5
Comment 8 Rob Frost CLA 2006-09-22 11:18:23 EDT
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. 
Comment 9 Kaloyan Raev CLA 2007-03-28 07:13:48 EDT
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. 
Comment 10 Naci Dai CLA 2007-03-28 08:25:59 EDT
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.

Comment 11 Kaloyan Raev CLA 2007-03-28 09:09:22 EDT
Bug 179715 created.
Comment 12 Kaloyan Raev CLA 2007-03-28 09:53:29 EDT
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".
Comment 13 Naci Dai CLA 2007-03-29 10:44:09 EDT
Will drop to fix to the next build
Comment 14 Kaloyan Raev CLA 2007-03-30 04:49:02 EDT
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.
Comment 15 Naci Dai CLA 2007-04-02 01:06:27 EDT
Patches tested and relased to HEAD build v200704020600
Comment 16 John Lanuti CLA 2007-04-03 11:51:38 EDT
Closing as part of mass query to clean up old resolved bugs in untargetted milestones.
Comment 17 Kaloyan Raev CLA 2007-04-04 03:59:48 EDT
Verified with S-2.0M6-200704040045.