Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 270514 | Differences between
and this patch

Collapse All | Expand All

(-)feature.xml (-1 / +1 lines)
Lines 2-8 Link Here
2
<feature
2
<feature
3
      id="org.eclipse.wst.ws_core.feature"
3
      id="org.eclipse.wst.ws_core.feature"
4
      label="%featureName"
4
      label="%featureName"
5
      version="3.0.4.qualifier"
5
      version="3.0.5.qualifier"
6
      provider-name="%providerName">
6
      provider-name="%providerName">
7
7
8
   <description>
8
   <description>
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %PLUGIN_NAME
3
Bundle-Name: %PLUGIN_NAME
4
Bundle-SymbolicName: org.eclipse.wst.ws.explorer; singleton:=true
4
Bundle-SymbolicName: org.eclipse.wst.ws.explorer; singleton:=true
5
Bundle-Version: 1.0.309.qualifier
5
Bundle-Version: 1.0.310.qualifier
6
Bundle-Activator: org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin
6
Bundle-Activator: org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin
7
Bundle-Vendor: %PLUGIN_PROVIDER
7
Bundle-Vendor: %PLUGIN_PROVIDER
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
(-)src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java (-13 / +70 lines)
Lines 14-19 Link Here
14
 * 20070327   172339 kathy@ca.ibm.com - Kathy Chan
14
 * 20070327   172339 kathy@ca.ibm.com - Kathy Chan
15
 * 20080123   216372 kathy@ca.ibm.com - Kathy Chan
15
 * 20080123   216372 kathy@ca.ibm.com - Kathy Chan
16
 * 20090122   257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs
16
 * 20090122   257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs
17
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
17
 *******************************************************************************/
18
 *******************************************************************************/
18
package org.eclipse.wst.ws.internal.explorer.popup;
19
package org.eclipse.wst.ws.internal.explorer.popup;
19
20
Lines 23-41 Link Here
23
import java.util.List;
24
import java.util.List;
24
import java.util.Vector;
25
import java.util.Vector;
25
26
27
import org.eclipse.core.resources.IFile;
26
import org.eclipse.core.resources.IResource;
28
import org.eclipse.core.resources.IResource;
29
import org.eclipse.core.resources.ResourcesPlugin;
30
import org.eclipse.core.runtime.Path;
27
import org.eclipse.core.runtime.Platform;
31
import org.eclipse.core.runtime.Platform;
28
import org.eclipse.jface.action.Action;
32
import org.eclipse.jface.action.Action;
29
import org.eclipse.jface.action.IAction;
33
import org.eclipse.jface.action.IAction;
30
import org.eclipse.jface.viewers.ISelection;
34
import org.eclipse.jface.viewers.ISelection;
31
import org.eclipse.jface.viewers.IStructuredSelection;
35
import org.eclipse.jface.viewers.IStructuredSelection;
32
import org.eclipse.ui.IActionDelegate;
36
import org.eclipse.ui.IActionDelegate;
37
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
33
import org.eclipse.wst.ws.internal.explorer.LaunchOption;
38
import org.eclipse.wst.ws.internal.explorer.LaunchOption;
34
import org.eclipse.wst.ws.internal.explorer.LaunchOptions;
39
import org.eclipse.wst.ws.internal.explorer.LaunchOptions;
35
import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand;
40
import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand;
36
import org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin;
41
import org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin;
37
import org.eclipse.wst.ws.internal.monitor.GetMonitorCommand;
42
import org.eclipse.wst.ws.internal.monitor.GetMonitorCommand;
38
import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser;
43
import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser;
44
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
39
import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils;
45
import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils;
40
import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper;
46
import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper;
41
import org.eclipse.wst.wsdl.Definition;
47
import org.eclipse.wst.wsdl.Definition;
Lines 66-80 Link Here
66
        Object object = it.next();
72
        Object object = it.next();
67
        if (object instanceof IResource)
73
        if (object instanceof IResource)
68
        {
74
        {
69
        	File wsdlFile = ((IResource)object).getLocation().toFile();
75
      	  File wsdlFile = ((IResource)object).getLocation().toFile();        		
70
        	try
76
    	  try
71
        	{
77
    	  {            	          		
72
        		wsdlURL = wsdlFile.toURL().toString();
78
    		wsdlURL = wsdlFile.toURL().toString();
73
        	}
79
    	  }
74
        	catch (MalformedURLException murle)
80
    	  catch (MalformedURLException murle)
75
        	{
81
    	  {
76
        		wsdlURL = wsdlFile.toString();
82
    		wsdlURL = wsdlFile.toString();
77
        	}
83
    	  }
84
    	  if (object instanceof IFile)
85
    		wsdlURL = getConvertedURIFromIFile((IFile)object,wsdlURL);
78
        }
86
        }
