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

Collapse All | Expand All

(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/validation/internal/Messages.java (+2 lines)
Lines 43-48 Link Here
43
43
44
	public static String INVALID_XML_MESSAGE;
44
	public static String INVALID_XML_MESSAGE;
45
45
46
	public static String COULDNT_FIND_AXIS_VALIDATOR_EXT;
47
	public static String COULDNT_FIND_AXIS_VALIDATOR;
46
	static
48
	static
47
	{
49
	{
48
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
50
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/validation/internal/messages.properties (+3 lines)
Lines 39-41 Link Here
39
FAILED_TO_CLOSE_IS = Failed to close the open inputstream
39
FAILED_TO_CLOSE_IS = Failed to close the open inputstream
40
40
41
INVALID_XML_MESSAGE = Invalid xml file : {0} 
41
INVALID_XML_MESSAGE = Invalid xml file : {0} 
42
43
COULDNT_FIND_AXIS_VALIDATOR_EXT = Cannot find axisValidator extension
44
COULDNT_FIND_AXIS_VALIDATOR = Found no axisValidator
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java (-2 / +4 lines)
Lines 144-153 Link Here
144
	public static String CODEGEN_PREF_SERVERLOC;
144
	public static String CODEGEN_PREF_SERVERLOC;
145
	public static String CODE_GEN_AXIS2_PROJECT_DIR;
145
	public static String CODE_GEN_AXIS2_PROJECT_DIR;
146
	public static String CODE_GEN_AXIS2_LOCATION_ERROR;
146
	public static String CODE_GEN_AXIS2_LOCATION_ERROR;
147
	public static String CODE_GEN_AXIS2_INSTAL_LOC_ERROR;
148
	public static String PORT_TO_LISTEN_FOR_OSGI_ENDPOINT;
147
	public static String PORT_TO_LISTEN_FOR_OSGI_ENDPOINT;
149
	public static String MUST_RESTART_TO_APPLY;
148
	public static String MUST_RESTART_TO_APPLY;
150
	
149
	public static String CODE_GEN_AXIS2_LIB_LOC_ERROR;
150
	public static String CODE_GEN_INVALID_JAR_PATTER;
151
	public static String CODE_GEN_INVALID_MAR_PATTER;
152
151
	static
153
	static
152
	{
154
	{
153
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
155
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties (-3 / +5 lines)
Lines 137-144 Link Here
137
FAILED_TO_INITIALIZE_MUSE_DESCRIPTOR_ERROR_ = IWAT0682E Failed to initialize muse descriptor
137
FAILED_TO_INITIALIZE_MUSE_DESCRIPTOR_ERROR_ = IWAT0682E Failed to initialize muse descriptor
138
CODE_GEN_VALIDATE_SLOCATION = Validating the Server Location 
138
CODE_GEN_VALIDATE_SLOCATION = Validating the Server Location 
139
CODEGEN_PREF_SERVERLOC = Please specify Axis2 server location:
139
CODEGEN_PREF_SERVERLOC = Please specify Axis2 server location:
140
CODE_GEN_AXIS2_PROJECT_DIR = Axis2 Server directory must be specified
140
CODE_GEN_AXIS2_PROJECT_DIR = Please specify server home location
141
CODE_GEN_AXIS2_LOCATION_ERROR = Invalid Axis2 Server location path
141
CODE_GEN_AXIS2_LOCATION_ERROR = Specified location {0} did not exists
142
CODE_GEN_AXIS2_INSTAL_LOC_ERROR = Invalid Axis2 Server Installation Path
142
CODE_GEN_AXIS2_LIB_LOC_ERROR = Specified location {0} did not exists
143
CODE_GEN_INVALID_JAR_PATTER = Jar file did not exists in lib folder : {0}
144
CODE_GEN_INVALID_MAR_PATTER = Mar file did not exists in modules folder : {0}
143
PORT_TO_LISTEN_FOR_OSGI_ENDPOINT = Port on which workbench should listen for notifications
145
PORT_TO_LISTEN_FOR_OSGI_ENDPOINT = Port on which workbench should listen for notifications
144
MUST_RESTART_TO_APPLY = The workbench will be restarted when you change this setting
146
MUST_RESTART_TO_APPLY = The workbench will be restarted when you change this setting
(-)src/org/eclipse/tptp/wsdm/tooling/editor/internal/Activator.java (+4 lines)
Lines 46-51 Link Here
46
	// Codegen extension point
46
	// Codegen extension point
47
	public static final String CODEGEN_EXT_PT = "codeGeneration";
47
	public static final String CODEGEN_EXT_PT = "codeGeneration";
48
48
49
	// Axis2 extenstion point
50
	public static final String AXIS2_EXT_PT = "axisValidator";
51
52
49
	/**
53
	/**
50
	 * Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc
54
	 * Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc
51
	 * -->
55
	 * -->
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/EclipseConfigurationData.java (+1 lines)
Lines 16-19 Link Here
16
	public static final String ADDITIONAL_JARS = "jars";
16
	public static final String ADDITIONAL_JARS = "jars";
17
	public static final String INSTANCES = "instances";
17
	public static final String INSTANCES = "instances";
18
	public static final String PROGRESS_MONITOR = "progress_monitor";
18
	public static final String PROGRESS_MONITOR = "progress_monitor";
19
	public static final String AXIS2_FILES = "axis2_files";
19
}
20
}
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/NewProjectWizard.java (-3 / +11 lines)
Lines 86-92 Link Here
86
	private boolean updatePreference;
86
	private boolean updatePreference;
87
	
87
	
88
	java.net.URI _projectLocation;
88
	java.net.URI _projectLocation;
89
	
89
90
	private String[] _requiredAxis2Files;
91
90
	/**
92
	/**
91
	 * Class that creates the Code Generation Wizard to create new Project
93
	 * Class that creates the Code Generation Wizard to create new Project
92
	 * @param codeGenerationDelegate
94
	 * @param codeGenerationDelegate
Lines 132-139 Link Here
132
					if(updatePreference)
134
					if(updatePreference)
133
					{
135
					{
134
		        		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
136
		        		IPreferenceStore store = Activator.getPlugin().getPreferenceStore();
135
		        		store.setValue(Axis2ServerLocationPreferencePage.SERVER_LOCATION_PREFERENCE_KEY,_serverLocation);	
137
		        		store.setValue(Axis2ServerLocationPreferencePage.SERVER_LOCATION_PREFERENCE_KEY,_serverLocation);
138
		        		// Update the Lib and module location
136
					}
139
					}
140
					_requiredAxis2Files = _axis2ServerLocationPage.getAxis2FilesToCopy();
137
				}
141
				}
138
				catch(Exception e)
142
				catch(Exception e)
139
				{
143
				{
Lines 146-154 Link Here
146
				_helper = _codeGenerationDelegate.run(new SubProgressMonitor(
150
				_helper = _codeGenerationDelegate.run(new SubProgressMonitor(
147
						monitor, 1));
151
						monitor, 1));
148
				// Step 3 : Copy the axis2 files for CodeGeneration
152
				// Step 3 : Copy the axis2 files for CodeGeneration
149
				String[] axis2files = _axis2ServerLocationPage.getAxis2Files();
153
/*				String[] axis2files = _axis2ServerLocationPage.getAxis2Files();
150
				if(_isAxis2Project)
154
				if(_isAxis2Project)
151
					_helper.addAdditionalJars(_serverLocation, axis2files);
155
					_helper.addAdditionalJars(_serverLocation, axis2files);
156
*/
157
152
				monitor.worked(1);
158
				monitor.worked(1);
153
			}
159
			}
154
			catch (Exception e)
160
			catch (Exception e)
Lines 256-261 Link Here
256
	{
262
	{
257
		ConfigurationData data = new ConfigurationData();
263
		ConfigurationData data = new ConfigurationData();
258
264
265
		data.addParameter(EclipseConfigurationData.AXIS2_FILES, _requiredAxis2Files);
266
		
259
		data.addParameter(ConfigurationData.DESCRIPTOR_DOCUMENT, _helper
267
		data.addParameter(ConfigurationData.DESCRIPTOR_DOCUMENT, _helper
260
				.getDescriptorDocument());
268
				.getDescriptorDocument());
261
		data.addParameter(EclipseConfigurationData.ADDITIONAL_JARS, _helper
269
		data.addParameter(EclipseConfigurationData.ADDITIONAL_JARS, _helper
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/Axis2ServerLocationPage.java (-38 / +47 lines)
Lines 12-19 Link Here
12
12
13
package org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional;
13
package org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional;
14
14
15
import java.io.File;
16
17
import org.eclipse.jface.preference.IPreferenceStore;
15
import org.eclipse.jface.preference.IPreferenceStore;
18
import org.eclipse.jface.wizard.WizardPage;
16
import org.eclipse.jface.wizard.WizardPage;
19
import org.eclipse.osgi.util.TextProcessor;
17
import org.eclipse.osgi.util.TextProcessor;
Lines 32-37 Link Here
32
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
30
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
33
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
31
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
34
import org.eclipse.tptp.wsdm.tooling.preferences.internal.Axis2ServerLocationPreferencePage;
32
import org.eclipse.tptp.wsdm.tooling.preferences.internal.Axis2ServerLocationPreferencePage;
33
import org.eclipse.tptp.wsdm.tooling.validation.util.internal.ValidationUtils;
35
34
36
/**
35
/**
37
 * This is Wizard Page to show the Axis2 server location details
36
 * This is Wizard Page to show the Axis2 server location details
Lines 43-51 Link Here
43
	protected Text _serverNameField;
42
	protected Text _serverNameField;
44
	private Button _browseButton;
43
	private Button _browseButton;
45
	private Button _preferenceUpdate;
44
	private Button _preferenceUpdate;
46
	private final String[] axis2files = {"lib/axis2-adb-1.1.1.jar",
45
	private String[] _filesToCopy;
47
			"lib/axis2-codegen-1.1.1.jar","lib/axis2-java2wsdl-1.1.1.jar"};
46
	
48
49
	/**
47
	/**
50
	 * Instantiates the class.
48
	 * Instantiates the class.
51
	 */
49
	 */
Lines 114-120 Link Here
114
			}
112
			}
115
		});
113
		});
116
        
114
        
117
        _serverNameField.setText(getPreferenceServerLocation());
115
    //    _serverNameField.setText(getPreferenceServerLocation());
118
116
119
        // browse button
117
        // browse button
120
		_browseButton = new Button(parent, SWT.PUSH);
118
		_browseButton = new Button(parent, SWT.PUSH);
Lines 186-240 Link Here
186
	
184
	
187
	private String validateLocation()
185
	private String validateLocation()
188
	{
186
	{
189
		String locationFieldContents = _serverNameField.getText();
187
		String serverHome = _serverNameField.getText();
190
		if (locationFieldContents.length() == 0)
191
			return(Messages.CODE_GEN_AXIS2_PROJECT_DIR);
192
		
193
		java.io.File newPath = new java.io.File(_serverNameField.getText());
194
		if (!newPath.exists())
195
			return(Messages.CODE_GEN_AXIS2_LOCATION_ERROR);
196
		
188
		
197
		if(newPath.exists())
189
		ISoapServerDependency axisValidators[] = ValidationUtils.getAllAxisValidators();
198
		{
190
		for(int i = 0 ; i < axisValidators.length ; i++){
199
			// Step 2 : Check for Axis2 installation libraries
200
			boolean found = true;
201
			
191
			
202
			for(int i = 0 ; i < axis2files.length ; i++)
192
			ISoapServerDependency axis2Dependency = (Axis2ServerDependency)axisValidators[i];
203
			{
193
			String errorMessage = axis2Dependency.validateSoapServerHome(serverHome);
204
				File axisFile = new File(locationFieldContents+ File.separator+axis2files[i]);
194
			if(errorMessage!=null)
205
				if(axisFile.exists())
195
				return errorMessage;
206
					continue;
196
			_filesToCopy = axis2Dependency.getFilesToCopy();
207
				else
197
			if(_filesToCopy == null)
208
				{
198
				_filesToCopy = new String[0];
209
					found = false;
210
					break;
211
				}
212
			}
213
			if(!found)
214
			{
215
				return Messages.CODE_GEN_AXIS2_INSTAL_LOC_ERROR;
216
			}
217
		}
199
		}
218
		return null;
200
		return null;		
219
	}
201
	}
220
	
202
	
221
	/**
203
	/**
222
	 * Returns the Axis2 files
204
	 * Returns the Axis2 files to copied to generated code
223
	 * @return
205
	 * @return
224
	 */
206
	 */
225
	public String[] getAxis2Files()
207
	public String[] getAxis2FilesToCopy()
226
	{
208
	{
227
		return axis2files;
209
		return _filesToCopy;
228
	}
210
	}
229
211
230
	/**
212
	/**
213
	 * Returns the absolute path of the lib folder. 
214
	 */
215
/*	public String getServerLibLocation(String serverName){
216
		ISoapServerDependency axisValidators[] = ValidationUtils.getAllAxisValidators();//new Axis2ServerDependency();
217
		for(int i = 0 ; i < axisValidators.length ; i++){
218
			ISoapServerDependency axis2Dependency = (Axis2ServerDependency)axisValidators[i];
219
			System.out.println("The lib folder : ");
220
			return axis2Dependency.getServerLibLocation(serverName);
221
		}
222
		return null;
223
	}
224
*/	
225
	/**
226
	 * Returns the absolute path of the modules folder. 
227
	 */
228
/*	public String getServerModulesLocation(String serverName){
229
		ISoapServerDependency axisValidators[] = ValidationUtils.getAllAxisValidators();
230
		for(int i = 0 ; i < axisValidators.length ; i++){
231
			ISoapServerDependency axis2Dependency = (Axis2ServerDependency)axisValidators[i];
232
			return axis2Dependency.getServerModulesLocation(serverName);
233
		}
234
		return null;
235
	}
236
*/	
237
	
238
	/**
231
	 * Method to Set the Wizard page to complete state
239
	 * Method to Set the Wizard page to complete state
232
	 * @param validPage 
240
	 * @param validPage 
233
	 */
241
	 */
234
	public void makePageComplete(boolean completePage)
242
	public synchronized void makePageComplete(boolean completePage)
235
	{
243
	{
236
		if(completePage)
244
		if(completePage){
237
			setPageComplete(true);
245
			setPageComplete(true);
246
		}
238
		else
247
		else
239
			setPageComplete(false);		
248
			setPageComplete(false);		
240
	}
249
	}
(-)src/org/eclipse/tptp/wsdm/tooling/validation/util/internal/ValidationUtils.java (+43 lines)
Lines 20-25 Link Here
20
import org.eclipse.core.runtime.IExtensionPoint;
20
import org.eclipse.core.runtime.IExtensionPoint;
21
import org.eclipse.core.runtime.IExtensionRegistry;
21
import org.eclipse.core.runtime.IExtensionRegistry;
22
import org.eclipse.core.runtime.Platform;
22
import org.eclipse.core.runtime.Platform;
23
import org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.ISoapServerDependency;
23
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
24
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
24
import org.eclipse.tptp.wsdm.tooling.nls.messages.validation.internal.Messages;
25
import org.eclipse.tptp.wsdm.tooling.nls.messages.validation.internal.Messages;
25
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog;
26
import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog;
Lines 159-164 Link Here
159
	}
