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

Collapse All | Expand All

(-)plugin.properties (+21 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2006 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
# 	Balan Subramanian (bsubram@us.ibm.com)
10
#     IBM Corporation - initial API and implementation
11
###############################################################################
12
13
###############################################################################
14
#  JAVA properties
15
###############################################################################
16
17
# NLS_ENCODING=UTF-8
18
# NLS_MESSAGEFORMAT_VAR
19
20
plugin.name=Apache Axis2
21
plugin.provider=Eclipse.org
(-).project (+22 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.apache.axis2</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.pde.ManifestBuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.SchemaBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
	</buildSpec>
19
	<natures>
20
		<nature>org.eclipse.pde.PluginNature</nature>
21
	</natures>
22
</projectDescription>
(-)META-INF/MANIFEST.MF (+7 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %plugin.name
4
Bundle-SymbolicName: org.apache.axis2
5
Bundle-Version: 1.1.0
6
Bundle-Vendor: %plugin.provider
7
Bundle-RequiredExecutionEnvironment: J2SE-1.4
(-)build.properties (+1 lines)
Added Link Here
1
bin.includes = META-INF/
(-)src/org/eclipse/tptp/wsdm/tooling/util/internal/EclipseUtils.java (+14 lines)
Lines 345-348 Link Here
345
		String ns2 = Activator.getPlugin().getBundle().getSymbolicName();
345
		String ns2 = Activator.getPlugin().getBundle().getSymbolicName();
346
		return ns2;
346
		return ns2;
347
	}
347
	}
348
	
349
	public static String getPluginResourceLocation(String pluginName, String resourceRelativePath) throws Exception
350
	{
351
		Bundle bundle = Platform.getBundle(pluginName);
352
		if (bundle == null)
353
			throw new Exception(Messages.bind(Messages.UNRESOLVED_BUNDLE_ERROR_, pluginName));
354
		URL url = null;
355
		if(resourceRelativePath == null)
356
			url = FileLocator.find(bundle,new Path(""),null);
357
		else
358
			url = FileLocator.find(bundle,new Path(resourceRelativePath),null);
359
		url = FileLocator.resolve(url);
360
		return url.getFile();
361
	}
348
}
362
}
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java (+1 lines)
Lines 146-151 Link Here
146
	public static String CODE_GEN_ERROR_AXIS2;
146
	public static String CODE_GEN_ERROR_AXIS2;
147
	public static String FAILED_TO_INITIALIZE_MUSE_DESCRIPTOR_ERROR_;
147
	public static String FAILED_TO_INITIALIZE_MUSE_DESCRIPTOR_ERROR_;
148
	public static String CODE_GEN_VALIDATE_SLOCATION;
148
	public static String CODE_GEN_VALIDATE_SLOCATION;
149
	public static String USE_BUILT_IN_AXIS2_LABEL;
149
	public static String CODEGEN_PREF_SERVERLOC;
150
	public static String CODEGEN_PREF_SERVERLOC;
150
	public static String CODE_GEN_AXIS2_PROJECT_DIR;
151
	public static String CODE_GEN_AXIS2_PROJECT_DIR;
151
	public static String CODE_GEN_AXIS2_LOCATION_ERROR_;