79
        else if (Platform.getAdapterManager().hasAdapter(object, WSDLURLStringWrapper.class.getName())) {
87
        else if (Platform.getAdapterManager().hasAdapter(object, WSDLURLStringWrapper.class.getName())) {
80
        	Object adaptedObject = Platform.getAdapterManager().loadAdapter(object, WSDLURLStringWrapper.class.getName());
88
        	Object adaptedObject = Platform.getAdapterManager().loadAdapter(object, WSDLURLStringWrapper.class.getName());
Lines 85-96 Link Here
85
        {
93
        {
86
        	ServiceImpl serviceImpl = (ServiceImpl)object;          
94
        	ServiceImpl serviceImpl = (ServiceImpl)object;          
87
        	Definition definition = serviceImpl.getEnclosingDefinition();        
95
        	Definition definition = serviceImpl.getEnclosingDefinition();        
88
        	wsdlURL = definition.getLocation();
96
        	wsdlURL = getConvertedURIFromURI(definition.getLocation());
89
        } else if (object instanceof WSDLResourceImpl)
97
        } else if (object instanceof WSDLResourceImpl)
90
        {
98
        {
91
        	WSDLResourceImpl WSDLRImpl = (WSDLResourceImpl)object;
99
        	WSDLResourceImpl WSDLRImpl = (WSDLResourceImpl)object;
92
        	Definition definition = WSDLRImpl.getDefinition();
100
        	Definition definition = WSDLRImpl.getDefinition();
93
        	wsdlURL = definition.getLocation();
101
        	wsdlURL = getConvertedURIFromURI(definition.getLocation());
94
        } else if (object instanceof String) {
102
        } else if (object instanceof String) {
95
        	wsdlURL = (String) object;
103
        	wsdlURL = (String) object;
96
        } else {
104
        } else {
Lines 100-107 Link Here
100
        	// If not found, wsdlURL would still be null.
108
        	// If not found, wsdlURL would still be null.
101
        	wsdlURL = AdapterUtils.getAdaptedWSDL(object);
109
        	wsdlURL = AdapterUtils.getAdaptedWSDL(object);
102
        }
110
        }
103
        
111
       if (wsdlURL != null)
104
       addLaunchOptions(launchOptions, wsdlURL, stateLocation, defaultFavoritesLocation);        
112
         addLaunchOptions(launchOptions, wsdlURL, stateLocation, defaultFavoritesLocation);        
105
      }
113
      }
106
    }
114
    }
107
    command.setLaunchOptions((LaunchOption[])launchOptions.toArray(new LaunchOption[0]));
115
    command.setLaunchOptions((LaunchOption[])launchOptions.toArray(new LaunchOption[0]));
Lines 148-151 Link Here
148
		  this.selection = null;
156
		  this.selection = null;
149
  }
157
  }
150
  
158
  
159
  private String getConvertedURIFromIFile(IFile file,String defaultURI)
160
  {
161
	String convertedLocation = null;
162
	boolean allowBaseConversionOnFailure = true;
163
	if (file != null && file.exists())
164
	{	
165
	  IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
166
	  if (converter != null)
167
	  {
168
		convertedLocation = converter.convert(file);
169
		allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure();
170
	  }
171
	}
172
	if (convertedLocation == null && allowBaseConversionOnFailure)
173
	  return defaultURI;
174
	return convertedLocation;
175
  }  
176
  
177
  private String getConvertedURIFromURI(String originalURI)
178
  {
179
	IFile file = null;
180
    if (originalURI != null)
181
	{
182
	  String platformResource = "platform:/resource";
183
	  if (originalURI.startsWith(platformResource))
184
	    file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(originalURI.substring(platformResource.length())));
185
	  else if (originalURI.startsWith("file:"))
186
	  {
187
		String filePath = convertToRelative(originalURI);
188
		file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filePath));
189
	  }
190
	}
191
    return getConvertedURIFromIFile(file,originalURI);
192
  }
193
  
194
  public static String convertToRelative(String uri)
195
  {
196
  	//remove file:
197
	String file = "file:/";
198
	String fileL = "file:";
199
  	String root = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
200
    root = file + root;
201
  	String rootL = fileL + root;
202
    if(uri.startsWith(root) || uri.startsWith(rootL)){
203
      return uri.substring(root.length());  	
204
    }
205
    return uri;
206
  }  
207
  
151
}
208
}
(-)src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java (-22 / +59 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2006 IBM Corporation and others.
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 11-16 Link Here
11
 * -------- -------- -----------------------------------------------------------
11
 * -------- -------- -----------------------------------------------------------
12
 * 20060222   125574 zina@ca.ibm.com - Zina Mostafia
12
 * 20060222   125574 zina@ca.ibm.com - Zina Mostafia
13
 * 20060222   225574 gilberta@ca.ibm.com - Gilbert Andrews
13
 * 20060222   225574 gilberta@ca.ibm.com - Gilbert Andrews
14
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
14
 *******************************************************************************/
15
 *******************************************************************************/
15
/*
16
/*
16
 * Created on May 8, 2004
17
 * Created on May 8, 2004
Lines 21-31 Link Here
21
import java.net.MalformedURLException;
22
import java.net.MalformedURLException;
22
import java.net.URL;
23
import java.net.URL;
23
24
25
import org.eclipse.core.resources.IFile;
24
import org.eclipse.core.resources.IProject;
26
import org.eclipse.core.resources.IProject;
25
import org.eclipse.core.resources.ResourcesPlugin;
27
import org.eclipse.core.resources.ResourcesPlugin;
26
import org.eclipse.core.runtime.IPath;
28
import org.eclipse.core.runtime.IPath;
29
import org.eclipse.core.runtime.Path;
27
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
30
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
28
import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
31
import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
32
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
33
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
29
import org.eclipse.wst.wsdl.Definition;
34
import org.eclipse.wst.wsdl.Definition;
30
import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
35
import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
31
import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
36
import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
Lines 35-48 Link Here
35
 * @author gilberta
40
 * @author gilberta
36
 */
41
 */
37
public class J2EEActionAdapterFactory {
42
public class J2EEActionAdapterFactory {
38
	
43
	 	  
39
 	
44
  private static String getConvertedURIFromIFile(IFile file,String defaultURI)
45
  {
46
	String convertedLocation = null;
47
	boolean allowBaseConversionOnFailure = true;
48
	if (file != null && file.exists())
49
	{	
50
	  IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
51
	  if (converter != null)
52
	  {
53
		convertedLocation = converter.convert(file);
54
		allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure();
55
	  }
56
	}
57
	if (convertedLocation == null && allowBaseConversionOnFailure)
58
	  return defaultURI;
59
	return convertedLocation;
60
  }
61
  
62
  private static String getConvertedURIFromURI(String originalURI)
63
  {
64
	IFile file = null;
65
    if (originalURI != null)
66
	{
67
	  String platformResource = "platform:/resource";
68
	  if (originalURI.startsWith(platformResource))
69
	    file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(originalURI.substring(platformResource.length())));
70
	  else if (originalURI.startsWith("file:"))
71
	  {
72
		String filePath = convertToRelative(originalURI);
73
		file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filePath));
74
	  }
75
	}
76
    return getConvertedURIFromIFile(file,originalURI);
77
  }
