public IStatus getStatus() { entity_ = getSelectionAsWebServiceEntity(); if (entity_ == null || entity_.getType() != WebServiceEntity.TYPE_WSDL) return StatusUtils.errorStatus( ConsumptionUIMessages.PAGE_MSG_SELECTION_MUST_BE_WSDL ); else return Status.OK_STATUS; }
public List getWsdlServicesFromWsilFile(IFile wsil) { List result = new ArrayList(); WebServiceEntity entity = parseWsilFile(wsil); if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSIL) { // get all the WSDL references from the WSIL entity List wsdlList = entity.getChildren(); for (Iterator it = wsdlList.iterator(); it.hasNext();) { Object item = it.next(); if (item != null && item instanceof WebServiceEntity) { if (((WebServiceEntity) item).getModel() != null && ((WebServiceEntity) item).getModel() instanceof Definition) { Definition def = (Definition) ((WebServiceEntity) item).getModel(); if (def != null && !def.getServices().isEmpty()) result.addAll(def.getServices().values()); } } } } return result; } public WebServiceEntity parseWsilFile(IFile wsil) {
public Image getImage(Object element) { switch (((WebServiceEntity)element).getType()) { case WebServiceEntity.TYPE_HTML: return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/html.gif").createImage(); case WebServiceEntity.TYPE_WSIL: return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/wsil.gif").createImage(); case WebServiceEntity.TYPE_WSDL: return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/wsdl.gif").createImage(); default: return null; } }
public boolean validate(String s) { String wsURI = s; if (wsURI.indexOf(':') < 0) { IFile file = uri2IFile(wsURI); if (file != null) wsURI = iFile2URI(file); } if (wsURI != null && wsURI.indexOf(':') >= 0 && webServicesParser.getWebServiceEntityByURI(wsURI) == null) { TimedWSDLSelectionConditionCommand cmd = new TimedWSDLSelectionConditionCommand(); cmd.setWebServicesParser(webServicesParser); cmd.setWebServiceURI(wsURI); cmd.execute(null, null); } // prime widget based on the string wsdlURI_ = wsURI; if (tree != null) tree.setWebServiceURI(wsURI); WebServiceEntity entity = webServicesParser.getWebServiceEntityByURI(wsURI); if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSDL) return true; else return false; } }
private void handleWebServiceURI(String wsURI) { if (wsURI.indexOf(':') < 0) { IFile file = uri2IFile(wsURI); if (file != null) wsURI = iFile2URI(file); } if (wsURI != null && wsURI.indexOf(':') >= 0 && webServicesParser.getWebServiceEntityByURI(wsURI) == null) { TimedWSDLSelectionConditionCommand cmd = new TimedWSDLSelectionConditionCommand(); cmd.setWebServicesParser(webServicesParser); cmd.setWebServiceURI(wsURI); cmd.execute(null, null); } WebServiceEntity entity = webServicesParser.getWebServiceEntityByURI(wsURI); if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSDL) tree.setEnabled(false); else tree.setEnabled(true); tree.setWebServiceURI(wsURI); tree.refreshTreeViewer(); wsdlURI_ = wsURI; }
if (wsEntity != null) int type = wsEntity.getType(); if (type != WebServiceEntity.TYPE_WSDL) needWSDLSelectionTreeWidget = true;
if (wsEntity != null && wsEntity.getType() == WebServiceEntity.TYPE_WSDL)