|
Lines 19-35
Link Here
|
| 19 |
|
19 |
|
| 20 |
package org.eclipse.jst.ws.internal.creation.ui.extension; |
20 |
package org.eclipse.jst.ws.internal.creation.ui.extension; |
| 21 |
|
21 |
|
|
|
22 |
import java.io.IOException; |
| 23 |
|
| 22 |
import org.eclipse.core.resources.IProject; |
24 |
import org.eclipse.core.resources.IProject; |
| 23 |
import org.eclipse.core.resources.ResourcesPlugin; |
25 |
import org.eclipse.core.resources.ResourcesPlugin; |
|
|
26 |
import org.eclipse.core.runtime.CoreException; |
| 24 |
import org.eclipse.core.runtime.IAdaptable; |
27 |
import org.eclipse.core.runtime.IAdaptable; |
| 25 |
import org.eclipse.core.runtime.IProgressMonitor; |
28 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 26 |
import org.eclipse.core.runtime.IStatus; |
29 |
import org.eclipse.core.runtime.IStatus; |
| 27 |
import org.eclipse.core.runtime.Status; |
30 |
import org.eclipse.core.runtime.Status; |
|
|
31 |
import org.eclipse.jdt.core.JavaModelException; |
| 28 |
import org.eclipse.jst.ws.internal.consumption.command.common.CreateFacetedProjectCommand; |
32 |
import org.eclipse.jst.ws.internal.consumption.command.common.CreateFacetedProjectCommand; |
| 29 |
import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; |
33 |
import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; |
| 30 |
import org.eclipse.jst.ws.internal.consumption.common.RequiredFacetVersion; |
34 |
import org.eclipse.jst.ws.internal.consumption.common.RequiredFacetVersion; |
|
|
35 |
import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; |
| 36 |
import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample.AddModuleDependenciesCommand; |
| 31 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; |
37 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; |
| 32 |
import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; |
38 |
import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; |
|
|
39 |
import org.eclipse.osgi.util.NLS; |
| 40 |
import org.eclipse.wst.command.internal.env.core.common.StatusUtils; |
| 33 |
import org.eclipse.wst.command.internal.env.core.context.ResourceContext; |
41 |
import org.eclipse.wst.command.internal.env.core.context.ResourceContext; |
| 34 |
import org.eclipse.wst.common.environment.IEnvironment; |
42 |
import org.eclipse.wst.common.environment.IEnvironment; |
| 35 |
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; |
43 |
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; |
|
Lines 39-44
Link Here
|
| 39 |
import org.eclipse.wst.ws.internal.wsrt.IWebService; |
47 |
import org.eclipse.wst.ws.internal.wsrt.IWebService; |
| 40 |
import org.eclipse.wst.ws.internal.wsrt.IWebServiceRuntime; |
48 |
import org.eclipse.wst.ws.internal.wsrt.IWebServiceRuntime; |
| 41 |
import org.eclipse.wst.ws.internal.wsrt.SimpleContext; |
49 |
import org.eclipse.wst.ws.internal.wsrt.SimpleContext; |
|
|
50 |
import org.eclipse.wst.ws.internal.wsrt.TestInfo; |
| 42 |
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; |
51 |
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; |
| 43 |
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; |
52 |
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; |
| 44 |
import org.eclipse.wst.ws.internal.wsrt.WebServiceState; |
53 |
import org.eclipse.wst.ws.internal.wsrt.WebServiceState; |
|
Lines 54-59
Link Here
|
| 54 |
private String moduleType_; |
63 |
private String moduleType_; |
| 55 |
private String earProject_; |
64 |
private String earProject_; |
| 56 |
private String ear_; |
65 |
private String ear_; |
|
|
66 |
private IProject initialProject_; |
| 57 |
|
67 |
|
| 58 |
private IWebService webService_; |
68 |
private IWebService webService_; |
| 59 |
private String j2eeLevel_; |
69 |
private String j2eeLevel_; |
|
Lines 159-164
Link Here
|
| 159 |
} |
169 |
} |
| 160 |
} |
170 |
} |
| 161 |
} |
171 |
} |
|
|
172 |
|
| 173 |
AddModuleDependenciesCommand addMod = new AddModuleDependenciesCommand(new TestInfo()); |
| 174 |
if(FacetUtils.isJavaProject(initialProject_)) |
| 175 |
addMod.addJavaProjectAsUtilityJar(initialProject_, project, monitor); |
| 176 |
|
| 177 |
|
| 178 |
try |
| 179 |
{ |
| 180 |
String uri = initialProject_.getName() + ".jar"; |
| 181 |
addMod.addJAROrModuleDependency(project, uri); |
| 182 |
} catch (CoreException ce) |
| 183 |
{ |
| 184 |
String errorMessage = NLS.bind(ConsumptionUIMessages.MSG_ERROR_MODULE_DEPENDENCY, new String[]{project.getName(), initialProject_.getName()}); |
| 185 |
IStatus errorStatus = StatusUtils.errorStatus(errorMessage); |
| 186 |
environment.getStatusHandler().reportError(errorStatus); |
| 187 |
} catch (IOException ioe) |
| 188 |
{ |
| 189 |
String errorMessage = NLS.bind(ConsumptionUIMessages.MSG_ERROR_MODULE_DEPENDENCY, new String[]{project.getName(), initialProject_.getName()}); |
| 190 |
IStatus errorStatus = StatusUtils.errorStatus(errorMessage); |
| 191 |
environment.getStatusHandler().reportError(errorStatus); |
| 192 |
} |
| 193 |
|
| 194 |
try { |
| 195 |
addMod.addBuildPath(project, initialProject_); |
| 196 |
} catch (JavaModelException jme) { |
| 197 |
// Do nothing in this catch block. The worst that |
| 198 |
// will happen is that the sample Web project |
| 199 |
// will show some compile errors. The sample will |
| 200 |
// likely still launch successfully on the server |
| 201 |
// and the user will be able to use it. |
| 202 |
} |
| 162 |
} |
203 |
} |
| 163 |
return status; |
204 |
return status; |
| 164 |
|
205 |
|
|
Lines 280-285
Link Here
|
| 280 |
{ |
321 |
{ |
| 281 |
client_ = genProxy; |
322 |
client_ = genProxy; |
| 282 |
} |
323 |
} |
|
|
324 |
|
| 325 |
public void setInitialProject(IProject initialProject) |
| 326 |
{ |
| 327 |
initialProject_ = initialProject; |
| 328 |
} |
| 329 |
|
| 330 |
public IProject getInitialProject() |
| 331 |
{ |
| 332 |
return initialProject_; |
| 333 |
} |
| 283 |
|
334 |
|
| 284 |
|
335 |
|
| 285 |
} |
336 |
} |