78
  
40
  public static String getWSDLURI(ServiceImpl serviceImpl)
79
  public static String getWSDLURI(ServiceImpl serviceImpl)
41
  {
80
  {
42
  	Definition definition = serviceImpl.getEnclosingDefinition();
81
  	Definition definition = serviceImpl.getEnclosingDefinition();
43
  	String location = definition.getLocation();
82
  	String location = definition.getLocation();
44
  	
83
  	return getConvertedURIFromURI(location);
45
  	return location;
46
  }
84
  }
47
   
85
   
48
  //has to be under the webcontent
86
  //has to be under the webcontent
Lines 66-91 Link Here
66
	 {
104
	 {
67
	   moduleRoot = APPCLIENT_MODULE;
105
	   moduleRoot = APPCLIENT_MODULE;
68
	 }
106
	 }
69
	 IPath path = project.getLocation().addTrailingSeparator();
107
70
	 path = path.append(moduleRoot).addTrailingSeparator();
108
	 if (moduleRoot != null)
71
	 path = path.append(serviceImpl.getWsdlFile());
109
	 {
72
	 File file = new File(path.toString());
110
	   IPath path = project.getLocation().addTrailingSeparator();
73
	 try{
111
	   path = path.append(moduleRoot).addTrailingSeparator();
74
	   URL url = file.toURL();
112
	   path = path.append(serviceImpl.getWsdlFile());
75
	   return url.toString();
113
	   File file = new File(path.toString());
76
	 }catch(MalformedURLException e){return null;}
114
	   try {
77
	 
115
	     URL url = file.toURL();
78
  
116
	     return getConvertedURIFromURI(url.toString());
79
	  
117
	   }
80
	
118
	   catch(MalformedURLException e) {		   
119
	   }
120
	 }
121
	 return null;
81
 }
122
 }
82
  
123
  
83
  public static String getWSDLURI(WSDLResourceImpl wsdlRI)
124
  public static String getWSDLURI(WSDLResourceImpl wsdlRI)
84
  {
125
  {
85
  	Definition definition = wsdlRI.getDefinition();
126
  	Definition definition = wsdlRI.getDefinition();
86
  	String location = definition.getLocation();
127
  	String location = definition.getLocation();
87
  	
128
  	return getConvertedURIFromURI(location);
88
  	return location;
89
  }
129
  }
90
  
130
  
91
  public static String getWSILPath(WSDLResourceImpl wsdlRI)
131
  public static String getWSILPath(WSDLResourceImpl wsdlRI)
Lines 116-122 Link Here
116
    }
156
    }
117
    return uri;
157
    return uri;
118
  }
158
  }
119
120
121
122
}
159
}
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %PLUGIN_NAME
3
Bundle-Name: %PLUGIN_NAME
4
Bundle-SymbolicName: org.eclipse.jst.ws
4
Bundle-SymbolicName: org.eclipse.jst.ws
5
Bundle-Version: 1.0.307.qualifier
5
Bundle-Version: 1.0.308.qualifier
6
Bundle-Activator: org.eclipse.jst.ws.internal.plugin.WebServicePlugin
6
Bundle-Activator: org.eclipse.jst.ws.internal.plugin.WebServicePlugin
7
Bundle-Vendor: %PLUGIN_PROVIDER
7
Bundle-Vendor: %PLUGIN_PROVIDER
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
(-)feature.xml (-1 / +1 lines)
Lines 2-8 Link Here
2
<feature
2
<feature
3
      id="org.eclipse.wst.ws_ui.feature"
3
      id="org.eclipse.wst.ws_ui.feature"
4
      label="%featureName"
4
      label="%featureName"
5
      version="3.0.4.qualifier"
5
      version="3.0.5.qualifier"
6
      provider-name="%providerName">
6
      provider-name="%providerName">
7
7
8
   <description>
