Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317414

Summary: Adding / Removing modules from server on project deletion should be a workspace change participant
Product: [WebTools] WTP Java EE Tools Reporter: Rob Stryker <stryker>
Component: jst.j2eeAssignee: Rob Stryker <stryker>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: enhancement    
Priority: P3 CC: ccc
Version: 3.2Flags: cbridgha: review+
Target Milestone: 3.3   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Changes deletion to a delete participant, keeps rename behaviour same none

Description Rob Stryker CLA 2010-06-21 06:30:28 EDT
Currently updating server references on a project deletion is done via a resource change listener. When a project is deleted, it is removed from the server, and on the very next publish it is deleted from the server. 

Some users might prefer to control whether or not the project gets removed from the server and deleted on the next publish. 

Another issue is that on the next publish, since the project is deleted, the server API only gets access to a DeletedModule. The module factories no longer have the actual J2EEFlexProjDeployable so when the publish goes through, an empty DeletedModule is provided. 

If both the removal from server *and* the publish were done as a workspace change participant, it could allow more control for the users and also allow the server API to have access to the actual module being removed *before* the project is deleted.
Comment 1 Rob Stryker CLA 2010-06-21 06:32:05 EDT
clearly an enhancement ;)
Comment 2 Carl Anderson CLA 2010-06-21 10:45:44 EDT
Assigning to Rob for initial work.  I set the target milestone to Future so we will see it when we review plan items for the next WTP release.  Please retarget as appropriate.
Comment 3 Rob Stryker CLA 2010-11-10 11:00:02 EST
Created attachment 182831 [details]
Changes deletion to a delete participant, keeps rename behaviour same

Carl and Chuck might want to take a peek
Comment 4 Rob Stryker CLA 2010-11-10 11:00:54 EST
Adding reviewers
Comment 5 Chuck Bridgham CLA 2011-01-10 10:37:31 EST
I say get this in Rob... but make sure Angel and other Server tools folks are aware
Comment 6 Rob Stryker CLA 2011-01-20 15:02:13 EST
I've just re-tested hte patch and it works and can be committed, but as always there's a note ;) 

The generic server framework ignores publish requests if the module's project is inaccessible. During the workspace change participants, the project is not accessible and doesn't even really exist.   

There should be no *real* change in behaviour though, because just as before, a call to publish will revert to the previous behaviour, publishing and passing in a DeletedModule.

However for server adapters that do not need to ignore publish requests to closed projects, the MODULE here still exists properly and can be cast into its delegate class... so... thats cool. 

Either way, if your adapter supports it, this works great. If your adapter doesn't support it, your adapter behaves the same as it did before with no change.
Comment 7 Rob Stryker CLA 2011-01-25 16:51:17 EST
This has been committed and released to head