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

Bug 326318

Summary: Server never shows publishing state and in sync state prematurely
Product: [WebTools] WTP ServerTools Reporter: Jason Duan <jasonxd>
Component: wst.serverAssignee: Elson Yuen <eyuen7>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: ccc, thatnitind
Version: unspecifiedFlags: arvera: review+
Target Milestone: 3.2.2 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 328891    
Attachments:
Description Flags
v1.0
none
Deprecate ServerContentProvider.publishing instead of removing ccc: iplog+, arvera: review+

Description Jason Duan CLA 2010-09-27 11:11:30 EDT
Build Identifier: 3.2.2

We noticed that the server never shows publishing state and it is in sync state even before the publishing is completed.

If we look at the org.eclipse.wst.server.ui.internal.cnf.ServerDecorator.getServerStatusLabel(IServer server).  The ServerContentProvider.publishing is never got set, so it will never return syncState[4], that is "Publishing."  Instead, it returns the syncState[0].  This is "Synchronized" state.

	public static String getServerStatusLabel(IServer server) {
		IStatus status = ((Server) server).getServerStatus();
		if (status != null)
			return status.getMessage();
		
		if (server.getServerType() == null)
			return "";

		if (server.getServerState() == IServer.STATE_UNKNOWN)
			return "";
		
		String serverId = server.getId();
		if (ServerContentProvider.publishing.contains(serverId))
			return ServerDecorator.syncState[4];
		
		// republish
		int i = 0;
		if (server.shouldPublish()) {
			if (((Server)server).isPublishUnknown())
				return "";
			i += 2;
		}
		
		if (server.shouldRestart())
			i = 1;
		
		return syncState[i];
	}


Reproducible: Always

Steps to Reproduce:
1. Publish a project that takes some time to publish.
2.
3.
Comment 1 Jason Duan CLA 2010-09-27 11:17:09 EDT
my ref# 57988
Comment 2 Elson Yuen CLA 2010-10-08 13:37:10 EDT
Created attachment 180506 [details]
v1.0

The problem is caused by the code is still using the old publishing states from the old variable before migrating to the cnf view.

This patch will fix the described problem to change the status to "Publishing" during the publish operation.

Tested scenario:
1. The status of the server changed to "Publishing..." when publishing to a tomcat server.
Comment 3 Elson Yuen CLA 2010-10-08 15:26:42 EDT
This problem is a regression on function on the CNF Servers view when comparing to the old Servers view on 3.0.x.
Comment 4 Angel Vera CLA 2010-10-13 09:23:57 EDT
Targeting to 3.2.2 P as per request of the adopter
Comment 5 Carl Anderson CLA 2010-10-18 09:18:08 EDT
Created attachment 181093 [details]
Deprecate ServerContentProvider.publishing instead of removing
Comment 6 Angel Vera CLA 2010-10-18 11:20:51 EDT
Comment on attachment 181093 [details]
Deprecate ServerContentProvider.publishing instead of removing

Carl your patch is a good idea since this is a maintenance release
Comment 7 Carl Anderson CLA 2010-10-19 09:56:07 EDT
Committed to R3_2_2_patches