8
   <description>
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java (-10 / +25 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 IBM Corporation and others.
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 25-30 Link Here
25
 * 20061211   161589 makandre@ca.ibm.com - Andrew Mak, NPE in service generation after opening and cancelling from browse dialog
25
 * 20061211   161589 makandre@ca.ibm.com - Andrew Mak, NPE in service generation after opening and cancelling from browse dialog
26
 * 20070131   168786 makandre@ca.ibm.com - Andrew Mak, wsdl url on web service wizard page 1 is not reflected in browse dialog
26
 * 20070131   168786 makandre@ca.ibm.com - Andrew Mak, wsdl url on web service wizard page 1 is not reflected in browse dialog
27
 * 20070326   171071 makandre@ca.ibm.com - Andrew Mak, Create public utility method for copying WSDL files
27
 * 20070326   171071 makandre@ca.ibm.com - Andrew Mak, Create public utility method for copying WSDL files
28
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
28
 *******************************************************************************/
29
 *******************************************************************************/
29
package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
30
package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
30
31
Lines 74-79 Link Here
74
import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
75
import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
75
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
76
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
76
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
77
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
78
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
77
import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity;
79
import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity;
78
import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser;
80
import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser;
79
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
81
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
Lines 510-524 Link Here
510
  
512
  
511
  private String iFile2URI(IFile file)
513
  private String iFile2URI(IFile file)
512
  {
514
  {
513
  	File f = file.getLocation().toFile();
515
	String uri = null;
514
    try
516
	IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
515
    {
517
	boolean allowBaseConversionOnFailure = true;	
516
      return f.toURL().toString();
518
	if (converter != null)
517
    }
519
	{
518
    catch (MalformedURLException murle)
520
		uri = converter.convert(file);
519
    {
521
		if (uri == null)
520
    }
522
			allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure();
521
    return f.toString();
523
	}
524
	if (uri == null && allowBaseConversionOnFailure)
525
	{
526
  	  File f = file.getLocation().toFile();
527
      try
528
      {
529
        uri = f.toURL().toString();
530
      }
531
      catch (MalformedURLException murle)
532
      {
533
    	uri = f.toString();
534
      }
535
	}
536
    return uri;
522
  }
537
  }
523
538
524
  public void setInitialSelection(IStructuredSelection initialSelection)
539
  public void setInitialSelection(IStructuredSelection initialSelection)
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java (-1 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 IBM Corporation and others.
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-23 Link Here
13
 * 20070327   172339 kathy@ca.ibm.com - Kathy Chan
13
 * 20070327   172339 kathy@ca.ibm.com - Kathy Chan
14
 * 20070713   191357 kathy@ca.ibm.com - Kathy Chan
14
 * 20070713   191357 kathy@ca.ibm.com - Kathy Chan
15
 * 20081208   257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs
15
 * 20081208   257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs
16
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
16
 *******************************************************************************/
17
 *******************************************************************************/
17
package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
18
package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
18
19
19
import java.net.MalformedURLException;
20
import java.net.MalformedURLException;
20
21
22
import org.eclipse.core.resources.IFile;
21
import org.eclipse.core.resources.IProject;
23
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IResource;
24
import org.eclipse.core.resources.IResource;
23
import org.eclipse.core.runtime.IPath;
25
import org.eclipse.core.runtime.IPath;
Lines 33-38 Link Here
33
import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory;
35
import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory;
34
import org.eclipse.jst.ws.internal.common.J2EEUtils;
36
import org.eclipse.jst.ws.internal.common.J2EEUtils;
35
import org.eclipse.wst.command.internal.env.core.data.Transformer;
37
import org.eclipse.wst.command.internal.env.core.data.Transformer;
38
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
39
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
36
import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils;
40
import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils;
37
import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper;
41
import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper;
38
import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
42
import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
Lines 52-57 Link Here
52
      {
56
      {
53
        try
57
        try
54
        {
58
        {
59
          if (sel instanceof IFile)
60
          {
61
        	IFile file = (IFile)sel;
62
        	IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
63
        	if (converter != null)
64
        	{
65
        	  String wsdlUrl = converter.convert(file);
66
        	  if (wsdlUrl != null || !converter.allowBaseConversionOnFailure())
67
        	    return wsdlUrl;
68
        	}
69
          }
55
          return new StructuredSelection(((IResource)sel).getLocation().toFile().toURL().toString());
70
          return new StructuredSelection(((IResource)sel).getLocation().toFile().toURL().toString());
56
        }
71
        }
57
        catch (MalformedURLException murle)
72
        catch (MalformedURLException murle)
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %PLUGIN_NAME
3
Bundle-Name: %PLUGIN_NAME
4
Bundle-SymbolicName: org.eclipse.jst.ws.consumption.ui; singleton:=true
4
Bundle-SymbolicName: org.eclipse.jst.ws.consumption.ui; singleton:=true
5
Bundle-Version: 1.1.4.qualifier
5
Bundle-Version: 1.1.5.qualifier
6
Bundle-Activator: org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin
6
Bundle-Activator: org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin
7
Bundle-Vendor: %PLUGIN_PROVIDER
7
Bundle-Vendor: %PLUGIN_PROVIDER
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java (-3 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 IBM Corporation and others.
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 16-21 Link Here
16
 * 20080220   219537 makandre@ca.ibm.com - Andrew Mak
16
 * 20080220   219537 makandre@ca.ibm.com - Andrew Mak
17
 * 20080501   229728 makandre@ca.ibm.com - Andrew Mak, uppercase .WSDL cannot be found by the Web Service Client wizard
17
 * 20080501   229728 makandre@ca.ibm.com - Andrew Mak, uppercase .WSDL cannot be found by the Web Service Client wizard
18
 * 20081208   257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs
18
 * 20081208   257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs
19
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
19
 *******************************************************************************/
20
 *******************************************************************************/
20
package org.eclipse.jst.ws.internal.consumption.ui.widgets;
21
package org.eclipse.jst.ws.internal.consumption.ui.widgets;
21
22
Lines 36-41 Link Here
36
import org.eclipse.jst.ws.internal.common.ResourceUtils;
37
import org.eclipse.jst.ws.internal.common.ResourceUtils;
37
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
38
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
38
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
39
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
40
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
41
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
39
import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils;
42
import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils;
40
import org.eclipse.wst.ws.internal.util.UniversalPathTransformer;
43
import org.eclipse.wst.ws.internal.util.UniversalPathTransformer;
41
import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper;
44
import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper;
Lines 62-69 Link Here
62
  	    IFile ifile = (IFile)firstSel;
65
  	    IFile ifile = (IFile)firstSel;
63
  	    String ext = ifile.getFileExtension();
66
  	    String ext = ifile.getFileExtension();
64
  	    if (ext != null && (ext.equalsIgnoreCase("wsdl") || ext.equalsIgnoreCase("wsil") || ext.equalsIgnoreCase("html")))
67
  	    if (ext != null && (ext.equalsIgnoreCase("wsdl") || ext.equalsIgnoreCase("wsil") || ext.equalsIgnoreCase("html")))
65
  	    {
68
  	    {  	    
66
  	      uri_ = ifile.getFullPath().toString();
69
  	      IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
70
  	      boolean allowBaseConversionOnFailure = true;
71
  	      if (converter != null)
72
  	      {
73
  	    	  uri_ = converter.convert(ifile);
74
  	    	  if (uri_ == null)
75
  	    		  allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure();
76
  	    		  
77
  	      }
78
  	      if ((uri_ == null || uri_.length() == 0) && allowBaseConversionOnFailure)
79
  	        uri_ = ifile.getFullPath().toString();
67
  	    }
80
  	    }
68
  	  } 
81
  	  } 
69
  	  else if (Platform.getAdapterManager().hasAdapter(firstSel, WSDLURLStringWrapper.class.getName())) {
82
  	  else if (Platform.getAdapterManager().hasAdapter(firstSel, WSDLURLStringWrapper.class.getName())) {
(-)src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java (-4 / +17 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-18 Link Here
13
 * 20070716   191357 kathy@ca.ibm.com - Kathy Chan
13
 * 20070716   191357 kathy@ca.ibm.com - Kathy Chan
14
 * 20080220   219537 makandre@ca.ibm.com - Andrew Mak
14
 * 20080220   219537 makandre@ca.ibm.com - Andrew Mak
15
 * 20080421   227824 makandre@ca.ibm.com - Andrew Mak, AdapterUtils adapt to IFile before String
15
 * 20080421   227824 makandre@ca.ibm.com - Andrew Mak, AdapterUtils adapt to IFile before String
16
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu
16
 *******************************************************************************/
17
 *******************************************************************************/
17
package org.eclipse.wst.ws.internal.ui.utils;
18
package org.eclipse.wst.ws.internal.ui.utils;
18
19
Lines 20-25 Link Here
20
21
21
import org.eclipse.core.resources.IFile;
22
import org.eclipse.core.resources.IFile;
22
import org.eclipse.core.runtime.Platform;
23
import org.eclipse.core.runtime.Platform;
24
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
25
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
23
26
24
/**
27
/**
25
 * The AdapterUtils class provides utility methods to get objects from the Platform's adapter extension.
28
 * The AdapterUtils class provides utility methods to get objects from the Platform's adapter extension.
Lines 67-77 Link Here
67
		  if ( adaptedObject != null) {
70
		  if ( adaptedObject != null) {
68
			  if (adaptedObject instanceof IFile)
71
			  if (adaptedObject instanceof IFile)
69
			  {
72
			  {
70
				  URI uri = ((IFile)adaptedObject).getLocationURI();
73
				  IFile file = (IFile)adaptedObject;
71
				  if (uri != null) {
74
				  boolean allowBaseConversionOnFailure = true;
75
				  IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
76
				  if (converter != null)
77
				  {
78
					  wsdlURI = converter.convert(file);
79
					  allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure();
80
				  }
81
				  if (wsdlURI == null && allowBaseConversionOnFailure)
82
				  {
83
				    URI uri = file.getLocationURI();
84
				    if (uri != null) {
72
					  wsdlURI = uri.toString();
85
					  wsdlURI = uri.toString();
86
				    }
73
				  }
87
				  }
74
				  
75
			  } else if (adaptedObject instanceof String) {
88
			  } else if (adaptedObject instanceof String) {
76
				  wsdlURI = (String) adaptedObject;
89
				  wsdlURI = (String) adaptedObject;
77
			  }
90
			  }
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %PLUGIN_NAME
3
Bundle-Name: %PLUGIN_NAME
4
Bundle-SymbolicName: org.eclipse.wst.ws.ui; singleton:=true
4
Bundle-SymbolicName: org.eclipse.wst.ws.ui; singleton:=true
5
Bundle-Version: 1.1.0.qualifier
5
Bundle-Version: 1.1.1.qualifier
6
Bundle-Activator: org.eclipse.wst.ws.internal.ui.plugin.WSUIPlugin
6
Bundle-Activator: org.eclipse.wst.ws.internal.ui.plugin.WSUIPlugin
7
Bundle-Vendor: %PLUGIN_PROVIDER
7
Bundle-Vendor: %PLUGIN_PROVIDER
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
(-)feature.xml (-1 / +1 lines)
Lines 2-8 Link Here
2
<feature
2
<feature
3
      id="org.eclipse.wst.ws_sdk.feature"
3
      id="org.eclipse.wst.ws_sdk.feature"
4
      label="%featureName"
4
      label="%featureName"
5
      version="3.0.4.qualifier"
5
      version="3.0.5.qualifier"
6
      provider-name="%providerName">
6
      provider-name="%providerName">
7
7
8
   <description>
8
   <description>
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %PLUGIN_NAME
3
Bundle-Name: %PLUGIN_NAME
4
Bundle-SymbolicName: org.eclipse.jst.ws.ui; singleton:=true
4
Bundle-SymbolicName: org.eclipse.jst.ws.ui; singleton:=true
5
Bundle-Version: 1.0.304.qualifier
5
Bundle-Version: 1.0.305.qualifier
6
Bundle-Activator: org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin
6
Bundle-Activator: org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin
7
Bundle-Vendor: %PLUGIN_PROVIDER
7
Bundle-Vendor: %PLUGIN_PROVIDER
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
(-)src/org/eclipse/jst/ws/internal/ui/popup/PopupTestService.java (-3 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2002, 2008 IBM Corporation and others.
2
 * Copyright (c) 2002, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-18 Link Here
13
 * 20070327   172339 kathy@ca.ibm.com - Kathy Chan
13
 * 20070327   172339 kathy@ca.ibm.com - Kathy Chan
14
 * 20080123   216372 kathy@ca.ibm.com - Kathy Chan
14
 * 20080123   216372 kathy@ca.ibm.com - Kathy Chan
15
 * 20090127	  257618 mahutch@ca.ibm.com - Mark Hutchinson
15
 * 20090127	  257618 mahutch@ca.ibm.com - Mark Hutchinson
16
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
16
 *******************************************************************************/
17
 *******************************************************************************/
17
package org.eclipse.jst.ws.internal.ui.popup;
18
package org.eclipse.jst.ws.internal.ui.popup;
18
19
Lines 58-65 Link Here
58
        }
59
        }
59
        else if (object instanceof ServiceRef)
60
        else if (object instanceof ServiceRef)
60
        {
61
        {
61
          ServiceRef serviceImpl = (ServiceRef)object;
62
          ServiceRef serviceRef = (ServiceRef)object;
62
          wsdlURL = J2EEActionAdapterFactory.getWSDLURI(serviceImpl);
63
          wsdlURL = J2EEActionAdapterFactory.getWSDLURI(serviceRef);
63
        } else if (object instanceof String) {
64
        } else if (object instanceof String) {
64
        	wsdlURL = (String) object;
65
        	wsdlURL = (String) object;
65
        } else {
66
        } else {
(-)plugin.properties (-1 / +3 lines)
Lines 1-5 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2000, 2008 IBM Corporation and others.
2
# Copyright (c) 2000, 2009 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
5
# which accompanies this distribution, and is available at
Lines 13-18 Link Here
13
# 20080324   220739 makandre@ca.ibm.com - Andrew Mak, Text Description missing for Profile Complaince nodes
13
# 20080324   220739 makandre@ca.ibm.com - Andrew Mak, Text Description missing for Profile Complaince nodes
14
# 20080403   225480 kathy@ca.ibm.com - Kathy Chan
14
# 20080403   225480 kathy@ca.ibm.com - Kathy Chan
15
# 20080715   240722 makandre@ca.ibm.com - Andrew Mak, Cannot setup TCP/IP Monitor for soap12 endpoints
15
# 20080715   240722 makandre@ca.ibm.com - Andrew Mak, Cannot setup TCP/IP Monitor for soap12 endpoints
16
# 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
16
###############################################################################
17
###############################################################################
17
18
18
#
19
#
Lines 27-32 Link Here
27
X_WEB_SERVICE_LOCATOR_CATEGORY_WORKSPACE=Workspace WSDL documents
28
X_WEB_SERVICE_LOCATOR_CATEGORY_WORKSPACE=Workspace WSDL documents
28
X_WSIL_CONTENT_TYPE=Web Services Inspection Language Document
29
X_WSIL_CONTENT_TYPE=Web Services Inspection Language Document
29
XP_EXTENSIBILITY_ELEMENT_TRANSFORMER=Extensibility Element Transformer
30
XP_EXTENSIBILITY_ELEMENT_TRANSFORMER=Extensibility Element Transformer
31
XP_IFILE_2_URI_CONVERTER=IFile to URI Converter
30
32
31
MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}.
33
MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}.
32
34
(-)plugin.xml (+1 lines)
Lines 7-12 Link Here
7
   <extension-point id="locator" name="%XP_WEB_SERVICE_LOCATOR" schema="schema/webServiceLocator.exsd"/>
7
   <extension-point id="locator" name="%XP_WEB_SERVICE_LOCATOR" schema="schema/webServiceLocator.exsd"/>
8
   
8
   
9
   <extension-point id="ExtensibilityElementTransformer" name="%XP_EXTENSIBILITY_ELEMENT_TRANSFORMER" schema="schema/ExtensibilityElementTransformer.exsd"/>
9
   <extension-point id="ExtensibilityElementTransformer" name="%XP_EXTENSIBILITY_ELEMENT_TRANSFORMER" schema="schema/ExtensibilityElementTransformer.exsd"/>
10
   <extension-point id="ifile2uriconverter" name="%XP_IFILE_2_URI_CONVERTER" schema="schema/ifile2uriconverter.exsd"/>
10
11
11
   <!-- Extension providing workspace WSDL discovery -->   
12
   <!-- Extension providing workspace WSDL discovery -->   
12
   <extension
13
   <extension
(-)src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java (-1 / +43 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 11-21 Link Here
11
 * -------- -------- -----------------------------------------------------------
11
 * -------- -------- -----------------------------------------------------------
12
 * 20060403 128827   kathy@ca.ibm.com - Kathy Chan
12
 * 20060403 128827   kathy@ca.ibm.com - Kathy Chan
13
 * 20060424   115690 sengpl@ca.ibm.com - Seng Phung-Lu
13
 * 20060424   115690 sengpl@ca.ibm.com - Seng Phung-Lu
14
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
14
 *******************************************************************************/
15
 *******************************************************************************/
15
16
16
package org.eclipse.wst.ws.internal.plugin;
17
package org.eclipse.wst.ws.internal.plugin;
17
18
19
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.core.runtime.IExtension;
22
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.core.runtime.Plugin;
23
import org.eclipse.core.runtime.Plugin;
24
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
19
import org.eclipse.wst.ws.internal.preferences.PersistentMergeContext;
25
import org.eclipse.wst.ws.internal.preferences.PersistentMergeContext;
20
import org.eclipse.wst.ws.internal.preferences.PersistentWSDLValidationContext;
26
import org.eclipse.wst.ws.internal.preferences.PersistentWSDLValidationContext;
21
import org.eclipse.wst.ws.internal.preferences.PersistentWSIAPContext;
27
import org.eclipse.wst.ws.internal.preferences.PersistentWSIAPContext;
Lines 37-42 Link Here
37
	private PersistentWSDLValidationContext wsdlValidationContext_;
43
	private PersistentWSDLValidationContext wsdlValidationContext_;
38
	private PersistentWaitForWSDLValidationContext waitForWsdlValidationContext_;
44
	private PersistentWaitForWSDLValidationContext waitForWsdlValidationContext_;
39
	private PersistentMergeContext mergeContext_;
45
	private PersistentMergeContext mergeContext_;
46
	private IIFile2UriConverter iFile2UriConverter_;
47
	private boolean isIFile2UriConverterInitialized_ = false;
40
48
41
	public static final String ID = "org.eclipse.wst.ws";
49
	public static final String ID = "org.eclipse.wst.ws";
42
	
50
	
Lines 157-160 Link Here
157
	  	}
165
	  	}
158
	  return mergeContext_;
166
	  return mergeContext_;
159
	}
167
	}
168
 
169
 /**
170
  * <p>
171
  * Get the product's registered IFile to URI converter. If there is no converter registered then this method will return null.
172
  * @return The IFile to URI converter registered with the <code>org.eclipse.wst.ws/IFile2UriConverterId</code> preference in plugin_customization.ini
173
  */
174
 public IIFile2UriConverter getIFile2UriConverter()
175
 {
176
	 if (!isIFile2UriConverterInitialized_)
177
	 {
178
		 String productConverterId = getPluginPreferences().getDefaultString("IFile2UriConverterId");
179
		 if (productConverterId.length() > 0)
180
		 {
181
			 IExtension extension = Platform.getExtensionRegistry().getExtension(productConverterId);
182
			 if (extension != null)
183
			 {
184
			   IConfigurationElement[] configElements = extension.getConfigurationElements();
185
			   if (configElements.length > 0)
186
			   {
187
				 try
188
				 {
189
				   iFile2UriConverter_ = (IIFile2UriConverter)configElements[0].createExecutableExtension("class");
190
				 }
191
				 catch (CoreException e)
192
				 {
193
					 getLog().log(e.getStatus());
194
				 }
195
			   }
196
			 }
197
		 }
198
		 isIFile2UriConverterInitialized_ = true;
199
	 }
200
	 return iFile2UriConverter_;
201
 }
160
}
202
}
(-)src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java (-9 / +26 lines)
Lines 1-16 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 *
8
 * Contributors:
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
9
 * IBM Corporation - initial API and implementation
