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 165544 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/wsdm/tooling/editor/capability/imports/wsdl/internal/OperationImportValidator.java (-2 / +74 lines)
Lines 12-19 Link Here
12
12
13
package org.eclipse.tptp.wsdm.tooling.editor.capability.imports.wsdl.internal;
13
package org.eclipse.tptp.wsdm.tooling.editor.capability.imports.wsdl.internal;
14
14
15
import java.util.ArrayList;
15
import java.util.HashMap;
16
import java.util.HashMap;
16
import java.util.Iterator;
17
import java.util.Iterator;
18
import java.util.List;
17
import java.util.Map;
19
import java.util.Map;
18
20
19
import javax.wsdl.Fault;
21
import javax.wsdl.Fault;
Lines 41-46 Link Here
41
	private Operation[] _operations;
43
	private Operation[] _operations;
42
	private Map _map = new HashMap();
44
	private Map _map = new HashMap();
43
	public static final String XMLSCHEMA_2001_URI = "http://www.w3.org/2001/XMLSchema";
45
	public static final String XMLSCHEMA_2001_URI = "http://www.w3.org/2001/XMLSchema";
46
	private Map _xsdElementReferredMap = new HashMap();
44
47
45
	/**
48
	/**
46
	 * Creates new object of this class. 
49
	 * Creates new object of this class. 
Lines 113-118 Link Here
113
							new Object[]
116
							new Object[]
114
							{ conflictedMessage, inputMessage });
117
							{ conflictedMessage, inputMessage });
115
				}
118
				}
119
				collectReferredElement(inputMessage);
116
			}
120
			}
117
			else
121
			else
118
			{
122
			{
Lines 142-148 Link Here
142
					return new ImportValidationStatus(errorMessage,
146
					return new ImportValidationStatus(errorMessage,
143
							new Object[]
147
							new Object[]
144
							{ conflictedMessage, outputMessage });
148
							{ conflictedMessage, outputMessage });
145
				}
149
				}				
146
			}
150
			}
147
			else
151
			else
148
			{
152
			{
Lines 178-187 Link Here
178
						return new ImportValidationStatus(errorMessage,
182
						return new ImportValidationStatus(errorMessage,
179
								new Object[]
183
								new Object[]
180
								{ conflictedMessage, faultMessage });
184
								{ conflictedMessage, faultMessage });
181
					}
185
					}					
182
				}
186
				}
183
			}
187
			}
184
		}
188
		}
189
		
190
		// Check if more than one input messages refer to same element
191
		// Then its invalid, because we are going to change the name of xsd element at import time for input message
192
		// Since Muse generates the Java Method name based on element name rather than operation name
193
		
194
		Iterator it = _xsdElementReferredMap.values().iterator();
195
		while(it.hasNext())
196
		{
197
			XSDElementReferred referred = (XSDElementReferred) it.next();
198
			Message[] referredMessages = referred.getReferringMessages();
199
			if(referredMessages.length > 1)
200
			{
201
				StringBuffer buffer = new StringBuffer();
202
				String newLine = System.getProperty("line.separator");
203
				buffer.append(Messages.SAME_ELEMENT_REFERRED_MESSAGE+newLine);
204
				for(int i=0; i<referredMessages.length; i++)
205
					buffer.append(referredMessages[i].getQName().getLocalPart()+newLine);				
206
				String errorMessage = buffer.toString();
207
				return new ImportValidationStatus(errorMessage,referredMessages);
208
			}
209
 		}
210
		
211
		// Everyting is fine
185
		return null;
212
		return null;
186
	}
213
	}
187
214
Lines 221-225 Link Here
221
		}
248
		}
222
		return true;
249
		return true;
223
	}
250
	}
251
	
252
	private void collectReferredElement(Message message)
253
	{
254
		Map partsMap = message.getParts();
255
		if (partsMap == null || partsMap.size() != 1)
256
			return;
257
		Part part_0 = (Part) partsMap.values().iterator().next();
258
		QName elementQName = part_0.getElementName();
259
		if(elementQName!=null)
260
		{
261
			XSDElementReferred referred = (XSDElementReferred) _xsdElementReferredMap.get(elementQName);
262
			if(referred == null)
263
			{
264
				referred = new XSDElementReferred(elementQName);
265
				_xsdElementReferredMap.put(elementQName, referred);
266
			}
267
			referred.addReferringMessage(message);
268
		}
269
	}
270
}
271
224
272
273
class XSDElementReferred
274
{
275
	private QName _elementQName;
276
	private List _referringMessages = new ArrayList();
277
	
278
	XSDElementReferred(QName elementQName)
279
	{
280
		_elementQName = elementQName;
281
	}
282
	
283
	void addReferringMessage(Message message)
284
	{
285
		_referringMessages.add(message);
286
	}
287
	
288
	Message[] getReferringMessages()
289
	{
290
		return (Message[]) _referringMessages.toArray(new Message[_referringMessages.size()]);
291
	}
292
	
293
	QName getXSDElementReferred()
294
	{
295
		return _elementQName;
296
	}
225
}
297
}
(-)src/org/eclipse/tptp/wsdm/tooling/editor/capability/imports/wsdl/internal/WsdlPortTypeLabelProvider.java (+2 lines)
Lines 67-72 Link Here
67
67
68
	public String getText(Object element)
68
	public String getText(Object element)
69
	{
69
	{
70
		if (element == null)
71
			return "";		
70
		if (element instanceof PortType)
72
		if (element instanceof PortType)
71
		{
73
		{
72
			PortType port = (PortType) element;
74
			PortType port = (PortType) element;
(-)src/org/eclipse/tptp/wsdm/tooling/editor/internal/StartupCapabilitiesCollector.java (-2 / +95 lines)
Lines 20-25 Link Here
20
import javax.wsdl.xml.WSDLReader;
20
import javax.wsdl.xml.WSDLReader;
21
21
22
import org.apache.muse.ws.wsdl.WsdlUtils;
22
import org.apache.muse.ws.wsdl.WsdlUtils;
23
import org.eclipse.core.resources.IFile;
24
import org.eclipse.core.resources.IResource;
25
import org.eclipse.core.resources.IWorkspaceRoot;
26
import org.eclipse.core.resources.ResourcesPlugin;
23
import org.eclipse.core.runtime.FileLocator;
27
import org.eclipse.core.runtime.FileLocator;
24
import org.eclipse.core.runtime.IConfigurationElement;
28
import org.eclipse.core.runtime.IConfigurationElement;
25
import org.eclipse.core.runtime.IExtension;
29
import org.eclipse.core.runtime.IExtension;
Lines 31-36 Link Here
31
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
35
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
32
import org.eclipse.tptp.wsdm.tooling.util.internal.CapUtils;
36
import org.eclipse.tptp.wsdm.tooling.util.internal.CapUtils;
33
import org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability;
37
import org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability;
38
import org.eclipse.tptp.wsdm.tooling.util.internal.EclipseUtils;
39
import org.eclipse.tptp.wsdm.tooling.util.internal.IResourceChangeConsumer;
40
import org.eclipse.tptp.wsdm.tooling.util.internal.ResourceChangeListener;
34
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog;
41
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog;
35
import org.eclipse.ui.IStartup;
42
import org.eclipse.ui.IStartup;
36
import org.osgi.framework.Bundle;
43
import org.osgi.framework.Bundle;
Lines 39-48 Link Here
39
46
40
/**
47
/**
41
 * This class will read all the capabilities at the eclipse startup using mrCapability extension point.<br>
48
 * This class will read all the capabilities at the eclipse startup using mrCapability extension point.<br>
42
 * This class will not load the capabilities available in workspace. 
49
 * This class will also load the capabilities available in workspace. 
43
 */
