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

Collapse All | Expand All

(-)src/org/eclipse/tptp/wsdm/tooling/wizard/capability/internal/NewCapabilityWizard.java (-26 / +22 lines)
Lines 66-73 Link Here
66
import org.eclipse.wst.wsdl.PortType;
66
import org.eclipse.wst.wsdl.PortType;
67
import org.eclipse.wst.wsdl.Types;
67
import org.eclipse.wst.wsdl.Types;
68
import org.eclipse.wst.wsdl.WSDLFactory;
68
import org.eclipse.wst.wsdl.WSDLFactory;
69
import org.eclipse.wst.wsdl.internal.impl.InputImpl;
70
import org.eclipse.wst.wsdl.internal.impl.OutputImpl;
71
import org.eclipse.wst.wsdl.util.WSDLConstants;
69
import org.eclipse.wst.wsdl.util.WSDLConstants;
72
import org.eclipse.xsd.XSDAnnotation;
70
import org.eclipse.xsd.XSDAnnotation;
73
import org.eclipse.xsd.XSDComplexTypeDefinition;
71
import org.eclipse.xsd.XSDComplexTypeDefinition;
Lines 608-640 Link Here
608
	List importFaults = importOp.getEFaults();
606
	List importFaults = importOp.getEFaults();
609
607
610
	if (importInput != null) {	    
608
	if (importInput != null) {	    
611
	    InputImpl newInput = (InputImpl) WSDLFactory.eINSTANCE.createInput();
609
		Input newInput = WSDLFactory.eINSTANCE.createInput();
612
	    newInput.setEnclosingDefinition(_wsdlCapDefinition);
610
		newInput.setEnclosingDefinition(_wsdlCapDefinition);
613
	    Element element = newInput.createElement();
611
		if(importInput.getName()!=null)
614
	    if(importInput.getName()!=null)
612
			newInput.setName(importInput.getName());
615
		newInput.setName(importInput.getName());
613
		newInput.setEMessage(importInput.getEMessage());
616
	    newInput.setEMessage(importInput.getEMessage());
614
		newOperation.setEInput(newInput);
617
	    WsdlUtils.createOrFindPrefix(_wsdlCapDefinition, WsdmConstants.WSA_URI, WsdmConstants.WSA_PREFIX);
615
		WsdlUtils.createOrFindPrefix(_wsdlCapDefinition, WsdmConstants.WSA_URI, WsdmConstants.WSA_PREFIX);
618
	    String opName = importOp.getName();
616
		String opName = importOp.getName();
619
	    opName = opName.substring(0, 1).toUpperCase() + opName.substring(1);
617
 	    opName = opName.substring(0, 1).toUpperCase() + opName.substring(1);
620
	    String action = capNS+opName+"Request";	    
618
 	    String action = capNS+opName+"Request";	    
621
	    newInput.getElement().setAttributeNS(WsdmConstants.WSA_URI, WsdmConstants.WSA_ACTION_NAME, action);
619
 	    newInput.getElement().setAttributeNS(WsdmConstants.WSA_URI, WsdmConstants.WSA_ACTION_NAME, action);
622
	    newOperation.setEInput(newInput);
620
	}
623
	}
621
624
622
	if (importOutput != null) {
625
	if (importOutput != null) {	    
623
		Output newOutput = WSDLFactory.eINSTANCE.createOutput();
626
	    OutputImpl newOutput = (OutputImpl) WSDLFactory.eINSTANCE.createOutput();
624
		newOutput.setEnclosingDefinition(_wsdlCapDefinition);
627
	    newOutput.setEnclosingDefinition(_wsdlCapDefinition);
625
		if(importOutput.getName()!=null)
628
	    Element element = newOutput.createElement();
626
			newOutput.setName(importOutput.getName());
629
	    if(importOutput.getName()!=null)
627
		newOutput.setEMessage(importOutput.getEMessage());
630
		newOutput.setName(importOutput.getName());
628
		newOperation.setEOutput(newOutput);
631
	    newOutput.setEMessage(importOutput.getEMessage());
629
		WsdlUtils.createOrFindPrefix(_wsdlCapDefinition, WsdmConstants.WSA_URI, WsdmConstants.WSA_PREFIX);		
632
	    WsdlUtils.createOrFindPrefix(_wsdlCapDefinition, WsdmConstants.WSA_URI, WsdmConstants.WSA_PREFIX);
633
	    String opName = importOp.getName();
630
	    String opName = importOp.getName();
634
	    opName = opName.substring(0, 1).toUpperCase() + opName.substring(1);
631
	    opName = opName.substring(0, 1).toUpperCase() + opName.substring(1);
635
	    String action = capNS+opName+"Response";	    
632
	    String action = capNS+opName+"Response";	    
636
	    newOutput.getElement().setAttributeNS(WsdmConstants.WSA_URI, WsdmConstants.WSA_ACTION_NAME, action);
633
	    newOutput.getElement().setAttributeNS(WsdmConstants.WSA_URI, WsdmConstants.WSA_ACTION_NAME, action);	    
637
	    newOperation.setEOutput(newOutput);
638
	}
634
	}