10
 * yyyymmdd bug      Email and other contact information
10
 * yyyymmdd bug      Email and other contact information
11
 * -------- -------- -----------------------------------------------------------
11
 * -------- -------- -----------------------------------------------------------
12
 * 20060317   127456 cbrealey@ca.ibm.com - Chris Brealey
12
 * 20060317   127456 cbrealey@ca.ibm.com - Chris Brealey
13
 * 20060620   147862 cbrealey@ca.ibm.com - Chris Brealey
13
 * 20060620   147862 cbrealey@ca.ibm.com - Chris Brealey
14
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
14
 *******************************************************************************/
15
 *******************************************************************************/
15
16
16
package org.eclipse.wst.ws.internal.wsfinder;
17
package org.eclipse.wst.ws.internal.wsfinder;
Lines 18-23 Link Here
18
import java.util.List;
19
import java.util.List;
19
import java.util.Vector;
20
import java.util.Vector;
20
21
22
import org.eclipse.core.resources.IFile;
21
import org.eclipse.core.resources.IProject;
23
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IResource;
24
import org.eclipse.core.resources.IResource;
23
import org.eclipse.core.resources.IResourceVisitor;
25
import org.eclipse.core.resources.IResourceVisitor;
Lines 25-30 Link Here
25
import org.eclipse.core.resources.ResourcesPlugin;
27
import org.eclipse.core.resources.ResourcesPlugin;
26
import org.eclipse.core.runtime.CoreException;
28
import org.eclipse.core.runtime.CoreException;
27
import org.eclipse.core.runtime.IProgressMonitor;
29
import org.eclipse.core.runtime.IProgressMonitor;
30
import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter;
31
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
28
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
32
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
29
33
30
/**
34
/**
Lines 124-137 Link Here
124
		public boolean visit(IResource resource)
128
		public boolean visit(IResource resource)
125
		{
129
		{
126
			if (resource.getType() == IResource.FILE)
130
			if (resource.getType() == IResource.FILE)
127
			{        
131
			{
128
				String ext = resource.getFileExtension();
132
				String wsdlURL = null;
129
				if (ext != null && ext.equalsIgnoreCase(WSDL_EXT))
133
				IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter();
134
				boolean allowBaseConversionOnFailure = true;
135
				if (converter != null)
136
				{
137
				  wsdlURL = converter.convert((IFile)resource);
138
				  if (wsdlURL == null)
139
					allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure();
140
				}
141
				if (wsdlURL == null && allowBaseConversionOnFailure)
142
				{
143
				  String ext = resource.getFileExtension();
144
				  if (ext != null && ext.equalsIgnoreCase(WSDL_EXT))
145
					wsdlURL = PLATFORM_RES + resource.getFullPath().toString();
146
				}
147
				if (wsdlURL != null)
130
				{
148
				{
131
					String urlString = PLATFORM_RES + resource.getFullPath().toString();
149
				  WebServiceInfo wsInfo = new WebServiceInfo();
132
					WebServiceInfo wsInfo = new WebServiceInfo();
150
				  wsInfo.setWsdlURL(wsdlURL);           
133
					wsInfo.setWsdlURL(urlString);           
151
				  wsdl.add(wsInfo);
134
					wsdl.add(wsInfo);
135
				}
152
				}
136
			}
153
			}
137
			return true;
154
			return true;
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 2-13 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %PLUGIN_NAME
3
Bundle-Name: %PLUGIN_NAME
4
Bundle-SymbolicName: org.eclipse.wst.ws; singleton:=true
4
Bundle-SymbolicName: org.eclipse.wst.ws; singleton:=true
5
Bundle-Version: 1.1.3.qualifier
5
Bundle-Version: 1.1.4.qualifier
6
Bundle-Activator: org.eclipse.wst.ws.internal.plugin.WSPlugin
6
Bundle-Activator: org.eclipse.wst.ws.internal.plugin.WSPlugin
7
Bundle-Vendor: %PLUGIN_PROVIDER
7
Bundle-Vendor: %PLUGIN_PROVIDER
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
9
Export-Package: org.eclipse.wst.ws.internal;x-internal:=true,
9
Export-Package: org.eclipse.wst.ws.internal;x-internal:=true,
10
 org.eclipse.wst.ws.internal.common;x-internal:=true,
10
 org.eclipse.wst.ws.internal.common;x-internal:=true,
11
 org.eclipse.wst.ws.internal.converter,
11
 org.eclipse.wst.ws.internal.data;x-internal:=true,
12
 org.eclipse.wst.ws.internal.data;x-internal:=true,
12
 org.eclipse.wst.ws.internal.datamodel;x-internal:=true,
13
 org.eclipse.wst.ws.internal.datamodel;x-internal:=true,
13
 org.eclipse.wst.ws.internal.ext;x-internal:=true,
14
 org.eclipse.wst.ws.internal.ext;x-internal:=true,
(-)schema/ifile2uriconverter.exsd (+106 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.wst.ws" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.wst.ws" id="ifile2uriconverter" name="IFile to URI Converter"/>
7
      </appinfo>
8
      <documentation>
9
         This extension point is provided to register IFile to URI converters which can override the default implementation of either file: or platform: URIs provided by the Web Services tools.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
19
      <complexType>
20
         <sequence>
21
            <element ref="converter"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string" use="required">
31
            <annotation>
32
               <documentation>
33
                  This is the ID of the IFile to URI Converter extension. If the extension will serve the product then this is the ID that must be added to the product&apos;s plugin_customization.ini via the setting:
34
35
&lt;code&gt;org.eclipse.wst.ws/IFile2UriConverter = [value of id]&lt;/code&gt;
36
               </documentation>
37
            </annotation>
38
         </attribute>
39
         <attribute name="name" type="string">
40
            <annotation>
41
               <documentation>
42
                  
43
               </documentation>
44
               <appinfo>
45
                  <meta.attribute translatable="true"/>
46
               </appinfo>
47
            </annotation>
48
         </attribute>
49
      </complexType>
50
   </element>
51
52
   <element name="converter">
53
      <complexType>
54
         <attribute name="class" type="string" use="required">
55
            <annotation>
56
               <documentation>
57
                  The fully qualified class name of the IFile to URI converter provided for this product.
58
               </documentation>
59
               <appinfo>
60
                  <meta.attribute kind="java" basedOn="org.eclipse.wst.internal.converter.AbstractIFile2UriConverter:"/>
61
               </appinfo>
62
            </annotation>
63
         </attribute>
64
      </complexType>
65
   </element>
66
67
   <annotation>
68
      <appinfo>
69
         <meta.section type="since"/>
70
      </appinfo>
71
      <documentation>
72
         [Enter the first release in which this extension point appears.]
73
      </documentation>
74
   </annotation>
75
76
   <annotation>
77
      <appinfo>
78
         <meta.section type="examples"/>
79
      </appinfo>
80
      <documentation>
81
         &lt;extension point=&quot;org.eclipse.wst.ws.ifile2uriconverter&quot; id=&quot;com.example.converterplugin.converterextension&quot;&gt;
82
  &lt;converter class=&quot;com.example.converterplugin.impl.MyIFile2UriConverter&quot;/&gt;
83
&lt;/extension&gt;
84
      </documentation>
85
   </annotation>
86
87
   <annotation>
88
      <appinfo>
89
         <meta.section type="apiinfo"/>
90
      </appinfo>
91
      <documentation>
92
         Extenders should subclass &lt;code&gt;org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter&lt;/code&gt;
93
      </documentation>
94
   </annotation>
95
96
   <annotation>
97
      <appinfo>
98
         <meta.section type="implementation"/>
99
      </appinfo>
100
      <documentation>
101
         [Enter information about supplied implementation of this extension point.]
102
      </documentation>
103
   </annotation>
104
105
106
</schema>
(-)src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java (+48 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
10
 * yyyymmdd bug      Email and other contact information
11
 * -------- -------- -----------------------------------------------------------
12
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
13
 *******************************************************************************/