152
	public static String CODE_GEN_AXIS2_LOCATION_ERROR_;
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties (+1 lines)
Lines 140-145 Link Here
140
CODE_GEN_ERROR_AXIS2 = IWAT0829E Invalid Axis2 Server Location
140
CODE_GEN_ERROR_AXIS2 = IWAT0829E Invalid Axis2 Server Location
141
FAILED_TO_INITIALIZE_MUSE_DESCRIPTOR_ERROR_ = IWAT0682E Failed to initialize muse descriptor
141
FAILED_TO_INITIALIZE_MUSE_DESCRIPTOR_ERROR_ = IWAT0682E Failed to initialize muse descriptor
142
CODE_GEN_VALIDATE_SLOCATION = Validating the Server Location 
142
CODE_GEN_VALIDATE_SLOCATION = Validating the Server Location 
143
USE_BUILT_IN_AXIS2_LABEL = Use built-in Apache Axis2 (1.1)
143
CODEGEN_PREF_SERVERLOC = Please specify Axis2 server location:
144
CODEGEN_PREF_SERVERLOC = Please specify Axis2 server location:
144
CODE_GEN_AXIS2_PROJECT_DIR = Please specify server home location
145
CODE_GEN_AXIS2_PROJECT_DIR = Please specify server home location
145
CODE_GEN_AXIS2_LOCATION_ERROR_ = IWAT0830E Specified location {0} does not exist
146
CODE_GEN_AXIS2_LOCATION_ERROR_ = IWAT0830E Specified location {0} does not exist
(-)src/org/eclipse/tptp/wsdm/tooling/preferences/internal/Axis2ServerLocationPreferencePage.java (-42 / +105 lines)
Lines 27-50 Link Here
27
import org.eclipse.swt.widgets.DirectoryDialog;
27
import org.eclipse.swt.widgets.DirectoryDialog;
28
import org.eclipse.swt.widgets.Label;
28
import org.eclipse.swt.widgets.Label;
29
import org.eclipse.swt.widgets.Text;
29
import org.eclipse.swt.widgets.Text;
30
import org.eclipse.tptp.wsdm.tooling.codegen.mrt.internal.Axis2LicenseDialog;
30
import org.eclipse.tptp.wsdm.tooling.codegen.mrt.internal.ISoapServerDependency;
31
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
31
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
32
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
32
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
33
import org.eclipse.tptp.wsdm.tooling.validation.util.internal.ValidationUtils;
33
import org.eclipse.ui.IWorkbench;
34
import org.eclipse.ui.IWorkbench;
34
import org.eclipse.ui.IWorkbenchPreferencePage;
35
import org.eclipse.ui.IWorkbenchPreferencePage;
35
36
36
/**
37
/**
37
 * The class is used to create the Preference page for the MRT Editor.
38
 * The class is used to create the Preference page for the Axis jars used in code generation.
38
 * It is used to set Axis2 Server Location.
39
 * It is used to set Axis2 Server Location.
39
 *
40
 *
40
 */
41
 */
