Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 131319 Details for
Bug 270514
[hotbug] Add service definition extension point to locate workspace artifacts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Modified patch
bug270514-patch.txt (text/plain), 48.19 KB, created by
Keith Chong
on 2009-04-08 14:31:19 EDT
(
hide
)
Description:
Modified patch
Filename:
MIME Type:
Creator:
Keith Chong
Created:
2009-04-08 14:31:19 EDT
Size:
48.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.ws_core.feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/webtools/webservices/features/org.eclipse.wst.ws_core.feature/feature.xml,v >retrieving revision 1.56.2.4 >diff -u -r1.56.2.4 feature.xml >--- feature.xml 26 Nov 2008 18:08:28 -0000 1.56.2.4 >+++ feature.xml 8 Apr 2009 18:25:46 -0000 >@@ -2,7 +2,7 @@ > <feature > id="org.eclipse.wst.ws_core.feature" > label="%featureName" >- version="3.0.4.qualifier" >+ version="3.0.5.qualifier" > provider-name="%providerName"> > > <description> >#P org.eclipse.wst.ws.explorer >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws.explorer/META-INF/MANIFEST.MF,v >retrieving revision 1.50.2.5 >diff -u -r1.50.2.5 MANIFEST.MF >--- META-INF/MANIFEST.MF 19 Nov 2008 20:25:21 -0000 1.50.2.5 >+++ META-INF/MANIFEST.MF 8 Apr 2009 18:25:46 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.wst.ws.explorer; singleton:=true >-Bundle-Version: 1.0.309.qualifier >+Bundle-Version: 1.0.310.qualifier > Bundle-Activator: org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin > Bundle-Vendor: %PLUGIN_PROVIDER > Bundle-Localization: plugin >Index: src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws.explorer/src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java,v >retrieving revision 1.9.2.1 >diff -u -r1.9.2.1 PopupTestWSDL.java >--- src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java 27 Jan 2009 18:27:32 -0000 1.9.2.1 >+++ src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java 8 Apr 2009 18:25:46 -0000 >@@ -14,6 +14,7 @@ > * 20070327 172339 kathy@ca.ibm.com - Kathy Chan > * 20080123 216372 kathy@ca.ibm.com - Kathy Chan > * 20090122 257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > package org.eclipse.wst.ws.internal.explorer.popup; > >@@ -23,19 +24,24 @@ > import java.util.List; > import java.util.Vector; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.ui.IActionDelegate; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; > import org.eclipse.wst.ws.internal.explorer.LaunchOption; > import org.eclipse.wst.ws.internal.explorer.LaunchOptions; > import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand; > import org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin; > import org.eclipse.wst.ws.internal.monitor.GetMonitorCommand; > import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils; > import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper; > import org.eclipse.wst.wsdl.Definition; >@@ -66,15 +72,17 @@ > Object object = it.next(); > if (object instanceof IResource) > { >- File wsdlFile = ((IResource)object).getLocation().toFile(); >- try >- { >- wsdlURL = wsdlFile.toURL().toString(); >- } >- catch (MalformedURLException murle) >- { >- wsdlURL = wsdlFile.toString(); >- } >+ File wsdlFile = ((IResource)object).getLocation().toFile(); >+ try >+ { >+ wsdlURL = wsdlFile.toURL().toString(); >+ } >+ catch (MalformedURLException murle) >+ { >+ wsdlURL = wsdlFile.toString(); >+ } >+ if (object instanceof IFile) >+ wsdlURL = getConvertedURIFromIFile((IFile)object,wsdlURL); > } > else if (Platform.getAdapterManager().hasAdapter(object, WSDLURLStringWrapper.class.getName())) { > Object adaptedObject = Platform.getAdapterManager().loadAdapter(object, WSDLURLStringWrapper.class.getName()); >@@ -85,12 +93,12 @@ > { > ServiceImpl serviceImpl = (ServiceImpl)object; > Definition definition = serviceImpl.getEnclosingDefinition(); >- wsdlURL = definition.getLocation(); >+ wsdlURL = getConvertedURIFromURI(definition.getLocation()); > } else if (object instanceof WSDLResourceImpl) > { > WSDLResourceImpl WSDLRImpl = (WSDLResourceImpl)object; > Definition definition = WSDLRImpl.getDefinition(); >- wsdlURL = definition.getLocation(); >+ wsdlURL = getConvertedURIFromURI(definition.getLocation()); > } else if (object instanceof String) { > wsdlURL = (String) object; > } else { >@@ -100,8 +108,8 @@ > // If not found, wsdlURL would still be null. > wsdlURL = AdapterUtils.getAdaptedWSDL(object); > } >- >- addLaunchOptions(launchOptions, wsdlURL, stateLocation, defaultFavoritesLocation); >+ if (wsdlURL != null) >+ addLaunchOptions(launchOptions, wsdlURL, stateLocation, defaultFavoritesLocation); > } > } > command.setLaunchOptions((LaunchOption[])launchOptions.toArray(new LaunchOption[0])); >@@ -148,4 +156,53 @@ > this.selection = null; > } > >+ private String getConvertedURIFromIFile(IFile file,String defaultURI) >+ { >+ String convertedLocation = null; >+ boolean allowBaseConversionOnFailure = true; >+ if (file != null && file.exists()) >+ { >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ if (converter != null) >+ { >+ convertedLocation = converter.convert(file); >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ } >+ if (convertedLocation == null && allowBaseConversionOnFailure) >+ return defaultURI; >+ return convertedLocation; >+ } >+ >+ private String getConvertedURIFromURI(String originalURI) >+ { >+ IFile file = null; >+ if (originalURI != null) >+ { >+ String platformResource = "platform:/resource"; >+ if (originalURI.startsWith(platformResource)) >+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(originalURI.substring(platformResource.length()))); >+ else if (originalURI.startsWith("file:")) >+ { >+ String filePath = convertToRelative(originalURI); >+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filePath)); >+ } >+ } >+ return getConvertedURIFromIFile(file,originalURI); >+ } >+ >+ public static String convertToRelative(String uri) >+ { >+ //remove file: >+ String file = "file:/"; >+ String fileL = "file:"; >+ String root = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString(); >+ root = file + root; >+ String rootL = fileL + root; >+ if(uri.startsWith(root) || uri.startsWith(rootL)){ >+ return uri.substring(root.length()); >+ } >+ return uri; >+ } >+ > } >#P org.eclipse.jst.ws >Index: src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java,v >retrieving revision 1.6 >diff -u -r1.6 J2EEActionAdapterFactory.java >--- src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java 23 Apr 2007 18:03:36 -0000 1.6 >+++ src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java 8 Apr 2009 18:25:47 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,6 +11,7 @@ > * -------- -------- ----------------------------------------------------------- > * 20060222 125574 zina@ca.ibm.com - Zina Mostafia > * 20060222 225574 gilberta@ca.ibm.com - Gilbert Andrews >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > /* > * Created on May 8, 2004 >@@ -21,11 +22,15 @@ > import java.net.MalformedURLException; > import java.net.URL; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.Path; > import org.eclipse.jem.util.emf.workbench.ProjectUtilities; > import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.wsdl.Definition; > import org.eclipse.wst.wsdl.internal.impl.ServiceImpl; > import org.eclipse.wst.wsdl.util.WSDLResourceImpl; >@@ -35,14 +40,47 @@ > * @author gilberta > */ > public class J2EEActionAdapterFactory { >- >- >+ >+ private static String getConvertedURIFromIFile(IFile file,String defaultURI) >+ { >+ String convertedLocation = null; >+ boolean allowBaseConversionOnFailure = true; >+ if (file != null && file.exists()) >+ { >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ if (converter != null) >+ { >+ convertedLocation = converter.convert(file); >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ } >+ if (convertedLocation == null && allowBaseConversionOnFailure) >+ return defaultURI; >+ return convertedLocation; >+ } >+ >+ private static String getConvertedURIFromURI(String originalURI) >+ { >+ IFile file = null; >+ if (originalURI != null) >+ { >+ String platformResource = "platform:/resource"; >+ if (originalURI.startsWith(platformResource)) >+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(originalURI.substring(platformResource.length()))); >+ else if (originalURI.startsWith("file:")) >+ { >+ String filePath = convertToRelative(originalURI); >+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filePath)); >+ } >+ } >+ return getConvertedURIFromIFile(file,originalURI); >+ } >+ > public static String getWSDLURI(ServiceImpl serviceImpl) > { > Definition definition = serviceImpl.getEnclosingDefinition(); > String location = definition.getLocation(); >- >- return location; >+ return getConvertedURIFromURI(location); > } > > //has to be under the webcontent >@@ -66,26 +104,28 @@ > { > moduleRoot = APPCLIENT_MODULE; > } >- IPath path = project.getLocation().addTrailingSeparator(); >- path = path.append(moduleRoot).addTrailingSeparator(); >- path = path.append(serviceImpl.getWsdlFile()); >- File file = new File(path.toString()); >- try{ >- URL url = file.toURL(); >- return url.toString(); >- }catch(MalformedURLException e){return null;} >- >- >- >- >+ >+ if (moduleRoot != null) >+ { >+ IPath path = project.getLocation().addTrailingSeparator(); >+ path = path.append(moduleRoot).addTrailingSeparator(); >+ path = path.append(serviceImpl.getWsdlFile()); >+ File file = new File(path.toString()); >+ try { >+ URL url = file.toURL(); >+ return getConvertedURIFromURI(url.toString()); >+ } >+ catch(MalformedURLException e) { >+ } >+ } >+ return null; > } > > public static String getWSDLURI(WSDLResourceImpl wsdlRI) > { > Definition definition = wsdlRI.getDefinition(); > String location = definition.getLocation(); >- >- return location; >+ return getConvertedURIFromURI(location); > } > > public static String getWSILPath(WSDLResourceImpl wsdlRI) >@@ -116,7 +156,4 @@ > } > return uri; > } >- >- >- > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws/META-INF/MANIFEST.MF,v >retrieving revision 1.36.2.6 >diff -u -r1.36.2.6 MANIFEST.MF >--- META-INF/MANIFEST.MF 14 Jan 2009 20:56:19 -0000 1.36.2.6 >+++ META-INF/MANIFEST.MF 8 Apr 2009 18:25:47 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.jst.ws >-Bundle-Version: 1.0.307.qualifier >+Bundle-Version: 1.0.308.qualifier > Bundle-Activator: org.eclipse.jst.ws.internal.plugin.WebServicePlugin > Bundle-Vendor: %PLUGIN_PROVIDER > Bundle-Localization: plugin >#P org.eclipse.wst.ws_ui.feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/webtools/webservices/features/org.eclipse.wst.ws_ui.feature/feature.xml,v >retrieving revision 1.44.2.4 >diff -u -r1.44.2.4 feature.xml >--- feature.xml 19 Nov 2008 20:27:12 -0000 1.44.2.4 >+++ feature.xml 8 Apr 2009 18:25:47 -0000 >@@ -2,7 +2,7 @@ > <feature > id="org.eclipse.wst.ws_ui.feature" > label="%featureName" >- version="3.0.4.qualifier" >+ version="3.0.5.qualifier" > provider-name="%providerName"> > > <description> >#P org.eclipse.jst.ws.consumption.ui >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java,v >retrieving revision 1.38 >diff -u -r1.38 WSDLSelectionWidget.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java 29 Mar 2007 02:23:42 -0000 1.38 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java 8 Apr 2009 18:25:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2007 IBM Corporation and others. >+ * Copyright (c) 2004, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -25,6 +25,7 @@ > * 20061211 161589 makandre@ca.ibm.com - Andrew Mak, NPE in service generation after opening and cancelling from browse dialog > * 20070131 168786 makandre@ca.ibm.com - Andrew Mak, wsdl url on web service wizard page 1 is not reflected in browse dialog > * 20070326 171071 makandre@ca.ibm.com - Andrew Mak, Create public utility method for copying WSDL files >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > package org.eclipse.jst.ws.internal.consumption.ui.widgets.object; > >@@ -74,6 +75,7 @@ > import org.eclipse.wst.command.internal.env.core.common.StatusUtils; > import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; > import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; > import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity; > import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; > import org.eclipse.wst.ws.internal.plugin.WSPlugin; >@@ -510,15 +512,28 @@ > > private String iFile2URI(IFile file) > { >- File f = file.getLocation().toFile(); >- try >- { >- return f.toURL().toString(); >- } >- catch (MalformedURLException murle) >- { >- } >- return f.toString(); >+ String uri = null; >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) >+ { >+ uri = converter.convert(file); >+ if (uri == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ if (uri == null && allowBaseConversionOnFailure) >+ { >+ File f = file.getLocation().toFile(); >+ try >+ { >+ uri = f.toURL().toString(); >+ } >+ catch (MalformedURLException murle) >+ { >+ uri = f.toString(); >+ } >+ } >+ return uri; > } > > public void setInitialSelection(IStructuredSelection initialSelection) >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java,v >retrieving revision 1.11.4.2 >diff -u -r1.11.4.2 WSDLSelectionTransformer.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java 7 Jan 2009 15:33:11 -0000 1.11.4.2 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java 8 Apr 2009 18:25:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2008 IBM Corporation and others. >+ * Copyright (c) 2004, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,11 +13,13 @@ > * 20070327 172339 kathy@ca.ibm.com - Kathy Chan > * 20070713 191357 kathy@ca.ibm.com - Kathy Chan > * 20081208 257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > package org.eclipse.jst.ws.internal.consumption.ui.widgets.object; > > import java.net.MalformedURLException; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.IPath; >@@ -33,6 +35,8 @@ > import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory; > import org.eclipse.jst.ws.internal.common.J2EEUtils; > import org.eclipse.wst.command.internal.env.core.data.Transformer; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils; > import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper; > import org.eclipse.wst.wsdl.internal.impl.ServiceImpl; >@@ -52,6 +56,17 @@ > { > try > { >+ if (sel instanceof IFile) >+ { >+ IFile file = (IFile)sel; >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ if (converter != null) >+ { >+ String wsdlUrl = converter.convert(file); >+ if (wsdlUrl != null || !converter.allowBaseConversionOnFailure()) >+ return wsdlUrl; >+ } >+ } > return new StructuredSelection(((IResource)sel).getLocation().toFile().toURL().toString()); > } > catch (MalformedURLException murle) >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.51.2.4 >diff -u -r1.51.2.4 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Nov 2008 15:58:26 -0000 1.51.2.4 >+++ META-INF/MANIFEST.MF 8 Apr 2009 18:25:47 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.jst.ws.consumption.ui; singleton:=true >-Bundle-Version: 1.1.4.qualifier >+Bundle-Version: 1.1.5.qualifier > Bundle-Activator: org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin > Bundle-Vendor: %PLUGIN_PROVIDER > Bundle-Localization: plugin >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java,v >retrieving revision 1.15.2.2 >diff -u -r1.15.2.2 WSDLSelectionWidgetDefaultingCommand.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java 7 Jan 2009 15:33:11 -0000 1.15.2.2 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java 8 Apr 2009 18:25:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2008 IBM Corporation and others. >+ * Copyright (c) 2004, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -16,6 +16,7 @@ > * 20080220 219537 makandre@ca.ibm.com - Andrew Mak > * 20080501 229728 makandre@ca.ibm.com - Andrew Mak, uppercase .WSDL cannot be found by the Web Service Client wizard > * 20081208 257618 mahutch@ca.ibm.com - Mark Hutchinson, Add Mechanism for Adopters to map Services to WSDL URLs >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > package org.eclipse.jst.ws.internal.consumption.ui.widgets; > >@@ -36,6 +37,8 @@ > import org.eclipse.jst.ws.internal.common.ResourceUtils; > import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; > import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils; > import org.eclipse.wst.ws.internal.util.UniversalPathTransformer; > import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper; >@@ -62,8 +65,18 @@ > IFile ifile = (IFile)firstSel; > String ext = ifile.getFileExtension(); > if (ext != null && (ext.equalsIgnoreCase("wsdl") || ext.equalsIgnoreCase("wsil") || ext.equalsIgnoreCase("html"))) >- { >- uri_ = ifile.getFullPath().toString(); >+ { >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) >+ { >+ uri_ = converter.convert(ifile); >+ if (uri_ == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ >+ } >+ if ((uri_ == null || uri_.length() == 0) && allowBaseConversionOnFailure) >+ uri_ = ifile.getFullPath().toString(); > } > } > else if (Platform.getAdapterManager().hasAdapter(firstSel, WSDLURLStringWrapper.class.getName())) { >#P org.eclipse.wst.ws.ui >Index: src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws.ui/src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java,v >retrieving revision 1.5 >diff -u -r1.5 AdapterUtils.java >--- src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java 28 Apr 2008 23:32:31 -0000 1.5 >+++ src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java 8 Apr 2009 18:25:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2008 IBM Corporation and others. >+ * Copyright (c) 2007, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,6 +13,7 @@ > * 20070716 191357 kathy@ca.ibm.com - Kathy Chan > * 20080220 219537 makandre@ca.ibm.com - Andrew Mak > * 20080421 227824 makandre@ca.ibm.com - Andrew Mak, AdapterUtils adapt to IFile before String >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu > *******************************************************************************/ > package org.eclipse.wst.ws.internal.ui.utils; > >@@ -20,6 +21,8 @@ > > import org.eclipse.core.resources.IFile; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > > /** > * The AdapterUtils class provides utility methods to get objects from the Platform's adapter extension. >@@ -67,11 +70,21 @@ > if ( adaptedObject != null) { > if (adaptedObject instanceof IFile) > { >- URI uri = ((IFile)adaptedObject).getLocationURI(); >- if (uri != null) { >+ IFile file = (IFile)adaptedObject; >+ boolean allowBaseConversionOnFailure = true; >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ if (converter != null) >+ { >+ wsdlURI = converter.convert(file); >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ if (wsdlURI == null && allowBaseConversionOnFailure) >+ { >+ URI uri = file.getLocationURI(); >+ if (uri != null) { > wsdlURI = uri.toString(); >+ } > } >- > } else if (adaptedObject instanceof String) { > wsdlURI = (String) adaptedObject; > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.32 >diff -u -r1.32 MANIFEST.MF >--- META-INF/MANIFEST.MF 28 Mar 2008 16:29:02 -0000 1.32 >+++ META-INF/MANIFEST.MF 8 Apr 2009 18:25:48 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.wst.ws.ui; singleton:=true >-Bundle-Version: 1.1.0.qualifier >+Bundle-Version: 1.1.1.qualifier > Bundle-Activator: org.eclipse.wst.ws.internal.ui.plugin.WSUIPlugin > Bundle-Vendor: %PLUGIN_PROVIDER > Bundle-Localization: plugin >#P org.eclipse.wst.ws_sdk.feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/webtools/webservices/features/org.eclipse.wst.ws_sdk.feature/feature.xml,v >retrieving revision 1.24.4.4 >diff -u -r1.24.4.4 feature.xml >--- feature.xml 20 Nov 2008 15:04:28 -0000 1.24.4.4 >+++ feature.xml 8 Apr 2009 18:25:48 -0000 >@@ -2,7 +2,7 @@ > <feature > id="org.eclipse.wst.ws_sdk.feature" > label="%featureName" >- version="3.0.4.qualifier" >+ version="3.0.5.qualifier" > provider-name="%providerName"> > > <description> >#P org.eclipse.jst.ws.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.30.2.2 >diff -u -r1.30.2.2 MANIFEST.MF >--- META-INF/MANIFEST.MF 27 Jan 2009 18:30:54 -0000 1.30.2.2 >+++ META-INF/MANIFEST.MF 8 Apr 2009 18:25:49 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.jst.ws.ui; singleton:=true >-Bundle-Version: 1.0.304.qualifier >+Bundle-Version: 1.0.305.qualifier > Bundle-Activator: org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin > Bundle-Vendor: %PLUGIN_PROVIDER > Bundle-Localization: plugin >Index: src/org/eclipse/jst/ws/internal/ui/popup/PopupTestService.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/popup/PopupTestService.java,v >retrieving revision 1.4.2.1 >diff -u -r1.4.2.1 PopupTestService.java >--- src/org/eclipse/jst/ws/internal/ui/popup/PopupTestService.java 27 Jan 2009 18:27:30 -0000 1.4.2.1 >+++ src/org/eclipse/jst/ws/internal/ui/popup/PopupTestService.java 8 Apr 2009 18:25:49 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 IBM Corporation and others. >+ * Copyright (c) 2002, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,6 +13,7 @@ > * 20070327 172339 kathy@ca.ibm.com - Kathy Chan > * 20080123 216372 kathy@ca.ibm.com - Kathy Chan > * 20090127 257618 mahutch@ca.ibm.com - Mark Hutchinson >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > package org.eclipse.jst.ws.internal.ui.popup; > >@@ -58,8 +59,8 @@ > } > else if (object instanceof ServiceRef) > { >- ServiceRef serviceImpl = (ServiceRef)object; >- wsdlURL = J2EEActionAdapterFactory.getWSDLURI(serviceImpl); >+ ServiceRef serviceRef = (ServiceRef)object; >+ wsdlURL = J2EEActionAdapterFactory.getWSDLURI(serviceRef); > } else if (object instanceof String) { > wsdlURL = (String) object; > } else { >#P org.eclipse.wst.ws >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/plugin.properties,v >retrieving revision 1.10.2.1 >diff -u -r1.10.2.1 plugin.properties >--- plugin.properties 16 Jul 2008 22:08:50 -0000 1.10.2.1 >+++ plugin.properties 8 Apr 2009 18:25:49 -0000 >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2000, 2008 IBM Corporation and others. >+# Copyright (c) 2000, 2009 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -13,6 +13,7 @@ > # 20080324 220739 makandre@ca.ibm.com - Andrew Mak, Text Description missing for Profile Complaince nodes > # 20080403 225480 kathy@ca.ibm.com - Kathy Chan > # 20080715 240722 makandre@ca.ibm.com - Andrew Mak, Cannot setup TCP/IP Monitor for soap12 endpoints >+# 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > ############################################################################### > > # >@@ -27,6 +28,7 @@ > X_WEB_SERVICE_LOCATOR_CATEGORY_WORKSPACE=Workspace WSDL documents > X_WSIL_CONTENT_TYPE=Web Services Inspection Language Document > XP_EXTENSIBILITY_ELEMENT_TRANSFORMER=Extensibility Element Transformer >+XP_IFILE_2_URI_CONVERTER=IFile to URI Converter > > MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}. > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/plugin.xml,v >retrieving revision 1.20.2.1 >diff -u -r1.20.2.1 plugin.xml >--- plugin.xml 16 Jul 2008 22:08:50 -0000 1.20.2.1 >+++ plugin.xml 8 Apr 2009 18:25:49 -0000 >@@ -7,6 +7,7 @@ > <extension-point id="locator" name="%XP_WEB_SERVICE_LOCATOR" schema="schema/webServiceLocator.exsd"/> > > <extension-point id="ExtensibilityElementTransformer" name="%XP_EXTENSIBILITY_ELEMENT_TRANSFORMER" schema="schema/ExtensibilityElementTransformer.exsd"/> >+ <extension-point id="ifile2uriconverter" name="%XP_IFILE_2_URI_CONVERTER" schema="schema/ifile2uriconverter.exsd"/> > > <!-- Extension providing workspace WSDL discovery --> > <extension >Index: src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java,v >retrieving revision 1.8 >diff -u -r1.8 WSPlugin.java >--- src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java 24 Apr 2006 18:05:05 -0000 1.8 >+++ src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java 8 Apr 2009 18:25:49 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,11 +11,17 @@ > * -------- -------- ----------------------------------------------------------- > * 20060403 128827 kathy@ca.ibm.com - Kathy Chan > * 20060424 115690 sengpl@ca.ibm.com - Seng Phung-Lu >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > > package org.eclipse.wst.ws.internal.plugin; > >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtension; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Plugin; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; > import org.eclipse.wst.ws.internal.preferences.PersistentMergeContext; > import org.eclipse.wst.ws.internal.preferences.PersistentWSDLValidationContext; > import org.eclipse.wst.ws.internal.preferences.PersistentWSIAPContext; >@@ -37,6 +43,8 @@ > private PersistentWSDLValidationContext wsdlValidationContext_; > private PersistentWaitForWSDLValidationContext waitForWsdlValidationContext_; > private PersistentMergeContext mergeContext_; >+ private IIFile2UriConverter iFile2UriConverter_; >+ private boolean isIFile2UriConverterInitialized_ = false; > > public static final String ID = "org.eclipse.wst.ws"; > >@@ -157,4 +165,38 @@ > } > return mergeContext_; > } >+ >+ /** >+ * <p> >+ * Get the product's registered IFile to URI converter. If there is no converter registered then this method will return null. >+ * @return The IFile to URI converter registered with the <code>org.eclipse.wst.ws/IFile2UriConverterId</code> preference in plugin_customization.ini >+ */ >+ public IIFile2UriConverter getIFile2UriConverter() >+ { >+ if (!isIFile2UriConverterInitialized_) >+ { >+ String productConverterId = getPluginPreferences().getDefaultString("IFile2UriConverterId"); >+ if (productConverterId.length() > 0) >+ { >+ IExtension extension = Platform.getExtensionRegistry().getExtension(productConverterId); >+ if (extension != null) >+ { >+ IConfigurationElement[] configElements = extension.getConfigurationElements(); >+ if (configElements.length > 0) >+ { >+ try >+ { >+ iFile2UriConverter_ = (IIFile2UriConverter)configElements[0].createExecutableExtension("class"); >+ } >+ catch (CoreException e) >+ { >+ getLog().log(e.getStatus()); >+ } >+ } >+ } >+ } >+ isIFile2UriConverterInitialized_ = true; >+ } >+ return iFile2UriConverter_; >+ } > } >Index: src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java,v >retrieving revision 1.7 >diff -u -r1.7 WorkspaceWSDLLocator.java >--- src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java 11 Jul 2006 20:04:56 -0000 1.7 >+++ src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java 8 Apr 2009 18:25:49 -0000 >@@ -1,16 +1,17 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * yyyymmdd bug Email and other contact information > * -------- -------- ----------------------------------------------------------- > * 20060317 127456 cbrealey@ca.ibm.com - Chris Brealey > * 20060620 147862 cbrealey@ca.ibm.com - Chris Brealey >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter > *******************************************************************************/ > > package org.eclipse.wst.ws.internal.wsfinder; >@@ -18,6 +19,7 @@ > import java.util.List; > import java.util.Vector; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IResourceVisitor; >@@ -25,6 +27,8 @@ > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; > > /** >@@ -124,14 +128,27 @@ > public boolean visit(IResource resource) > { > if (resource.getType() == IResource.FILE) >- { >- String ext = resource.getFileExtension(); >- if (ext != null && ext.equalsIgnoreCase(WSDL_EXT)) >+ { >+ String wsdlURL = null; >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) >+ { >+ wsdlURL = converter.convert((IFile)resource); >+ if (wsdlURL == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ if (wsdlURL == null && allowBaseConversionOnFailure) >+ { >+ String ext = resource.getFileExtension(); >+ if (ext != null && ext.equalsIgnoreCase(WSDL_EXT)) >+ wsdlURL = PLATFORM_RES + resource.getFullPath().toString(); >+ } >+ if (wsdlURL != null) > { >- String urlString = PLATFORM_RES + resource.getFullPath().toString(); >- WebServiceInfo wsInfo = new WebServiceInfo(); >- wsInfo.setWsdlURL(urlString); >- wsdl.add(wsInfo); >+ WebServiceInfo wsInfo = new WebServiceInfo(); >+ wsInfo.setWsdlURL(wsdlURL); >+ wsdl.add(wsInfo); > } > } > return true; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/META-INF/MANIFEST.MF,v >retrieving revision 1.39.2.3 >diff -u -r1.39.2.3 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Jan 2009 21:24:04 -0000 1.39.2.3 >+++ META-INF/MANIFEST.MF 8 Apr 2009 18:25:49 -0000 >@@ -2,12 +2,13 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.wst.ws; singleton:=true >-Bundle-Version: 1.1.3.qualifier >+Bundle-Version: 1.1.4.qualifier > Bundle-Activator: org.eclipse.wst.ws.internal.plugin.WSPlugin > Bundle-Vendor: %PLUGIN_PROVIDER > Bundle-Localization: plugin > Export-Package: org.eclipse.wst.ws.internal;x-internal:=true, > org.eclipse.wst.ws.internal.common;x-internal:=true, >+ org.eclipse.wst.ws.internal.converter, > org.eclipse.wst.ws.internal.data;x-internal:=true, > org.eclipse.wst.ws.internal.datamodel;x-internal:=true, > org.eclipse.wst.ws.internal.ext;x-internal:=true, >Index: schema/ifile2uriconverter.exsd >=================================================================== >RCS file: schema/ifile2uriconverter.exsd >diff -N schema/ifile2uriconverter.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/ifile2uriconverter.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,106 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.wst.ws" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appinfo> >+ <meta.schema plugin="org.eclipse.wst.ws" id="ifile2uriconverter" name="IFile to URI Converter"/> >+ </appinfo> >+ <documentation> >+ 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. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appinfo> >+ <meta.element /> >+ </appinfo> >+ </annotation> >+ <complexType> >+ <sequence> >+ <element ref="converter"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ 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's plugin_customization.ini via the setting: >+ >+<code>org.eclipse.wst.ws/IFile2UriConverter = [value of id]</code> >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute translatable="true"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="converter"> >+ <complexType> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The fully qualified class name of the IFile to URI converter provided for this product. >+ </documentation> >+ <appinfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.wst.internal.converter.AbstractIFile2UriConverter:"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="since"/> >+ </appinfo> >+ <documentation> >+ [Enter the first release in which this extension point appears.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="examples"/> >+ </appinfo> >+ <documentation> >+ <extension point="org.eclipse.wst.ws.ifile2uriconverter" id="com.example.converterplugin.converterextension"> >+ <converter class="com.example.converterplugin.impl.MyIFile2UriConverter"/> >+</extension> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="apiinfo"/> >+ </appinfo> >+ <documentation> >+ Extenders should subclass <code>org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter</code> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="implementation"/> >+ </appinfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ >+</schema> >Index: src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java >=================================================================== >RCS file: src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java >diff -N src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,48 @@ >+/******************************************************************************* >+ * Copyright (c) 2005, 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * yyyymmdd bug Email and other contact information >+ * -------- -------- ----------------------------------------------------------- >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter >+ *******************************************************************************/ >+package org.eclipse.wst.ws.internal.converter; >+ >+import org.eclipse.core.resources.IFile; >+ >+/** >+ * <p> >+ * The interface for an Eclipse IFile to URI converter. Adopters should >+ * subclass AbstractIFile2UriConverter instead. >+ * >+ * @see AbstractIFile2UriConverter >+ */ >+public interface IIFile2UriConverter { >+ /** >+ * <p> >+ * Produce a String URI from a given IFile. The IFile is from the workbench. If this method returns null, >+ * the result is considered a failure and the >+ * {@link #allowBaseConversionOnFailure allowBaseConversionOnFailure} method will be consulted to determine >+ * whether or not base conversion should be used as a backup. >+ * @param file An IFile reference. >+ * @return The String URI corresponding to the IFile reference. >+ * <p> >+ * @since 3.1 >+ */ >+ public String convert(IFile file); >+ >+ /** >+ * <p> >+ * Determines whether or not a converter will allow base conversion routines to be performed >+ * when a failure occurs. >+ * @return <code>true</code> if base conversion should be performed when a failure occurs. >+ * <p> >+ * @since 3.1 >+ */ >+ public boolean allowBaseConversionOnFailure(); >+} >Index: src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java >=================================================================== >RCS file: src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java >diff -N src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/******************************************************************************* >+ * Copyright (c) 2005, 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * yyyymmdd bug Email and other contact information >+ * -------- -------- ----------------------------------------------------------- >+ * 20090310 242440 yenlu@ca.ibm.com - Yen Lu, Pluggable IFile to URI Converter >+ *******************************************************************************/ >+package org.eclipse.wst.ws.internal.converter; >+ >+import org.eclipse.core.resources.IFile; >+ >+/** >+ * <p> >+ * The abstract implementation of an IFile to URI converter. Adopters who wish to >+ * provide their own converter should subclass this abstract class rather than implementing IIFile2UriConverter. >+ * >+ * @see IIFile2UriConverter >+ */ >+public abstract class AbstractIFile2UriConverter implements IIFile2UriConverter { >+ >+ public String convert(IFile file) { >+ return null; >+ } >+ >+ public boolean allowBaseConversionOnFailure() >+ { >+ return true; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 270514
:
131038
| 131319