160
	}
160
161
161
	/**
162
	/**
163
	 * Returns all the mrt validators by reading the plugin registry.
164
	 */
165
	public static ISoapServerDependency[] getAllAxisValidators()
166
	{
167
		List validators = new ArrayList();
168
		IExtensionRegistry er = Platform.getExtensionRegistry();
169
		IExtensionPoint iep = er.getExtensionPoint(Activator.PLUGIN_ID,
170
				Activator.AXIS2_EXT_PT);
171
		if (iep == null)
172
		{
173
			WsdmToolingLog.logWarning(Messages.COULDNT_FIND_AXIS_VALIDATOR_EXT);
174
			return null;
175
		}
176
		IExtension[] extensions = iep.getExtensions();
177
		if (extensions.length == 0)
178
		{
179
			WsdmToolingLog.logWarning(Messages.COULDNT_FIND_AXIS_VALIDATOR);
180
			return null;
181
		}
182
		for (int i = 0; i < extensions.length; i++)
183
		{
184
			IConfigurationElement[] ice = extensions[i]
185
					.getConfigurationElements();
186
			Object validator = null;
187
			try
188
			{
189
				validator = ice[0].createExecutableExtension("validator");
190
				
191
			}
192
			catch (CoreException e)
193
			{
194
				e.printStackTrace();
195
			}
196
			if (validator instanceof ISoapServerDependency)
197
				validators.add(validator);
198
		}
199
		return (ISoapServerDependency[]) validators
200
				.toArray(new ISoapServerDependency[validators.size()]);
201
	}