50
 */
44
51
45
public class StartupCapabilitiesCollector implements IStartup
52
public class StartupCapabilitiesCollector implements IStartup, IResourceChangeConsumer
46
{
53
{
47
54
48
	public static final String WSDL_EXTN = ".WSDL";
55
	public static final String WSDL_EXTN = ".WSDL";
Lines 54-64 Link Here
54
	private static Category _resourceLifetimeCategory = new Category(
61
	private static Category _resourceLifetimeCategory = new Category(
55
			"ResourceLifetime");
62
			"ResourceLifetime");
56
	private static Category _resourceTypeCategory = new Category("ResourceType");
63
	private static Category _resourceTypeCategory = new Category("ResourceType");
64
	private static Category _userDefinedCategory = new Category("UserDefined");
57
	private static MRCapabilityExtensionPointInfo[] _registeredCapabilitiesInfo = new MRCapabilityExtensionPointInfo[0];
65
	private static MRCapabilityExtensionPointInfo[] _registeredCapabilitiesInfo = new MRCapabilityExtensionPointInfo[0];
58
	static boolean _initialized = false;
66
	static boolean _initialized = false;
59
	
67
	
60
	public void earlyStartup()
68
	public void earlyStartup()
61
	{		
69
	{		
70
		new ResourceChangeListener().addResourceChangeConsumer(this);
62
		if(!_initialized) {
71
		if(!_initialized) {
63
			initialize();
72
			initialize();
64
		}
73
		}
Lines 72-77 Link Here
72
			loadResourcePropertyCapabilities();
81
			loadResourcePropertyCapabilities();
73
			loadResourceLifetimeCapabilities();
82
			loadResourceLifetimeCapabilities();
74
			loadResourceTypeCapabilities();
83
			loadResourceTypeCapabilities();
84
			loadUserDefinedCapabilities();
75
			_initialized = true;
85
			_initialized = true;
76
		}
86
		}
77
	}
87
	}