14
package org.eclipse.wst.ws.internal.converter;
15
16
import org.eclipse.core.resources.IFile;
17
18
/**
19
 * <p>
20
 * The interface for an Eclipse IFile to URI converter. Adopters should
21
 * subclass AbstractIFile2UriConverter instead.
22
 * 
23
 * @see AbstractIFile2UriConverter
24
 */
25
public interface IIFile2UriConverter {
26
	/**
27
	 * <p>
28
	 * Produce a String URI from a given IFile. The IFile is from the workbench. If this method returns null,
29
	 * the result is considered a failure and the
30
	 * {@link #allowBaseConversionOnFailure allowBaseConversionOnFailure} method will be consulted to determine
31
	 * whether or not base conversion should be used as a backup.
32
	 * @param file An IFile reference.
33
	 * @return The String URI corresponding to the IFile reference.
34
	 * <p>
35
	 * @since 3.1
36
	 */
37
	public String convert(IFile file);
38
	
39
	/**
40
	 * <p>
41
	 * Determines whether or not a converter will allow base conversion routines to be performed
42
	 * when a failure occurs.
43
	 * @return <code>true</code> if base conversion should be performed when a failure occurs.
44
	 * <p>
45
	 * @since 3.1
46
	 */
47
	public boolean allowBaseConversionOnFailure();	
48
}
(-)src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java (+36 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
10
 * yyyymmdd bug      Email and other contact information
11
 * -------- -------- -----------------------------------------------------------
12
 * 20090310   242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter
13
 *******************************************************************************/
14
package org.eclipse.wst.ws.internal.converter;
15
16
import org.eclipse.core.resources.IFile;
17
18
/**
19
 * <p>
20
 * The abstract implementation of an IFile to URI converter. Adopters who wish to
21
 * provide their own converter should subclass this abstract class rather than implementing IIFile2UriConverter. 
22
 *
23
 * @see IIFile2UriConverter
24
 */
25
public abstract class AbstractIFile2UriConverter implements IIFile2UriConverter {
26
27
	public String convert(IFile file) {
28
		return null;
29
	}
30
	
31
	public boolean allowBaseConversionOnFailure()
32
	{
33
		return true;
34
	}
35
36
}

Return to bug 270514