41
public class Axis2ServerLocationPreferencePage extends PreferencePage implements IWorkbenchPreferencePage 
42
public class Axis2ServerLocationPreferencePage extends PreferencePage implements IWorkbenchPreferencePage 
42
{
43
{
43
44
45
	private Button _useBuiltInAxis2Button;
46
	
44
	private Text _serverLocation;
47
	private Text _serverLocation;
45
	
48
	
46
	private Button _browseButton;
49
	private Button _browseButton;
47
	
50
	
51
	private ISoapServerDependency _axisValidator;
52
	
53
	public static final String USE_BUILT_IN_AXIS2_PREFERENCE_KEY = "MRT_CODE_GEN.USE_BUILT_IN_AXIS2";
54
	
48
	public static final String SERVER_LOCATION_PREFERENCE_KEY = "MRT_CODE_GEN.AXIS2_SERVER_LOCATION";
55
	public static final String SERVER_LOCATION_PREFERENCE_KEY = "MRT_CODE_GEN.AXIS2_SERVER_LOCATION";
49
	
56
	
50
	/**
57
	/**
Lines 52-58 Link Here
52
	 */
59
	 */
53
	public Axis2ServerLocationPreferencePage() 
60
	public Axis2ServerLocationPreferencePage() 
54
	{
61
	{
55
		init();
56
	}
62
	}
57
63
58
	/**
64
	/**
Lines 62-74 Link Here
62
	public Axis2ServerLocationPreferencePage(String title) 
68
	public Axis2ServerLocationPreferencePage(String title) 
63
	{
69
	{
64
		super(title);
70
		super(title);
65
		init();
66
	}
71
	}
67
72
68
	public Axis2ServerLocationPreferencePage(String title, ImageDescriptor image) 
73
	public Axis2ServerLocationPreferencePage(String title, ImageDescriptor image) 
69
	{
74
	{
70
		super(title, image);
75
		super(title, image);
71
		init();
72
	}
76
	}
73
77
74
	protected Control createContents(Composite parent) 
78
	protected Control createContents(Composite parent) 
Lines 76-107 Link Here
76
		Composite composite = new Composite(parent, SWT.NONE);
80
		Composite composite = new Composite(parent, SWT.NONE);
77
		GridLayout layout = new GridLayout();
81
		GridLayout layout = new GridLayout();
78
		layout.numColumns = 2;
82
		layout.numColumns = 2;
79
		composite.setLayout(layout);
83
		composite.setLayout(layout);		
80
		
84
		
85
		_useBuiltInAxis2Button = new Button(composite, SWT.CHECK);
81
		GridData data = new GridData();
86
		GridData data = new GridData();
82
		data.horizontalSpan = 2;
87
		data.horizontalSpan = 2;
83
		data.grabExcessHorizontalSpace = true;
88
		data.grabExcessHorizontalSpace = true;
89
		_useBuiltInAxis2Button.setLayoutData(data);
90
		_useBuiltInAxis2Button.setText(Messages.USE_BUILT_IN_AXIS2_LABEL);
91
		_useBuiltInAxis2Button.addSelectionListener(new SelectionAdapter() 
92
		{
93
			public void widgetSelected(SelectionEvent event) 
94
			{
95
				handleUseBuiltInAxis2Button();
96
			}
97
		});
98
		
84
		Label label = new Label(composite, SWT.NONE);
99
		Label label = new Label(composite, SWT.NONE);
100
		data = new GridData();
101
		data.horizontalSpan = 2;
102
		data.grabExcessHorizontalSpace = true;
85
		label.setLayoutData(data);
103
		label.setLayoutData(data);
86
		String labelText = Messages.CODEGEN_PREF_SERVERLOC;
104
		String labelText = Messages.CODEGEN_PREF_SERVERLOC;
87
		label.setText(labelText);
105
		label.setText(labelText);
88
		
106
		
89
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
107
		_serverLocation = new Text(composite, SWT.BORDER);
90
		String ss = store.getString(SERVER_LOCATION_PREFERENCE_KEY);
91
		data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
108
		data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
92
		data.grabExcessHorizontalSpace = true;
109
		data.grabExcessHorizontalSpace = true;
93
		data.horizontalSpan = 1;
110
		data.horizontalSpan = 1;
94
		data.widthHint = 240;
111
		data.widthHint = 240;
95
	
96
		_serverLocation = new Text(composite, SWT.BORDER);
97
		_serverLocation.setLayoutData(data);
112
		_serverLocation.setLayoutData(data);
98
		
113
		
99
		String runtime = "";
100
		if (runtime != null || runtime.length() > 0)
101
			_serverLocation.setText(ss);
102
		else
103
			_serverLocation.setText("");
104
		
105
		_browseButton = new Button(composite, SWT.PUSH);
114
		_browseButton = new Button(composite, SWT.PUSH);
106
		_browseButton.setText(Messages.HOOKUP_WIZARD_TXT5);
115
		_browseButton.setText(Messages.HOOKUP_WIZARD_TXT5);
107
		_browseButton.addSelectionListener(new SelectionAdapter() 
116
		_browseButton.addSelectionListener(new SelectionAdapter() 
Lines 110-121 Link Here
110
			{
119
			{
111
				handleLocationBrowseButtonPressed();
120
				handleLocationBrowseButtonPressed();
112
			}
121
			}
113
		});		
122
		});
123
		
124
		initializeControls();
125
		
114
		return composite;
126
		return composite;
115
	}
127
	}
128
	
129
	private void initializeControls()
130
	{
131
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
132
		boolean useBuiltInAxis2 = store.getBoolean(USE_BUILT_IN_AXIS2_PREFERENCE_KEY);
133
		_useBuiltInAxis2Button.setSelection(useBuiltInAxis2);
134
		_serverLocation.setEnabled(!useBuiltInAxis2);
135
		_browseButton.setEnabled(!useBuiltInAxis2);
136
		
137
		String runtime = store.getString(SERVER_LOCATION_PREFERENCE_KEY);		
138
		if (runtime != null || runtime.length() > 0)
139
		{
140
			_serverLocation.setText(runtime);
141
			if(!useBuiltInAxis2)
142
			{
143
				String errorMessage = _axisValidator.validateSoapServerHome(runtime);
144
				setErrorMessage(errorMessage);
145
			}			
146
		}			
147
		else
148
			_serverLocation.setText("");
149
	}
116
150
117
	public void init(IWorkbench workbench) 
151
	public void init(IWorkbench workbench) 
118
	{
152
	{
153
		_axisValidator = ValidationUtils.getAllAxisValidators()[0];		
154
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
155
		store.setDefault(SERVER_LOCATION_PREFERENCE_KEY,"");
156
		store.setDefault(USE_BUILT_IN_AXIS2_PREFERENCE_KEY, true);
157
	}
158
	
159
	private void handleUseBuiltInAxis2Button()
160
	{
161
		boolean useBuiltInAxis2 = _useBuiltInAxis2Button.getSelection();
162
		_serverLocation.setEnabled(!useBuiltInAxis2);
163
		_browseButton.setEnabled(!useBuiltInAxis2);
164
		if(useBuiltInAxis2)
165
			setErrorMessage(null);
166
		else
167
			setErrorMessage(_axisValidator.validateSoapServerHome(_serverLocation.getText()));
119
	}
168
	}
120
	
169
	
121
	private void handleLocationBrowseButtonPressed() 
170
	private void handleLocationBrowseButtonPressed() 
Lines 126-174 Link Here
126
		selectedDirectory = dialog.open();
175
		selectedDirectory = dialog.open();
127
		
176
		
128
		if (selectedDirectory != null)
177
		if (selectedDirectory != null)
129
			_serverLocation.setText(TextProcessor.process(selectedDirectory));
178
		{
179
			String selectedPath = TextProcessor.process(selectedDirectory);
180
			_serverLocation.setText(selectedPath);
181
			setErrorMessage(_axisValidator.validateSoapServerHome(selectedPath));
182
		}
183
			
130
	}
184
	}
131
		
185
		
132
	protected void performDefaults() 
186
	protected void performDefaults() 
133
	{
187
	{
134
		super.performDefaults();
188
		super.performDefaults();
135
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
189
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
136
		String defaultValue = store.getDefaultString(SERVER_LOCATION_PREFERENCE_KEY);
190
		boolean useBuiltInAxis2 = store.getDefaultBoolean(USE_BUILT_IN_AXIS2_PREFERENCE_KEY);
137
		_serverLocation.setText(defaultValue);
191
		String runtime = store.getDefaultString(SERVER_LOCATION_PREFERENCE_KEY);
192
		_serverLocation.setText(runtime);
193
		_useBuiltInAxis2Button.setSelection(useBuiltInAxis2);
194
		_serverLocation.setEnabled(!useBuiltInAxis2);
195
		_browseButton.setEnabled(!useBuiltInAxis2);
196
		setErrorMessage(null);
138
    }
197
    }
139
198
140
	protected void performApply()
199
	protected void performApply()
141
	{
200
	{
142
		popupAxis2LicenseDialog();		
201
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
202
		boolean useBuiltInAxis2 = _useBuiltInAxis2Button.getSelection();
203
		if(!useBuiltInAxis2)
204
		{
205
			String errorMessage = validateAxisLocation();
206
			setErrorMessage(errorMessage);
207
			if(errorMessage!=null)
208
				return;
209
		}
210
		
211
		store.setValue(USE_BUILT_IN_AXIS2_PREFERENCE_KEY, useBuiltInAxis2);
212
		store.setValue(SERVER_LOCATION_PREFERENCE_KEY, _serverLocation.getText());
143
	}
213
	}
144
	
214
	
145
	public boolean performOk()
215
	public boolean performOk()
146
	{
216
	{
147
		popupAxis2LicenseDialog();		
148
		return true;
149
	}
150
	
151
	private void popupAxis2LicenseDialog()
152
	{
153
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
217
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
154
		String oldLocation = store.getString(SERVER_LOCATION_PREFERENCE_KEY);
218
		boolean useBuiltInAxis2 = _useBuiltInAxis2Button.getSelection();
155
		String newLocation = _serverLocation.getText();
219
		
156
		if(newLocation == null || newLocation.equals(""))
220
		if(!useBuiltInAxis2)
157
			store.setValue(SERVER_LOCATION_PREFERENCE_KEY,_serverLocation.getText());
158
		else
159
		{
221
		{
160
			if(!newLocation.equals(oldLocation))
222
			String errorMessage = validateAxisLocation();
161
			{
223
			setErrorMessage(errorMessage);
162
				int result = new Axis2LicenseDialog().showWindow();
224
			if(errorMessage!=null)
163
				if(result == Axis2LicenseDialog.AGREE)
225
				return false;
164
					store.setValue(SERVER_LOCATION_PREFERENCE_KEY,_serverLocation.getText());
165
			}
166
		}
226
		}
227
		store.setValue(USE_BUILT_IN_AXIS2_PREFERENCE_KEY, useBuiltInAxis2);
228
		store.setValue(SERVER_LOCATION_PREFERENCE_KEY, _serverLocation.getText());
229
		return true;
167
	}
230
	}
168
231
	
169
	private void init()
232
	private String validateAxisLocation()
170
	{
233
	{
171
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
234
		String newLocation = _serverLocation.getText();
172
		store.setDefault(SERVER_LOCATION_PREFERENCE_KEY,"");		
235
		return _axisValidator.validateSoapServerHome(newLocation);
173
	}
236
	}
174
}
237
}
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/internal/GenerationOptionsPage.java (-6 / +50 lines)
Lines 12-17 Link Here
12
12
13
package org.eclipse.tptp.wsdm.tooling.codegen.mrt.internal;
13
package org.eclipse.tptp.wsdm.tooling.codegen.mrt.internal;
14
14
15
import java.io.IOException;
15
import java.util.HashMap;
16
import java.util.HashMap;
16
import java.util.Iterator;
17
import java.util.Iterator;
17
import java.util.Map;
18
import java.util.Map;
Lines 58-64 Link Here
58
import org.eclipse.tptp.wsdm.tooling.editor.mrt.relationship.dialog.internal.MemoryComboBox;
59
import org.eclipse.tptp.wsdm.tooling.editor.mrt.relationship.dialog.internal.MemoryComboBox;
59
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
60
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
60
import org.eclipse.tptp.wsdm.tooling.preferences.internal.Axis2ServerLocationPreferencePage;
61
import org.eclipse.tptp.wsdm.tooling.preferences.internal.Axis2ServerLocationPreferencePage;
62
import org.eclipse.tptp.wsdm.tooling.util.internal.EclipseUtils;
61
import org.eclipse.tptp.wsdm.tooling.util.internal.Validation;
63
import org.eclipse.tptp.wsdm.tooling.util.internal.Validation;
64
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog;
62
import org.eclipse.tptp.wsdm.tooling.validation.util.internal.ValidationUtils;
65
import org.eclipse.tptp.wsdm.tooling.validation.util.internal.ValidationUtils;
63
66
64
/**
67
/**
Lines 71-76 Link Here
71
	
74
	
72
	private static final String EXT_PT = "codeGeneration";
75
	private static final String EXT_PT = "codeGeneration";
73
	
76
	
77
	private static final String IN_BUILT_AXIS2_PLUGIN = "org.apache.axis2";
78
	
74
	private Button _overwriteButton;
79
	private Button _overwriteButton;
75
80
76
	private Combo _projectNameField;
81
	private Combo _projectNameField;
Lines 535-540 Link Here
535
			return;
540
			return;
536
		}
541
		}
537
		
542
		
543
		// If the selected container is Axis2, then verify the Preference Page setting
544
		if ("Axis2".equals(_containerCombo.getText()))
545
		{
546
			String errorMessage = null;
547
			try 
548
			{
549
				errorMessage = validateAxis2Location();
550
			}
551
			catch (Exception e) 
552
			{
553
				updateStatus(e.getMessage());
554
				return;
555
			}
556
			if(errorMessage!=null)
557
			{
558
				updateStatus(errorMessage);
559
				return;
560
			}								
561
		}
562
		
538
		updateStatus(null, DialogPage.NONE);
563
		updateStatus(null, DialogPage.NONE);
539
	}
564
	}
540
565
Lines 652-661 Link Here
652
		MemoryComboBox.save(_projectNameField, PROJECT_MEMORY_COMBO_ID, Preferences.userNodeForPackage(GenerationOptionsPage.class));
677
		MemoryComboBox.save(_projectNameField, PROJECT_MEMORY_COMBO_ID, Preferences.userNodeForPackage(GenerationOptionsPage.class));
653
	}
678
	}
654
	
679
	
655
	private String validateLocation()
680
	private String validateAxis2Location() throws Exception
656
	{
681
	{
657
		String serverHome = getPreferenceServerLocation();
682
		String serverHome = getPreferenceServerLocation();		
658
		
659
		ISoapServerDependency axisValidators[] = ValidationUtils.getAllAxisValidators();
683
		ISoapServerDependency axisValidators[] = ValidationUtils.getAllAxisValidators();
660
		for(int i = 0 ; i < axisValidators.length ; i++){
684
		for(int i = 0 ; i < axisValidators.length ; i++){
661
			
685
			
Lines 676-691 Link Here
676
	 */
700
	 */
677
	public TargetedFileList[] getAxis2FilesToCopy()
701
	public TargetedFileList[] getAxis2FilesToCopy()
678
	{
702
	{
679
		validateLocation();
703
		try 
704
		{
705
			validateAxis2Location();
706
		} catch (Exception e) 
707
		{
708
			WsdmToolingLog.logError(e.getMessage(), e);
709
		}
680
		return _filesToCopy;
710
		return _filesToCopy;
681
	}
711
	}
682
	
712
	
683
	protected String getPreferenceServerLocation() 
713
	protected String getPreferenceServerLocation() throws Exception
684
	{
714
	{
685
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
715
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
716
		boolean useBuiltInAxis2 = store.getBoolean(Axis2ServerLocationPreferencePage.USE_BUILT_IN_AXIS2_PREFERENCE_KEY);
717
		// If user prefer the In-Built Axis2, then return the location of "org.eclipse.axis2" plugin
718
		if(useBuiltInAxis2)
719
		{
720
			return getBuiltInAxis2Location();			
721
		}
722
		// Return the user specified Axis2 location
686
		String location = store.getString(Axis2ServerLocationPreferencePage.SERVER_LOCATION_PREFERENCE_KEY).trim();
723
		String location = store.getString(Axis2ServerLocationPreferencePage.SERVER_LOCATION_PREFERENCE_KEY).trim();
687
		if(location != null && !location.equals(""))
724
		if(location != null && !location.equals(""))
688
			return location;
725
			return location;
689
		return "";
726
		// User didn't specify any location and didn't want to use In-Built Axis2
727
		// Its not a proper choice, so we go with In-Built Axis2
728
		return getBuiltInAxis2Location();
729
	}
730
	
731
	private String getBuiltInAxis2Location() throws Exception
732
	{
733
		return EclipseUtils.getPluginResourceLocation(IN_BUILT_AXIS2_PLUGIN, null);
690
	}
734
	}
691
}
735
}
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/internal/NewProjectWizard.java (-29 / +2 lines)
Lines 86-102 Link Here
86
86
87
	private DescriptorHelper _helper;