Lines 203-208 Link Here
203
			}
213
			}
204
		}
214
		}
205
	}
215
	}
216
	
217
	/**
218
	 * Loads all the user defined capabilities from workspace.
219
	 */
220
	private static void loadUserDefinedCapabilities()
221
	{
222
		_userDefinedCategory.clearAllCapabilities();
223
		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
224
		IResource[] resources = EclipseUtils.getResourcesOfExtension(root,
225
				"mcap");
226
		for (int i = 0; i < resources.length; i++)
227
		{
228
			IFile mcapFile = (IFile) resources[i];
229
			CapabilityInfo capabilityInfo = loadCapability(mcapFile);
230
			_userDefinedCategory.addCapabilityInfo(capabilityInfo);
231
		}		
232
	}
233
	
234
	/**
235
	 *  Loads the capability from Eclipse workspace mcap file.
236
	 */
237
	private static CapabilityInfo loadCapability(IFile mcapFile)
238
	{
239
		CapabilityDefinition capabilityDefinition = null;
240
		try
241
		{
242
			capabilityDefinition = org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils
243
					.getCapabilityDefinition(mcapFile);
244
		}
245
		catch (Exception e)
246
		{
247
			WsdmToolingLog.logError(e.getMessage(), e);
248
		}
249
		Definition definition = capabilityDefinition.getDefinition();
250
		URI uri = capabilityDefinition.getWSDLResourceProtocolURI();
251
		Definition2Capability def2cap = new Definition2Capability(definition);
252
		Capability capability = def2cap.getCapability(uri);
253
		CapabilityInfo capabilityInfo = new CapabilityInfo(capability);
254
		return capabilityInfo;
255
	}
206
256
207
	/**
257
	/**
208
	 * Now returns a Collection (of String) of wsdlFileLocations (relative path
258
	 * Now returns a Collection (of String) of wsdlFileLocations (relative path
Lines 302-307 Link Here
302
	{
352
	{
303
		return _resourceTypeCategory;
353
		return _resourceTypeCategory;
304
	}
354
	}
355
	
356
	/**
357
	 * Returns User defined category. 
358
	 */
359
	public static Category getUserDefinedCategory()
360
	{
361
		return _userDefinedCategory;
362
	}
363
364
	public void fileAdded(IFile addedFile) 
365
	{
366
		if(addedFile.getFileExtension().equals("mcap"))
367
		{
368
			CapabilityInfo capability = loadCapability(addedFile);
369
			_userDefinedCategory.addCapabilityInfo(capability);
370
		}
371
	}
372
373
	public void fileChanged(IFile changedFile) 
