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

Collapse All | Expand All

(-)src/org/eclipse/tptp/wsdm/tooling/internal/projectizer/EclipseOsgiProjectizer.java (+36 lines)
Lines 32-37 Link Here
32
import org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.EclipseConfigurationData;
32
import org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.EclipseConfigurationData;
33
import org.eclipse.tptp.wsdm.tooling.internal.util.PluginProjectHelper;
33
import org.eclipse.tptp.wsdm.tooling.internal.util.PluginProjectHelper;
34
import org.w3c.dom.Document;
34
import org.w3c.dom.Document;
35
import org.w3c.dom.Element;
35
36
36
public class EclipseOsgiProjectizer extends OsgiAxis2Projectizer {
37
public class EclipseOsgiProjectizer extends OsgiAxis2Projectizer {
37
	
38
	
Lines 47-52 Link Here
47
		};
48
		};
48
	private File[] _additionalJars;
49
	private File[] _additionalJars;
49
	private Object[][] _instances;
50
	private Object[][] _instances;
51
52
	private int _resourceCounter = 0;
50
		
53
		
51
	public void projectize(ConfigurationData data) throws Exception {
54
	public void projectize(ConfigurationData data) throws Exception {
52
		ConfigurationData.checkConfiguration(this, data);
55
		ConfigurationData.checkConfiguration(this, data);
Lines 82-88 Link Here
82
		
85
		
83
		helper.refreshProject();
86
		helper.refreshProject();
84
	}
87
	}
88
		
89
	protected void createRouterEntries(File routerEntriesDir, String serviceName, Map capabilitiesMap)
90
			throws Exception {
91
		
92
		if(_instances == null) {
93
			super.createRouterEntries(routerEntriesDir, serviceName, capabilitiesMap);
94
		} else {
95
			
96
			for(int i=0; i < _instances.length; i++) {
97
				Object[] instancePair = _instances[i];
98
				
99
				//
100
				//This is really tacky, but it's the only real way to do this
101
				// since there are no pairs. The File use is to get the last element
102
				// of the path in a nice, non-hack way. 
103
				//
104
				String path = (String) instancePair[0];
105
				String resourcePathName = new File(path).getName();
106
				
107
				Element instanceElement = (Element) instancePair[1];
108
				
109
				File serviceDir = new File(routerEntriesDir, resourcePathName);				
110
				File routerEntryFile = new File(serviceDir, getResourceFileName());
111
				
112
				writeToFileCheck(instanceElement, routerEntryFile);				
113
			}
114
115
		}
116
	}
85
	
117
	
118
	protected String getResourceFileName() {
119
		return Axis2ProjectizerConstants.RESOURCE_FILE.replaceFirst(PLACE_HOLDER, String.valueOf(_resourceCounter++));
120
	}
121
86
	protected void loadParameters(ConfigurationData data) {
122
	protected void loadParameters(ConfigurationData data) {
87
		super.loadParameters(data);
123
		super.loadParameters(data);
88
		_additionalJars = (File[])data.getParameter(EclipseConfigurationData.ADDITIONAL_JARS);
124
		_additionalJars = (File[])data.getParameter(EclipseConfigurationData.ADDITIONAL_JARS);
(-)src/org/eclipse/tptp/wsdm/tooling/internal/projectizer/EclipseAxis2Projectizer.java (+32 lines)
Lines 33-38 Link Here
33
import org.eclipse.tptp.wsdm.tooling.internal.codegeneration.Activator;
33
import org.eclipse.tptp.wsdm.tooling.internal.codegeneration.Activator;
34
import org.eclipse.tptp.wsdm.tooling.internal.util.WebProjectHelper;
34
import org.eclipse.tptp.wsdm.tooling.internal.util.WebProjectHelper;
35
import org.w3c.dom.Document;
35
import org.w3c.dom.Document;
36
import org.w3c.dom.Element;
36
37
37
/**
38
/**
38
 * Construct the projectizer for code generation
39
 * Construct the projectizer for code generation
Lines 55-60 Link Here
55
	private Object[][] _instances;
56
	private Object[][] _instances;
56
	private IProgressMonitor _progressMonitor;
57
	private IProgressMonitor _progressMonitor;
57
	private TargetedFileList[] _filesToCopy;
58
	private TargetedFileList[] _filesToCopy;
59
60
	private int _resourceCounter = 0;
58
	
61
	
59
	public void projectize(ConfigurationData configuration) throws Exception {
62
	public void projectize(ConfigurationData configuration) throws Exception {
60
		
63
		
Lines 154-159 Link Here
154
		return helper;
157
		return helper;
155
	}
158
	}
156
	
159
	
160
	protected void createRouterEntries(File routerEntriesDir, String serviceName, Map capabilitiesMap) throws Exception {
161
		if(_instances == null) {
162
			super.createRouterEntries(routerEntriesDir, serviceName, capabilitiesMap);
163
		} else {
164
			for(int i=0; i < _instances.length; i++) {
165
				Object[] instancePair = _instances[i];
166
				
167
				//
168
				//This is really tacky, but it's the only real way to do this
169
				// since there are no pairs. The File use is to get the last element
170
				// of the path in a nice, non-hack way. 
171
				//
172
				String path = (String) instancePair[0];
173
				String resourcePathName = new File(path).getName();
174
				
175
				Element instanceElement = (Element) instancePair[1];
176
				
177
				File serviceDir = new File(routerEntriesDir, resourcePathName);				
178
				File routerEntryFile = new File(serviceDir, getResourceFileName());
179
				
180
				writeToFileCheck(instanceElement, routerEntryFile);				
181
			}
182
		}
183
	}
184
	
185
	protected String getResourceFileName() {
186
		return Axis2ProjectizerConstants.RESOURCE_FILE.replaceFirst(PLACE_HOLDER, String.valueOf(_resourceCounter++));
187
	}
188
	
157
	protected File copyTemplate(File destination) throws Exception {	
189
	protected File copyTemplate(File destination) throws Exception {	
158
		URL url = Platform.getBundle(Activator.PLUGIN_ID).getEntry(EclipseAxis2ProjectizerConstants.WEBCONTENT_DIR_RESOURCE);
190
		URL url = Platform.getBundle(Activator.PLUGIN_ID).getEntry(EclipseAxis2ProjectizerConstants.WEBCONTENT_DIR_RESOURCE);
159
		url = FileLocator.toFileURL(url);
191
		url = FileLocator.toFileURL(url);

Return to bug 167366