* Since this monitor here doesn't make much sense, we
* should either remove the progress monitor from the CodeGenWizard,
* or give a (custom) progress monitor to the generate() method, so
* we will be informed by Axis2 about the progress of code generation.
*/
WSDL2JavaGenerator generator = new WSDL2JavaGenerator();
monitor.subTask(CodegenWizardPlugin.getResourceString("generator.readingWOM"));
AxisService service = generator.getAxisService(wsdlSelectionPage.getFileName());
monitor.worked(1);
//The generate all fix (Axis2-1862)
boolean isServerside,isServiceXML,isGenerateServerSideInterface = false;
if (optionsPage.getGenerateAll()){
isServerside = true;
isServiceXML = true;
isGenerateServerSideInterface = true;
}else{
isServerside = optionsPage.isServerside();
isServiceXML =optionsPage.isServerXML();
isGenerateServerSideInterface = optionsPage.getGenerateServerSideInterface();
}
Map optionsMap = generator.fillOptionMap(optionsPage.isAsyncOnlyOn(),
optionsPage.isSyncOnlyOn(),
isServerside,
isServiceXML,
optionsPage.isGenerateTestCase(),
optionsPage.getGenerateAll(),
optionsPage.getServiceName(),
optionsPage.getPortName(),
optionsPage.getDatabinderName(),
wsdlSelectionPage.getFileName(),
optionsPage.getPackageName(),
optionsPage.getSelectedLanguage(),
outputPage.getOutputLocation(),
optionsPage.getNs2PkgMapping(),
isGenerateServerSideInterface,
optionsPage.getAdvanceOptions());
//Fix for the CodeGenConfiguration Contructor Change
//CodeGenConfiguration codegenConfig = new CodeGenConfiguration(service, optionsMap);
CodeGenConfiguration codegenConfig = new CodeGenConfiguration(optionsMap);
codegenConfig.addAxisService(service);
//set the wsdl definision for codegen config for skeleton generarion.
WSDLPropertyReader reader = new WSDLPropertyReader();
reader.readWSDL(wsdlSelectionPage.getFileName());
Definition wsdlDefinition = reader.getWsdlDefinition();
codegenConfig.setWsdlDefinition(wsdlDefinition);
//set the baseURI
codegenConfig.setBaseURI(generator.getBaseUri(wsdlSelectionPage.getFileName()));
monitor.worked(1);
monitor.subTask(CodegenWizardPlugin.getResourceString("generator.generating"));
new CodeGenerationEngine(codegenConfig).generate();