374
	{
375
		if(changedFile.getFileExtension().equals("mcap"))
376
		{
377
			URI capabilityURI = URI.createPlatformResourceURI(changedFile.getFullPath().toString());
378
			_userDefinedCategory.removeCapabilityInfo(capabilityURI);
379
			CapabilityInfo capability = loadCapability(changedFile);
380
			_userDefinedCategory.addCapabilityInfo(capability);
381
		}
382
	}
383
384
	public void fileRemoved(IFile removedFile)
385
	{
386
		if(removedFile.getFileExtension().equals("mcap"))
387
		{
388
			URI capabilityURI = URI.createPlatformResourceURI(removedFile.getFullPath().toString());
389
			_userDefinedCategory.removeCapabilityInfo(capabilityURI);			
390
		}
391
	}
392
393
	public void fileReplaced(IFile replacedFile) 
394
	{
395
		// TODO Find out the proper use case for this
396
		fileChanged(replacedFile);		
397
	}
305
398
306
}
399
}
307
400
(-)src/org/eclipse/tptp/wsdm/tooling/editor/internal/CategoryCollection.java (-46 / +3 lines)
Lines 18-35 Link Here
18
import java.util.List;
18
import java.util.List;
19
import java.util.Map;
19
import java.util.Map;
20
20
21
import javax.wsdl.Definition;
22
23
import org.eclipse.core.resources.IFile;
24
import org.eclipse.core.resources.IResource;
25
import org.eclipse.core.resources.IWorkspaceRoot;
26
import org.eclipse.core.resources.ResourcesPlugin;
27
import org.eclipse.emf.common.util.URI;
21
import org.eclipse.emf.common.util.URI;
28
import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability;
22
import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability;
29
import org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability;
30
import org.eclipse.tptp.wsdm.tooling.util.internal.EclipseUtils;
31
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils;
32
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog;
33
23
34
/**
24
/**
35
 * This class is the collection for all the capability categories. 
25
 * This class is the collection for all the capability categories. 
Lines 61-67 Link Here
61
				.getResourceLifetimeCategory().clone();
51
				.getResourceLifetimeCategory().clone();
62
		Category resourceTypeCategory = (Category) StartupCapabilitiesCollector
52
		Category resourceTypeCategory = (Category) StartupCapabilitiesCollector
63
				.getResourceTypeCategory().clone();
53
				.getResourceTypeCategory().clone();
64
		Category userDefinedCategory = getUserDefinedCategory(true);
54
		Category userDefinedCategory = (Category) StartupCapabilitiesCollector
55
		.getUserDefinedCategory().clone();
65
56
66
		populateMap(managementCategory);
57
		populateMap(managementCategory);
67
		populateMap(managementRelatedCategory);
58
		populateMap(managementRelatedCategory);
Lines 111-154 Link Here
111
				.getResourceLifetimeCategory().clone());
102
				.getResourceLifetimeCategory().clone());
112
		categories.add(StartupCapabilitiesCollector.getResourceTypeCategory()
103
		categories.add(StartupCapabilitiesCollector.getResourceTypeCategory()
113
				.clone());
104
				.clone());
114
		categories.add(getUserDefinedCategory(loadMetadata));
105
		categories.add(StartupCapabilitiesCollector.getUserDefinedCategory().clone());
115
		return (Category[]) categories.toArray(new Category[categories.size()]);
106
		return (Category[]) categories.toArray(new Category[categories.size()]);
116
	}
107
	}
117
108
118
	private Category getUserDefinedCategory(boolean loadMetadata)
119
	{
120
		Category category = new Category("UserDefined");
121
		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
122
		IResource[] resources = EclipseUtils.getResourcesOfExtension(root,
123
				"mcap");
124
		for (int i = 0; i < resources.length; i++)
125
		{
126
			IFile mcapFile = (IFile) resources[i];
127
			CapabilityDefinition capabilityDefinition = null;
128
			try
129
			{
130
				capabilityDefinition = WsdlUtils
131
						.getCapabilityDefinition(mcapFile);
132
			}
133
			catch (Exception e)
134
			{
135
				WsdmToolingLog.logError(e.getMessage(), e);
136
			}
137
			Definition definition = capabilityDefinition.getDefinition();
138
			URI uri = capabilityDefinition.getWSDLResourceProtocolURI();
139
			Definition2Capability def2cap = null;
140
			if (loadMetadata)
141
				def2cap = new Definition2Capability(definition);
142
			else
143
				def2cap = new Definition2Capability(definition, false, false,
144
						false, false);
145
			Capability capability = def2cap.getCapability(uri);
146
			CapabilityInfo capabilityInfo = new CapabilityInfo(capability);
147
			category.addCapabilityInfo(capabilityInfo);
148
		}
149
		return category;
150
	}
151
152
	/**
109
	/**
153
	 * Returns the capability.
110
	 * Returns the capability.
154
	 * @param capabilityURI
111
	 * @param capabilityURI
(-)src/org/eclipse/tptp/wsdm/tooling/editor/internal/Category.java (+8 lines)
Lines 100-105 Link Here
100
		if (indexToRemove != -1)
100
		if (indexToRemove != -1)
101
			_capabilitiesInfo.remove(indexToRemove);
101
			_capabilitiesInfo.remove(indexToRemove);
102
	}
102
	}
103
	
104
	/**
105
	 * Clears all the capabilities from this category.
106
	 */