202
	
203
	
204
	/**
162
	 * Returns new error validation message.
205
	 * Returns new error validation message.
163
	 */
206
	 */
164
	public static IValidationMessage createNewErrorMessage(String message)
207
	public static IValidationMessage createNewErrorMessage(String message)
(-)plugin.xml (+8 lines)
Lines 6-11 Link Here
6
   <extension-point id="mrtValidator" name="mrtValidator" schema="schema/mrtValidator.exsd"/>
6
   <extension-point id="mrtValidator" name="mrtValidator" schema="schema/mrtValidator.exsd"/>
7
   <extension-point id="ddeValidator" name="ddeValidator" schema="schema/ddeValidator.exsd"/>
7
   <extension-point id="ddeValidator" name="ddeValidator" schema="schema/ddeValidator.exsd"/>
8
   <extension-point id="codeGeneration" name="Code Generation Contributions" schema="schema/codeGeneration.exsd"/>
8
   <extension-point id="codeGeneration" name="Code Generation Contributions" schema="schema/codeGeneration.exsd"/>
9
   <extension-point id="axisValidator" name="Axis 2 Server Location " schema="schema/axisValidator.exsd"/>
9
   
10
   
10
   <extension
11
   <extension
11
         id="org.eclipse.tptp.wsdm.editor.validation.WSDMBuilder"
