|
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); |