107
	public void clearAllCapabilities()
108
	{
109
		_capabilitiesInfo.clear();
110
	}
103
111
104
	public Object clone()
112
	public Object clone()
105
	{
113
	{
(-)src/org/eclipse/tptp/wsdm/tooling/editor/capability/command/operation/internal/ImportWSDLOperationCommand.java (-8 / +43 lines)
Lines 38-45 Link Here
38
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils;
38
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils;
39
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmConstants;
39
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmConstants;
40
import org.eclipse.tptp.wsdm.tooling.util.internal.XsdUtils;
40
import org.eclipse.tptp.wsdm.tooling.util.internal.XsdUtils;
41
import org.eclipse.xsd.XSDComplexTypeDefinition;
41
import org.eclipse.xsd.XSDElementDeclaration;
42
import org.eclipse.xsd.XSDElementDeclaration;
42
import org.eclipse.xsd.XSDSchema;
43
import org.eclipse.xsd.XSDSchema;
44
import org.eclipse.xsd.XSDTypeDefinition;
43
import org.w3c.dom.Document;
45
import org.w3c.dom.Document;
44
import org.w3c.dom.Element;
46
import org.w3c.dom.Element;
45
47
Lines 59-65 Link Here
59
	private IProgressMonitor _monitor;
61
	private IProgressMonitor _monitor;
60
	private QName WSA_ACTION_QNAME = new QName(WsdmConstants.WSA_URI,
62
	private QName WSA_ACTION_QNAME = new QName(WsdmConstants.WSA_URI,
61
			WsdmConstants.WSA_ACTION_NAME);
63
			WsdmConstants.WSA_ACTION_NAME);
62
64
	
63
	/**
65
	/**
64
	 * Creates a new object of this class.
66
	 * Creates a new object of this class.
65
	 */
67
	 */
Lines 139-145 Link Here
139
		newInput.setName(importedOperation.getInput().getName());
141
		newInput.setName(importedOperation.getInput().getName());
140
142
141
		Message importedMessage = importedOperation.getInput().getMessage();
143
		Message importedMessage = importedOperation.getInput().getMessage();
142
		Message newMessage = createNewMessage(importedMessage);
144
		Message newMessage = createNewMessage(importedOperation, importedMessage, true);
143
		newInput.setMessage(newMessage);
145
		newInput.setMessage(newMessage);
144
		_capabilityDefinition.addMessage(newMessage);
146
		_capabilityDefinition.addMessage(newMessage);
145
147
Lines 166-172 Link Here
166
		newOutput.setName(importedOperation.getOutput().getName());
168
		newOutput.setName(importedOperation.getOutput().getName());
167
169
168
		Message importedMessage = importedOperation.getOutput().getMessage();
170
		Message importedMessage = importedOperation.getOutput().getMessage();
169
		Message newMessage = createNewMessage(importedMessage);
171
		Message newMessage = createNewMessage(importedOperation, importedMessage, false);
170
		newOutput.setMessage(newMessage);
172
		newOutput.setMessage(newMessage);
171
		_capabilityDefinition.addMessage(newMessage);
173
		_capabilityDefinition.addMessage(newMessage);
172
		
174
		
Lines 192-205 Link Here
192
				newFault.setName(importFault.getName());
194
				newFault.setName(importFault.getName());
193
195
194
				Message importedMessage = importFault.getMessage();
196
				Message importedMessage = importFault.getMessage();
195
				Message newMessage = createNewMessage(importedMessage);
197
				Message newMessage = createNewMessage(importedOperation, importedMessage, false);
196
				newFault.setMessage(newMessage);
198
				newFault.setMessage(newMessage);
197
				_capabilityDefinition.addMessage(newMessage);
199
				_capabilityDefinition.addMessage(newMessage);
198
			}
200
			}