12
         id="org.eclipse.tptp.wsdm.editor.validation.WSDMBuilder"
Lines 64-69 Link Here
64
         point="org.eclipse.tptp.wsdm.editor.ddeValidator">
65
         point="org.eclipse.tptp.wsdm.editor.ddeValidator">
65
      <ddeValidator validator="org.eclipse.tptp.wsdm.tooling.validation.dde.internal.DdeValidator"/>
66
      <ddeValidator validator="org.eclipse.tptp.wsdm.tooling.validation.dde.internal.DdeValidator"/>
66
   </extension>
67
   </extension>
68
69
   <extension
70
         id="wsdmAxisValidator"
71
         name="Axis2 Validator"
72
         point="org.eclipse.tptp.wsdm.editor.axisValidator">
73
      <axisValidator validator="org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.Axis2ServerDependency"/>
74
   </extension>
67
   
75
   
68
   <extension
76
   <extension
69
         point="org.eclipse.ui.editors">
77
         point="org.eclipse.ui.editors">
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/ISoapServerDependency.java (+42 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 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
package org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional;
14
15
/**
16
 * Interface to represent Soap Library dependency used in Tooling codegeneration. 
17
 */
18
19
public interface ISoapServerDependency 
20
{
21
	/**
22
	 * Returns null if the given Server Home has all the required soap jar files.
23
	 */
24
	String validateSoapServerHome(String serverHome);
25
	
26
	/**
27
	 * Returns the absolute path of all the required soap jar files. 
28
	 */
29
	String[] getFilesToCopy();
30
	
31
	/**
32
	 * Returns the absolute path of the lib folder. 
33
	 */
34
//	String getServerLibLocation(String serverName);
35
	
36
	/**
37
	 * Returns the absolute path of the modules folder. 
38
	 */
39
//	String getServerModulesLocation(String serverName);
40
41
	
42
}
(-)src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/Axis2ServerDependency.java (+146 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 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
package org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional;
14
15
import java.io.File;
16
import java.io.FileFilter;
17
import java.util.LinkedList;
18
import java.util.List;
19
20
import org.eclipse.osgi.util.NLS;
21
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
22
23
/**
24
 * This class verifies the Axis2 Soap Library dependency. 
25
 */
26
27
public class Axis2ServerDependency implements ISoapServerDependency
28
{
29
	private String[] _jarFiles = new String[]{"annogen-*", "axiom-api-*", "axiom-impl-*",
30
			"axis2-adb-*", "axis2-codegen-*", "axis2-java2wsdl-*","axis2-jibx-*", "axis2-kernel-*", "axis2-soapmonitor-*",
31
			"axis2-xmlbeans-*", "backport-util-concurrent-*", "commons-codec-*", "commons-fileupload-*",
32
			"commons-httpclient-*", "commons-logging-*","geronimo-spec-jms-*", 
33
			"jaxen-*", "jibx-run-*", "neethi-*", "stax-api-*", "wstx-asl-*", "xbean-*", "xercesImpl-*",
34
			"xml-apis-*", "XmlSchema-*"};
35
	
36
	private String[] _marFiles = new String[]{
37
			"addressing-*", "soapmonitor-*"
38
	};
39
40
	private List _filesToCopy = new LinkedList();
41
	
42
	public String validateSoapServerHome(String serverHome)
43
	{
44
		if(serverHome == null || serverHome.length() == 0)
45
			return Messages.CODE_GEN_AXIS2_PROJECT_DIR;
46
		
47
		File serverHomeDir = new File(serverHome);
48
		if(!serverHomeDir.exists()){
49
			return NLS.bind(Messages.CODE_GEN_AXIS2_LOCATION_ERROR, serverHome);
50
		}
51
		
52
		File libDir = new File(serverHome+File.separatorChar+"lib");
53
		if(!libDir.exists()){
54
			return NLS.bind(Messages.CODE_GEN_AXIS2_LIB_LOC_ERROR, serverHome+File.separatorChar+"lib");
55
		}
56
		
57
		File[] allJarFiles = libDir.listFiles(new CustomFileFilter("jar"));
58
		for(int i=0;i<_jarFiles.length;i++)
59
		{
60
			String pattern = _jarFiles[i].substring(0,_jarFiles[i].indexOf("-*"));
61
			boolean jarFileFound = false;
62
			for(int j=0;j<allJarFiles.length;j++)
63
			{
64
				if(allJarFiles[j].getName().startsWith(pattern))
65
				{
66
					jarFileFound = true;
67
					_filesToCopy.add(allJarFiles[j].getAbsolutePath());
68
					break;
69
				}
70
			}
71
			if(!jarFileFound){
72
				return NLS.bind(Messages.CODE_GEN_INVALID_JAR_PATTER, pattern);
73
			}
74
		}		
75
		
76
		File modulesDir = new File(serverHome+File.separatorChar+"repository"+ File.separatorChar+"modules");
77
		if(!modulesDir.exists()){
78
			return NLS.bind(Messages.CODE_GEN_AXIS2_LIB_LOC_ERROR, serverHome+File.separatorChar+"repository"+ File.separatorChar+"modules");
79
		}
80
		
81
		File[] allMarFiles = modulesDir.listFiles(new CustomFileFilter("mar"));
82
		for(int i=0;i<_marFiles.length;i++)
83
		{
84
			String pattern = _marFiles[i].substring(0,_marFiles[i].indexOf("-*"));
85
			boolean marFileFound = false;
86
			for(int j=0;j<allMarFiles.length;j++)
87
			{
88
				if(allMarFiles[j].getName().startsWith(pattern))
89
				{
90
					marFileFound = true;
91
					_filesToCopy.add(allMarFiles[j].getAbsolutePath());
92
					break;
93
				}
94
			}
95
			if(!marFileFound){
96
				return NLS.bind(Messages.CODE_GEN_INVALID_MAR_PATTER, pattern);
97
			}
98
		}		
99
				
100
		return null;
101
	}
102
103
	public String[] getFilesToCopy()
104
	{
105
		return (String[])_filesToCopy.toArray(new String[_filesToCopy.size()]);
106
	}
107
	
108
	/**
109
	 * Returns the absolute path of the lib folder. 
110
	 */
111
/*	public String getServerLibLocation(String serverName){
112
		String serverLocation = serverName;
113
		if(!serverLocation.endsWith(File.separator)){
114
			serverLocation+=File.separator;
115
		}
116
		return serverLocation+"lib";
117
	}
118
*/	
119
	/**
120
	 * Returns the absolute path of the modules folder. 
121
	 */
122
/*	public String getServerModulesLocation(String serverName){
123
		String serverLocation = serverName;
124
		if(!serverLocation.endsWith(File.separator)){
125
			serverLocation+=File.separator;
126
		}
127
		return serverLocation+"repository"+File.separator+"modules";	
128
		
129
	}
130
	*/
131
}
132
133
class CustomFileFilter implements FileFilter
134
{
135
	String fileExtension;
136
	
137
	CustomFileFilter(String extension){
138
		fileExtension = extension;
139
	}
140
	public boolean accept(File pathname) 
141
	{
142
		if(!pathname.isFile())
143
			return false;
144
		return pathname.getName().endsWith(fileExtension);		
145
	}	
146
}
(-)schema/axisValidator.exsd (+110 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.tptp.wsdm.editor">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.tptp.wsdm.editor" id="axisValidator" name="axisValidator"/>
7
      </appInfo>
8
      <documentation>
9
         This extension point will be used for validation of Axis2 libraries
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <complexType>
15
         <sequence>
16
            <element ref="axisValidator"/>
17
         </sequence>
18
         <attribute name="point" type="string" use="required">
19
            <annotation>
20
               <documentation>
21
                  
22
               </documentation>
23
            </annotation>
24
         </attribute>
25
         <attribute name="id" type="string">
26
            <annotation>
27
               <documentation>
28
                  
29
               </documentation>
30
            </annotation>
31
         </attribute>
32
         <attribute name="name" type="string">
33
            <annotation>
34
               <documentation>
35
                  
36
               </documentation>
37
               <appInfo>
38
                  <meta.attribute translatable="true"/>
39
               </appInfo>
40
            </annotation>
41
         </attribute>
42
      </complexType>
43
   </element>
44
45
   <element name="axisValidator">
46
      <annotation>
47
         <documentation>
48
            specify the validator for wsdm resource type.
49
         </documentation>
50
      </annotation>
51
      <complexType>
52
         <attribute name="validator" type="string" use="required">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appInfo>
58
                  <meta.attribute kind="java" basedOn="org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.ISoapServerDependency"/>
59
               </appInfo>
60
            </annotation>
61
         </attribute>
62
      </complexType>
63
   </element>
64
65
   <annotation>
66
      <appInfo>
67
         <meta.section type="since"/>
68
      </appInfo>
69
      <documentation>
70
         [Enter the first release in which this extension point appears.]
71
      </documentation>
72
   </annotation>
73
74
   <annotation>
75
      <appInfo>
76
         <meta.section type="examples"/>
77
      </appInfo>
78
      <documentation>
79
         [Enter extension point usage example here.]
80
      </documentation>
81
   </annotation>
82
83
   <annotation>
84
      <appInfo>
85
         <meta.section type="apiInfo"/>
86
      </appInfo>
87
      <documentation>
88
         [Enter API information here.]
89
      </documentation>
90
   </annotation>
91
92
   <annotation>
93
      <appInfo>
94
         <meta.section type="implementation"/>
95
      </appInfo>
96
      <documentation>
97
         [Enter information about supplied implementation of this extension point.]
98
      </documentation>
99
   </annotation>
100
101
   <annotation>
102
      <appInfo>
103
         <meta.section type="copyright"/>
104
      </appInfo>
105
      <documentation>
106
         Copyright (c) 2007 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
107
      </documentation>
108
   </annotation>
109
110
</schema>

Return to bug 150385