87
	private DescriptorHelper _helper;
88
88
89
	private String _serverLocation;
90
91
	private boolean _isAxis2Project;
89
	private boolean _isAxis2Project;
92
	private boolean updatePreference;
90
	
93
94
	private String _projectLocation;
91
	private String _projectLocation;
95
92
96
	private TargetedFileList[] _requiredAxis2Files;
93
	private TargetedFileList[] _requiredAxis2Files;
97
94
98
	private boolean _licenseAccepted = false;
99
100
	/**
95
	/**
101
	 * Class that creates the Code Generation Wizard to create new Project
96
	 * Class that creates the Code Generation Wizard to create new Project
102
	 * 
97
	 * 
Lines 119-136 Link Here
119
		ImageDescriptor imgDescrTP = ExtendedImageRegistry.INSTANCE.getImageDescriptor(imgTP);
114
		ImageDescriptor imgDescrTP = ExtendedImageRegistry.INSTANCE.getImageDescriptor(imgTP);
120
		setDefaultPageImageDescriptor(imgDescrTP);
115
		setDefaultPageImageDescriptor(imgDescrTP);
121
	}
116
	}
122
117
	
123
	private void popupAxis2LicenseDialog() {
124
		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
125
		String preferencesLocation = store.getString(Axis2ServerLocationPreferencePage.SERVER_LOCATION_PREFERENCE_KEY);
126
		if (!_serverLocation.equals(preferencesLocation)) {
127
			int result = new Axis2LicenseDialog().showWindow();
128
			_licenseAccepted = (result == Axis2LicenseDialog.AGREE);
129
		} else
130
			_licenseAccepted = true;
131
132
	}
133
134
	private void performFinish(IProgressMonitor monitor) throws InvocationTargetException {
118
	private void performFinish(IProgressMonitor monitor) throws InvocationTargetException {
135
		try {
119
		try {
136
			monitor.beginTask(Messages.CODE_GEN_START, 7);
120
			monitor.beginTask(Messages.CODE_GEN_START, 7);
Lines 139-151 Link Here
139
				try {
123
				try {
140
					// Step 1: Validate the server path
124
					// Step 1: Validate the server path
141
					monitor.subTask(Messages.CODE_GEN_VALIDATE_SLOCATION);
125
					monitor.subTask(Messages.CODE_GEN_VALIDATE_SLOCATION);
142
					// Step 2 : Update the Preferences, if needed
143
					if (updatePreference) {
144
						IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
145
						store.setValue(Axis2ServerLocationPreferencePage.SERVER_LOCATION_PREFERENCE_KEY,
146
								_serverLocation);
147
						// Update the Lib and module location
148
					}
149
					_requiredAxis2Files = _generationOptionsPage.getAxis2FilesToCopy();
126
					_requiredAxis2Files = _generationOptionsPage.getAxis2FilesToCopy();
150
				} catch (Exception e) {
127
				} catch (Exception e) {
151
					throw new RuntimeException(e);
128
					throw new RuntimeException(e);
Lines 208-217 Link Here
208
		_projectName = _generationOptionsPage.getProjectName();
185
		_projectName = _generationOptionsPage.getProjectName();
209
		_projectLocation = _generationOptionsPage.getProjectLocation();
186
		_projectLocation = _generationOptionsPage.getProjectLocation();
210
187
211
		if (_isAxis2Project) {
212
			_serverLocation = _generationOptionsPage.getPreferenceServerLocation();
213
		}
214
215
		IRunnableWithProgress runnable = new IRunnableWithProgress() {
188
		IRunnableWithProgress runnable = new IRunnableWithProgress() {
216
			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
189
			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
217
				performFinish(monitor);
190
				performFinish(monitor);
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/capability/internal/messages.properties (+1 lines)
Lines 148-150 Link Here
148
INVALID_RMD_XML_MESSAGE = IWAT0785E RMD file is not a valid xml
148
INVALID_RMD_XML_MESSAGE = IWAT0785E RMD file is not a valid xml
149
PROP_SCHEMA_MISSING_MESSAGE = IWAT0786E One of the properties schema file for this capability is missing
149
PROP_SCHEMA_MISSING_MESSAGE = IWAT0786E One of the properties schema file for this capability is missing
150
RMD_FILE_MISSING_MESSAGE = IWAT0787E RMD file for this capability is missing
150
RMD_FILE_MISSING_MESSAGE = IWAT0787E RMD file for this capability is missing
151
UNRESOLVED_BUNDLE_ERROR_ = IWAT0885E Unresolved bundle : {0}
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/capability/internal/Messages.java (+1 lines)
Lines 157-162 Link Here
157
	public static String INVALID_RMD_XML_MESSAGE;
157
	public static String INVALID_RMD_XML_MESSAGE;
158
	public static String PROP_SCHEMA_MISSING_MESSAGE;
158
	public static String PROP_SCHEMA_MISSING_MESSAGE;
159
	public static String RMD_FILE_MISSING_MESSAGE;
159
	public static String RMD_FILE_MISSING_MESSAGE;
160
	public static String UNRESOLVED_BUNDLE_ERROR_;
160
161
161
	static
162
	static
162
	{
163
	{

Return to bug 188895