199
		}
201
		}
200
	}
202
	}
201
203
202
	private Message createNewMessage(Message importedMessage)
204
	private Message createNewMessage(Operation importedOperation, Message importedMessage, boolean isInputMessge)
203
	{
205
	{
204
		  Definition definition = _capabilityDefinition.getDefinition();
206
		  Definition definition = _capabilityDefinition.getDefinition();
205
		  Message existingMessage = WsdlUtils.getWSDLMessage(definition,importedMessage.getQName().getLocalPart()); 
207
		  Message existingMessage = WsdlUtils.getWSDLMessage(definition,importedMessage.getQName().getLocalPart()); 
Lines 219-227 Link Here
219
			  String xsdNS = importedPart.getElementName().getNamespaceURI();
221
			  String xsdNS = importedPart.getElementName().getNamespaceURI();
220
			  String elementName = importedPart.getElementName().getLocalPart();
222
			  String elementName = importedPart.getElementName().getLocalPart();
221
			  XSDSchema elementSchema = _capabilityDefinition.getSchema(xsdNS); 
223
			  XSDSchema elementSchema = _capabilityDefinition.getSchema(xsdNS); 
222
			  XSDElementDeclaration element = XsdUtils.getXSDElementDeclarationOfName(elementSchema, elementName);
224
			  XSDElementDeclaration element = XsdUtils.getXSDElementDeclarationOfName(elementSchema, elementName);			  
223
			  _capabilityDefinition.createOrFindPrefix(element.getTargetNamespace(), null);			  
225
			  _capabilityDefinition.createOrFindPrefix(element.getTargetNamespace(), null);			  
224
			  part.setElementName(new QName(xsdNS, elementName));  
226
			  
227
			  XSDTypeDefinition typeDef = element.getType();
228
			  XSDSchema typeDefSchema = _capabilityDefinition.getSchema(typeDef.getTargetNamespace());
229
			  typeDef = getXSDTypeDefinition(typeDefSchema, typeDef.getName());
230
			  if(typeDef instanceof XSDComplexTypeDefinition)
231
			  {
232
				  XSDTypeDefinition anonymousTypeDef = (XSDTypeDefinition)typeDef.cloneConcreteComponent(true, false);
233
				  anonymousTypeDef.setName(null);
234
				  element.setAnonymousTypeDefinition(anonymousTypeDef);
235
			  }
236
			  
237
			  if(isInputMessge)
238
			  {
239
				  // Muse 2.2 requires the XSD element name should be same as the operation name
240
				  // So we change the XSD element name to the operation name
241
				  // Remove this if Muse fixes it in its next release
242
				  element.setName(importedOperation.getName());				  
243
			  }
244
			  QName elementQName = new QName(xsdNS, element.getName());
245
			  part.setElementName(elementQName);
225
		  }
246
		  }
226
		  else if(importedPart.getTypeName()!=null)
247
		  else if(importedPart.getTypeName()!=null)