639
635
640
	for (int i = 0; i < importFaults.size(); i++) {
636
	for (int i = 0; i < importFaults.size(); i++) {
(-)src/org/eclipse/tptp/wsdm/tooling/dialog/provisional/IFileBrowserDialog.java (-3 / +52 lines)
Lines 21-30 Link Here
21
import org.eclipse.core.resources.ResourcesPlugin;
21
import org.eclipse.core.resources.ResourcesPlugin;
22
import org.eclipse.core.runtime.CoreException;
22
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.IStatus;
24
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
25
import org.eclipse.jface.viewers.Viewer;
24
import org.eclipse.jface.viewers.Viewer;
26
import org.eclipse.jface.viewers.ViewerFilter;
25
import org.eclipse.jface.viewers.ViewerFilter;
27
import org.eclipse.swt.widgets.Shell;
26
import org.eclipse.swt.widgets.Shell;
27
import org.eclipse.tptp.wsdm.tooling.editor.capability.internal.CapabilityEditorPlugin;
28
import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages;
28
import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages;
29
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
29
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
30
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
30
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
Lines 166-174 Link Here
166
class IFileSelectionStatusValidator implements ISelectionStatusValidator
166
class IFileSelectionStatusValidator implements ISelectionStatusValidator
167
{
167
{
168
168
169
    private IStatus ErrorStatus = new StatusInfo(IStatus.ERROR, "");
169
	private IStatus ErrorStatus = new Status(IStatus.ERROR, "");
170
170
171
    private IStatus OKStatus = new StatusInfo();
171
	private IStatus OKStatus = new Status(IStatus.OK, "");
172
172
173
    public IStatus validate(Object[] selection)
173
    public IStatus validate(Object[] selection)
174
    {
174
    {
Lines 193-195 Link Here
193
    }
193
    }
194
194
195
}
195
}
196
197
198
199
class Status implements IStatus
200
{
201
	private int _severity;
202
	private String _message;
203
	
204
	Status(int severity, String message){
205
		_severity = severity;
206
		_message = message;
207
	}
208
	
209
	public IStatus[] getChildren() {
210
		return new IStatus[0];
211
	}
212
213
	public int getCode() {
214
		return _severity;
215
	}
216
217
	public Throwable getException() {
218
		return null;
219
	}
220
221
	public String getMessage() {
222
		return _message;
223
	}
224
225
	public String getPlugin() {
226
		return CapabilityEditorPlugin.PLUGIN_ID;
227
	}
228
229
	public int getSeverity() {
230
		return _severity;
231
	}
232
233
	public boolean isMultiStatus() {
234
		return false;
235
	}
236
237
	public boolean isOK() {
238
		return _severity == IStatus.OK;
239
	}
240
241
	public boolean matches(int severityMask) {
242
		return (_severity & severityMask) != 0;
243
	}	
244
}
(-)src/org/eclipse/tptp/wsdm/tooling/editor/capability/pages/overview/internal/DetailsSection.java (-3 / +1 lines)
Lines 40-46 Link Here
40
import org.eclipse.ui.forms.widgets.FormToolkit;
40
import org.eclipse.ui.forms.widgets.FormToolkit;
41
import org.eclipse.ui.forms.widgets.ScrolledForm;
41
import org.eclipse.ui.forms.widgets.ScrolledForm;
42
import org.eclipse.wst.wsdl.Definition;
42
import org.eclipse.wst.wsdl.Definition;
43
import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
44
43
45
/**
44
/**
46
 * 
45
 * 
Lines 182-189 Link Here
182
	    {
181
	    {
183
		if (!_dialogThrown)
182
		if (!_dialogThrown)
184
		{
183
		{
185
		    DefinitionImpl definition = (DefinitionImpl) _editor
184
		    Definition definition =  _editor.getCapabilityDomain().getDefinition();
186
			    .getCapabilityDomain().getDefinition();
187
		    List importsWsdl = definition.getImports(definition
185
		    List importsWsdl = definition.getImports(definition
188
			    .getTargetNamespace());
186
			    .getTargetNamespace());
189
		    if (importsWsdl.size() > 0)
187
		    if (importsWsdl.size() > 0)
(-)src/org/eclipse/tptp/wsdm/tooling/util/internal/WsdlUtils.java (-3 / +19 lines)
Lines 32-37 Link Here
32
import org.eclipse.emf.common.util.URI;
32
import org.eclipse.emf.common.util.URI;
33
import org.eclipse.emf.ecore.resource.Resource;
33
import org.eclipse.emf.ecore.resource.Resource;
34
import org.eclipse.emf.ecore.resource.ResourceSet;
34
import org.eclipse.emf.ecore.resource.ResourceSet;
35
import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
35
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
36
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
36
import org.eclipse.osgi.util.NLS;
37
import org.eclipse.osgi.util.NLS;
37
import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages;
38
import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages;
Lines 45-51 Link Here
45
import org.eclipse.wst.wsdl.Types;
46
import org.eclipse.wst.wsdl.Types;
46
import org.eclipse.wst.wsdl.WSDLFactory;
47
import org.eclipse.wst.wsdl.WSDLFactory;
47
import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
48
import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
48
import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
49
import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
49
import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
50
import org.eclipse.xsd.XSDComplexTypeDefinition;
50
import org.eclipse.xsd.XSDComplexTypeDefinition;
51
import org.eclipse.xsd.XSDDerivationMethod;
51
import org.eclipse.xsd.XSDDerivationMethod;
Lines 108-114 Link Here
108
    {
108
    {
109
	ResourceSet resourceSet = new ResourceSetImpl();
109
	ResourceSet resourceSet = new ResourceSetImpl();
110
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
110
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
111
		.put("*.wsdl", new WSDLResourceFactoryImpl());
111
		.put("*.wsdl", new CustomWSDLResourceFactoryImpl());
112
	WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl) resourceSet
112
	WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl) resourceSet
113
		.createResource(URI.createURI("*.wsdl"));
113
		.createResource(URI.createURI("*.wsdl"));
114
	wsdlMainResource.setURI(wsdlURI);
114
	wsdlMainResource.setURI(wsdlURI);
Lines 311-317 Link Here
311
	}
311
	}
312
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
312
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
313
		.put(Resource.Factory.Registry.DEFAULT_EXTENSION,
313
		.put(Resource.Factory.Registry.DEFAULT_EXTENSION,
314
			new WSDLResourceFactoryImpl());
314
			new CustomWSDLResourceFactoryImpl());
315
	URI wsdlFileURI = URI.createPlatformResourceURI(fileURI);
315
	URI wsdlFileURI = URI.createPlatformResourceURI(fileURI);
316
	Resource resource = resourceSet.createResource(wsdlFileURI);
316
	Resource resource = resourceSet.createResource(wsdlFileURI);
317
	resource.getContents().add(definition);
317
	resource.getContents().add(definition);
Lines 1046-1048 Link Here
1046
	return wsdlLocation;
1046
	return wsdlLocation;
1047
    }
1047
    }
1048
}
1048
}
1049
1050
1051
class CustomWSDLResourceFactoryImpl extends ResourceFactoryImpl
1052
{	
1053
	public CustomWSDLResourceFactoryImpl()
1054
    {
1055
    }
1056
1057
    public Resource createResource(URI uri)
1058
    {
1059
        Resource result = new WSDLResourceImpl(uri);
1060
        return result;
1061
    }
1062
}
1063
1064

Return to bug 161932