227
		  {
248
		  {
Lines 251-257 Link Here
251
        Map namespacesMap = _importDefinition.getNamespaces();
272
        Map namespacesMap = _importDefinition.getNamespaces();
252
        for(int i=0;i<schemas.length;i++)
273
        for(int i=0;i<schemas.length;i++)
253
        {
274
        {
254
        	_capabilityDefinition.addSchema(schemas[i], namespacesMap);
275
        	String tns = schemas[i].getAttribute("targetNamespace");
276
        	if(_capabilityDefinition.getSchema(tns) == null)
277
        		_capabilityDefinition.addSchema(schemas[i], namespacesMap);
255
        }        
278
        }        
256
	}
279
	}
280
	
281
	private XSDTypeDefinition getXSDTypeDefinition(XSDSchema schema, String typeName)
282
	{
283
		List types = schema.getTypeDefinitions();
284
		for(int i=0;i<types.size();i++)
285
		{
286
			XSDTypeDefinition typeDef = (XSDTypeDefinition) types.get(i);
287
			if(typeDef.getName().equals(typeName))
288
				return typeDef;
289
		}
290
		return null;
291
	}
257
}
292
}
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/capability/imports/internal/Messages.java (+1 lines)
Lines 30-35 Link Here
30
	public static String CONFLICTED_MESSAGE;
30
	public static String CONFLICTED_MESSAGE;
31
	public static String INPUT_MESSAGE_NOT_DEFINED;
31
	public static String INPUT_MESSAGE_NOT_DEFINED;
32
	public static String OUTPUT_MESSAGE_NOT_DEFINED;
32
	public static String OUTPUT_MESSAGE_NOT_DEFINED;
33
	public static String SAME_ELEMENT_REFERRED_MESSAGE;
33
	public static String IMPROPER_WSDL_FILE;
34
	public static String IMPROPER_WSDL_FILE;
34
	public static String DEFINE_CAPABILITY_FROM_WSDL;
35
	public static String DEFINE_CAPABILITY_FROM_WSDL;
35
	public static String SPECIFY_EXISTING_WSDL;
36
	public static String SPECIFY_EXISTING_WSDL;
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/capability/imports/internal/messages.properties (+1 lines)
Lines 21-26 Link Here
21
CONFLICTED_MESSAGE = IWAT0834E Conflicted message :
21
CONFLICTED_MESSAGE = IWAT0834E Conflicted message :
22
INPUT_MESSAGE_NOT_DEFINED = IWAT0835E Input message must be defined
22
INPUT_MESSAGE_NOT_DEFINED = IWAT0835E Input message must be defined
23
OUTPUT_MESSAGE_NOT_DEFINED = IWAT0836E Output message must be defined
23
OUTPUT_MESSAGE_NOT_DEFINED = IWAT0836E Output message must be defined
24
SAME_ELEMENT_REFERRED_MESSAGE = IWAT0875E Following input messages refer to same xsd elements:
24
IMPROPER_WSDL_FILE = IWAT0837E Improper wsdl file
25
IMPROPER_WSDL_FILE = IWAT0837E Improper wsdl file
25
DEFINE_CAPABILITY_FROM_WSDL = Define capability from existing WSDL file:
26
DEFINE_CAPABILITY_FROM_WSDL = Define capability from existing WSDL file:
26
SPECIFY_EXISTING_WSDL = Please specify existing WSDL file
27
SPECIFY_EXISTING_WSDL = Please specify existing WSDL file
(-)src/org/eclipse/tptp/wsdm/tooling/wizard/mrt/internal/CapabilitySelectionWizardPage.java (-3 lines)
Lines 99-107 Link Here
99
		_capsViewer.setLabelProvider(_contentProvider.getLabelProvider());
99
		_capsViewer.setLabelProvider(_contentProvider.getLabelProvider());
100
		_capsViewer.setSorter(_contentProvider.getSorter());
100
		_capsViewer.setSorter(_contentProvider.getSorter());
101
101
102
		CategoryCollection collection = new CategoryCollection();
103
		Category[] categories = collection.getAllCategories();
104
		_capsViewer.setInput(Arrays.asList(categories));
105
		initialize();
102
		initialize();
106
		hookAllListeners();
103
		hookAllListeners();
107
		setControl(container);
104
		setControl(container);

Return to bug 165544