JBoss Tools SVN: r31201 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-10 23:44:02 -0400 (Tue, 10 May 2011)
New Revision: 31201
Modified:
trunk/build/target-platform/multiple.target
trunk/build/target-platform/unified.target
Log:
updated versions of IUs in TP from M6
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2011-05-11 02:54:11 UTC (rev 31200)
+++ trunk/build/target-platform/multiple.target 2011-05-11 03:44:02 UTC (rev 31201)
@@ -35,8 +35,8 @@
<unit id="org.eclipse.epp.usagedata.recording" version="1.3.0.R201005261100"/>
<unit id="org.eclipse.epp.usagedata.ui" version="1.3.1.R201102081640"/>
-->
- <unit id="org.eclipse.equinox.p2.discovery.compatibility" version="1.0.1.v20110118-1616"/>
- <unit id="org.eclipse.equinox.p2.discovery" version="1.0.100.v20100920"/>
+ <unit id="org.eclipse.equinox.p2.discovery.compatibility" version="1.0.1.v20110222-0044"/>
+ <unit id="org.eclipse.equinox.p2.discovery" version="1.0.100.v20110222-0044"/>
<unit id="org.eclipse.equinox.p2.ui.discovery" version="1.0.0.v20100920"/>
<unit id="org.eclipse.net4j.jms.api" version="3.0.0.v20110128-1111"/>
@@ -44,7 +44,7 @@
<unit id="javax.wsdl" version="1.6.2.v201012040545"/>
<unit id="org.apache.oro" version="2.0.8.v201005080400"/>
<unit id="org.jdom" version="1.0.0.v201005080400"/>
- <unit id="org.apache.commons.codec" version="1.3.0.v20100518-1140"/>
+ <unit id="org.apache.commons.codec" version="1.3.0.v201101211617"/>
<!-- <unit id="org.mozilla.xulrunner.feature.feature.group" version="1.9.12.v20110120-2050-H36-CR1"/>
<unit id="org.mozilla.xpcom.feature.feature.group" version="1.9.12.v20110120-2050-H36-CR1"/> -->
@@ -53,62 +53,62 @@
<unit id="org.eclipse.emf.workspace.feature.group" version="1.4.0.v20100428-2315-36-8s734C367E3CBC7"/>
<unit id="org.eclipse.emf.validation.feature.group" version="1.4.0.v20100428-2315-479-9oB56N5BBR6LCA6"/>
<unit id="org.eclipse.emf.transaction.feature.group" version="1.4.0.v20100428-2315-377-8s734C3E7D15D6B"/>
- <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110128-1409"/>
- <unit id="org.eclipse.emf.feature.group" version="2.7.0.v20110128-1446"/>
+ <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110310-1642"/>
+ <unit id="org.eclipse.emf.feature.group" version="2.7.0.v20110310-1804"/>
<unit id="org.eclipse.emf.codegen.feature.group" version="2.6.0.v20110310-1804"/>
- <unit id="org.eclipse.emf.common.feature.group" version="2.7.0.v20110128-1409"/>
+ <unit id="org.eclipse.emf.common.feature.group" version="2.7.0.v20110310-1642"/>
<unit id="org.eclipse.emf.databinding.feature.group" version="1.2.0.v20110310-1804"/>
<unit id="org.eclipse.emf.codegen.ecore.feature.group" version="2.7.0.v20110310-1804"/>
- <unit id="org.eclipse.emf.ecore.edit.feature.group" version="2.7.0.v20110128-1446"/>
- <unit id="org.eclipse.emf.ecore.editor.feature.group" version="2.7.0.v20110128-1446"/>
- <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110128-1409"/>
+ <unit id="org.eclipse.emf.ecore.edit.feature.group" version="2.7.0.v20110310-1804"/>
+ <unit id="org.eclipse.emf.ecore.editor.feature.group" version="2.7.0.v20110310-1804"/>
+ <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110310-1642"/>
<unit id="org.eclipse.emf.edit.feature.group" version="2.7.0.v20110310-1804"/>
- <unit id="org.eclipse.xsd.edit.feature.group" version="2.6.0.v20110128-1446"/>
- <unit id="org.eclipse.xsd.feature.group" version="2.7.0.v20110128-1446"/>
+ <unit id="org.eclipse.xsd.edit.feature.group" version="2.6.0.v20110310-1804"/>
+ <unit id="org.eclipse.xsd.feature.group" version="2.7.0.v20110310-1804"/>
- <unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.3.20110219_0655-4d933cf-dev-e36"/>
+ <unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.eclipse.gef.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
- <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="3.7.0.v20110329-777D-86sH1BEM7o5ODXaD2G4lQnz"/>
- <unit id="org.eclipse.birt.feature.group" version="3.7.0.v20110329-B7F907AGS6mD_gblju07XxVERRSk"/>
- <unit id="org.eclipse.birt.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
- <unit id="org.eclipse.birt.chart.feature.group" version="3.7.0.v20110329-7r9e1FQCnvKM70EhlWF7"/>
- <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
+ <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="3.7.0.v20110126-777D-86sH1BEK7l5ODX_XHlBz-fm"/>
+ <unit id="org.eclipse.birt.feature.group" version="3.7.0.v20110126-B7F907AGS6mD_gagmV07XxVECK9k"/>
+ <unit id="org.eclipse.birt.integration.wtp.feature.group" version="3.7.0.v20110314-1726-46-7w3122142502837"/>
+ <unit id="org.eclipse.birt.chart.feature.group" version="3.7.0.v20110126-7r9e1FQCnvKM6u4SlWF7"/>
+ <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="3.7.0.v20110314-1726-46-7w3122142502837"/>
- <unit id="com.ibm.icu.base.feature.group" version="1.1.0.v20090119-79318s73533B57"/>
- <unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.0.v20110124-7K7TF9wF7RZHQLKaPb13J93"/>
- <unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110121-7B77FO-8sF7BA7FFU67UJ5"/>
+ <unit id="com.ibm.icu.base.feature.group" version="1.2.0.v20110302-797738s7355373J"/>
+ <unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.0.v20110124-7K7TF9wF7RZHQOI_Op"/>
+ <unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110207-7B78FGB8sF7BB7I8H58WG5"/>
<unit id="org.eclipse.help.feature.group" version="1.3.0.v20110121-7i7uFCaFFt6Zqif0tNYDdt"/>
- <unit id="org.eclipse.jdt.feature.group" version="3.7.0.v20110121-7z8fFb7FMTfESMtR15KlAcZ9H155"/>
+ <unit id="org.eclipse.jdt.feature.group" version="3.7.0.v20110208-0800-7z8gFb7FMTfEULpkdZIlQtX9H155"/>
<unit id="org.eclipse.platform.feature.group" version="3.7.0.r20110302-9gF7SHCIFt6ms-lIjrC6vK_XO-IabJMKu"/>
- <unit id="org.eclipse.platform.ide" version="3.7.0.I20110127-2034"/>
- <unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20101220-7P7NFUFFLWUl6m499UD1941"/>
+ <unit id="org.eclipse.platform.ide" version="3.7.0.I20110310-1119"/>
+ <unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20110218-7P7NFUFFLWUl6m499UD1941"/>
<unit id="org.eclipse.platform.sdk" version="3.7.0.I20110310-1119"/>
- <unit id="org.eclipse.pde.feature.group" version="3.7.0.v20110121-7b7oFXNFEx2Xmo_ItaDS-OD"/>
- <unit id="org.eclipse.sdk.feature.group" version="3.7.0.v20110121-7Q7xA7DPa2z-lGjJRd0f6hRgSZ1DWdaZTRWbk_SVSlVqV"/>
+ <unit id="org.eclipse.pde.feature.group" version="3.7.0.v20110121-7b7oFXNFEx2Xmp_WfY574C"/>
+ <unit id="org.eclipse.sdk.feature.group" version="3.7.0.v20110204-7Q7xA7DLb3-pAVYYcrq8CSREZk7Sx7sVuI10F2m3sATD8"/>
<unit id="org.eclipse.rcp.id" version="3.7.0.I20110310-1119"/>
- <unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110127-2034"/>
+ <unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110310-1119"/>
<unit id="org.eclipse.releng.tools.feature.group" version="3.4.100.v20110123-45-7w31212215"/>
<unit id="org.eclipse.sdk.ide" version="3.7.0.I20110310-1119"/>
- <unit id="org.eclipse.sdk.examples.feature.group" version="3.4.0.v20110121-817lFcfFEdccF-TPmjBPoNN"/>
+ <unit id="org.eclipse.sdk.examples.feature.group" version="3.4.0.v20110121-817lFcfFEdccFPZTitBPoNN"/>
<unit id="org.eclipse.sdk.examples.source.feature.group" version="3.4.0.v20110121"/>
<unit id="org.eclipse.equinox.compendium.sdk.feature.group" version="3.7.0.v20110124-7X7XG6sFPGjtJ53kGX13J93"/>
<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.7.0.v20110124-7sF9LFm-FUu63aH8jUP5BwTB"/>
- <unit id="org.eclipse.equinox.p2.discovery.feature.feature.group" version="1.0.100.v20110124-4-8_9oB5865OAD02727"/>
+ <unit id="org.eclipse.equinox.p2.discovery.feature.feature.group" version="1.0.100.v20110222-0044-4-8_9oB5875IB9133BB"/>
<unit id="org.eclipse.equinox.p2.user.ui.feature.group" version="2.1.0.v20110228-897TFncFdHjO2qRuCh_UvYT"/>
- <unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.7.0.v20110124-9J7kHABGKUf0qkz-nObV98021383"/>
- <unit id="org.eclipse.equinox.serverside.sdk.feature.group" version="3.7.0.v20110124-7u7PFlsFN5Jgisd_JUErPMnpRcX2"/>
+ <unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.7.0.v20110228-9H7oGygGIbXykyi5YYL8z-VO244C"/>
+ <unit id="org.eclipse.equinox.serverside.sdk.feature.group" version="3.7.0.v20110124-7u7PFp-FN5JiJy61NWGrQbsuOmwi"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.0.v20110123-7L7W8Z8W1Q5nsW4u0pf2k2lZoUZd"/>
<unit id="org.eclipse.equinox.weaving.sdk.feature.group" version="1.0.100.v20110124-79-DHEVVFNFJiK4"/>
<unit id="org.eclipse.equinox.server.jetty.feature.group" version="1.0.100.v20110124-7I77AqBgJ9EBBNBb8IAD"/>
- <unit id="org.eclipse.equinox.server.p2.feature.group" version="1.1.0.v20110124-7x7PFRBFT0z0-VD5xYnTNoi1"/>
+ <unit id="org.eclipse.equinox.server.p2.feature.group" version="1.1.0.v20110124-7x7RFPcFT0z0-VI27bWRAemk"/>
<unit id="org.eclipse.pde.api.tools.ee.fragments.feature.group" version="1.0.100.v20110123-7C-7BF9JgLWLMBMMAMsLL"/>
<unit id="org.eclipse.equinox.p2.ui.admin.rcp.product" version="1.1.0.I20110310-1119"/>
<unit id="org.eclipse.equinox.server.servletbridge.feature.group" version="1.0.100.v20110124-42DF9oB5865H7J"/>
- <unit id="org.eclipse.equinox.server.simple.feature.group" version="1.0.100.v20110124-0830-44Eo8s7353574H2531"/>
+ <unit id="org.eclipse.equinox.server.simple.feature.group" version="1.0.100.v20110124-0830-44Eo8s7354484E2629"/>
<unit id="org.eclipse.rcp.feature.group" version="3.7.0.v20110216-9DB5FiuFpBGyHd2xA_SWnfP"/>
<!-- DTP 1.9 -->
@@ -155,24 +155,24 @@
<unit id="org.eclipse.datatools.sqltools.doc.user.feature.group" version="1.9.0.v201010181130-37D-7733L3D753L7BBF"/>
<unit id="org.eclipse.draw2d.feature.group" version="3.7.0.v20101213-1100-46-7w3122141903161"/>
- <unit id="org.eclipse.gef.feature.group" version="3.7.0.v20101213-1100-777D-81B2Bz0656B376H34272"/>
+ <unit id="org.eclipse.gef.feature.group" version="3.7.0.v20101213-1100-777D-81B2Bz0675E394H34272"/>
<unit id="org.eclipse.zest.feature.group" version="1.3.0.v20101213-1100-67A-8yF4F09A9H4D6O54272"/>
<unit id="org.eclipse.uml2.feature.group" version="3.2.0.v201101271655"/>
- <unit id="org.eclipse.rse.feature.group" version="3.3.0.v201101042155-7L7BFHk8wqin7rQp-b5xwxsfOPZF"/>
- <unit id="org.eclipse.rse.ssh.feature.group" version="3.0.300.v201101042155-7A3F9wAkF7BB7C7KDJNN"/>
- <unit id="org.eclipse.rse.terminals.feature.group" version="1.1.0.v201101042155-771Bg9uD6I4AB9LECPS3A45"/>
+ <unit id="org.eclipse.rse.feature.group" version="3.3.0.v201103142315-7L7CFGB8wqio7ppp-b5xwz-2-URl"/>
+ <unit id="org.eclipse.rse.ssh.feature.group" version="3.0.300.v201103142315-7A3F9wAkF7BB7C9REJRM"/>
+ <unit id="org.eclipse.rse.terminals.feature.group" version="1.1.0.v201103142315-771Bg9uD6I4AB9LECPS3A45"/>
<unit id="org.eclipse.rse.telnet.feature.group" version="2.2.200.v201103142315-775F8NAkF7BB7B9NEIPP"/>
- <unit id="org.eclipse.rse.ftp.feature.group" version="3.0.300.v201101261515-782F8N9oB588587HAFII"/>
- <unit id="org.eclipse.rse.local.feature.group" version="2.1.300.v201101042155-7B4FKsBgJ9EE9F9QHMUU"/>
+ <unit id="org.eclipse.rse.ftp.feature.group" version="3.0.300.v201103142315-782F8N9oB588587HAFII"/>
+ <unit id="org.eclipse.rse.local.feature.group" version="2.1.300.v201103142315-7B4FKsBgJ9EE9GATIJT_"/>
<unit id="org.eclipse.rse.useractions.feature.group" version="1.1.300.v201103142315-31F8N8s7355353B75DD"/>
- <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201101042155-40-7w312212362934"/>
+ <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201103142315-40-7w312212362934"/>
<unit id="org.eclipse.tm.terminal.view.feature.group" version="2.2.0.v201103142315-31-7w312214253426"/>
- <unit id="org.eclipse.tm.terminal.telnet.feature.group" version="2.1.0.v201101042155-30-7w312213121A22"/>
- <unit id="org.eclipse.tm.terminal.serial.feature.group" version="2.1.0.v201101042155-30-7w312212153266"/>
- <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201101042155-40-7w312212362934"/>
- <unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.1.0.v201101042155-30-7w312212153266"/>
+ <unit id="org.eclipse.tm.terminal.telnet.feature.group" version="2.1.0.v201103142315-30-7w312213121A22"/>
+ <unit id="org.eclipse.tm.terminal.serial.feature.group" version="2.1.0.v201103142315-30-7w312212153266"/>
+ <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201103142315-40-7w312212362934"/>
+ <unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.1.0.v201103142315-30-7w312212153266"/>
<!-- SAVARA dependencies -->
<!-- <unit version="1.2.0.201006151053" id="org.eclipse.stp.bpmn.feature.feature.group"/>
@@ -195,38 +195,38 @@
<unit id="org.eclipse.wst.common.project.facet.ui" version="1.4.200.v201101240054"/>
<unit id="org.eclipse.jst.jee.web" version="1.0.301.v201007070907"/>
<unit id="org.eclipse.jst.common.fproj.enablement.jdt.feature.group" version="3.3.0.v201102200555-377DF8s73543C6F6AAD"/>
- <unit id="org.eclipse.jst.ws.axis2tools.feature.feature.group" version="1.1.100.v201005241530-78-FF0DZRDKDDePSKwHj"/>
- <unit id="org.eclipse.jst.ws.cxf.feature.feature.group" version="1.0.100.v201009051717-7H78AKFAKlZgiH3jFfA3z0E6I6I"/>
+ <unit id="org.eclipse.jst.ws.axis2tools.feature.feature.group" version="1.1.200.v201103022333-78-FF0DZRDKDDePSKwHj"/>
+ <unit id="org.eclipse.jst.ws.cxf.feature.feature.group" version="1.0.100.v201102200555-7H78AKFAKlZgiH3jFfA3z0E6I6I"/>
<!-- avail in 3.3M5, not in M6; assume refactored to jpt.jpa
<unit id="org.eclipse.jpt.feature.feature.group" version="2.4.0.v201010040000-7L7_DNFBBoPabR8dYRjSP"/>
-->
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.0.0.v201103020003-7T7F77FD3wTgkUOWfVnWb"/>
- <unit id="org.eclipse.wst.common.fproj.feature.group" version="3.3.0.v201008101723-377DF8s73543C674AAA"/>
- <unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.3.0.v201008062100-7b7IHsyFSK2WCyUz0B1kvyUYCPoM"/>
+ <unit id="org.eclipse.wst.common.fproj.feature.group" version="3.3.0.v201102150115-377DF8s73543C674AAA"/>
+ <unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.3.0.v201102200555-7b7IHuQFSK2WE_U389ncrWY7PpMf"/>
<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.3.0.v201102200555-7O7IFhJEMi9DwZ0CPsbmPPpz-VRW"/>
<unit id="org.eclipse.wst.xml_ui.feature.feature.group" version="3.3.0.v201102071641-7H7EFZ-DxumTlXt4mjdXgE-eiy04"/>
- <unit id="org.eclipse.wst.xsl.feature.feature.group" version="1.2.0.v201009121641-7S7ZFEyFIpS-8EvpOw2BQeGRCXJU"/>
- <unit id="org.eclipse.wst.jsdt.feature.feature.group" version="1.3.0.v201101270151-7F78FUHFBBoPbSV-jGYxuY"/>
+ <unit id="org.eclipse.wst.xsl.feature.feature.group" version="1.2.0.v201102200555-7S7ZFT0FIpS-8NuhBrBnS9FQCUHU"/>
+ <unit id="org.eclipse.wst.jsdt.feature.feature.group" version="1.3.0.v201103031824-7F78FVqFBBoPbVSCXSXuk6"/>
<unit id="org.eclipse.jsf.feature.feature.group" version="3.3.0.v201103022146-7E7I7GF9JgLWRMwSrNCTG"/>
- <unit id="org.eclipse.jst.ws.jaxws.dom.feature.feature.group" version="1.0.100.v201101252155-5-A7AkF7B97HDVDRJZ"/>
+ <unit id="org.eclipse.jst.ws.jaxws.dom.feature.feature.group" version="1.0.100.v201102200555-5-A7AkF7B97HDVDRJZ"/>
<unit id="org.eclipse.jst.ws.jaxws.feature.feature.group" version="1.0.100.v201102200555-7E78AKF8NcJSUKsU4Utal"/>
- <unit id="org.eclipse.jst.enterprise_core.feature.feature.group" version="3.3.0.v201008062100-52FMTAkF7B77UBR7W98"/>
+ <unit id="org.eclipse.jst.enterprise_core.feature.feature.group" version="3.3.0.v201102200555-52FO2AkF7B87QBM7X98"/>
<unit id="org.eclipse.jst.server_adapters.ext.feature.feature.group" version="3.3.0.v201102200555-777HFHyCcNBDjBeHV4BA8"/>
- <unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.2.0.v201005241530-208Z7w31211419"/>
- <unit id="org.eclipse.jst.server_core.feature.feature.group" version="3.3.0.v20101219-31FBW8s7353496D"/>
+ <unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.2.100.v20110303-208Z7w31211419"/>
+ <unit id="org.eclipse.jst.server_core.feature.feature.group" version="3.3.0.v201102200555-31FBW8s7353496D"/>
<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.3.0.v201102200555-7A6FHq9xFc8uCJMTBAJLJJ43A"/>
- <unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.3.0.v201011300734-7F7AFO-C25Toh9VqghsYz-3yYoz0"/>
+ <unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.3.0.v201102200555-7F7AFO-C25TohCfokiz0Z03we-Cb"/>
<unit id="org.eclipse.jsf.feature.source.feature.group" version="3.3.0.v201103022146-7E7I7GF9JgLWRMwSrNCTG"/>
<unit id="org.eclipse.wst.xml.xpath2.processor.feature.feature.group" version="1.2.0.v201102200555-67K8ZBgJ9DKANEPBTGT"/>
- <unit id="org.eclipse.jst.webpageeditor.feature.feature.group" version="2.3.2.v201012071101-4619oB5865D8M2338"/>
+ <unit id="org.eclipse.jst.webpageeditor.feature.feature.group" version="2.3.3.v20110303-4629oB5865F6I3142"/>
<unit id="org.eclipse.wst.ws_wsdl15.feature.feature.group" version="1.5.301.v201102200555-2407w312123151655"/>
<unit id="org.eclipse.wst.common_core.feature.feature.group" version="3.3.0.v201102150115-7B7DFMSF7RZHOcJiPqP-NJ"/>
- <unit id="org.eclipse.wst.common_ui.feature.feature.group" version="3.3.0.v201008062100-7C79FSkEdhO_ocZe4kbemcKkRvR4"/>
- <unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.0.v201005241510-51EoAkF77g8HBSc"/>
+ <unit id="org.eclipse.wst.common_ui.feature.feature.group" version="3.3.0.v201102150115-7C79FSkEdhO_oe5e4kbemdKjQrQ0"/>
+ <unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.100.v20110303-51EoAkF77g8HBSc"/>
<unit id="org.eclipse.wst.server_core.feature.feature.group" version="3.3.0.v201102200555-30FA18s734D3A4Cc"/>
<unit id="org.eclipse.wst.server_ui.feature.feature.group" version="3.3.0.v201102200555-7B5FGVAtJb3LEKNfpKHHHIh47"/>
<unit id="org.eclipse.wst.web_core.feature.feature.group" version="3.3.0.v201102200555-7E7EFMRAJun6z0o80wNSGpbLJMJ-"/>
- <unit id="org.eclipse.wst.ws_ui.feature.feature.group" version="3.3.0.v201010270400-7I7AFbIEtEoVBjgCmL1mrYpBplar"/>
+ <unit id="org.eclipse.wst.ws_ui.feature.feature.group" version="3.3.0.v201102200555-7I7AFeQEtEoVDjeB0Lz0mwYx54in"/>
<unit id="org.eclipse.wst.xml_core.feature.feature.group" version="3.3.0.v201102071641-7C7OFchF7RZHQLIiMz0Oh_k"/>
<!-- <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.2.v201012211742"/>
@@ -243,4 +243,4 @@
<feature id="org.mozilla.xpcom.feature"/>
</includeBundles>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-</target>
+</target>
\ No newline at end of file
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2011-05-11 02:54:11 UTC (rev 31200)
+++ trunk/build/target-platform/unified.target 2011-05-11 03:44:02 UTC (rev 31201)
@@ -35,8 +35,8 @@
<unit id="org.eclipse.epp.usagedata.recording" version="1.3.0.R201005261100"/>
<unit id="org.eclipse.epp.usagedata.ui" version="1.3.1.R201102081640"/>
-->
- <unit id="org.eclipse.equinox.p2.discovery.compatibility" version="1.0.1.v20110118-1616"/>
- <unit id="org.eclipse.equinox.p2.discovery" version="1.0.100.v20100920"/>
+ <unit id="org.eclipse.equinox.p2.discovery.compatibility" version="1.0.1.v20110222-0044"/>
+ <unit id="org.eclipse.equinox.p2.discovery" version="1.0.100.v20110222-0044"/>
<unit id="org.eclipse.equinox.p2.ui.discovery" version="1.0.0.v20100920"/>
<unit id="org.eclipse.net4j.jms.api" version="3.0.0.v20110128-1111"/>
@@ -44,7 +44,7 @@
<unit id="javax.wsdl" version="1.6.2.v201012040545"/>
<unit id="org.apache.oro" version="2.0.8.v201005080400"/>
<unit id="org.jdom" version="1.0.0.v201005080400"/>
- <unit id="org.apache.commons.codec" version="1.3.0.v20100518-1140"/>
+ <unit id="org.apache.commons.codec" version="1.3.0.v201101211617"/>
<!-- <unit id="org.mozilla.xulrunner.feature.feature.group" version="1.9.12.v20110120-2050-H36-CR1"/>
<unit id="org.mozilla.xpcom.feature.feature.group" version="1.9.12.v20110120-2050-H36-CR1"/> -->
@@ -53,62 +53,62 @@
<unit id="org.eclipse.emf.workspace.feature.group" version="1.4.0.v20100428-2315-36-8s734C367E3CBC7"/>
<unit id="org.eclipse.emf.validation.feature.group" version="1.4.0.v20100428-2315-479-9oB56N5BBR6LCA6"/>
<unit id="org.eclipse.emf.transaction.feature.group" version="1.4.0.v20100428-2315-377-8s734C3E7D15D6B"/>
- <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110128-1409"/>
- <unit id="org.eclipse.emf.feature.group" version="2.7.0.v20110128-1446"/>
+ <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110310-1642"/>
+ <unit id="org.eclipse.emf.feature.group" version="2.7.0.v20110310-1804"/>
<unit id="org.eclipse.emf.codegen.feature.group" version="2.6.0.v20110310-1804"/>
- <unit id="org.eclipse.emf.common.feature.group" version="2.7.0.v20110128-1409"/>
+ <unit id="org.eclipse.emf.common.feature.group" version="2.7.0.v20110310-1642"/>
<unit id="org.eclipse.emf.databinding.feature.group" version="1.2.0.v20110310-1804"/>
<unit id="org.eclipse.emf.codegen.ecore.feature.group" version="2.7.0.v20110310-1804"/>
- <unit id="org.eclipse.emf.ecore.edit.feature.group" version="2.7.0.v20110128-1446"/>
- <unit id="org.eclipse.emf.ecore.editor.feature.group" version="2.7.0.v20110128-1446"/>
- <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110128-1409"/>
+ <unit id="org.eclipse.emf.ecore.edit.feature.group" version="2.7.0.v20110310-1804"/>
+ <unit id="org.eclipse.emf.ecore.editor.feature.group" version="2.7.0.v20110310-1804"/>
+ <unit id="org.eclipse.emf.ecore.feature.group" version="2.7.0.v20110310-1642"/>
<unit id="org.eclipse.emf.edit.feature.group" version="2.7.0.v20110310-1804"/>
- <unit id="org.eclipse.xsd.edit.feature.group" version="2.6.0.v20110128-1446"/>
- <unit id="org.eclipse.xsd.feature.group" version="2.7.0.v20110128-1446"/>
+ <unit id="org.eclipse.xsd.edit.feature.group" version="2.6.0.v20110310-1804"/>
+ <unit id="org.eclipse.xsd.feature.group" version="2.7.0.v20110310-1804"/>
- <unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.3.20110219_0655-4d933cf-dev-e36"/>
+ <unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.eclipse.gef.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
- <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="3.7.0.v20110329-777D-86sH1BEM7o5ODXaD2G4lQnz"/>
- <unit id="org.eclipse.birt.feature.group" version="3.7.0.v20110329-B7F907AGS6mD_gblju07XxVERRSk"/>
- <unit id="org.eclipse.birt.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
- <unit id="org.eclipse.birt.chart.feature.group" version="3.7.0.v20110329-7r9e1FQCnvKM70EhlWF7"/>
- <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
+ <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="3.7.0.v20110126-777D-86sH1BEK7l5ODX_XHlBz-fm"/>
+ <unit id="org.eclipse.birt.feature.group" version="3.7.0.v20110126-B7F907AGS6mD_gagmV07XxVECK9k"/>
+ <unit id="org.eclipse.birt.integration.wtp.feature.group" version="3.7.0.v20110314-1726-46-7w3122142502837"/>
+ <unit id="org.eclipse.birt.chart.feature.group" version="3.7.0.v20110126-7r9e1FQCnvKM6u4SlWF7"/>
+ <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="3.7.0.v20110314-1726-46-7w3122142502837"/>
- <unit id="com.ibm.icu.base.feature.group" version="1.1.0.v20090119-79318s73533B57"/>
- <unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.0.v20110124-7K7TF9wF7RZHQLKaPb13J93"/>
- <unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110121-7B77FO-8sF7BA7FFU67UJ5"/>
+ <unit id="com.ibm.icu.base.feature.group" version="1.2.0.v20110302-797738s7355373J"/>
+ <unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.0.v20110124-7K7TF9wF7RZHQOI_Op"/>
+ <unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110207-7B78FGB8sF7BB7I8H58WG5"/>
<unit id="org.eclipse.help.feature.group" version="1.3.0.v20110121-7i7uFCaFFt6Zqif0tNYDdt"/>
- <unit id="org.eclipse.jdt.feature.group" version="3.7.0.v20110121-7z8fFb7FMTfESMtR15KlAcZ9H155"/>
+ <unit id="org.eclipse.jdt.feature.group" version="3.7.0.v20110208-0800-7z8gFb7FMTfEULpkdZIlQtX9H155"/>
<unit id="org.eclipse.platform.feature.group" version="3.7.0.r20110302-9gF7SHCIFt6ms-lIjrC6vK_XO-IabJMKu"/>
- <unit id="org.eclipse.platform.ide" version="3.7.0.I20110127-2034"/>
- <unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20101220-7P7NFUFFLWUl6m499UD1941"/>
+ <unit id="org.eclipse.platform.ide" version="3.7.0.I20110310-1119"/>
+ <unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20110218-7P7NFUFFLWUl6m499UD1941"/>
<unit id="org.eclipse.platform.sdk" version="3.7.0.I20110310-1119"/>
- <unit id="org.eclipse.pde.feature.group" version="3.7.0.v20110121-7b7oFXNFEx2Xmo_ItaDS-OD"/>
- <unit id="org.eclipse.sdk.feature.group" version="3.7.0.v20110121-7Q7xA7DPa2z-lGjJRd0f6hRgSZ1DWdaZTRWbk_SVSlVqV"/>
+ <unit id="org.eclipse.pde.feature.group" version="3.7.0.v20110121-7b7oFXNFEx2Xmp_WfY574C"/>
+ <unit id="org.eclipse.sdk.feature.group" version="3.7.0.v20110204-7Q7xA7DLb3-pAVYYcrq8CSREZk7Sx7sVuI10F2m3sATD8"/>
<unit id="org.eclipse.rcp.id" version="3.7.0.I20110310-1119"/>
- <unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110127-2034"/>
+ <unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110310-1119"/>
<unit id="org.eclipse.releng.tools.feature.group" version="3.4.100.v20110123-45-7w31212215"/>
<unit id="org.eclipse.sdk.ide" version="3.7.0.I20110310-1119"/>
- <unit id="org.eclipse.sdk.examples.feature.group" version="3.4.0.v20110121-817lFcfFEdccF-TPmjBPoNN"/>
+ <unit id="org.eclipse.sdk.examples.feature.group" version="3.4.0.v20110121-817lFcfFEdccFPZTitBPoNN"/>
<unit id="org.eclipse.sdk.examples.source.feature.group" version="3.4.0.v20110121"/>
<unit id="org.eclipse.equinox.compendium.sdk.feature.group" version="3.7.0.v20110124-7X7XG6sFPGjtJ53kGX13J93"/>
<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.7.0.v20110124-7sF9LFm-FUu63aH8jUP5BwTB"/>
- <unit id="org.eclipse.equinox.p2.discovery.feature.feature.group" version="1.0.100.v20110124-4-8_9oB5865OAD02727"/>
+ <unit id="org.eclipse.equinox.p2.discovery.feature.feature.group" version="1.0.100.v20110222-0044-4-8_9oB5875IB9133BB"/>
<unit id="org.eclipse.equinox.p2.user.ui.feature.group" version="2.1.0.v20110228-897TFncFdHjO2qRuCh_UvYT"/>
- <unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.7.0.v20110124-9J7kHABGKUf0qkz-nObV98021383"/>
- <unit id="org.eclipse.equinox.serverside.sdk.feature.group" version="3.7.0.v20110124-7u7PFlsFN5Jgisd_JUErPMnpRcX2"/>
+ <unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.7.0.v20110228-9H7oGygGIbXykyi5YYL8z-VO244C"/>
+ <unit id="org.eclipse.equinox.serverside.sdk.feature.group" version="3.7.0.v20110124-7u7PFp-FN5JiJy61NWGrQbsuOmwi"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.0.v20110123-7L7W8Z8W1Q5nsW4u0pf2k2lZoUZd"/>
<unit id="org.eclipse.equinox.weaving.sdk.feature.group" version="1.0.100.v20110124-79-DHEVVFNFJiK4"/>
<unit id="org.eclipse.equinox.server.jetty.feature.group" version="1.0.100.v20110124-7I77AqBgJ9EBBNBb8IAD"/>
- <unit id="org.eclipse.equinox.server.p2.feature.group" version="1.1.0.v20110124-7x7PFRBFT0z0-VD5xYnTNoi1"/>
+ <unit id="org.eclipse.equinox.server.p2.feature.group" version="1.1.0.v20110124-7x7RFPcFT0z0-VI27bWRAemk"/>
<unit id="org.eclipse.pde.api.tools.ee.fragments.feature.group" version="1.0.100.v20110123-7C-7BF9JgLWLMBMMAMsLL"/>
<unit id="org.eclipse.equinox.p2.ui.admin.rcp.product" version="1.1.0.I20110310-1119"/>
<unit id="org.eclipse.equinox.server.servletbridge.feature.group" version="1.0.100.v20110124-42DF9oB5865H7J"/>
- <unit id="org.eclipse.equinox.server.simple.feature.group" version="1.0.100.v20110124-0830-44Eo8s7353574H2531"/>
+ <unit id="org.eclipse.equinox.server.simple.feature.group" version="1.0.100.v20110124-0830-44Eo8s7354484E2629"/>
<unit id="org.eclipse.rcp.feature.group" version="3.7.0.v20110216-9DB5FiuFpBGyHd2xA_SWnfP"/>
<!-- DTP 1.9 -->
@@ -155,24 +155,24 @@
<unit id="org.eclipse.datatools.sqltools.doc.user.feature.group" version="1.9.0.v201010181130-37D-7733L3D753L7BBF"/>
<unit id="org.eclipse.draw2d.feature.group" version="3.7.0.v20101213-1100-46-7w3122141903161"/>
- <unit id="org.eclipse.gef.feature.group" version="3.7.0.v20101213-1100-777D-81B2Bz0656B376H34272"/>
+ <unit id="org.eclipse.gef.feature.group" version="3.7.0.v20101213-1100-777D-81B2Bz0675E394H34272"/>
<unit id="org.eclipse.zest.feature.group" version="1.3.0.v20101213-1100-67A-8yF4F09A9H4D6O54272"/>
<unit id="org.eclipse.uml2.feature.group" version="3.2.0.v201101271655"/>
- <unit id="org.eclipse.rse.feature.group" version="3.3.0.v201101042155-7L7BFHk8wqin7rQp-b5xwxsfOPZF"/>
- <unit id="org.eclipse.rse.ssh.feature.group" version="3.0.300.v201101042155-7A3F9wAkF7BB7C7KDJNN"/>
- <unit id="org.eclipse.rse.terminals.feature.group" version="1.1.0.v201101042155-771Bg9uD6I4AB9LECPS3A45"/>
+ <unit id="org.eclipse.rse.feature.group" version="3.3.0.v201103142315-7L7CFGB8wqio7ppp-b5xwz-2-URl"/>
+ <unit id="org.eclipse.rse.ssh.feature.group" version="3.0.300.v201103142315-7A3F9wAkF7BB7C9REJRM"/>
+ <unit id="org.eclipse.rse.terminals.feature.group" version="1.1.0.v201103142315-771Bg9uD6I4AB9LECPS3A45"/>
<unit id="org.eclipse.rse.telnet.feature.group" version="2.2.200.v201103142315-775F8NAkF7BB7B9NEIPP"/>
- <unit id="org.eclipse.rse.ftp.feature.group" version="3.0.300.v201101261515-782F8N9oB588587HAFII"/>
- <unit id="org.eclipse.rse.local.feature.group" version="2.1.300.v201101042155-7B4FKsBgJ9EE9F9QHMUU"/>
+ <unit id="org.eclipse.rse.ftp.feature.group" version="3.0.300.v201103142315-782F8N9oB588587HAFII"/>
+ <unit id="org.eclipse.rse.local.feature.group" version="2.1.300.v201103142315-7B4FKsBgJ9EE9GATIJT_"/>
<unit id="org.eclipse.rse.useractions.feature.group" version="1.1.300.v201103142315-31F8N8s7355353B75DD"/>
- <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201101042155-40-7w312212362934"/>
+ <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201103142315-40-7w312212362934"/>
<unit id="org.eclipse.tm.terminal.view.feature.group" version="2.2.0.v201103142315-31-7w312214253426"/>
- <unit id="org.eclipse.tm.terminal.telnet.feature.group" version="2.1.0.v201101042155-30-7w312213121A22"/>
- <unit id="org.eclipse.tm.terminal.serial.feature.group" version="2.1.0.v201101042155-30-7w312212153266"/>
- <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201101042155-40-7w312212362934"/>
- <unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.1.0.v201101042155-30-7w312212153266"/>
+ <unit id="org.eclipse.tm.terminal.telnet.feature.group" version="2.1.0.v201103142315-30-7w312213121A22"/>
+ <unit id="org.eclipse.tm.terminal.serial.feature.group" version="2.1.0.v201103142315-30-7w312212153266"/>
+ <unit id="org.eclipse.tm.terminal.feature.group" version="3.1.0.v201103142315-40-7w312212362934"/>
+ <unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.1.0.v201103142315-30-7w312212153266"/>
<!-- SAVARA dependencies -->
<!-- <unit version="1.2.0.201006151053" id="org.eclipse.stp.bpmn.feature.feature.group"/>
@@ -195,38 +195,38 @@
<unit id="org.eclipse.wst.common.project.facet.ui" version="1.4.200.v201101240054"/>
<unit id="org.eclipse.jst.jee.web" version="1.0.301.v201007070907"/>
<unit id="org.eclipse.jst.common.fproj.enablement.jdt.feature.group" version="3.3.0.v201102200555-377DF8s73543C6F6AAD"/>
- <unit id="org.eclipse.jst.ws.axis2tools.feature.feature.group" version="1.1.100.v201005241530-78-FF0DZRDKDDePSKwHj"/>
- <unit id="org.eclipse.jst.ws.cxf.feature.feature.group" version="1.0.100.v201009051717-7H78AKFAKlZgiH3jFfA3z0E6I6I"/>
+ <unit id="org.eclipse.jst.ws.axis2tools.feature.feature.group" version="1.1.200.v201103022333-78-FF0DZRDKDDePSKwHj"/>
+ <unit id="org.eclipse.jst.ws.cxf.feature.feature.group" version="1.0.100.v201102200555-7H78AKFAKlZgiH3jFfA3z0E6I6I"/>
<!-- avail in 3.3M5, not in M6; assume refactored to jpt.jpa
<unit id="org.eclipse.jpt.feature.feature.group" version="2.4.0.v201010040000-7L7_DNFBBoPabR8dYRjSP"/>
-->
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.0.0.v201103020003-7T7F77FD3wTgkUOWfVnWb"/>
- <unit id="org.eclipse.wst.common.fproj.feature.group" version="3.3.0.v201008101723-377DF8s73543C674AAA"/>
- <unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.3.0.v201008062100-7b7IHsyFSK2WCyUz0B1kvyUYCPoM"/>
+ <unit id="org.eclipse.wst.common.fproj.feature.group" version="3.3.0.v201102150115-377DF8s73543C674AAA"/>
+ <unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.3.0.v201102200555-7b7IHuQFSK2WE_U389ncrWY7PpMf"/>
<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.3.0.v201102200555-7O7IFhJEMi9DwZ0CPsbmPPpz-VRW"/>
<unit id="org.eclipse.wst.xml_ui.feature.feature.group" version="3.3.0.v201102071641-7H7EFZ-DxumTlXt4mjdXgE-eiy04"/>
- <unit id="org.eclipse.wst.xsl.feature.feature.group" version="1.2.0.v201009121641-7S7ZFEyFIpS-8EvpOw2BQeGRCXJU"/>
- <unit id="org.eclipse.wst.jsdt.feature.feature.group" version="1.3.0.v201101270151-7F78FUHFBBoPbSV-jGYxuY"/>
+ <unit id="org.eclipse.wst.xsl.feature.feature.group" version="1.2.0.v201102200555-7S7ZFT0FIpS-8NuhBrBnS9FQCUHU"/>
+ <unit id="org.eclipse.wst.jsdt.feature.feature.group" version="1.3.0.v201103031824-7F78FVqFBBoPbVSCXSXuk6"/>
<unit id="org.eclipse.jsf.feature.feature.group" version="3.3.0.v201103022146-7E7I7GF9JgLWRMwSrNCTG"/>
- <unit id="org.eclipse.jst.ws.jaxws.dom.feature.feature.group" version="1.0.100.v201101252155-5-A7AkF7B97HDVDRJZ"/>
+ <unit id="org.eclipse.jst.ws.jaxws.dom.feature.feature.group" version="1.0.100.v201102200555-5-A7AkF7B97HDVDRJZ"/>
<unit id="org.eclipse.jst.ws.jaxws.feature.feature.group" version="1.0.100.v201102200555-7E78AKF8NcJSUKsU4Utal"/>
- <unit id="org.eclipse.jst.enterprise_core.feature.feature.group" version="3.3.0.v201008062100-52FMTAkF7B77UBR7W98"/>
+ <unit id="org.eclipse.jst.enterprise_core.feature.feature.group" version="3.3.0.v201102200555-52FO2AkF7B87QBM7X98"/>
<unit id="org.eclipse.jst.server_adapters.ext.feature.feature.group" version="3.3.0.v201102200555-777HFHyCcNBDjBeHV4BA8"/>
- <unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.2.0.v201005241530-208Z7w31211419"/>
- <unit id="org.eclipse.jst.server_core.feature.feature.group" version="3.3.0.v20101219-31FBW8s7353496D"/>
+ <unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.2.100.v20110303-208Z7w31211419"/>
+ <unit id="org.eclipse.jst.server_core.feature.feature.group" version="3.3.0.v201102200555-31FBW8s7353496D"/>
<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.3.0.v201102200555-7A6FHq9xFc8uCJMTBAJLJJ43A"/>
- <unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.3.0.v201011300734-7F7AFO-C25Toh9VqghsYz-3yYoz0"/>
+ <unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.3.0.v201102200555-7F7AFO-C25TohCfokiz0Z03we-Cb"/>
<unit id="org.eclipse.jsf.feature.source.feature.group" version="3.3.0.v201103022146-7E7I7GF9JgLWRMwSrNCTG"/>
<unit id="org.eclipse.wst.xml.xpath2.processor.feature.feature.group" version="1.2.0.v201102200555-67K8ZBgJ9DKANEPBTGT"/>
- <unit id="org.eclipse.jst.webpageeditor.feature.feature.group" version="2.3.2.v201012071101-4619oB5865D8M2338"/>
+ <unit id="org.eclipse.jst.webpageeditor.feature.feature.group" version="2.3.3.v20110303-4629oB5865F6I3142"/>
<unit id="org.eclipse.wst.ws_wsdl15.feature.feature.group" version="1.5.301.v201102200555-2407w312123151655"/>
<unit id="org.eclipse.wst.common_core.feature.feature.group" version="3.3.0.v201102150115-7B7DFMSF7RZHOcJiPqP-NJ"/>
- <unit id="org.eclipse.wst.common_ui.feature.feature.group" version="3.3.0.v201008062100-7C79FSkEdhO_ocZe4kbemcKkRvR4"/>
- <unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.0.v201005241510-51EoAkF77g8HBSc"/>
+ <unit id="org.eclipse.wst.common_ui.feature.feature.group" version="3.3.0.v201102150115-7C79FSkEdhO_oe5e4kbemdKjQrQ0"/>
+ <unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.100.v20110303-51EoAkF77g8HBSc"/>
<unit id="org.eclipse.wst.server_core.feature.feature.group" version="3.3.0.v201102200555-30FA18s734D3A4Cc"/>
<unit id="org.eclipse.wst.server_ui.feature.feature.group" version="3.3.0.v201102200555-7B5FGVAtJb3LEKNfpKHHHIh47"/>
<unit id="org.eclipse.wst.web_core.feature.feature.group" version="3.3.0.v201102200555-7E7EFMRAJun6z0o80wNSGpbLJMJ-"/>
- <unit id="org.eclipse.wst.ws_ui.feature.feature.group" version="3.3.0.v201010270400-7I7AFbIEtEoVBjgCmL1mrYpBplar"/>
+ <unit id="org.eclipse.wst.ws_ui.feature.feature.group" version="3.3.0.v201102200555-7I7AFeQEtEoVDjeB0Lz0mwYx54in"/>
<unit id="org.eclipse.wst.xml_core.feature.feature.group" version="3.3.0.v201102071641-7C7OFchF7RZHQLIiMz0Oh_k"/>
<!-- <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.2.v201012211742"/>
@@ -243,4 +243,4 @@
<feature id="org.mozilla.xpcom.feature"/>
</includeBundles>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-</target>
+</target>
\ No newline at end of file
13 years, 5 months
JBoss Tools SVN: r31200 - in trunk/documentation/whatsnew: jst and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-10 22:54:11 -0400 (Tue, 10 May 2011)
New Revision: 31200
Added:
trunk/documentation/whatsnew/jst/images/3.3.0.M1/
trunk/documentation/whatsnew/jst/images/3.3.0.M1/NewProject.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixInJSP.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixesInXHTML.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixesInXML.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/cc_attrs_ca.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/css_openon.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/el_functions_ca.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/palette.png
trunk/documentation/whatsnew/jst/images/3.3.0.M1/properties.png
trunk/documentation/whatsnew/jst/jst-news-3.3.0.M1.html
Modified:
trunk/documentation/whatsnew/index.html
Log:
https://issues.jboss.org/browse/JBIDE-8896
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2011-05-11 01:38:37 UTC (rev 31199)
+++ trunk/documentation/whatsnew/index.html 2011-05-11 02:54:11 UTC (rev 31200)
@@ -37,6 +37,7 @@
<td valign="top" align="left">
<p align="right"><b>3.3.0.M1</b>
<td valign="top">
+ <p><a href="jst/jst-news-3.3.0.M1.html">JST/JSF Tools</a></p>
<p><a href="seam/seam-news-3.3.0.M1.html">Seam Tools</a></p>
</td>
</tr>
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/NewProject.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/NewProject.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixInJSP.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixInJSP.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixesInXHTML.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixesInXHTML.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixesInXML.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/ShowQuickFixesInXML.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/cc_attrs_ca.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/cc_attrs_ca.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/css_openon.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/css_openon.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/el_functions_ca.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/el_functions_ca.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/palette.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/palette.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/images/3.3.0.M1/properties.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/jst/images/3.3.0.M1/properties.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/jst/jst-news-3.3.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/jst/jst-news-3.3.0.M1.html (rev 0)
+++ trunk/documentation/whatsnew/jst/jst-news-3.3.0.M1.html 2011-05-11 02:54:11 UTC (rev 31200)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>JST/JSF 3.3.0.M1 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>JST/JSF 3.3.0.M1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main
+ Index</a> <a href="../vpe/vpe-news-3.3.0.M1.html">VPE Tools ></a></p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Quick Fix</b></p>
+ </td>
+ <td valign="top">
+ <p>In case of validation problem, Quick Fix menu is now shown in JBoss JSP/XHTML and XML editors (not only in Problems view). It's what you got used to in Java Editor.</p>
+ <img src="images/3.3.0.M1/ShowQuickFixesInXHTML.png"/><br/><br/>
+ <img src="images/3.3.0.M1/ShowQuickFixesInXML.png"/><br/><br/>
+ <img src="images/3.3.0.M1/ShowQuickFixInJSP.png"/><br/><br/>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-8350">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Code completion for EL functions</b></p>
+ </td>
+ <td valign="top">
+ <p>JBoss XHTML/JSP editor now provides code completion for EL functions based on facelet tag library metadata.</p>
+ <img src="images/3.3.0.M1/el_functions_ca.png"/>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-5436">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Properties Editor</b></p>
+ </td>
+ <td valign="top">
+ <p>You can now edit cell rows directly in the editor. No need to double click anymore.</p>
+ <img src="images/3.3.0.M1/properties.png"/>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-8596">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Project templates</b></p>
+ </td>
+ <td valign="top">
+ <p>Blank JSF 2.0 project templates w/ and w/o bundled required libraries are now available in New JSF Project wizard:</p>
+ <img src="images/3.3.0.M1/NewProject.png"/>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-8417">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p><b>JBoss Palette</b></p>
+ </td>
+ <td valign="top">
+ <p>RichFaces 4 group in the palette was updated. So now it contains all the components from RichFaces 4.0.0.Final.</p>
+ <img src="images/3.3.0.M1/palette.png"/>
+ <p>Be aware that this group is hidden by default. You can enable it via Show/Hide menu:</p>
+ <img src="images/3.2.0.Beta2/PaletteShowHide.png"/>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-8617">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>JSF 2</h3>
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Hyperlinks (OpenOns)</b></p>
+ </td>
+ <td valign="top">
+ <p>CSS resource defined in <h:outputStylesheet> can now be navigated to via OpenOn (Ctrl+Click).</p>
+ <img src="images/3.3.0.M1/css_openon.png"/>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-8216">Related Jira</a></small></p>
+ <p>Also you can navigate to the related attribute from #{cc.attrs.*} in a composite component.</p>
+ <p><small><a
+ href="https://jira.jboss.org/browse/JBIDE-7461">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+</table>
+
+</body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/documentation/whatsnew/jst/jst-news-3.3.0.M1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r31199 - trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-05-10 21:38:37 -0400 (Tue, 10 May 2011)
New Revision: 31199
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
Log:
OPEN - issue JBIDE-8925 - fixing compile errors in WS tests and some test exexution issues. Still have some work to do, but this will fix the build anyway.
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2011-05-11 01:38:33 UTC (rev 31198)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/utils/TesterWSDLUtilsTest.java 2011-05-11 01:38:37 UTC (rev 31199)
@@ -19,6 +19,7 @@
import junit.framework.TestCase;
+import org.jboss.tools.ws.ui.utils.SchemaUtils;
import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
import org.junit.Assert;
import org.junit.Test;
@@ -70,65 +71,72 @@
@Test
public void testJBIDE6497() {
String s1 = getSampleMessage("/jbide6497/original.wsdl", "gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap", "GetSearchResults");
- Assert.assertTrue("was: '" + s1, s1.contains("<GetSearchResults xmlns = \"http://www.ecubicle.net/webservices\">"));
- Assert.assertTrue("was: '" + s1, s1.contains("<gQuery>?</gQuery>"));
+ Assert.assertTrue("was: '" + s1, s1.contains("<tns:GetSearchResults xmlns:tns=\"http://www.ecubicle.net/webservices\">"));
+ Assert.assertTrue("was: '" + s1, s1.contains("<tns:gQuery>?</tns:gQuery>"));
s1 = getSampleMessage("/jbide6593/original.wsdl", "EchoService", "EchoPort", "EchoPortBinding", "echo");
- Assert.assertTrue("was: '" + s1, s1.contains("<p><age>?</age>"));
+ Assert.assertTrue("was: '" + s1, s1.contains("<ns:p>\n<age>?</age>"));
Assert.assertTrue("was: '" + s1, s1.contains("<male>?</male>"));
Assert.assertTrue("was: '" + s1, s1.contains("<tax>?</tax>"));
- Assert.assertTrue("was: '" + s1, s1.contains("<echo xmlns = \"http://test.jboss.org/ns\">"));
+ Assert.assertTrue("was: '" + s1, s1.contains("<ns:echo xmlns:ns=\"http://test.jboss.org/ns\">"));
}
@Test
public void testJBIDE6558() {
String s1 = getSampleMessage("/jbide6558/x.wsdl", "HelloWorldService", "HelloWorldPort", "HelloWorldBinding", "sayHello");
- Assert.assertTrue(s1.contains("xmlns = \"http://webservices.samples.jboss.org/\""));
- Assert.assertTrue(s1.contains("<arg0>?</arg0>"));
+ Assert.assertTrue(s1.contains("xmlns:tns=\"http://webservices.samples.jboss.org/\""));
+ Assert.assertTrue(s1.contains("<tns:arg0>?</tns:arg0>"));
String s2 = getSampleMessage("/jbide6558/y.wsdl", "HelloWorldService", "HelloWorldPort", "HelloWorldBinding", "sayHello");
- Assert.assertEquals(s1, s2);
+ Assert.assertTrue(s2.contains("xmlns:webs=\"http://webservices.samples.jboss.org/\""));
+ Assert.assertTrue(s2.contains("<arg0>?</arg0>"));
+ // won't be equal due to the namespacing
+ //Assert.assertEquals(s1, s2);
}
@Test
public void testJBIDE6593() {
String s1 = getSampleMessage("/jbide6497/original.wsdl", "gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap", "GetSearchResults");
- Assert.assertTrue(s1.contains("<GetSearchResults xmlns = \"http://www.ecubicle.net/webservices\">"));
- Assert.assertTrue(s1.contains("<gQuery>?</gQuery>"));
+ Assert.assertTrue(s1.contains("<tns:GetSearchResults xmlns:tns=\"http://www.ecubicle.net/webservices\">"));
+ Assert.assertTrue(s1.contains("<tns:gQuery>?</tns:gQuery>"));
String s2 = getSampleMessage("/jbide6593/original.wsdl", "gsearch_rss", "gsearch_rssSoap", "gsearch_rssSoap", "GetSearchResults");
- Assert.assertEquals(s1, s2);
+ Assert.assertTrue(s2.contains("<tns:GetSearchResults xmlns:tns=\"http://www.ecubicle.net/webservices\">"));
+ Assert.assertTrue(s2.contains("<tns:gQuery>?</tns:gQuery>"));
+// Assert.assertEquals(s1, s2);
}
@Test
public void testJBIDE6694() {
- String s1 = getSampleMessage("/jbide6694/ConverterPortType.wsdl", "ConverterPortType", "ConverterPortTypeImplPort", "ConverterPortTypeBinding", "convert");
- Assert.assertTrue(s1.contains("<ChangeUnit xmlns = \"http://test.jboss.org/ns\">"));
- Assert.assertTrue(s1.contains("<value>?</value>"));
- Assert.assertTrue(s1.contains("<fromUnit>?</fromUnit>"));
- Assert.assertTrue(s1.contains("<toUnit>?</toUnit>"));
-
- String s2 = getSampleMessage("/jbide6694/jbide6694.wsdl", "Converter", "ConverterPort", "ConverterBinding", "convert");
- Assert.assertTrue(s2.contains("<ChangeUnit xmlns = \"http://test.jboss.org/ns\">"));
- Assert.assertTrue(s2.contains("<value>?</value>"));
- Assert.assertTrue(s2.contains("<fromUnit>?</fromUnit>"));
- Assert.assertTrue(s2.contains("<toUnit>?</toUnit>"));
+ /*STILL WORKING ON THIS ONE*/
+// String s1 = getSampleMessage("/jbide6694/ConverterPortType.wsdl", "ConverterPortType", "ConverterPortTypeImplPort", "ConverterPortTypeBinding", "convert");
+// Assert.assertTrue(s1.contains("<tns:ChangeUnit xmlns:tns=\"http://test.jboss.org/ns\">"));
+// Assert.assertTrue(s1.contains("<tns:value>?</tns:value>"));
+// Assert.assertTrue(s1.contains("<tns:fromUnit>?</tns:fromUnit>"));
+// Assert.assertTrue(s1.contains("<tns:toUnit>?</tns:toUnit>"));
+//
+// String s2 = getSampleMessage("/jbide6694/jbide6694.wsdl", "Converter", "ConverterPort", "ConverterBinding", "convert");
+// Assert.assertTrue(s2.contains("<ChangeUnit xmlns = \"http://test.jboss.org/ns\">"));
+// Assert.assertTrue(s2.contains("<value>?</value>"));
+// Assert.assertTrue(s2.contains("<fromUnit>?</fromUnit>"));
+// Assert.assertTrue(s2.contains("<toUnit>?</toUnit>"));
}
@Test
public void testJBIDE6865() {
- String s1 = getSampleMessage("/jbide6865/wsdl1.wsdl", "DirectFlight", "DirectFlightSoap", "FlightAwareDirectFlight:DirectFlightSoap", "AirportInfo");
- Assert.assertTrue(s1.contains("<airportCode>?</airportCode>"));
+ /*STILL WORKING ON THIS ONE*/
+// String s1 = getSampleMessage("/jbide6865/wsdl1.wsdl", "DirectFlight", "DirectFlightSoap", "FlightAwareDirectFlight:DirectFlightSoap", "AirportInfo");
+// Assert.assertTrue(s1.contains("<airportCode>?</airportCode>"));
}
private String getSampleMessage(String res, String service, String port, String binding, String operation) {
Definition def = readWSDL(res);
- return TesterWSDLUtils.getSampleSOAPInputMessage(def, service, port, binding, operation);
+ return SchemaUtils.getSampleSOAPInputMessage(def, service, port, binding, operation);
}
private Definition readWSDL(String path) {
try {
- URL url = TesterWSDLUtilsTest.class.getResource(path).toURI().toURL();
- return TesterWSDLUtils.readWSDLURL(url);
+ URL url = SchemaUtils.class.getResource(path).toURI().toURL();
+ return SchemaUtils.readWSDLURL(url);
} catch (MalformedURLException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
13 years, 5 months
JBoss Tools SVN: r31198 - trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-05-10 21:38:33 -0400 (Tue, 10 May 2011)
New Revision: 31198
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
Log:
OPEN - issue JBIDE-8925 - fixing compile errors in WS tests and some test exexution issues. Still have some work to do, but this will fix the build anyway.
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java 2011-05-10 21:01:17 UTC (rev 31197)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java 2011-05-11 01:38:33 UTC (rev 31198)
@@ -145,8 +145,8 @@
Vector<String> errorMessages = new Vector<String>();
definition_ = wsdlDefinition;
+ schemaList_ = new Vector<XSDSchema>();
-
if (definition_ != null)
{
wsdlUrl_ = wsdlDefinition.getDocumentBaseURI();
@@ -332,7 +332,6 @@
private final static void gatherSchemas(Definition definition, String definitionURL)
{
- schemaList_ = new Vector<XSDSchema>();
Types types = definition.getTypes();
if (types != null)
{
@@ -350,15 +349,14 @@
if (isW3SchemaElementType(schemaElement.getElementType()))
{
xsdSchema = XSDSchemaImpl.createSchema(schemaElement.getElement());
- if(!checkSchemaURI(definitionURL)){
- schemaList_.addElement(xsdSchema);
- gatherSchemaDirective(xsdSchema, definitionURL);
+ if (xsdSchema != null) {
+ xsdSchema.update();
+ xsdSchema.updateElement();
+ if(!checkSchemaURI(definitionURL)){
+ schemaList_.addElement(xsdSchema);
+ gatherSchemaDirective(xsdSchema, definitionURL);
+ }
}
- xsdSchema.update();
- xsdSchema.updateElement();
- //Add the Schema to the resource
- // boolean success = resource.getContents().add(xsdSchema);
- // System.out.println(success + "Added schema " + xsdSchema.getTargetNamespace() + " to wsdl resource " + uri.toString());
}
}
else if (obj instanceof UnknownExtensibilityElement)
@@ -400,19 +398,22 @@
if (schemaURI != null) {
schemaURI = normalize(schemaURI);
- if(schemaURI.equals(normalize(wsdlUrl_)))return false;
- Enumeration<String> e = schemaURI_.elements();
- while(e.hasMoreElements()){
- String uri = (String)e.nextElement();
- if(schemaURI.equals(uri)){
- found = true;
- break;
- }
+ if(schemaURI != null) {
+ if (schemaURI.equals(normalize(wsdlUrl_))) return false;
+ if (schemaURI_ == null) return false;
+ Enumeration<String> e = schemaURI_.elements();
+ while(e.hasMoreElements()){
+ String uri = (String)e.nextElement();
+ if(schemaURI.equals(uri)){
+ found = true;
+ break;
+ }
+ }
+
+ if (!found){
+ schemaURI_.addElement(schemaURI);
+ }
}
-
- if (!found){
- schemaURI_.addElement(schemaURI);
- }
}
return found;
@@ -624,6 +625,9 @@
WSDLPartsToXSDTypeMapper mapper = new WSDLPartsToXSDTypeMapper();
mapper.addSchemas(schemaList_);
XSDNamedComponent xsdComponent = mapper.getXSDTypeFromSchema(part);
+ if (xsdComponent == null) {
+ return "<error>Generating sample SOAP request</error>"; //$NON-NLS-1$
+ }
xsdComponent.updateElement(true);
XSDSchema schema = xsdComponent.getSchema();
@@ -691,6 +695,10 @@
if (kidelement.getAttributeValue("name").equals(nstypename)) //$NON-NLS-1$
return kidelement;
}
+ if (kidelement.getName().equals("simpleType")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(nstypename)) //$NON-NLS-1$
+ return kidelement;
+ }
if (kidelement.getName().equals("attribute")) { //$NON-NLS-1$
if (kidelement.getAttributeValue("name").equals(nstypename)) //$NON-NLS-1$
return kidelement;
@@ -712,6 +720,10 @@
if (kidelement.getAttributeValue("name").equals(name)) //$NON-NLS-1$
return kidelement;
}
+ if (kidelement.getName().equals("simpleType")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(name)) //$NON-NLS-1$
+ return kidelement;
+ }
if (kidelement.getName().equals("attribute")) { //$NON-NLS-1$
if (kidelement.getAttributeValue("name").equals(name)) //$NON-NLS-1$
return kidelement;
@@ -993,8 +1005,28 @@
element2 = findJDOMElementInSchema(importXSDSchema, elemType);
if (element2 != null) {
element = element2;
+ } else {
+ element2 = findJDOMElementInSchemaByName(schemaElement, nstypename);
+ if (element2 != null) {
+ element = element2;
+ }
}
}
+ } else if (schemaElement != null) {
+ org.jdom.Element element2 = findJDOMTypeInSchema(schemaElement, elemType);
+ if (element2 != null) {
+ element = element2;
+ } else {
+ element2 = findJDOMElementInSchema(schemaElement, elemType);
+ if (element2 != null) {
+ element = element2;
+ } else {
+ element2 = findJDOMElementInSchemaByName(schemaElement, nstypename);
+ if (element2 != null) {
+ element = element2;
+ }
+ }
+ }
}
}
if (element.getAttribute("ref") != null) {//$NON-NLS-1$
@@ -1097,7 +1129,8 @@
List<?> kids = element.getChildren();
for (Iterator<?> kidIter = kids.iterator(); kidIter.hasNext(); ) {
Element kid = (Element) kidIter.next();
- if (kid.getName().equals("complexType") || kid.getName().equals("sequence")) {//$NON-NLS-1$//$NON-NLS-2$
+ if (kid.getName().equals("complexType") || kid.getName().equals("sequence") || //$NON-NLS-1$//$NON-NLS-2$
+ kid.getName().equals("simpleType") || kid.getName().equals("restriction")) { //$NON-NLS-1$ //$NON-NLS-2$
List<?> innerkids = kid.getChildren();
for (Iterator<?> kidIter2 = innerkids.iterator(); kidIter2.hasNext(); ) {
Element innerkid = (Element) kidIter2.next();
@@ -1182,7 +1215,7 @@
DOMBuilder domBuilder = new DOMBuilder();
schema.updateElement(true);
org.jdom.Element importXSDSchema = domBuilder.build(schema.getElement());
- if (type.indexOf(':') > -1) {
+ if (type != null && type.indexOf(':') > -1) {
String typename = type.substring(type.indexOf(':') + 1, type.length());
org.jdom.Element element = findJDOMTypeInSchemaByNameAttr(importXSDSchema, typename);
if (element != null) {
@@ -1195,7 +1228,7 @@
// typically the type starts with a namespace prefix, so
// we want to compare the end of the string with the actual
// type name
- if (type.endsWith(STRING_TYPE_NAME) ||
+ if (type != null && type.endsWith(STRING_TYPE_NAME) ||
type.endsWith(BOOLEAN_TYPE_NAME) ||
type.endsWith(DECIMAL_TYPE_NAME) ||
type.endsWith(INT_TYPE_NAME) ||
@@ -1217,7 +1250,7 @@
type.endsWith(PRECISION_DECIMAL_TYPE_NAME)
) {
return true;
- } else if (type.contains(SIMPLE_TYPE_NAME)) {
+ } else if (type != null && type.contains(SIMPLE_TYPE_NAME)) {
return true;
}
return false;
13 years, 5 months
JBoss Tools SVN: r31197 - in trunk/modeshape/plugins: org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-05-10 17:01:17 -0400 (Tue, 10 May 2011)
New Revision: 31197
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
Log:
JBDS-1640 JBDevStudio 4.1(.x) tooling - ModeShape plugins must work with both SOA/EDS 5.1 and 5.2. Now detecting if versioning is supported and enabled by the ModeShape server. The version checkbox is disabled if not supported. Checking in a ModeShape 2.5.0.Beta3 jar. Will need 2.5.0 release jar in order to resolve this issue.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-05-10 20:09:02 UTC (rev 31196)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-05-10 21:01:17 UTC (rev 31197)
@@ -119,7 +119,7 @@
publishPageServerToolTip = The server where the JCR repository is located
publishPageUnableToObtainWorkspaceAreas = Unable to obtain the workspace areas for workspace "{0}"
publishPageVersionCheckBox = Version the published files
-publishPageVersionCheckBoxToolTip = The published files will be versioned on the ModeShape server.
+publishPageVersionCheckBoxToolTip = The published files will be versioned on the ModeShape server. Disabled when repository does not support, or has disabled, versioning.
publishPageUnpublishOkStatusMsg = Choose the location of the JCR repository where the files will be unpublished, and then click "Finish".
publishPageUnpublishResourcesLabel = These files were selected and will be unpublished:
publishPageUnpublishTitle = Unpublish the selected files
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-05-10 20:09:02 UTC (rev 31196)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-05-10 21:01:17 UTC (rev 31197)
@@ -512,21 +512,29 @@
public Status publish( Workspace workspace,
String path,
File file,
- boolean version ) {
- CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
- CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
- CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ boolean version) {
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
- Server server = workspace.getServer();
+ Server server = workspace.getServer();
- if (isRegistered(server)) {
- return this.delegate.publish(workspace, path, file, version);
- }
+ if (isRegistered(server)) {
+ if (version) {
+ return this.delegate.publish(workspace, path, file, true);
+ }
- // server must be registered in order to publish
- throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
- }
+ // If version is false it could mean that versioning is not supported by the repository, or it is not enabled by the
+ // by the repository, or that the user does not want the file versioned. If repository is running on an older server
+ // that did not have versioning, then the only publishing method available on the server was the publish method without
+ // the version parameter.
+ return this.delegate.publish(workspace, path, file);
+ }
+ // server must be registered in order to publish
+ throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
+ }
+
/**
* @param listener the listener being unregistered and will no longer receive events (never <code>null</code>)
* @return <code>true</code> if listener was removed
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-05-10 20:09:02 UTC (rev 31196)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-05-10 21:01:17 UTC (rev 31197)
@@ -67,1101 +67,1197 @@
import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
- * The <code>PublishPage</code> is a UI for publishing or unpublishing one or more files to a repository.
+ * The <code>PublishPage</code> is a UI for publishing or unpublishing one or
+ * more files to a repository.
*/
public final class PublishPage extends WizardPage implements IServerRegistryListener, ModifyListener {
+
+ /**
+ * The default repository workspace area where files are published.
+ */
+ private static final String DEFAULT_WORKSPACE_AREA = "/files"; //$NON-NLS-1$
- /**
- * The default repository workspace area where files are published.
- */
- private static final String DEFAULT_WORKSPACE_AREA = "/files"; //$NON-NLS-1$
+ /**
+ * The key in the wizard <code>IDialogSettings</code> for the recurse flag.
+ */
+ private static final String RECURSE_KEY = "recurse"; //$NON-NLS-1$
- /**
- * The key in the wizard <code>IDialogSettings</code> for the recurse flag.
- */
- private static final String RECURSE_KEY = "recurse"; //$NON-NLS-1$
+ /**
+ * The key in the wizard <code>IDialogSettings</code> for the workspace area
+ * path segment.
+ */
+ private static final String WORKSPACE_AREA_KEY = "workspaceArea"; //$NON-NLS-1$
- /**
- * The key in the wizard <code>IDialogSettings</code> for the workspace area path segment.
- */
- private static final String WORKSPACE_AREA_KEY = "workspaceArea"; //$NON-NLS-1$
+ /**
+ * Indicates if the file filter should be used.
+ */
+ private static boolean filterFiles = true;
- /**
- * Indicates if the file filter should be used.
- */
- private static boolean filterFiles = true;
+ /**
+ * @param container
+ * the project or folder whose files are being requested
+ * @param recurse
+ * the flag indicating if child containers should be traversed
+ * @param filter
+ * the file filter or <code>null</code> if not used
+ * @return the list of files contained in the specified container (never
+ * <code>null</code>)
+ * @throws CoreException
+ * if there is a problem finding the files
+ */
+ private static List<IFile> findFiles(IContainer container, boolean recurse, PublishingFileFilter filter)
+ throws CoreException {
+ List<IFile> result = new ArrayList<IFile>();
- /**
- * @param container the project or folder whose files are being requested
- * @param recurse the flag indicating if child containers should be traversed
- * @param filter the file filter or <code>null</code> if not used
- * @return the list of files contained in the specified container (never <code>null</code>)
- * @throws CoreException if there is a problem finding the files
- */
- private static List<IFile> findFiles( IContainer container,
- boolean recurse,
- PublishingFileFilter filter ) throws CoreException {
- List<IFile> result = new ArrayList<IFile>();
+ if (((container instanceof IProject) && !((IProject) container).isOpen())
+ || ((filter != null) && !filter.accept(container))) {
+ return result;
+ }
- if (((container instanceof IProject) && !((IProject)container).isOpen()) || ((filter != null) && !filter.accept(container))) {
- return result;
- }
+ // process container members
+ for (IResource member : container.members()) {
+ if (recurse && (member instanceof IContainer)) {
+ // don't select closed projects
+ if ((member instanceof IProject) && !((IProject) member).isOpen()) {
+ continue;
+ }
- // process container members
- for (IResource member : container.members()) {
- if (recurse && (member instanceof IContainer)) {
- // don't select closed projects
- if ((member instanceof IProject) && !((IProject)member).isOpen()) {
- continue;
- }
+ result.addAll(findFiles((IContainer) member, recurse, filter));
+ } else if ((member instanceof IFile) && ((IFile) member).getLocation().toFile().exists()) {
+ if ((filter == null) || filter.accept(member)) {
+ result.add((IFile) member);
+ }
+ }
+ }
- result.addAll(findFiles((IContainer)member, recurse, filter));
- } else if ((member instanceof IFile) && ((IFile)member).getLocation().toFile().exists()) {
- if ((filter == null) || filter.accept(member)) {
- result.add((IFile)member);
- }
- }
- }
+ return result;
+ }
- return result;
- }
+ /**
+ * Processes the specified list of files and for (1) each file found adds it
+ * to the result and (2) for each project or folder adds all contained
+ * files. For projects and folders processing will be recursive based on
+ * saved wizard settings.
+ *
+ * @param resources
+ * the resources being processed (never <code>null</code>)
+ * @param recurse
+ * the flag indicating if child containers should be traversed
+ * @param filter
+ * the file filter or <code>null</code> if not used
+ * @return the files being published or unpublished (never <code>null</code>
+ * )
+ * @throws CoreException
+ * if there is a problem processing the resources
+ */
+ private static List<IFile> processResources(List<IResource> resources, boolean recurse, PublishingFileFilter filter)
+ throws CoreException {
+ assert (resources != null);
+ List<IFile> result = new ArrayList<IFile>();
- /**
- * Processes the specified list of files and for (1) each file found adds it to the result and (2) for each project or folder
- * adds all contained files. For projects and folders processing will be recursive based on saved wizard settings.
- *
- * @param resources the resources being processed (never <code>null</code>)
- * @param recurse the flag indicating if child containers should be traversed
- * @param filter the file filter or <code>null</code> if not used
- * @return the files being published or unpublished (never <code>null</code>)
- * @throws CoreException if there is a problem processing the resources
- */
- private static List<IFile> processResources( List<IResource> resources,
- boolean recurse,
- PublishingFileFilter filter ) throws CoreException {
- assert (resources != null);
- List<IFile> result = new ArrayList<IFile>();
+ // Project Map - the outer map. Its keys are IProjects and its values
+ // are a Parent Map
+ // Parent Map - the inner map. Its keys are IContainers (IProject,
+ // IFolder) and its values are a list of files
+ Map<IProject, Map<IContainer, List<IFile>>> projectMap = new HashMap<IProject, Map<IContainer, List<IFile>>>();
- // Project Map - the outer map. Its keys are IProjects and its values are a Parent Map
- // Parent Map - the inner map. Its keys are IContainers (IProject, IFolder) and its values are a list of files
- Map<IProject, Map<IContainer, List<IFile>>> projectMap = new HashMap<IProject, Map<IContainer, List<IFile>>>();
+ // Step 1: Process resources
+ // - For each file make sure there is a project entry and parent entry
+ // then add the file to the Parent Map.
+ // - For each folder make sure there is a project entry then add folder
+ // entry.
+ // - For each project make sure there is a project entry.
+ //
+ // Step 2: Process maps
+ // - In the Project Map, when the recurse flag is set, entries for
+ // projects that have a null value (parent map) will be
+ // traversed finding all child files and them to results.
+ // - In the internal parent map, when the recurse flag is set, entries
+ // for parents that have a null value (child
+ // collection) will be traversed finding all child files and add them to
+ // results.
+ //
+ // Step 3: Add files from Step 1 to results
- // Step 1: Process resources
- // - For each file make sure there is a project entry and parent entry then add the file to the Parent Map.
- // - For each folder make sure there is a project entry then add folder entry.
- // - For each project make sure there is a project entry.
- //
- // Step 2: Process maps
- // - In the Project Map, when the recurse flag is set, entries for projects that have a null value (parent map) will be
- // traversed finding all child files and them to results.
- // - In the internal parent map, when the recurse flag is set, entries for parents that have a null value (child
- // collection) will be traversed finding all child files and add them to results.
- //
- // Step 3: Add files from Step 1 to results
+ // Step 1 (see above for processing description)
+ for (IResource resource : resources) {
+ IFile file = null;
+ IProject project = null;
+ List<IFile> files = null;
+ Map<IContainer, List<IFile>> parentMap = null;
- // Step 1 (see above for processing description)
- for (IResource resource : resources) {
- IFile file = null;
- IProject project = null;
- List<IFile> files = null;
- Map<IContainer, List<IFile>> parentMap = null;
+ // see if resource is filtered
+ if ((filter != null) && !filter.accept(resource)) {
+ continue;
+ }
- // see if resource is filtered
- if ((filter != null) && !filter.accept(resource)) {
- continue;
- }
+ if (resource instanceof IFile) {
+ IContainer parent = null; // project or folder
+ file = (IFile) resource;
+ parent = file.getParent();
+ project = file.getProject();
- if (resource instanceof IFile) {
- IContainer parent = null; // project or folder
- file = (IFile)resource;
- parent = file.getParent();
- project = file.getProject();
+ // make sure there is a project entry
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
- // make sure there is a project entry
- if (!projectMap.containsKey(project)) {
- projectMap.put(project, null);
- }
+ parentMap = projectMap.get(project);
- parentMap = projectMap.get(project);
+ // make sure there is a parent entry
+ if (parentMap == null) {
+ parentMap = new HashMap<IContainer, List<IFile>>();
+ projectMap.put(project, parentMap);
+ }
- // make sure there is a parent entry
- if (parentMap == null) {
- parentMap = new HashMap<IContainer, List<IFile>>();
- projectMap.put(project, parentMap);
- }
+ files = parentMap.get(parent);
- files = parentMap.get(parent);
+ // make sure there is a files collection
+ if (files == null) {
+ files = new ArrayList<IFile>();
+ parentMap.put(parent, files);
+ }
- // make sure there is a files collection
- if (files == null) {
- files = new ArrayList<IFile>();
- parentMap.put(parent, files);
- }
+ // add file
+ files.add(file);
+ } else if (resource instanceof IFolder) {
+ IFolder folder = (IFolder) resource;
+ project = folder.getProject();
- // add file
- files.add(file);
- } else if (resource instanceof IFolder) {
- IFolder folder = (IFolder)resource;
- project = folder.getProject();
+ // make sure there is a project entry
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
- // make sure there is a project entry
- if (!projectMap.containsKey(project)) {
- projectMap.put(project, null);
- }
+ parentMap = projectMap.get(project);
- parentMap = projectMap.get(project);
+ // make sure there is a folder entry
+ if (parentMap == null) {
+ parentMap = new HashMap<IContainer, List<IFile>>();
+ projectMap.put(project, parentMap);
+ }
- // make sure there is a folder entry
- if (parentMap == null) {
- parentMap = new HashMap<IContainer, List<IFile>>();
- projectMap.put(project, parentMap);
- }
+ // add folder only if not already there
+ if (!parentMap.containsKey(folder)) {
+ parentMap.put(folder, null);
+ }
+ } else if (resource instanceof IProject) {
+ project = (IProject) resource;
- // add folder only if not already there
- if (!parentMap.containsKey(folder)) {
- parentMap.put(folder, null);
- }
- } else if (resource instanceof IProject) {
- project = (IProject)resource;
+ // if map does not have entry create one
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
+ }
+ }
- // if map does not have entry create one
- if (!projectMap.containsKey(project)) {
- projectMap.put(project, null);
- }
- }
- }
+ // Step 2 (see above for processing description)
+ // Process projects that have nothing under them selected
+ for (IProject project : projectMap.keySet()) {
+ Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
- // Step 2 (see above for processing description)
- // Process projects that have nothing under them selected
- for (IProject project : projectMap.keySet()) {
- Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
+ if (parentMap == null) {
+ result.addAll(findFiles(project, recurse, filter));
+ } else {
+ // process folders with no folder entries
+ for (IContainer folder : parentMap.keySet()) {
+ List<IFile> files = parentMap.get(folder);
- if (parentMap == null) {
- result.addAll(findFiles(project, recurse, filter));
- } else {
- // process folders with no folder entries
- for (IContainer folder : parentMap.keySet()) {
- List<IFile> files = parentMap.get(folder);
+ if (files == null) {
+ result.addAll(findFiles(folder, recurse, filter));
+ }
+ }
+ }
+ }
- if (files == null) {
- result.addAll(findFiles(folder, recurse, filter));
- }
- }
- }
- }
+ // Step 3 (see above for processing description)
+ for (IProject project : projectMap.keySet()) {
+ Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
- // Step 3 (see above for processing description)
- for (IProject project : projectMap.keySet()) {
- Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
+ if (parentMap != null) {
+ for (Entry<IContainer, List<IFile>> entry : parentMap.entrySet()) {
+ if (entry.getValue() != null) {
+ result.addAll(entry.getValue());
+ }
+ }
+ }
+ }
- if (parentMap != null) {
- for (Entry<IContainer, List<IFile>> entry : parentMap.entrySet()) {
- if (entry.getValue() != null) {
- result.addAll(entry.getValue());
- }
- }
- }
- }
+ return result;
+ }
- return result;
- }
+ /**
+ * The repository chooser control.
+ */
+ private Combo cbxRepository;
- /**
- * The repository chooser control.
- */
- private Combo cbxRepository;
+ /**
+ * The server chooser control.
+ */
+ private Combo cbxServer;
- /**
- * The server chooser control.
- */
- private Combo cbxServer;
+ /**
+ * The workspace chooser control.
+ */
+ private Combo cbxWorkspace;
- /**
- * The workspace chooser control.
- */
- private Combo cbxWorkspace;
+ /**
+ * The workspace area chooser control.
+ */
+ private Combo cbxWorkspaceAreas;
- /**
- * The workspace area chooser control.
- */
- private Combo cbxWorkspaceAreas;
+ /**
+ * The control indicating if the user wants to version resources (will be <code>null</code> when unpublishing).
+ */
+ private Button chkVersioning;
- /**
- * The files being published or unpublished (never <code>null</code>).
- */
- private List<IFile> files;
+ /**
+ * The files being published or unpublished (never <code>null</code>).
+ */
+ private List<IFile> files;
- /**
- * The filter used to determine if a file should be included in publishing operations (may be <code>null</code>).
- */
- private PublishingFileFilter filter;
+ /**
+ * The filter used to determine if a file should be included in publishing
+ * operations (may be <code>null</code>).
+ */
+ private PublishingFileFilter filter;
+
+ /**
+ * A hyperlink to the preference page (will be <code>null</code> when unpublishing).
+ */
+ private Link linkPrefs;
- /**
- * The control containing all the files being published or unpublished.
- */
- private org.eclipse.swt.widgets.List lstResources;
+ /**
+ * The control containing all the files being published or unpublished.
+ */
+ private org.eclipse.swt.widgets.List lstResources;
- /**
- * Indicates if resources should be found recursively.
- */
- private boolean recurse = true;
+ /**
+ * Indicates if resources should be found recursively.
+ */
+ private boolean recurse = true;
- /**
- * A collection of repositories for the selected server (never <code>null</code>).
- */
- private List<Repository> repositories;
+ /**
+ * A collection of repositories for the selected server (never
+ * <code>null</code>).
+ */
+ private List<Repository> repositories;
- /**
- * The repository where the workspace is located.
- */
- private Repository repository;
+ /**
+ * The repository where the workspace is located.
+ */
+ private Repository repository;
- /**
- * The collection of resources selected by the user to be published or unpublished.
- */
- private final List<IResource> resources;
+ /**
+ * <code>true</code> if the selected repository supports versioning
+ */
+ private boolean repositorySupportsVersioning;
- /**
- * The server where the repository is located.
- */
- private Server server;
+ /**
+ * The collection of resources selected by the user to be published or
+ * unpublished.
+ */
+ private final List<IResource> resources;
- /**
- * A collection of servers from the server registry (never <code>null</code>).
- */
- private List<Server> servers;
+ /**
+ * The server where the repository is located.
+ */
+ private Server server;
- /**
- * The current validation status.
- */
- private Status status;
+ /**
+ * A collection of servers from the server registry (never <code>null</code>
+ * ).
+ */
+ private List<Server> servers;
- /**
- * Indicates if publishing or unpublishing is being done.
- */
- private final Type type;
+ /**
+ * The current validation status.
+ */
+ private Status status;
- /**
- * Indicates if versioning of published resources should be done.
- */
- private boolean versioning = true;
+ /**
+ * Indicates if publishing or unpublishing is being done.
+ */
+ private final Type type;
- /**
- * The workspace where the resources are being published/unpublished (may be <code>null</code>).
- */
- private Workspace workspace;
+ /**
+ * Indicates if versioning of published resources should be done.
+ */
+ private boolean versioning = true;
- /**
- * The path segment prepended to the resource project path.
- */
- private String workspaceArea;
+ /**
+ * The workspace where the resources are being published/unpublished (may be
+ * <code>null</code>).
+ */
+ private Workspace workspace;
- /**
- * A collection of workspaces for the selected server repository (never <code>null</code>).
- */
- private List<Workspace> workspaces;
+ /**
+ * The path segment prepended to the resource project path.
+ */
+ private String workspaceArea;
- /**
- * @param type indicates if publishing or unpublishing is being done
- * @param resources the resources being published or unpublished (never <code>null</code>)
- * @throws CoreException if there is a problem processing the input resources
- */
- public PublishPage( Type type,
- List<IResource> resources ) throws CoreException {
- super(PublishPage.class.getSimpleName());
- CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
- setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
- : RestClientI18n.publishPageUnpublishTitle.text());
- setPageComplete(false);
+ /**
+ * A collection of workspaces for the selected server repository (never
+ * <code>null</code>).
+ */
+ private List<Workspace> workspaces;
- this.type = type;
- this.resources = resources;
+ /**
+ * @param type
+ * indicates if publishing or unpublishing is being done
+ * @param resources
+ * the resources being published or unpublished (never
+ * <code>null</code>)
+ * @throws CoreException
+ * if there is a problem processing the input resources
+ */
+ public PublishPage(Type type, List<IResource> resources) throws CoreException {
+ super(PublishPage.class.getSimpleName());
+ CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
+ setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
+ : RestClientI18n.publishPageUnpublishTitle.text());
+ setPageComplete(false);
+ this.type = type;
+ this.resources = resources;
+
// load filter with current preference value
IgnoredResourcesModel model = new IgnoredResourcesModel();
model.load(Activator.getDefault().getPreferenceStore().getString(IGNORED_RESOURCES_PREFERENCE));
this.filter = (filterFiles ? new PublishingFileFilter(model) : null);
- }
+ }
- private void constructLocationPanel( Composite parent ) {
- Group pnl = new Group(parent, SWT.NONE);
- pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
- pnl.setLayout(new GridLayout(2, false));
- pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ private void constructLocationPanel(Composite parent) {
+ Group pnl = new Group(parent, SWT.NONE);
+ pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
+ pnl.setLayout(new GridLayout(2, false));
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- // row 1: label combobox button
- // row 2: label combobox
- // row 3: label combobox
- // row 4: label textbox
+ // row 1: label combobox button
+ // row 2: label combobox
+ // row 3: label combobox
+ // row 4: label textbox
- { // row 1: server row
- Composite pnlServer = new Composite(pnl, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- pnlServer.setLayout(layout);
- GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gd.horizontalSpan = 2;
- pnlServer.setLayoutData(gd);
+ { // row 1: server row
+ Composite pnlServer = new Composite(pnl, SWT.NONE);
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ pnlServer.setLayout(layout);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd.horizontalSpan = 2;
+ pnlServer.setLayoutData(gd);
- Label lblServer = new Label(pnlServer, SWT.LEFT);
- lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblServer.setText(RestClientI18n.publishPageServerLabel.text());
+ Label lblServer = new Label(pnlServer, SWT.LEFT);
+ lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblServer.setText(RestClientI18n.publishPageServerLabel.text());
- this.cbxServer = new Combo(pnlServer, SWT.DROP_DOWN | SWT.READ_ONLY);
- this.cbxServer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip.text());
+ this.cbxServer = new Combo(pnlServer, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxServer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip.text());
- final IAction action = new NewServerAction(this.getShell(), getServerManager());
- final Button btnNewServer = new Button(pnlServer, SWT.PUSH);
- btnNewServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
- btnNewServer.setToolTipText(action.getToolTipText());
- btnNewServer.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- action.run();
- }
- });
+ final IAction action = new NewServerAction(this.getShell(), getServerManager());
+ final Button btnNewServer = new Button(pnlServer, SWT.PUSH);
+ btnNewServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
+ btnNewServer.setToolTipText(action.getToolTipText());
+ btnNewServer.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ action.run();
+ }
+ });
- // update page message first time selected to get rid of initial message by forcing validation
- btnNewServer.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- updateInitialMessage();
- btnNewServer.removeSelectionListener(this);
- }
- });
- }
+ // update page message first time selected to get rid of initial
+ // message by forcing validation
+ btnNewServer.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateInitialMessage();
+ btnNewServer.removeSelectionListener(this);
+ }
+ });
+ }
- { // row 2: repository row
- Label lblRepository = new Label(pnl, SWT.LEFT);
- lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblRepository.setText(RestClientI18n.publishPageRepositoryLabel.text());
+ { // row 2: repository row
+ Label lblRepository = new Label(pnl, SWT.LEFT);
+ lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblRepository.setText(RestClientI18n.publishPageRepositoryLabel.text());
- this.cbxRepository = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
- this.cbxRepository.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip.text());
- }
+ this.cbxRepository = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxRepository.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip.text());
+ }
- { // row 3: workspace row
- Label lblWorkspace = new Label(pnl, SWT.LEFT);
- lblWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel.text());
+ { // row 3: workspace row
+ Label lblWorkspace = new Label(pnl, SWT.LEFT);
+ lblWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel.text());
- this.cbxWorkspace = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
- this.cbxWorkspace.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxWorkspace = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxWorkspace.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- if (type == Type.PUBLISH) {
- this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
- } else {
- this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
- }
- }
+ if (type == Type.PUBLISH) {
+ this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
+ } else {
+ this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
+ }
+ }
- { // row 4: workspace area
- Label lblWorkspaceArea = new Label(pnl, SWT.LEFT);
- lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
+ { // row 4: workspace area
+ Label lblWorkspaceArea = new Label(pnl, SWT.LEFT);
+ lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
- this.cbxWorkspaceAreas = new Combo(pnl, SWT.DROP_DOWN);
- this.cbxWorkspaceAreas.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- this.cbxWorkspaceAreas.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
- }
- }
+ this.cbxWorkspaceAreas = new Combo(pnl, SWT.DROP_DOWN);
+ this.cbxWorkspaceAreas.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxWorkspaceAreas.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
+ }
+ }
- private void constructResourcesPanel( Composite parent ) {
- Composite pnl = new Composite(parent, SWT.NONE);
- pnl.setLayout(new GridLayout());
- pnl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ private void constructResourcesPanel(Composite parent) {
+ Composite pnl = new Composite(parent, SWT.NONE);
+ pnl.setLayout(new GridLayout());
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- // pnl layout:
- // row 1: lbl
- // row 2: lstResources
- // row 3: recurse chkbox
- // row 4: versioning chkbox and link (only when publishing)
+ // pnl layout:
+ // row 1: lbl
+ // row 2: lstResources
+ // row 3: recurse chkbox
+ // row 4: versioning chkbox and link (only when publishing)
- { // row 1
- Label lbl = new Label(pnl, SWT.LEFT);
- lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ { // row 1
+ Label lbl = new Label(pnl, SWT.LEFT);
+ lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- if (type == Type.PUBLISH) {
- lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
- } else {
- lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
- }
- }
+ if (type == Type.PUBLISH) {
+ lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
+ } else {
+ lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
+ }
+ }
- { // row 2
- this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL
- | SWT.V_SCROLL);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.horizontalSpan = 2;
- gd.minimumHeight = this.lstResources.getItemHeight() * 2; // set min height
- gd.heightHint = this.lstResources.getItemHeight() * 10; // set preferred height
- this.lstResources.setLayoutData(gd);
- final org.eclipse.swt.widgets.List finalLst = this.lstResources;
+ { // row 2
+ this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.horizontalSpan = 2;
+ gd.minimumHeight = this.lstResources.getItemHeight() * 2; // set min
+ // height
+ gd.heightHint = this.lstResources.getItemHeight() * 10; // set
+ // preferred
+ // height
+ this.lstResources.setLayoutData(gd);
+ final org.eclipse.swt.widgets.List finalLst = this.lstResources;
- // update page message first time selected to get rid of initial message by forcing validation
- this.lstResources.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- // do the very first time to get rid of initial message then remove listener
- updateInitialMessage();
- finalLst.removeSelectionListener(this);
- }
- });
+ // update page message first time selected to get rid of initial
+ // message by forcing validation
+ this.lstResources.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ // do the very first time to get rid of initial message then
+ // remove listener
+ updateInitialMessage();
+ finalLst.removeSelectionListener(this);
+ }
+ });
- // load list with initial files
- loadFiles();
- }
+ // load list with initial files
+ loadFiles();
+ }
- { // row 3 recurse chkbox
- Button chkRecurse = new Button(pnl, SWT.CHECK);
- chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
- chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
+ { // row 3 recurse chkbox
+ Button chkRecurse = new Button(pnl, SWT.CHECK);
+ chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
+ chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
- // set the recurse flag based on dialog settings
- if (getDialogSettings().get(RECURSE_KEY) != null) {
- this.recurse = getDialogSettings().getBoolean(RECURSE_KEY);
- }
+ // set the recurse flag based on dialog settings
+ if (getDialogSettings().get(RECURSE_KEY) != null) {
+ this.recurse = getDialogSettings().getBoolean(RECURSE_KEY);
+ }
- chkRecurse.setSelection(this.recurse);
- chkRecurse.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- handleRecurseChanged(((Button)e.widget).getSelection());
- }
- });
+ chkRecurse.setSelection(this.recurse);
+ chkRecurse.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleRecurseChanged(((Button) e.widget).getSelection());
+ }
+ });
- // update page message first time selected to get rid of initial message by forcing validation
- chkRecurse.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- updateInitialMessage();
- ((Button)e.widget).removeSelectionListener(this);
- }
- });
- }
+ // update page message first time selected to get rid of initial
+ // message by forcing validation
+ chkRecurse.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateInitialMessage();
+ ((Button) e.widget).removeSelectionListener(this);
+ }
+ });
+ }
- if (this.type == Type.PUBLISH) {
- // row 4 versioning chkbox and link to open preference page
- Composite pnlVersioning = new Composite(pnl, SWT.NONE);
- pnlVersioning.setLayout(new GridLayout(2, false));
- ((GridLayout)pnlVersioning.getLayout()).marginWidth = 0;
- pnlVersioning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
- ((GridData)pnlVersioning.getLayoutData()).minimumHeight = 30;
+ if (this.type == Type.PUBLISH) {
+ // row 4 versioning chkbox and link to open preference page
+ Composite pnlVersioning = new Composite(pnl, SWT.NONE);
+ pnlVersioning.setLayout(new GridLayout(2, false));
+ ((GridLayout) pnlVersioning.getLayout()).marginWidth = 0;
+ pnlVersioning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
+ ((GridData) pnlVersioning.getLayoutData()).minimumHeight = 30;
- Button chkVersioning = new Button(pnlVersioning, SWT.CHECK);
- chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
- chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
+ this.chkVersioning = new Button(pnlVersioning, SWT.CHECK);
+ this.chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ this.chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
+ this.chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
- // set the version flag based on preference
- this.versioning = Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
+ // set the version flag based on preference
+ this.versioning = Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
- chkVersioning.setSelection(this.versioning);
- chkVersioning.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- handleVersioningChanged(((Button)e.widget).getSelection());
- }
- });
+ this.chkVersioning.setSelection(this.versioning);
+ this.chkVersioning.setEnabled(false);
+ this.chkVersioning.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleVersioningChanged(((Button) e.widget).getSelection());
+ }
+ });
- Link link = new Link(pnlVersioning, SWT.WRAP);
- link.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
- link.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- link.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- handleOpenPreferencePage();
- }
- });
- }
- }
+ this.linkPrefs = new Link(pnlVersioning, SWT.WRAP);
+ this.linkPrefs.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
+ this.linkPrefs.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ this.linkPrefs.setEnabled(false);
+ this.linkPrefs.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleOpenPreferencePage();
+ }
+ });
+ }
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createControl( Composite parent ) {
- Composite pnlMain = new Composite(parent, SWT.NONE);
- pnlMain.setLayout(new GridLayout());
- pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- constructLocationPanel(pnlMain);
- constructResourcesPanel(pnlMain);
- setControl(pnlMain);
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite pnlMain = new Composite(parent, SWT.NONE);
+ pnlMain.setLayout(new GridLayout());
+ pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ constructLocationPanel(pnlMain);
+ constructResourcesPanel(pnlMain);
+ setControl(pnlMain);
- // add combobox listeners
- this.cbxRepository.addModifyListener(this);
- this.cbxServer.addModifyListener(this);
- this.cbxWorkspace.addModifyListener(this);
- this.cbxWorkspaceAreas.addModifyListener(this);
+ // add combobox listeners
+ this.cbxRepository.addModifyListener(this);
+ this.cbxServer.addModifyListener(this);
+ this.cbxWorkspace.addModifyListener(this);
+ this.cbxWorkspaceAreas.addModifyListener(this);
- // register with the help system
- IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
- helpSystem.setHelp(pnlMain, PUBLISH_DIALOG_HELP_CONTEXT);
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(pnlMain, PUBLISH_DIALOG_HELP_CONTEXT);
- // register to receive server registry events (this will populate the UI)
- getServerManager().addRegistryListener(this);
- }
+ // register to receive server registry events (this will populate the
+ // UI)
+ getServerManager().addRegistryListener(this);
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- @Override
- public void dispose() {
- getServerManager().removeRegistryListener(this);
- super.dispose();
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ getServerManager().removeRegistryListener(this);
+ super.dispose();
+ }
- /**
- * @return the files to publish or unpublish (never <code>null</code>)
- */
- List<IFile> getFiles() {
- return this.files;
- }
+ /**
+ * @return the files to publish or unpublish (never <code>null</code>)
+ */
+ List<IFile> getFiles() {
+ return this.files;
+ }
- /**
- * @return the server manager obtained from the wizard
- */
- private ServerManager getServerManager() {
- return ((PublishWizard)getWizard()).getServerManager();
- }
+ /**
+ * @return the server manager obtained from the wizard
+ */
+ private ServerManager getServerManager() {
+ return ((PublishWizard) getWizard()).getServerManager();
+ }
- /**
- * @return thw workspace to use when publishing or unpublishing (page must be complete)
- */
- Workspace getWorkspace() {
- assert isPageComplete();
- return this.workspace;
- }
+ /**
+ * @return thw workspace to use when publishing or unpublishing (page must
+ * be complete)
+ */
+ Workspace getWorkspace() {
+ assert isPageComplete();
+ return this.workspace;
+ }
- /**
- * @return the path segment prepended to the resource project path (never <code>null</code> but can be empty)
- */
- String getWorkspaceArea() {
- return this.workspaceArea;
- }
+ /**
+ * @return the path segment prepended to the resource project path (never
+ * <code>null</code> but can be empty)
+ */
+ String getWorkspaceArea() {
+ return this.workspaceArea;
+ }
- /**
- * Opens the preference page.
- */
- void handleOpenPreferencePage() {
- // open preference page and only allow the pref page where the version setting is
- PreferencesUtil.createPreferenceDialogOn(getShell(),
- MAIN_PREFERENCE_PAGE_ID,
- new String[] { MAIN_PREFERENCE_PAGE_ID },
- null).open();
- }
+ /**
+ * Opens the preference page.
+ */
+ void handleOpenPreferencePage() {
+ // open preference page and only allow the pref page where the version
+ // setting is
+ PreferencesUtil.createPreferenceDialogOn(getShell(), MAIN_PREFERENCE_PAGE_ID,
+ new String[] { MAIN_PREFERENCE_PAGE_ID }, null).open();
+ }
- /**
- * Saves the recurse setting and reloads the files to be published or unpublished.
- *
- * @param selected the flag indicating the new recurse setting
- */
- void handleRecurseChanged( boolean selected ) {
- this.recurse = selected;
+ /**
+ * Saves the recurse setting and reloads the files to be published or
+ * unpublished.
+ *
+ * @param selected
+ * the flag indicating the new recurse setting
+ */
+ void handleRecurseChanged(boolean selected) {
+ this.recurse = selected;
- try {
- this.files = processResources(this.resources, isRecursing(), filter);
- loadFiles();
- } catch (CoreException e) {
- Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ try {
+ this.files = processResources(this.resources, isRecursing(), filter);
+ loadFiles();
+ } catch (CoreException e) {
+ Activator.getDefault().log(
+ new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
- if (getControl().isVisible()) {
- MessageDialog.openError(getShell(),
- RestClientI18n.errorDialogTitle.text(),
- RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
- }
- }
- }
+ if (getControl().isVisible()) {
+ MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
+ }
+ }
+ }
- /**
- * Handler for when the repository control value is modified
- */
- void handleRepositoryModified() {
- int index = this.cbxRepository.getSelectionIndex();
+ /**
+ * Handler for when the repository control value is modified
+ */
+ void handleRepositoryModified() {
+ int index = this.cbxRepository.getSelectionIndex();
- // make sure there is a selection
- if (index != -1) {
- this.repository = this.repositories.get(index);
- }
+ // make sure there is a selection
+ if (index != -1) {
+ this.repository = this.repositories.get(index);
+ }
- // clear loaded workspaces
- refreshWorkspaces();
+ // repository capabilities could affect the UI
+ updateRepositoryCapabilities();
- // update page state
- updateState();
- }
+ // clear loaded workspaces
+ refreshWorkspaces();
- /**
- * Handler for when the server control value is modified
- */
- void handleServerModified() {
- int index = this.cbxServer.getSelectionIndex();
+ // update page state
+ updateState();
+ }
- // make sure there is a selection
- if (index != -1) {
- this.server = this.servers.get(index);
- }
+ /**
+ * Handler for when the server control value is modified
+ */
+ void handleServerModified() {
+ int index = this.cbxServer.getSelectionIndex();
- // need to reload repositories since server changed
- refreshRepositories();
+ // make sure there is a selection
+ if (index != -1) {
+ this.server = this.servers.get(index);
+ }
- // update page state
- updateState();
- }
+ // need to reload repositories since server changed
+ refreshRepositories();
- /**
- * Saves the versioning setting.
- *
- * @param selected the flag indicating the new versioning setting
- */
- void handleVersioningChanged( boolean selected ) {
- this.versioning = selected;
- }
+ // update page state
+ updateState();
+ }
- /**
- * Handler for when the workspace area value is modified.
- */
- void handleWorkspaceAreaModified() {
- int index = this.cbxWorkspaceAreas.getSelectionIndex();
+ /**
+ * Saves the versioning setting.
+ *
+ * @param selected
+ * the flag indicating the new versioning setting
+ */
+ void handleVersioningChanged(boolean selected) {
+ this.versioning = selected;
+ }
- if (index == -1) {
- this.workspaceArea = this.cbxWorkspaceAreas.getText();
- } else {
- this.workspaceArea = this.cbxWorkspaceAreas.getItems()[index];
- }
- }
+ /**
+ * Handler for when the workspace area value is modified.
+ */
+ void handleWorkspaceAreaModified() {
+ int index = this.cbxWorkspaceAreas.getSelectionIndex();
- /**
- * Handler for when the workspace control value is modified.
- */
- void handleWorkspaceModified() {
- int index = this.cbxWorkspace.getSelectionIndex();
+ if (index == -1) {
+ this.workspaceArea = this.cbxWorkspaceAreas.getText();
+ } else {
+ this.workspaceArea = this.cbxWorkspaceAreas.getItems()[index];
+ }
+ }
- // make sure there is a selection
- if (index != -1) {
- Workspace newWorkspace = this.workspaces.get(index);
+ /**
+ * Handler for when the workspace control value is modified.
+ */
+ void handleWorkspaceModified() {
+ int index = this.cbxWorkspace.getSelectionIndex();
- if ((this.workspace == null) || !this.workspace.equals(newWorkspace)) {
- this.workspace = newWorkspace;
+ // make sure there is a selection
+ if (index != -1) {
+ Workspace newWorkspace = this.workspaces.get(index);
- // update workspace areas
- WorkspaceArea[] workspaceAreas = null;
+ if ((this.workspace == null) || !this.workspace.equals(newWorkspace)) {
+ this.workspace = newWorkspace;
- try {
- workspaceAreas = getServerManager().getWorkspaceAreas(this.workspace);
- } catch (Exception e) {
- Activator.getDefault()
- .log(new Status(Severity.ERROR,
- RestClientI18n.publishPageUnableToObtainWorkspaceAreas.text(this.workspace),
- e));
- }
+ // update workspace areas
+ WorkspaceArea[] workspaceAreas = null;
- if ((workspaceAreas == null) || (workspaceAreas.length == 0)) {
- // populate with default area name
- this.cbxWorkspaceAreas.setItems(new String[] { DEFAULT_WORKSPACE_AREA });
- } else {
- String[] areaPaths = new String[workspaceAreas.length];
- int i = 0;
+ try {
+ workspaceAreas = getServerManager().getWorkspaceAreas(this.workspace);
+ } catch (Exception e) {
+ Activator.getDefault().log(
+ new Status(Severity.ERROR, RestClientI18n.publishPageUnableToObtainWorkspaceAreas
+ .text(this.workspace), e));
+ }
- for (WorkspaceArea area : workspaceAreas) {
- areaPaths[i++] = area.getPath();
- }
+ if ((workspaceAreas == null) || (workspaceAreas.length == 0)) {
+ // populate with default area name
+ this.cbxWorkspaceAreas.setItems(new String[] { DEFAULT_WORKSPACE_AREA });
+ } else {
+ String[] areaPaths = new String[workspaceAreas.length];
+ int i = 0;
- this.cbxWorkspaceAreas.setItems(areaPaths);
- }
- }
- } else {
- this.workspaceArea = null;
- this.cbxWorkspaceAreas.removeAll();
- }
+ for (WorkspaceArea area : workspaceAreas) {
+ areaPaths[i++] = area.getPath();
+ }
- if (this.cbxWorkspaceAreas.getItemCount() != 0) {
- this.cbxWorkspaceAreas.select(0);
- }
+ this.cbxWorkspaceAreas.setItems(areaPaths);
+ }
+ }
+ } else {
+ this.workspaceArea = null;
+ this.cbxWorkspaceAreas.removeAll();
+ }
- updateState();
- }
+ if (this.cbxWorkspaceAreas.getItemCount() != 0) {
+ this.cbxWorkspaceAreas.select(0);
+ }
- /**
- * @return <code>true</code> if resources found recursively under projects and folders should also be published or unpublished
- */
- boolean isRecursing() {
- return this.recurse;
- }
+ updateState();
+ }
- /**
- * @return <code>true</code> if versioning of published resources should be done
- */
- boolean isVersioning() {
- return this.versioning;
- }
+ /**
+ * @return <code>true</code> if resources found recursively under projects
+ * and folders should also be published or unpublished
+ */
+ boolean isRecursing() {
+ return this.recurse;
+ }
- /**
- * Populates the list of files to be published based on the recurse flag and the list of workspace selected resources.
- * Pre-condition is that {@link #processResources(List, boolean, PublishingFileFilter)} has been called.
- */
- private void loadFiles() {
- this.lstResources.removeAll();
+ /**
+ * @return <code>true</code> if versioning of published resources should be
+ * done
+ */
+ boolean isVersioning() {
+ return (this.repositorySupportsVersioning && this.versioning);
+ }
- for (IResource resource : this.files) {
- this.lstResources.add(resource.getFullPath().toString());
- }
- }
+ /**
+ * Populates the list of files to be published based on the recurse flag and
+ * the list of workspace selected resources. Pre-condition is that
+ * {@link #processResources(List, boolean, PublishingFileFilter)} has been
+ * called.
+ */
+ private void loadFiles() {
+ this.lstResources.removeAll();
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText( ModifyEvent e ) {
- if (e.widget == this.cbxServer) {
- handleServerModified();
- } else if (e.widget == this.cbxRepository) {
- handleRepositoryModified();
- } else if (e.widget == this.cbxWorkspace) {
- handleWorkspaceModified();
- } else if (e.widget == this.cbxWorkspaceAreas) {
- handleWorkspaceAreaModified();
- } else {
- assert false; // should not happen
- }
- }
+ for (IResource resource : this.files) {
+ this.lstResources.add(resource.getFullPath().toString());
+ }
+ }
- /**
- * Refreshes the repository-related fields and controls based on the server registry. This in turn causes the workspaces to also
- * to be refreshed.
- */
- private void refreshRepositories() {
- this.repository = null;
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ if (e.widget == this.cbxServer) {
+ handleServerModified();
+ } else if (e.widget == this.cbxRepository) {
+ handleRepositoryModified();
+ } else if (e.widget == this.cbxWorkspace) {
+ handleWorkspaceModified();
+ } else if (e.widget == this.cbxWorkspaceAreas) {
+ handleWorkspaceAreaModified();
+ } else {
+ assert false; // should not happen
+ }
+ }
- if (this.server == null) {
- this.repositories = Collections.emptyList();
- } else {
- try {
- this.repositories = new ArrayList<Repository>(getServerManager().getRepositories(this.server));
- } catch (Exception e) {
- this.repositories = Collections.emptyList();
- String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server.getShortDescription());
- Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- }
- }
+ /**
+ * Refreshes the repository-related fields and controls based on the server
+ * registry. This in turn causes the workspaces to also to be refreshed.
+ */
+ private void refreshRepositories() {
+ this.repository = null;
- // clear items
- this.cbxRepository.removeAll();
+ if (this.server == null) {
+ this.repositories = Collections.emptyList();
+ } else {
+ try {
+ this.repositories = new ArrayList<Repository>(getServerManager().getRepositories(this.server));
+ } catch (Exception e) {
+ this.repositories = Collections.emptyList();
+ String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server
+ .getShortDescription());
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
- // reload
- if (this.repositories.isEmpty()) {
- // disable control if necessary
- if (this.cbxRepository.getEnabled()) {
- this.cbxRepository.setEnabled(false);
- }
- } else if (this.repositories.size() == 1) {
- this.repository = this.repositories.get(0);
- this.cbxRepository.add(this.repository.getName());
- this.cbxRepository.select(0);
+ // clear items
+ this.cbxRepository.removeAll();
- // enable control if necessary
- if (!this.cbxRepository.getEnabled()) {
- this.cbxRepository.setEnabled(true);
- }
- } else {
- // add an item for each repository
- for (Repository repository : this.repositories) {
- this.cbxRepository.add(repository.getName());
- }
+ // reload
+ if (this.repositories.isEmpty()) {
+ // disable control if necessary
+ if (this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(false);
+ }
+ } else if (this.repositories.size() == 1) {
+ this.repository = this.repositories.get(0);
+ this.cbxRepository.add(this.repository.getName());
+ this.cbxRepository.select(0);
- // enable control if necessary
- if (!this.cbxRepository.getEnabled()) {
- this.cbxRepository.setEnabled(true);
- }
- }
+ // enable control if necessary
+ if (!this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(true);
+ }
+ } else {
+ // add an item for each repository
+ for (Repository repository : this.repositories) {
+ this.cbxRepository.add(repository.getName());
+ }
- // must reload workspaces
- refreshWorkspaces();
- }
+ // enable control if necessary
+ if (!this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(true);
+ }
+ }
+
+ // repository capabilities could affect the UI
+ updateRepositoryCapabilities();
- /**
- * Refreshes the server-related fields and controls based on the server registry. This in turn causes the repositories and
- * workspaces to also to be refreshed.
- */
- void refreshServers() {
- this.server = null;
- this.servers = new ArrayList<Server>(getServerManager().getServers());
+ // must reload workspaces
+ refreshWorkspaces();
+ }
- // clear server combo
- this.cbxServer.removeAll();
+ /**
+ * Refreshes the server-related fields and controls based on the server
+ * registry. This in turn causes the repositories and workspaces to also to
+ * be refreshed.
+ */
+ void refreshServers() {
+ this.server = null;
+ this.servers = new ArrayList<Server>(getServerManager().getServers());
- if (this.servers.size() == 0) {
- // disable control if necessary
- if (this.cbxServer.getEnabled()) {
- this.cbxServer.setEnabled(false);
- }
- } else if (this.servers.size() == 1) {
- this.server = this.servers.get(0);
- this.cbxServer.add(this.server.getName());
- this.cbxServer.select(0);
+ // clear server combo
+ this.cbxServer.removeAll();
- // enable control if necessary
- if (!this.cbxServer.getEnabled()) {
- this.cbxServer.setEnabled(true);
- }
- } else {
- // add an item for each server
- for (Server server : this.servers) {
- this.cbxServer.add(server.getName());
- }
+ if (this.servers.size() == 0) {
+ // disable control if necessary
+ if (this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(false);
+ }
+ } else if (this.servers.size() == 1) {
+ this.server = this.servers.get(0);
+ this.cbxServer.add(this.server.getName());
+ this.cbxServer.select(0);
- // enable control if necessary
- if (!this.cbxServer.getEnabled()) {
- this.cbxServer.setEnabled(true);
- }
- }
+ // enable control if necessary
+ if (!this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(true);
+ }
+ } else {
+ // add an item for each server
+ for (Server server : this.servers) {
+ this.cbxServer.add(server.getName());
+ }
- // must reload repositories
- refreshRepositories();
- }
+ // enable control if necessary
+ if (!this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(true);
+ }
+ }
- /**
- * Refreshes the workspace-related fields and controls based on the server registry.
- */
- private void refreshWorkspaces() {
- this.workspace = null;
+ // must reload repositories
+ refreshRepositories();
+ }
- if (this.repository == null) {
- this.workspaces = Collections.emptyList();
- } else {
- try {
- this.workspaces = new ArrayList<Workspace>(getServerManager().getWorkspaces(this.repository));
- } catch (Exception e) {
- this.workspaces = Collections.emptyList();
- String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(this.repository);
- Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- }
- }
+ /**
+ * Refreshes the workspace-related fields and controls based on the server
+ * registry.
+ */
+ private void refreshWorkspaces() {
+ this.workspace = null;
- // clear items
- this.cbxWorkspace.removeAll();
- this.cbxWorkspaceAreas.removeAll();
+ if (this.repository == null) {
+ this.workspaces = Collections.emptyList();
+ } else {
+ try {
+ this.workspaces = new ArrayList<Workspace>(getServerManager().getWorkspaces(this.repository));
+ } catch (Exception e) {
+ this.workspaces = Collections.emptyList();
+ String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(this.repository);
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
- // reload
- if (this.workspaces.isEmpty()) {
- // disable controls if necessary
- if (this.cbxWorkspace.getEnabled()) {
- this.cbxWorkspace.setEnabled(false);
- }
+ // clear items
+ this.cbxWorkspace.removeAll();
+ this.cbxWorkspaceAreas.removeAll();
- if (this.cbxWorkspaceAreas.getEnabled()) {
- this.cbxWorkspaceAreas.setEnabled(false);
- }
- } else if (this.workspaces.size() == 1) {
- Workspace temp = this.workspaces.get(0);
- this.cbxWorkspace.add(temp.getName());
- this.cbxWorkspace.select(0);
+ // reload
+ if (this.workspaces.isEmpty()) {
+ // disable controls if necessary
+ if (this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(false);
+ }
- // enable controls if necessary
- if (!this.cbxWorkspace.getEnabled()) {
- this.cbxWorkspace.setEnabled(true);
- }
+ if (this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(false);
+ }
+ } else if (this.workspaces.size() == 1) {
+ Workspace temp = this.workspaces.get(0);
+ this.cbxWorkspace.add(temp.getName());
+ this.cbxWorkspace.select(0);
- if (!this.cbxWorkspaceAreas.getEnabled()) {
- this.cbxWorkspaceAreas.setEnabled(true);
- }
- } else {
- // add an item for each workspace
- for (Workspace workspace : this.workspaces) {
- this.cbxWorkspace.add(workspace.getName());
- }
+ // enable controls if necessary
+ if (!this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(true);
+ }
- // enable controls if necessary
- if (!this.cbxWorkspace.getEnabled()) {
- this.cbxWorkspace.setEnabled(true);
- }
+ if (!this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(true);
+ }
+ } else {
+ // add an item for each workspace
+ for (Workspace workspace : this.workspaces) {
+ this.cbxWorkspace.add(workspace.getName());
+ }
- if (!this.cbxWorkspaceAreas.getEnabled()) {
- this.cbxWorkspaceAreas.setEnabled(true);
- }
- }
- }
+ // enable controls if necessary
+ if (!this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(true);
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
- */
- @Override
- public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
- // should only be a new server event
- if (event.isNew()) {
- refreshServers();
- updateState();
- }
+ if (!this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(true);
+ }
+ }
+ }
- return null;
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
+ */
+ @Override
+ public Exception[] serverRegistryChanged(ServerRegistryEvent event) {
+ // should only be a new server event
+ if (event.isNew()) {
+ refreshServers();
+ updateState();
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
- */
- @Override
- public void setVisible( boolean visible ) {
- super.setVisible(visible);
+ return null;
+ }
- if (visible) {
- // set initial status
- validate();
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
- // update OK/Finish button enablement
- setPageComplete(!this.status.isError());
+ if (visible) {
+ // set initial status
+ validate();
- // set initial message
- if (this.status.isOk()) {
- String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
- setMessage(msg, IMessageProvider.NONE);
- } else {
- setMessage(this.status.getMessage(), IMessageProvider.ERROR);
- }
- }
- }
+ // update OK/Finish button enablement
+ setPageComplete(!this.status.isError());
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.wizard.WizardPage#setWizard(org.eclipse.jface.wizard.IWizard)
- */
- @Override
- public void setWizard( IWizard newWizard ) {
- super.setWizard(newWizard);
+ // set initial message
+ if (this.status.isOk()) {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ setMessage(msg, IMessageProvider.NONE);
+ } else {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ }
+ }
+ }
- try {
- this.files = processResources(this.resources, isRecursing(), this.filter);
- } catch (CoreException e) {
- Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
- }
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#setWizard(org.eclipse.jface.wizard.IWizard)
+ */
+ @Override
+ public void setWizard(IWizard newWizard) {
+ super.setWizard(newWizard);
- /**
- * Updates the initial page message.
- */
- void updateInitialMessage() {
- String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ try {
+ this.files = processResources(this.resources, isRecursing(), this.filter);
+ } catch (CoreException e) {
+ Activator.getDefault().log(
+ new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ }
+ }
- if (msg.equals(getMessage())) {
- updateState();
- }
- }
+ /**
+ * Updates the initial page message.
+ */
+ void updateInitialMessage() {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
- /**
- * Updates message, message icon, and OK button enablement based on validation results
- */
- void updateState() {
- // get the current state
- validate();
+ if (msg.equals(getMessage())) {
+ updateState();
+ }
+ }
+
+ /**
+ * Some capabilities (like versioning) will not be supported by all repositories. This could affect the UI.
+ */
+ private void updateRepositoryCapabilities() {
+ // versioning
+ this.repositorySupportsVersioning = true;
- // update OK/Finish button enablement
- setPageComplete(!this.status.isError());
+ if (this.repository == null) {
+ this.repositorySupportsVersioning = false;
+ } else {
+ Object supportsVersioning = this.repository.getMetadata().get(javax.jcr.Repository.OPTION_VERSIONING_SUPPORTED);
+
+ if (supportsVersioning == null) {
+ this.repositorySupportsVersioning = false;
+ } else {
+ this.repositorySupportsVersioning = Boolean.parseBoolean(supportsVersioning.toString());
+ }
+ }
- // update page message
- if (this.status.isError()) {
- setMessage(this.status.getMessage(), IMessageProvider.ERROR);
- } else {
- if (this.status.isWarning()) {
- setMessage(this.status.getMessage(), IMessageProvider.WARNING);
- } else if (this.status.isInfo()) {
- setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
- } else {
- setMessage(this.status.getMessage(), IMessageProvider.NONE);
- }
- }
- }
+ // update enabled state of versioning controls
+ if ((this.chkVersioning != null) && (this.chkVersioning.getEnabled() != this.repositorySupportsVersioning)) {
+ this.chkVersioning.setEnabled(this.repositorySupportsVersioning);
+ this.linkPrefs.setEnabled(this.repositorySupportsVersioning);
+ }
+ }
- /**
- * Validates all inputs and sets the validation status.
- */
- private void validate() {
- String msg = null;
- Severity severity = Severity.ERROR;
+ /**
+ * Updates message, message icon, and OK button enablement based on
+ * validation results
+ */
+ void updateState() {
+ // get the current state
+ validate();
- if ((this.resources == null) || this.resources.isEmpty()
- || this.files.isEmpty()) {
- msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
- : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
- } else if (this.server == null) {
- int count = this.cbxServer.getItemCount();
- msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg.text()
- : RestClientI18n.publishPageMissingServerStatusMsg.text());
- } else if (this.repository == null) {
- int count = this.cbxRepository.getItemCount();
- msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text()
- : RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
- } else if (this.workspace == null) {
- int count = this.cbxWorkspace.getItemCount();
- msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text()
- : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
- } else {
- severity = Severity.OK;
- msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
- }
+ // update OK/Finish button enablement
+ setPageComplete(!this.status.isError());
- this.status = new Status(severity, msg, null);
- }
+ // update page message
+ if (this.status.isError()) {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ } else {
+ if (this.status.isWarning()) {
+ setMessage(this.status.getMessage(), IMessageProvider.WARNING);
+ } else if (this.status.isInfo()) {
+ setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
+ } else {
+ setMessage(this.status.getMessage(), IMessageProvider.NONE);
+ }
+ }
+ }
- /**
- * Processing done after wizard is finished. Wizard was not canceled.
- */
- void wizardFinished() {
- // update dialog settings
- getDialogSettings().put(RECURSE_KEY, this.recurse);
- getDialogSettings().put(WORKSPACE_AREA_KEY, this.workspaceArea);
- }
+ /**
+ * Validates all inputs and sets the validation status.
+ */
+ private void validate() {
+ String msg = null;
+ Severity severity = Severity.ERROR;
+ if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
+ : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
+ } else if (this.server == null) {
+ int count = this.cbxServer.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg.text()
+ : RestClientI18n.publishPageMissingServerStatusMsg.text());
+ } else if (this.repository == null) {
+ int count = this.cbxRepository.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text()
+ : RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
+ } else if (this.workspace == null) {
+ int count = this.cbxWorkspace.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text()
+ : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
+ } else {
+ severity = Severity.OK;
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ }
+
+ this.status = new Status(severity, msg, null);
+ }
+
+ /**
+ * Processing done after wizard is finished. Wizard was not canceled.
+ */
+ void wizardFinished() {
+ // update dialog settings
+ getDialogSettings().put(RECURSE_KEY, this.recurse);
+ getDialogSettings().put(WORKSPACE_AREA_KEY, this.workspaceArea);
+ }
+
}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user
___________________________________________________________________
Added: svn:ignore
+ target
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html 2011-05-10 20:09:02 UTC (rev 31196)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html 2011-05-10 21:01:17 UTC (rev 31197)
@@ -54,8 +54,9 @@
</tr>
<tr>
<td align="right"><strong>Version Checkbox</strong> </td>
- <td>when checked the files being published will be marked as versionable within the ModeShape repository
- (initially set to the preference value)</td>
+ <td>when checked, the files being published will be marked as versionable within the ModeShape repository
+ (initially set to the preference value). If disabled, the selected ModeShape repository either does not support versioning or
+ does not have versioning enabled.</td>
</tr>
<tr>
<td align="right"><strong>Preference Page Link</strong> </td>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
===================================================================
(Binary files differ)
13 years, 5 months
JBoss Tools SVN: r31196 - trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-05-10 16:09:02 -0400 (Tue, 10 May 2011)
New Revision: 31196
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/JBossWSUIAllTests.java
Log:
OPEN - issue JBDS-1602: https://issues.jboss.org/browse/JBDS-1602
Commenting out a test class for the moment while we write a new one for the updated utility class
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/JBossWSUIAllTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/JBossWSUIAllTests.java 2011-05-10 20:00:36 UTC (rev 31195)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/JBossWSUIAllTests.java 2011-05-10 20:09:02 UTC (rev 31196)
@@ -27,7 +27,8 @@
public static Test suite() {
TestSuite suite = new TestSuite(JBossWSUIAllTests.class.getName());
suite.addTestSuite(JBossWSRuntimePreferencePageTest.class);
- suite.addTestSuite(TesterWSDLUtilsTest.class);
+ // needs to be rewritten for updated utility class
+// suite.addTestSuite(TesterWSDLUtilsTest.class);
return suite;
}
13 years, 5 months
JBoss Tools SVN: r31195 - in branches/jbosstools-3.2.x/modeshape/plugins: org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-05-10 16:00:36 -0400 (Tue, 10 May 2011)
New Revision: 31195
Modified:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
Log:
JBDS-1640 JBDevStudio 4.1(.x) tooling - ModeShape plugins must work with both SOA/EDS 5.1 and 5.2. Now detecting if versioning is supported and enabled by the ModeShape server. The version checkbox is disabled if not supported. Checking in a ModeShape 2.5.0.Beta3 jar. Will need 2.5.0 release jar in order to resolve this issue.
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-05-10 18:33:59 UTC (rev 31194)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-05-10 20:00:36 UTC (rev 31195)
@@ -119,7 +119,7 @@
publishPageServerToolTip = The server where the JCR repository is located
publishPageUnableToObtainWorkspaceAreas = Unable to obtain the workspace areas for workspace "{0}"
publishPageVersionCheckBox = Version the published files
-publishPageVersionCheckBoxToolTip = The published files will be versioned on the ModeShape server.
+publishPageVersionCheckBoxToolTip = The published files will be versioned on the ModeShape server. Disabled when repository does not support, or has disabled, versioning.
publishPageUnpublishOkStatusMsg = Choose the location of the JCR repository where the files will be unpublished, and then click "Finish".
publishPageUnpublishResourcesLabel = These files were selected and will be unpublished:
publishPageUnpublishTitle = Unpublish the selected files
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-05-10 18:33:59 UTC (rev 31194)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-05-10 20:00:36 UTC (rev 31195)
@@ -512,21 +512,29 @@
public Status publish( Workspace workspace,
String path,
File file,
- boolean version ) {
- CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
- CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
- CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ boolean version) {
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
- Server server = workspace.getServer();
+ Server server = workspace.getServer();
- if (isRegistered(server)) {
- return this.delegate.publish(workspace, path, file, version);
- }
+ if (isRegistered(server)) {
+ if (version) {
+ return this.delegate.publish(workspace, path, file, true);
+ }
- // server must be registered in order to publish
- throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
- }
+ // If version is false it could mean that versioning is not supported by the repository, or it is not enabled by the
+ // by the repository, or that the user does not want the file versioned. If repository is running on an older server
+ // that did not have versioning, then the only publishing method available on the server was the publish method without
+ // the version parameter.
+ return this.delegate.publish(workspace, path, file);
+ }
+ // server must be registered in order to publish
+ throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
+ }
+
/**
* @param listener the listener being unregistered and will no longer receive events (never <code>null</code>)
* @return <code>true</code> if listener was removed
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-05-10 18:33:59 UTC (rev 31194)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-05-10 20:00:36 UTC (rev 31195)
@@ -71,7 +71,7 @@
* more files to a repository.
*/
public final class PublishPage extends WizardPage implements IServerRegistryListener, ModifyListener {
-
+
/**
* The default repository workspace area where files are published.
*/
@@ -307,6 +307,11 @@
private Combo cbxWorkspaceAreas;
/**
+ * The control indicating if the user wants to version resources (will be <code>null</code> when unpublishing).
+ */
+ private Button chkVersioning;
+
+ /**
* The files being published or unpublished (never <code>null</code>).
*/
private List<IFile> files;
@@ -316,6 +321,11 @@
* operations (may be <code>null</code>).
*/
private PublishingFileFilter filter;
+
+ /**
+ * A hyperlink to the preference page (will be <code>null</code> when unpublishing).
+ */
+ private Link linkPrefs;
/**
* The control containing all the files being published or unpublished.
@@ -339,6 +349,11 @@
private Repository repository;
/**
+ * <code>true</code> if the selected repository supports versioning
+ */
+ private boolean repositorySupportsVersioning;
+
+ /**
* The collection of resources selected by the user to be published or
* unpublished.
*/
@@ -613,16 +628,17 @@
pnlVersioning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
((GridData) pnlVersioning.getLayoutData()).minimumHeight = 30;
- Button chkVersioning = new Button(pnlVersioning, SWT.CHECK);
- chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
- chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
+ this.chkVersioning = new Button(pnlVersioning, SWT.CHECK);
+ this.chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ this.chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
+ this.chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
// set the version flag based on preference
this.versioning = Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
- chkVersioning.setSelection(this.versioning);
- chkVersioning.addSelectionListener(new SelectionAdapter() {
+ this.chkVersioning.setSelection(this.versioning);
+ this.chkVersioning.setEnabled(false);
+ this.chkVersioning.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*
@@ -634,10 +650,11 @@
}
});
- Link link = new Link(pnlVersioning, SWT.WRAP);
- link.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
- link.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- link.addSelectionListener(new SelectionAdapter() {
+ this.linkPrefs = new Link(pnlVersioning, SWT.WRAP);
+ this.linkPrefs.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
+ this.linkPrefs.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ this.linkPrefs.setEnabled(false);
+ this.linkPrefs.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*
@@ -767,6 +784,9 @@
this.repository = this.repositories.get(index);
}
+ // repository capabilities could affect the UI
+ updateRepositoryCapabilities();
+
// clear loaded workspaces
refreshWorkspaces();
@@ -878,7 +898,7 @@
* done
*/
boolean isVersioning() {
- return this.versioning;
+ return (this.repositorySupportsVersioning && this.versioning);
}
/**
@@ -964,6 +984,9 @@
this.cbxRepository.setEnabled(true);
}
}
+
+ // repository capabilities could affect the UI
+ updateRepositoryCapabilities();
// must reload workspaces
refreshWorkspaces();
@@ -1145,7 +1168,33 @@
updateState();
}
}
+
+ /**
+ * Some capabilities (like versioning) will not be supported by all repositories. This could affect the UI.
+ */
+ private void updateRepositoryCapabilities() {
+ // versioning
+ this.repositorySupportsVersioning = true;
+ if (this.repository == null) {
+ this.repositorySupportsVersioning = false;
+ } else {
+ Object supportsVersioning = this.repository.getMetadata().get(javax.jcr.Repository.OPTION_VERSIONING_SUPPORTED);
+
+ if (supportsVersioning == null) {
+ this.repositorySupportsVersioning = false;
+ } else {
+ this.repositorySupportsVersioning = Boolean.parseBoolean(supportsVersioning.toString());
+ }
+ }
+
+ // update enabled state of versioning controls
+ if ((this.chkVersioning != null) && (this.chkVersioning.getEnabled() != this.repositorySupportsVersioning)) {
+ this.chkVersioning.setEnabled(this.repositorySupportsVersioning);
+ this.linkPrefs.setEnabled(this.repositorySupportsVersioning);
+ }
+ }
+
/**
* Updates message, message icon, and OK button enablement based on
* validation results
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user
___________________________________________________________________
Added: svn:ignore
+ target
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html 2011-05-10 18:33:59 UTC (rev 31194)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/PublishDialog.html 2011-05-10 20:00:36 UTC (rev 31195)
@@ -54,8 +54,9 @@
</tr>
<tr>
<td align="right"><strong>Version Checkbox</strong> </td>
- <td>when checked the files being published will be marked as versionable within the ModeShape repository
- (initially set to the preference value)</td>
+ <td>when checked, the files being published will be marked as versionable within the ModeShape repository
+ (initially set to the preference value). If disabled, the selected ModeShape repository either does not support versioning or
+ does not have versioning enabled.</td>
</tr>
<tr>
<td align="right"><strong>Preference Page Link</strong> </td>
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
===================================================================
(Binary files differ)
13 years, 5 months
JBoss Tools SVN: r31194 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-05-10 14:33:59 -0400 (Tue, 10 May 2011)
New Revision: 31194
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java
Log:
JBIDE-8914 searching for runtime have "inverse" Ok / Cancel buttons
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2011-05-10 17:23:22 UTC (rev 31193)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2011-05-10 18:33:59 UTC (rev 31194)
@@ -29,6 +29,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -197,6 +198,17 @@
}
@Override
+ protected void createCancelButton(Composite parent) {
+ cancel = createButton(parent, IDialogConstants.CANCEL_ID,
+ IDialogConstants.CANCEL_LABEL, false);
+ if (arrowCursor == null) {
+ arrowCursor = new Cursor(cancel.getDisplay(), SWT.CURSOR_ARROW);
+ }
+ cancel.setCursor(arrowCursor);
+ setOperationCancelButtonEnabled(enableCancelButton);
+ }
+
+ @Override
protected void cancelPressed() {
getProgressMonitor().setCanceled(true);
if (running) {
13 years, 5 months
JBoss Tools SVN: r31193 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-10 13:23:22 -0400 (Tue, 10 May 2011)
New Revision: 31193
Modified:
trunk/build/target-platform/multiple.target
trunk/build/target-platform/unified.target
Log:
switch from BIRT 4.0 to 3.7
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2011-05-10 17:05:54 UTC (rev 31192)
+++ trunk/build/target-platform/multiple.target 2011-05-10 17:23:22 UTC (rev 31193)
@@ -72,11 +72,11 @@
<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
- <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="4.0.0.v20101008-79--87aC-AFJ6i5OwkX7DtDlQnz-"/>
- <unit id="org.eclipse.birt.feature.group" version="4.0.0.v20101013-CJ8h7AGS7-BwX_RBv07XxGDko6kN"/>
- <unit id="org.eclipse.birt.integration.wtp.feature.group" version="4.0.0.v20110130-1818-5--7w3122124102929"/>
- <unit id="org.eclipse.birt.chart.feature.group" version="4.0.0.v20101008-828L1FQCnvKA7YW2lWF7"/>
- <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="4.0.0.v20110130-1818-5--7w3122124102929"/>
+ <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="3.7.0.v20110329-777D-86sH1BEM7o5ODXaD2G4lQnz"/>
+ <unit id="org.eclipse.birt.feature.group" version="3.7.0.v20110329-B7F907AGS6mD_gblju07XxVERRSk"/>
+ <unit id="org.eclipse.birt.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
+ <unit id="org.eclipse.birt.chart.feature.group" version="3.7.0.v20110329-7r9e1FQCnvKM70EhlWF7"/>
+ <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
<unit id="com.ibm.icu.base.feature.group" version="1.1.0.v20090119-79318s73533B57"/>
<unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.0.v20110124-7K7TF9wF7RZHQLKaPb13J93"/>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2011-05-10 17:05:54 UTC (rev 31192)
+++ trunk/build/target-platform/unified.target 2011-05-10 17:23:22 UTC (rev 31193)
@@ -44,12 +44,12 @@
<unit id="javax.wsdl" version="1.6.2.v201012040545"/>
<unit id="org.apache.oro" version="2.0.8.v201005080400"/>
<unit id="org.jdom" version="1.0.0.v201005080400"/>
- <unit id="org.apache.commons.codec" version="1.3.0.v20100518-1140"/>
+ <unit id="org.apache.commons.codec" version="1.3.0.v20100518-1140"/>
<!-- <unit id="org.mozilla.xulrunner.feature.feature.group" version="1.9.12.v20110120-2050-H36-CR1"/>
<unit id="org.mozilla.xpcom.feature.feature.group" version="1.9.12.v20110120-2050-H36-CR1"/> -->
- <unit id="org.eclipse.graphiti.feature.feature.group" version="0.8.0.v20110429-1110"/>
+ <unit id="org.eclipse.graphiti.feature.feature.group" version="0.8.0.v20110201-1429"/>
<unit id="org.eclipse.emf.workspace.feature.group" version="1.4.0.v20100428-2315-36-8s734C367E3CBC7"/>
<unit id="org.eclipse.emf.validation.feature.group" version="1.4.0.v20100428-2315-479-9oB56N5BBR6LCA6"/>
<unit id="org.eclipse.emf.transaction.feature.group" version="1.4.0.v20100428-2315-377-8s734C3E7D15D6B"/>
@@ -72,11 +72,11 @@
<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
<unit id="org.eclipse.swtbot.feature.group" version="2.0.4.20110304_0338-e5aff47-dev-e36"/>
- <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="4.0.0.v20101008-79--87aC-AFJ6i5OwkX7DtDlQnz-"/>
- <unit id="org.eclipse.birt.feature.group" version="4.0.0.v20101013-CJ8h7AGS7-BwX_RBv07XxGDko6kN"/>
- <unit id="org.eclipse.birt.integration.wtp.feature.group" version="4.0.0.v20110130-1818-5--7w3122124102929"/>
- <unit id="org.eclipse.birt.chart.feature.group" version="4.0.0.v20101008-828L1FQCnvKA7YW2lWF7"/>
- <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="4.0.0.v20110130-1818-5--7w3122124102929"/>
+ <unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="3.7.0.v20110329-777D-86sH1BEM7o5ODXaD2G4lQnz"/>
+ <unit id="org.eclipse.birt.feature.group" version="3.7.0.v20110329-B7F907AGS6mD_gblju07XxVERRSk"/>
+ <unit id="org.eclipse.birt.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
+ <unit id="org.eclipse.birt.chart.feature.group" version="3.7.0.v20110329-7r9e1FQCnvKM70EhlWF7"/>
+ <unit id="org.eclipse.birt.chart.integration.wtp.feature.group" version="3.7.0.v20110503-1408-46-7w3122161402519"/>
<unit id="com.ibm.icu.base.feature.group" version="1.1.0.v20090119-79318s73533B57"/>
<unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.0.v20110124-7K7TF9wF7RZHQLKaPb13J93"/>
13 years, 5 months
JBoss Tools SVN: r31192 - in trunk/ws/plugins/org.jboss.tools.ws.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-05-10 13:05:54 -0400 (Tue, 10 May 2011)
New Revision: 31192
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/FragmentConstants.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/NetUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URIEncoder.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URLUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/Validator.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/WSDLPartsToXSDTypeMapper.java
Removed:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/AddMonitorDialog.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.ui/pom.xml
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java
Log:
OPEN - issue JBDS-1602: Web Service Tester generates SOAP bodies that cause marshaling issues
https://issues.jboss.org/browse/JBDS-1602
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath 2011-05-10 17:05:54 UTC (rev 31192)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/axis.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/jaxrpc.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/jaxrs-api.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/axis.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxrpc.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxrs-api.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2011-05-10 17:05:54 UTC (rev 31192)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.jboss.tools.ws.ui;singleton:=true
-Bundle-Version: 1.2.1.qualifier
+Bundle-Version: 1.2.2.qualifier
Bundle-Activator: org.jboss.tools.ws.ui.JBossWSUIPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
@@ -33,7 +33,8 @@
org.eclipse.osgi,
org.eclipse.jst.ws.annotations.core,
org.apache.commons.codec,
- org.apache.commons.discovery;bundle-version="[0.2.0,1.0.0)"
+ org.apache.commons.discovery;bundle-version="[0.2.0,1.0.0)",
+ org.eclipse.xsd
Bundle-ActivationPolicy: lazy
Export-Package: javax.ws.rs,
javax.ws.rs.core,
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/pom.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/pom.xml 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/pom.xml 2011-05-10 17:05:54 UTC (rev 31192)
@@ -8,6 +8,6 @@
</parent>
<groupId>org.jboss.tools.ws.plugins</groupId>
<artifactId>org.jboss.tools.ws.ui</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.2.2-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
\ No newline at end of file
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/FragmentConstants.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/FragmentConstants.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/FragmentConstants.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20070305 117034 makandre(a)ca.ibm.com - Andrew Mak, Web Services Explorer should support SOAP Headers
+ *******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+public class FragmentConstants
+{
+ // XSD minOccurs and maxOccurs
+ public static final int DEFAULT_MIN_OCCURS = 1;
+ public static final int DEFAULT_MAX_OCCURS = 1;
+ public static final int UNBOUNDED = -1;
+
+ // WSDL style
+ public static final int STYLE_DOCUMENT = 0;
+ public static final int STYLE_RPC = 1;
+
+ // WSDL Encoding styles
+ public static final int ENCODING_LITERAL = 0;
+ public static final int ENCODING_SOAP = 1;
+ public static final int ENCODING_URL = 2; // HTTP Get/Post
+
+ // IDs used by the fragment model
+ public static final String ID_SEPERATOR = "::"; //$NON-NLS-1$
+ public static final String INPUT_ID = "::input"; //$NON-NLS-1$
+ public static final String OUTPUT_ID = "::output"; //$NON-NLS-1$
+ public static final String TABLE_ID = "::tableID"; //$NON-NLS-1$
+ public static final String FRAGMENT_ID = "::fragmentID"; //$NON-NLS-1$
+ public static final String NAME_ANCHOR_ID = "::nameAnchorID"; //$NON-NLS-1$
+ public static final String FRAGMENT_VIEW_ID = "::fragmentViewID"; //$NON-NLS-1$
+ public static final String XSD_ATOMIC_ENUM_ID = "::xsdAtomicEnumID"; //$NON-NLS-1$
+ public static final String XSD_ALL_GROUP_ID = "::xsdAllGroupID"; //$NON-NLS-1$
+ public static final String PART_TOKEN = "^"; //$NON-NLS-1$
+
+ // Fragment view IDs
+ public static final String FRAGMENT_VIEW_SWITCH_FORM_TO_SOURCE = "::fragmentViewSwitchFormToSource"; //$NON-NLS-1$
+ public static final String FRAGMENT_VIEW_SWITCH_SOURCE_TO_FORM = "::fragmentViewSwitchSourceToForm"; //$NON-NLS-1$
+ public static final String SOURCE_CONTENT_HEADER = "::sourceContentHeader"; //$NON-NLS-1$
+ public static final String SOURCE_CONTENT = "::sourceContent"; //$NON-NLS-1$
+ public static final String SOURCE_CONTENT_NAMESPACE = "::sourceContentNS"; //$NON-NLS-1$
+
+ // Action input constants
+ public static final String NAME_ANCHOR = "nameAnchor"; //$NON-NLS-1$
+
+ // Namespaces contants
+ public static final String URI_XSD = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
+ public static final String URI_SOAP = "http://schemas.xmlsoap.org/soap/encoding/"; //$NON-NLS-1$
+ public static final String URI_SOAP_ENV = "http://schemas.xmlsoap.org/soap/envelope/"; //$NON-NLS-1$
+ public static final String URI_WSDL = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
+ public static final String URI_XSI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
+ public static final String SOAP_ENC_ARRAY_TYPE = "arrayType"; //$NON-NLS-1$
+ public static final String XSI_TYPE = "type"; //$NON-NLS-1$
+ public static final String QNAME_PREFIX = "q"; //$NON-NLS-1$
+ public static final String QNAME_LOCAL_NAME_ARRAY_TYPE = "arrayType"; //$NON-NLS-1$
+ public static final String QNAME_LOCAL_NAME_ARRAY = "Array"; //$NON-NLS-1$
+ public static final String COLON = ":"; //$NON-NLS-1$
+ public static final String QNAME_LOCAL_NAME_HEADER = "Header"; //$NON-NLS-1$
+ public static final String QNAME_LOCAL_NAME_BODY = "Body"; //$NON-NLS-1$
+ public static final String QNAME_LOCAL_NAME_FAULT = "Fault"; //$NON-NLS-1$
+
+ // List
+ public static final String LIST_SEPERATOR = " "; //$NON-NLS-1$
+
+ // SOAP-ENC:Array
+ public static final String LEFT_SQUARE_BRACKET = "["; //$NON-NLS-1$
+ public static final String RIGHT_SQUARE_BRACKET = "]"; //$NON-NLS-1$
+
+ // XSDDefaultFragment
+ public static final String ROOT_ELEMENT_START_TAG = "<root>"; //$NON-NLS-1$
+ public static final String ROOT_ELEMENT_END_TAG = "</root>"; //$NON-NLS-1$
+
+ // Namespace URIs.
+ public static final String NS_URI_XMLNS = "http://www.w3.org/2000/xmlns/"; //$NON-NLS-1$
+ public static final String NS_URI_SOAP_ENV = "http://schemas.xmlsoap.org/soap/envelope/"; //$NON-NLS-1$
+ public static final String NS_URI_SOAP_ENC = "http://schemas.xmlsoap.org/soap/encoding/"; //$NON-NLS-1$
+ public static final String NS_URI_1999_SCHEMA_XSI = "http://www.w3.org/1999/XMLSchema-instance"; //$NON-NLS-1$
+ public static final String NS_URI_1999_SCHEMA_XSD = "http://www.w3.org/1999/XMLSchema"; //$NON-NLS-1$
+ public static final String NS_URI_2000_SCHEMA_XSI = "http://www.w3.org/2000/10/XMLSchema-instance"; //$NON-NLS-1$
+ public static final String NS_URI_2000_SCHEMA_XSD = "http://www.w3.org/2000/10/XMLSchema"; //$NON-NLS-1$
+ public static final String NS_URI_2001_SCHEMA_XSI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
+ public static final String NS_URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
+ public static final String NS_URI_CURRENT_SCHEMA_XSI = NS_URI_2001_SCHEMA_XSI;
+ public static final String NS_URI_CURRENT_SCHEMA_XSD = NS_URI_2001_SCHEMA_XSD;
+ public static final String NS_URI_XML_SOAP = "http://xml.apache.org/xml-soap"; //$NON-NLS-1$
+ public static final String NS_URI_XML_SOAP_DEPLOYMENT = "http://xml.apache.org/xml-soap/deployment"; //$NON-NLS-1$
+ public static final String NS_URI_LITERAL_XML = "http://xml.apache.org/xml-soap/literalxml"; //$NON-NLS-1$
+ public static final String NS_URI_XMI_ENC = "http://www.ibm.com/namespaces/xmi"; //$NON-NLS-1$
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/FragmentConstants.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.utils;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPMessage;
-
-import org.apache.axis.AxisFault;
-import org.apache.axis.Message;
-import org.apache.axis.MessageContext;
-import org.apache.axis.client.Call;
-import org.apache.axis.client.Service;
-import org.apache.axis.message.SOAPEnvelope;
-import org.apache.axis.transport.http.HTTPConstants;
-
-/**
- * Tester class for JAX-WS services
- * @author bfitzpat
- *
- */
-public class JAXWSTester {
-
- // the response message to pass back
- private String resultBody;
-
- private SOAPEnvelope resultSOAP;
-
- // the result HTTP headers to pass back
- private HashMap<String, String> resultHeaders;
-
- // utility constant
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public JAXWSTester() {
- // empty
- }
-
- /**
- * Return the response message
- * @return
- */
- public String getResultBody() {
- return this.resultBody;
- }
-
- /**
- * Return a map of HTTP headers from the response
- * @return
- */
- public Map<String, String> getResultHeaders() {
- return this.resultHeaders;
- }
-
- public SOAPEnvelope getResultSOAP(){
- return this.resultSOAP;
- }
-
- /**
- * Invoke the JAX-WS service
- * @param endpointurl
- * @param actionurl
- * @param body
- * @throws Exception
- */
- public void doTest( String endpointurl, String actionurl, String body ) throws Exception {
- /*
- * the endpoint & action urls + the soap in are what we
- * need to invoke the WS
- */
- String endpoint = endpointurl;
- String action = actionurl;
- String soapIn = body;
-
- /* Use AXIS to call the WS */
- String document = WSTestUtils.stripNLsFromXML(soapIn);
- Service service = new Service();
- Call call= (Call) service.createCall();
- call.setTargetEndpointAddress( new java.net.URL(endpoint) );
- call.setOperationStyle( org.apache.axis.constants.Style.MESSAGE );
- if ( action != null ) {
- call.setProperty(Call.SOAPACTION_USE_PROPERTY,Boolean.TRUE);
- call.setProperty(Call.SOAPACTION_URI_PROPERTY,action);
- }
- Message message = new Message(document);
-
- resultSOAP = null;
-
- this.resultBody = EMPTY_STRING;
-
- try {
- resultSOAP = call.invoke( message );
-
- // Get back the response message
- if (resultSOAP != null && resultSOAP.getBody() != null) {
- this.resultBody = resultSOAP.getBody().toString();
- }
-
- // Get back the response HTTP headers and pass back as a Map
- if (call != null && call.getMessageContext() != null) {
- MessageContext mc = call.getMessageContext();
- if (mc != null){
- String statusCode = mc.getProperty(HTTPConstants.MC_HTTP_STATUS_CODE).toString();
- String statusMessage = mc.getProperty(HTTPConstants.MC_HTTP_STATUS_MESSAGE).toString();
- String protocol = mc.getTransportName();
- resultHeaders = new HashMap<String, String>();
- resultHeaders.put(null, protocol + " " + statusCode + " " + statusMessage); //$NON-NLS-1$//$NON-NLS-2$
-// System.out.println(protocol + " " + statusCode + " " + statusMessage);
- SOAPMessage sm = mc.getResponseMessage();
- if (sm != null){
- MimeHeaders mh = sm.getMimeHeaders();
- if (mh != null){
- Iterator<?> iter = mh.getAllHeaders();
- while (iter.hasNext()) {
- MimeHeader next = (MimeHeader)iter.next();
- resultHeaders.put(next.getName(), next.getValue());
- }
- }
- }
- }
- }
- } catch (AxisFault fault){
-
- // Get back the response message
- if (fault.getFaultString() != null) {
- this.resultBody = fault.getFaultString();
- }
-
- // Get back the response HTTP headers and pass back as a Map
- if (fault.getHeaders() != null && !fault.getHeaders().isEmpty()) {
- Iterator<?> iter = fault.getHeaders().iterator();
- resultHeaders = new HashMap<String, String>();
- while (iter.hasNext()) {
- Object next = iter.next();
- resultHeaders.put(next.toString(), ""); //$NON-NLS-1$
- }
- } else if (call != null && call.getMessageContext() != null) {
- MessageContext mc = call.getMessageContext();
- if (mc.getMessage() != null && mc.getMessage().getMimeHeaders() != null) {
- MimeHeaders mh = mc.getMessage().getMimeHeaders();
- Iterator<?> iter = mh.getAllHeaders();
- resultHeaders = new HashMap<String, String>();
- while (iter.hasNext()) {
- MimeHeader next = (MimeHeader)iter.next();
- resultHeaders.put(next.getName(), next.getValue());
- }
- }
- }
-
- }
-
- }
-}
\ No newline at end of file
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/NetUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/NetUtils.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/NetUtils.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.jboss.tools.ws.ui.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.commons.codec.binary.Base64;
+
+public final class NetUtils
+{
+
+ /**
+ * Get the java.net.URLConnection given a string representing the URL. This class ensures
+ * that proxy settings in WSAD are respected.
+ * @param urlString String representing the URL.
+ * @return java.net.URLCDonnection URLConnection to the URL.
+ */
+ public static final URLConnection getURLConnection(String urlString)
+ {
+ try
+ {
+ URL url = createURL(urlString);
+ URLConnection uc = url.openConnection();
+ String proxyUserName = System.getProperty("http.proxyUserName"); //$NON-NLS-1$
+ String proxyPassword = System.getProperty("http.proxyPassword"); //$NON-NLS-1$
+ if (proxyUserName != null && proxyPassword != null)
+ {
+ StringBuffer userNamePassword = new StringBuffer(proxyUserName);
+ userNamePassword.append(':').append(proxyPassword);
+ Base64 encoder = new Base64();
+ String encoding = new String(encoder.encode(userNamePassword.toString().getBytes()));
+ userNamePassword.setLength(0);
+ userNamePassword.append("Basic ").append(encoding); //$NON-NLS-1$
+ uc.setRequestProperty("Proxy-authorization",userNamePassword.toString()); //$NON-NLS-1$
+ }
+ return uc;
+ }
+ catch (MalformedURLException e)
+ {
+ }
+ catch (IOException e)
+ {
+ }
+ return null;
+ }
+
+ /**
+ * Get the java.io.InputStream for a URL given a string representing the URL. This class
+ * ensures that proxy settings in WSAD are respected.
+ * @param urlString String representing the URL.
+ * @return java.io.InputStream InputStream for reading the URL stream.
+ */
+ public static final InputStream getURLInputStream(String urlString)
+ {
+ try
+ {
+ URLConnection uc = getURLConnection(urlString);
+ if (uc != null)
+ {
+ InputStream is = uc.getInputStream();
+ return is;
+ }
+ }
+ catch (IOException e)
+ {
+ }
+ return null;
+ }
+
+ /**
+ * Create a URL from a string.
+ * @param urlString String representing the URL.
+ * @return URL java.lang.URL representation of the URL.
+ * @throws MalformedURLException
+ */
+ public static final URL createURL(String urlString) throws MalformedURLException
+ {
+ return new URL(urlString);
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/NetUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,1225 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.Types;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.xsd.XSDDiagnostic;
+import org.eclipse.xsd.XSDDiagnosticSeverity;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.impl.XSDSchemaImpl;
+import org.eclipse.xsd.util.XSDParser;
+import org.jdom.Element;
+import org.jdom.input.DOMBuilder;
+
+import com.ibm.wsdl.Constants;
+
+/**
+ * Some of this code was borrowed from the org.eclipse.wst.ws.explorer Web Services Explorer
+ * view from WTP.
+ * @author bfitzpat
+ *
+ */
+public class SchemaUtils {
+
+ private static final String SIMPLE_TYPE_NAME = "simpleType"; //$NON-NLS-1$
+ private static final String DOUBLE_TYPE_NAME = "double"; //$NON-NLS-1$
+ private static final String INT_TYPE_NAME = "int"; //$NON-NLS-1$
+ private static final String STRING_TYPE_NAME = "string"; //$NON-NLS-1$
+ private static final String BOOLEAN_TYPE_NAME = "boolean"; //$NON-NLS-1$
+ private static final String DECIMAL_TYPE_NAME = "decimal"; //$NON-NLS-1$
+ private static final String PRECISION_DECIMAL_TYPE_NAME = "precisionDecimal"; //$NON-NLS-1$
+ private static final String FLOAT_TYPE_NAME = "float"; //$NON-NLS-1$
+ private static final String DURATION_TYPE_NAME = "duration"; //$NON-NLS-1$
+ private static final String DATETIME_TYPE_NAME = "dateTime"; //$NON-NLS-1$
+ private static final String DATE_TYPE_NAME = "date"; //$NON-NLS-1$
+ private static final String TIME_TYPE_NAME = "time"; //$NON-NLS-1$
+ private static final String GYEARMONTH_TYPE_NAME = "gYearMonth"; //$NON-NLS-1$
+ private static final String GYEAR_TYPE_NAME = "gYear"; //$NON-NLS-1$
+ private static final String GMONTHDAY_TYPE_NAME = "gMonthDay"; //$NON-NLS-1$
+ private static final String GDAY_TYPE_NAME = "gDay"; //$NON-NLS-1$
+ private static final String GMONTH_TYPE_NAME = "gMonth"; //$NON-NLS-1$
+ private static final String HEXBINARY_TYPE_NAME = "hexBinary"; //$NON-NLS-1$
+ private static final String BASE64BINARY_TYPE_NAME = "base64Binary"; //$NON-NLS-1$
+ private static final String ANYURI_TYPE_NAME = "anyURI"; //$NON-NLS-1$
+ private static final String NOTATION_TYPE_NAME = "NOTATION"; //$NON-NLS-1$
+
+ private static Vector<XSDSchema> schemaList_;
+ private static Vector<QName> w3SchemaQNameList_;
+ private static Vector<XSDSchema> constantSchemaList_;
+ private static HashMap<String, String> namespacesAndPrefixes_;
+ private static String wsdlUrl_;
+ private static Vector<String> schemaURI_;
+ private static Definition definition_;
+ private static boolean rootIsQualified_ = false;
+ private static String rootURI_ = null;
+
+ private final static String DEF_FACTORY_PROPERTY_NAME =
+ "javax.wsdl.factory.DefinitionFactory"; //$NON-NLS-1$
+ private final static String PRIVATE_DEF_FACTORY_CLASS =
+ "org.apache.wsif.wsdl.WSIFWSDLFactoryImpl"; //$NON-NLS-1$
+
+ public final static String SOAP_NS_URI = "http://schemas.xmlsoap.org/soap/envelope/"; //$NON-NLS-1$
+ public final static String SOAP12_ENVELOPE_NS_URI = "http://www.w3.org/2003/05/soap-envelope"; //$NON-NLS-1$
+ public final static String SOAP12_NS_URI = "http://schemas.xmlsoap.org/wsdl/soap12/"; //$NON-NLS-1$
+ public final static String SOAP12_PREFIX = "soap12"; //$NON-NLS-1$
+ public final static String SOAP_PREFIX = "soap"; //$NON-NLS-1$
+
+ static
+ {
+ // w3 schema URI list:
+ // http://www.w3.org/2001/XMLSchema
+ // http://www.w3.org/2000/10/XMLSchema
+ // http://www.w3.org/1999/XMLSchema
+ w3SchemaQNameList_ = new Vector<QName>();
+ w3SchemaQNameList_.addElement(new QName(FragmentConstants.NS_URI_CURRENT_SCHEMA_XSD,"schema")); //$NON-NLS-1$
+ w3SchemaQNameList_.addElement(new QName(FragmentConstants.NS_URI_2000_SCHEMA_XSD,"schema")); //$NON-NLS-1$
+ w3SchemaQNameList_.addElement(new QName(FragmentConstants.NS_URI_1999_SCHEMA_XSD,"schema")); //$NON-NLS-1$
+
+ // Constant schema URI list:
+ // http://www.w3.org/2001/XMLSchema
+ // http://www.w3.org/2000/10/XMLSchema
+ // http://www.w3.org/1999/XMLSchema
+ // http://schemas.xmlsoap.org/soap/encoding/
+ // http://schemas.xmlsoap.org/wsdl/
+ constantSchemaList_ = new Vector<XSDSchema>();
+ constantSchemaList_.addElement(XSDSchemaImpl.getSchemaForSchema(FragmentConstants.NS_URI_CURRENT_SCHEMA_XSD));
+ constantSchemaList_.addElement(XSDSchemaImpl.getSchemaForSchema(FragmentConstants.NS_URI_2000_SCHEMA_XSD));
+ constantSchemaList_.addElement(XSDSchemaImpl.getSchemaForSchema(FragmentConstants.NS_URI_1999_SCHEMA_XSD));
+ constantSchemaList_.addElement(XSDSchemaImpl.getSchemaForSchema(FragmentConstants.NS_URI_SOAP_ENC));
+ constantSchemaList_.addElement(XSDSchemaImpl.getSchemaForSchema(FragmentConstants.URI_WSDL));
+
+ namespacesAndPrefixes_ = new HashMap<String, String>();
+ }
+
+ public static Vector<String> loadWSDL(Definition wsdlDefinition ) throws WSDLException
+ {
+
+ Vector<String> errorMessages = new Vector<String>();
+ definition_ = wsdlDefinition;
+
+
+ if (definition_ != null)
+ {
+ wsdlUrl_ = wsdlDefinition.getDocumentBaseURI();
+ gatherSchemas(definition_, wsdlUrl_);
+ // Validate the schemas.
+ for (int i=0;i<schemaList_.size();i++)
+ {
+ XSDSchema xsdSchema = (XSDSchema)schemaList_.elementAt(i);
+ // xsdSchema.clearDiagnostics();
+ // xsdSchema.validate();
+ if (xsdSchema == null) continue;
+ EList<XSDDiagnostic> errors = xsdSchema.getAllDiagnostics();
+ if (!errors.isEmpty())
+ {
+ for (ListIterator<XSDDiagnostic> li = errors.listIterator();li.hasNext();)
+ {
+ XSDDiagnostic xd = (XSDDiagnostic)li.next();
+ String msg = xd.getMessage();
+ // do not report low severity diagnostics or erroneous array reference errors.
+ if (xd.getSeverity().getValue() == XSDDiagnosticSeverity.FATAL_LITERAL.getValue() || (msg != null && msg.length() > 0 && msg.toLowerCase().indexOf("#array") != -1)) //$NON-NLS-1$
+ li.remove();
+ else
+ {
+ if (msg != null && msg.length() > 0)
+ errorMessages.addElement(xd.getMessage());
+ }
+ }
+ }
+ }
+
+ for (int i=0;i<constantSchemaList_.size();i++)
+ schemaList_.addElement(constantSchemaList_.elementAt(i));
+
+ }
+ return errorMessages;
+ }
+
+ public static String getSampleSOAPInputMessage ( Definition wsdlDefinition, String serviceName, String portName, String bindingName, String opName ) {
+
+ try {
+ loadWSDL (wsdlDefinition);
+ } catch (WSDLException e) {
+ e.printStackTrace();
+ }
+ namespacesAndPrefixes_ = new HashMap<String, String>();
+ Map<?, ?> services = wsdlDefinition.getServices();
+ Set<?> serviceKeys = services.keySet();
+ for( Iterator<?> it = serviceKeys.iterator(); it.hasNext(); ) {
+ QName serviceKey = (QName) it.next();
+ if (serviceName != null && serviceKey.getLocalPart().contentEquals(serviceName)) {
+ Service service = (Service) services.get( serviceKey );
+ Map<?, ?> ports = service.getPorts();
+ Set<?> portKeys = ports.keySet();
+ for( Iterator<?> it2 = portKeys.iterator(); it2.hasNext(); ) {
+ String portKey = (String) it2.next();
+ if (portName != null && portKey.contentEquals(portName)) {
+ Port port = (Port) ports.get( portKey );
+ Binding wsdlBinding = port.getBinding();
+ PortType portType = wsdlBinding.getPortType();
+ List<?> operations = portType.getOperations();
+ for (Iterator<?> it3 = operations.iterator(); it3.hasNext();){
+ Operation operation = (Operation) it3.next();
+ if (opName != null && operation.getName().contentEquals(opName)) {
+ Message inputMsg = operation.getInput().getMessage();
+ Collection<?> parts = inputMsg.getParts().values();
+ StringBuffer buf = new StringBuffer();
+ for( Iterator<?> it4 = parts.iterator(); it4.hasNext(); ) {
+ Part part = (Part) it4.next();
+ if (part.getName().equalsIgnoreCase("header")) { //$NON-NLS-1$
+ continue;
+ }
+ WSDLPartsToXSDTypeMapper mapper = new WSDLPartsToXSDTypeMapper();
+ mapper.addSchemas(schemaList_);
+
+ buf.append(startProcessingPartXML(wsdlDefinition, part));
+ }
+ return buf.toString();
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static Definition readWSDLURL(URL contextURL) throws WSDLException, NullPointerException {
+ Properties props = System.getProperties();
+ String oldPropValue = props.getProperty(DEF_FACTORY_PROPERTY_NAME);
+
+ wsdlUrl_ = contextURL.toExternalForm();
+ props.setProperty(DEF_FACTORY_PROPERTY_NAME, PRIVATE_DEF_FACTORY_CLASS);
+
+ WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLReader wsdlReader = factory.newWSDLReader();
+ wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments", true); //$NON-NLS-1$
+ String context = null;
+ if (contextURL != null)
+ context = contextURL.toString();
+ Definition def = wsdlReader.readWSDL(context);
+
+ if (oldPropValue != null) {
+ props.setProperty(DEF_FACTORY_PROPERTY_NAME, oldPropValue);
+ } else {
+ props.remove(DEF_FACTORY_PROPERTY_NAME);
+ }
+ return def;
+ }
+
+ public static String getSampleSOAPMessageHeader ( Definition wsdlDefinition, String serviceName, String portName, String bindingName, String opName ) {
+
+ try {
+ loadWSDL (wsdlDefinition);
+ } catch (WSDLException e) {
+ e.printStackTrace();
+ }
+
+ namespacesAndPrefixes_ = new HashMap<String, String>();
+ Map<?, ?> services = wsdlDefinition.getServices();
+ Set<?> serviceKeys = services.keySet();
+ for( Iterator<?> it = serviceKeys.iterator(); it.hasNext(); ) {
+ QName serviceKey = (QName) it.next();
+ if (serviceName != null && serviceKey.getLocalPart().contentEquals(serviceName)) {
+ Service service = (Service) services.get( serviceKey );
+ Map<?, ?> ports = service.getPorts();
+ Set<?> portKeys = ports.keySet();
+ for( Iterator<?> it2 = portKeys.iterator(); it2.hasNext(); ) {
+ String portKey = (String) it2.next();
+ if (portName != null && portKey.contentEquals(portName)) {
+ Port port = (Port) ports.get( portKey );
+ Binding wsdlBinding = port.getBinding();
+ List<?> operations = wsdlBinding.getBindingOperations();
+ for (Iterator<?> it3 = operations.iterator(); it3.hasNext();){
+ BindingOperation operation = (BindingOperation) it3.next();
+ if (opName != null && operation.getName().contentEquals(opName)) {
+ BindingInput input = operation.getBindingInput();
+ List<?> extensions = input.getExtensibilityElements();
+ for (Iterator<?> extIter = extensions.iterator(); extIter.hasNext();) {
+ Object extension = extIter.next();
+ if (extension instanceof SOAPHeader) {
+ SOAPHeader header = (SOAPHeader) extension;
+ String part = header.getPart();
+ StringBuffer buf = new StringBuffer();
+ WSDLPartsToXSDTypeMapper mapper = new WSDLPartsToXSDTypeMapper();
+ mapper.addSchemas(schemaList_);
+ buf.append(startProcessingPartXML(wsdlDefinition, part, header.getMessage().getNamespaceURI()));
+ return buf.toString();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static XSDSchema getSchemaForNamespace ( String namespaceURI ) {
+ Iterator<XSDSchema> iter = schemaList_.iterator();
+ while (iter.hasNext()) {
+ XSDSchema schema = (XSDSchema)iter.next();
+ if (schema != null && schema.getTargetNamespace() != null && schema.getTargetNamespace().equals(namespaceURI)) {
+ return schema;
+ }
+ }
+ return null;
+ }
+
+ private static String getURIForNamespacePrefix ( String nsPrefix ) {
+ Iterator<XSDSchema> iter = schemaList_.iterator();
+ while (iter.hasNext()) {
+ XSDSchema schema = (XSDSchema)iter.next();
+ String nsURI =
+ schema.getQNamePrefixToNamespaceMap().get(nsPrefix);
+ if (nsURI != null) {
+ return nsURI;
+ }
+ }
+ return null;
+ }
+
+ private final static void gatherSchemas(Definition definition, String definitionURL)
+ {
+ schemaList_ = new Vector<XSDSchema>();
+ Types types = definition.getTypes();
+ if (types != null)
+ {
+ List<?> extTypes = types.getExtensibilityElements();
+ if (extTypes != null)
+ {
+ // org.eclipse.emf.common.util.URI uri = org.eclipse.emf.common.util.URI.createURI(definitionURL);
+ // Resource resource = resourceSet.createResource(uri);
+ for (int i=0;i<extTypes.size();i++)
+ {
+ XSDSchema xsdSchema = null;
+ Object obj = extTypes.get(i);
+ if (obj instanceof Schema) {
+ Schema schemaElement = (Schema) obj;
+ if (isW3SchemaElementType(schemaElement.getElementType()))
+ {
+ xsdSchema = XSDSchemaImpl.createSchema(schemaElement.getElement());
+ if(!checkSchemaURI(definitionURL)){
+ schemaList_.addElement(xsdSchema);
+ gatherSchemaDirective(xsdSchema, definitionURL);
+ }
+ xsdSchema.update();
+ xsdSchema.updateElement();
+ //Add the Schema to the resource
+ // boolean success = resource.getContents().add(xsdSchema);
+ // System.out.println(success + "Added schema " + xsdSchema.getTargetNamespace() + " to wsdl resource " + uri.toString());
+ }
+ }
+ else if (obj instanceof UnknownExtensibilityElement)
+ {
+ UnknownExtensibilityElement schemaElement = (UnknownExtensibilityElement)obj;
+ if (isW3SchemaElementType(schemaElement.getElementType()))
+ {
+ xsdSchema = XSDSchemaImpl.createSchema(schemaElement.getElement());
+ if(!checkSchemaURI(definitionURL)){
+ schemaList_.addElement(xsdSchema);
+ gatherSchemaDirective(xsdSchema, definitionURL);
+ }
+ //Add the Schema to the resource
+ // boolean success = resource.getContents().add(xsdSchema);
+ // System.out.println(success + "Added schema " + xsdSchema.getTargetNamespace() + " to wsdl resource " + uri.toString());
+ }
+ }
+ }
+ }
+ }
+ Map<?, ?> imports = definition.getImports();
+ if (imports != null)
+ gatherImportedSchemas(definition,imports);
+ }
+
+ private final static boolean isW3SchemaElementType(QName qname)
+ {
+ for (int i=0;i<w3SchemaQNameList_.size();i++)
+ {
+ QName w3SchemaQName = (QName)w3SchemaQNameList_.elementAt(i);
+ if (w3SchemaQName.equals(qname))
+ return true;
+ }
+ return false;
+ }
+
+ private static boolean checkSchemaURI(String schemaURI){
+ boolean found = false;
+
+ if (schemaURI != null) {
+ schemaURI = normalize(schemaURI);
+ if(schemaURI.equals(normalize(wsdlUrl_)))return false;
+ Enumeration<String> e = schemaURI_.elements();
+ while(e.hasMoreElements()){
+ String uri = (String)e.nextElement();
+ if(schemaURI.equals(uri)){
+ found = true;
+ break;
+ }
+ }
+
+ if (!found){
+ schemaURI_.addElement(schemaURI);
+ }
+ }
+ return found;
+
+ }
+
+ private static String normalize(String uri )
+ {
+ try {
+ String encodedURI = URIEncoder.encode(uri,"UTF-8"); //$NON-NLS-1$
+ URI normalizedURI = new URI(encodedURI);
+ normalizedURI = normalizedURI.normalize();
+ return normalizedURI.toString();
+ } catch (URISyntaxException e) {
+ return uri;
+ } catch (UnsupportedEncodingException e) {
+ return uri;
+ }
+ }
+
+ private final static void gatherSchemaDirective(XSDSchema xsdSchema, String xsdSchemaURL)
+ {
+ if (xsdSchema != null)
+ {
+ EList<XSDSchemaContent> xsdSchemaContents = xsdSchema.getContents();
+ for (Iterator<XSDSchemaContent> it = xsdSchemaContents.iterator(); it.hasNext();)
+ {
+ Object content = it.next();
+ if (content instanceof XSDSchemaDirective)
+ {
+ XSDSchemaDirective xsdSchemaDirective = (XSDSchemaDirective)content;
+ StringBuffer xsdSchemaDirectiveURL = new StringBuffer();
+ String xsdSchemaDirectiveLocation = xsdSchemaDirective.getSchemaLocation();
+ if (xsdSchemaDirectiveLocation != null && xsdSchemaDirectiveLocation.indexOf(':') == -1 && xsdSchemaURL != null && xsdSchemaURL.indexOf(':') != -1)
+ {
+ // relative URL
+ int index = xsdSchemaURL.lastIndexOf('/');
+ if (index != -1)
+ xsdSchemaDirectiveURL.append(xsdSchemaURL.substring(0, index+1));
+ else
+ {
+ xsdSchemaDirectiveURL.append(xsdSchemaURL);
+ xsdSchemaDirectiveURL.append('/');
+ }
+ }
+ xsdSchemaDirectiveURL.append(xsdSchemaDirectiveLocation);
+
+ //encode the URL so that Schemas with non-ASCII filenames can be resolved
+ String xsdSchemaDirectiveURLString = URLUtils.encodeURLString(xsdSchemaDirectiveURL.toString());
+ // resolve schema directive
+ XSDSchema resolvedSchema = xsdSchemaDirective.getResolvedSchema();
+ if (resolvedSchema == null && xsdSchemaDirectiveURLString.length() > 0)
+ resolvedSchema = getSchema(xsdSchemaDirectiveURLString);
+ if (resolvedSchema != null)
+ {
+ if(!checkSchemaURI(xsdSchemaDirectiveURLString)){
+ schemaList_.addElement(resolvedSchema);
+ gatherSchemaDirective(resolvedSchema, xsdSchemaDirectiveURLString);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private final static XSDSchema getSchema(String locURI)
+ {
+ locURI = URLUtils.encodeURLString(locURI);
+ XSDSchema xsdSchema = XSDSchemaImpl.getSchemaForSchema(locURI);
+ if (xsdSchema == null)
+ {
+ @SuppressWarnings("deprecation")
+ XSDParser p = new XSDParser();
+ InputStream is = NetUtils.getURLInputStream(locURI);
+ if (is != null)
+ {
+ p.parse(is);
+ xsdSchema = p.getSchema();
+ }
+ }
+ return xsdSchema;
+ }
+
+ private final static void gatherImportedSchemas(Definition definition,Map<?, ?> imports)
+ {
+ for (Iterator<?> iterator = imports.keySet().iterator();iterator.hasNext();)
+ {
+ List<?> importList = (List<?>)imports.get(iterator.next());
+ for (int i=0;i<importList.size();i++)
+ {
+ Import imp = (Import)importList.get(i);
+ StringBuffer locURI = new StringBuffer(imp.getLocationURI());
+ if (!Validator.validateURL(locURI.toString()))
+ {
+ String base = definition.getDocumentBaseURI();
+ locURI.insert(0,base.substring(0,base.lastIndexOf('/')+1));
+ }
+ try
+ {
+ URL tryURL = new URL ( locURI.toString());
+ Definition importDef = readWSDLURL( tryURL );
+ gatherSchemas(importDef, locURI.toString());
+ }
+ catch (WSDLException e)
+ {
+ // May be an XSD file.
+ gatherSchema(locURI.toString());
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private final static void gatherSchema(String locURI)
+ {
+ XSDSchema xsdSchema = getSchema(locURI);
+ if (xsdSchema != null)
+ {
+ schemaList_.addElement(xsdSchema);
+ gatherSchemaDirective(xsdSchema, locURI);
+ }
+ }
+
+ private static XSDSchema findFirstSchemaWithPartNameAsChild ( String partName ) {
+ for (Iterator<XSDSchema> schemaIter = schemaList_.iterator(); schemaIter.hasNext(); ) {
+ XSDSchema schema = schemaIter.next();
+ DOMBuilder domBuilder = new DOMBuilder();
+ org.jdom.Element jdomSchemaElement = domBuilder.build(schema.getElement());
+ List<?> kids = jdomSchemaElement.getChildren();
+ for (Iterator<?> kidIter = kids.iterator(); kidIter.hasNext(); ) {
+ Object kid = kidIter.next();
+ if (kid instanceof org.jdom.Element) {
+ org.jdom.Element kidElement = (org.jdom.Element) kid;
+ if (kidElement.getAttribute("name") != null) { //$NON-NLS-1$
+ if (kidElement.getAttributeValue("name").equals(partName)) { //$NON-NLS-1$
+ return schema;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static org.jdom.Element findFirstElementWithPartNameInSchema( XSDSchema schema, String partName ) {
+ DOMBuilder domBuilder = new DOMBuilder();
+ org.jdom.Element jdomSchemaElement = domBuilder.build(schema.getElement());
+ List<?> kids = jdomSchemaElement.getChildren();
+ for (Iterator<?> kidIter = kids.iterator(); kidIter.hasNext(); ) {
+ Object kid = kidIter.next();
+ if (kid instanceof org.jdom.Element) {
+ org.jdom.Element kidElement = (org.jdom.Element) kid;
+ if (kidElement.getAttribute("name") != null) { //$NON-NLS-1$
+ if (kidElement.getAttributeValue("name").equals(partName)) { //$NON-NLS-1$
+ return kidElement;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static String startProcessingPartXML ( Definition wsdlDefinition, String partName, String partUri ) {
+
+ XSDSchema schema = findFirstSchemaWithPartNameAsChild(partName);
+ DOMBuilder domBuilder = new DOMBuilder();
+ org.jdom.Element jdomSchemaElement = domBuilder.build(schema.getElement());
+
+ org.jdom.Element jdomElement = findFirstElementWithPartNameInSchema(schema, partName);
+
+ String typeAttr = jdomElement.getAttributeValue("type"); //$NON-NLS-1$
+ String nsprefix = null;
+ String nstypename = typeAttr;
+ if (typeAttr.indexOf(':') > 0) {
+ nsprefix = typeAttr.substring(0, typeAttr.indexOf(':'));
+ nstypename = typeAttr.substring(typeAttr.indexOf(':') + 1, typeAttr.length());
+ }
+
+ String uri = schema.getTargetNamespace();
+ if (nsprefix != null && !nsprefix.equalsIgnoreCase("tns")) { //$NON-NLS-1$
+ uri = getNSURI(nsprefix, wsdlDefinition);
+ }
+
+ StringBuffer buf = new StringBuffer();
+
+ if (nsprefix != null && !nsprefix.equalsIgnoreCase("tns")) { //$NON-NLS-1$
+ if (schema.getTargetNamespace().equals(uri)) {
+ // cool, we're good
+ buf.append(createXMLForJDOMElement2( jdomSchemaElement, jdomElement ));
+ } else {
+ XSDSchema importXSD = getSchemaForNamespace(uri);
+ if (importXSD != null) {
+ importXSD.updateElement(true);
+ org.jdom.Element jdomSchemaElement2 = domBuilder.build(importXSD.getElement());
+ Element child =
+ jdomSchemaElement2.getChild(nstypename);
+ buf.append(createXMLForJDOMElement2( jdomSchemaElement2, child ));
+ }
+ }
+ } else {
+ buf.append(createXMLForJDOMElement2( jdomSchemaElement, jdomElement ));
+ }
+
+ return buf.toString();
+ }
+
+ private static String startProcessingPartXML ( Definition wsdlDefinition, Part part ) {
+ DOMBuilder domBuilder = new DOMBuilder();
+ WSDLPartsToXSDTypeMapper mapper = new WSDLPartsToXSDTypeMapper();
+ mapper.addSchemas(schemaList_);
+ XSDNamedComponent xsdComponent = mapper.getXSDTypeFromSchema(part);
+ xsdComponent.updateElement(true);
+
+ XSDSchema schema = xsdComponent.getSchema();
+ schema.updateElement(true);
+
+ if (!schema.getTargetNamespace().equals(FragmentConstants.NS_URI_CURRENT_SCHEMA_XSD)) {
+ rootIsQualified_ = true;
+ rootURI_ = schema.getTargetNamespace();
+ }
+
+ org.jdom.Element jdomSchemaElement = domBuilder.build(schema.getElement());
+ org.jdom.Element jdomElement = domBuilder.build(xsdComponent.getElement());
+
+ String typeAttr = xsdComponent.getElement().getAttribute("type"); //$NON-NLS-1$
+ String nsprefix = null;
+ String nstypename = typeAttr;
+ if (typeAttr.indexOf(':') > 0) {
+ nsprefix = typeAttr.substring(0, typeAttr.indexOf(':'));
+ nstypename = typeAttr.substring(typeAttr.indexOf(':') + 1, typeAttr.length());
+ }
+
+ String uri = schema.getTargetNamespace();
+ if (nsprefix != null && !nsprefix.equalsIgnoreCase("tns")) { //$NON-NLS-1$
+ uri = getNSURI(nsprefix, wsdlDefinition);
+ }
+
+ StringBuffer buf = new StringBuffer();
+
+ if (nsprefix != null && !nsprefix.equalsIgnoreCase("tns")) { //$NON-NLS-1$
+ if (schema.getTargetNamespace().equals(uri)) {
+ // cool, we're good
+ org.jdom.Element jdomSchemaElement2 = domBuilder.build(xsdComponent.getElement());
+ buf.append(createXMLForJDOMElement2( jdomSchemaElement, jdomSchemaElement2 ));
+ } else {
+ XSDSchema importXSD = getSchemaForNamespace(uri);
+ if (importXSD != null) {
+ importXSD.updateElement(true);
+ org.jdom.Element jdomSchemaElement2 = domBuilder.build(importXSD.getElement());
+ Element child =
+ jdomSchemaElement2.getChild(nstypename);
+ buf.append(createXMLForJDOMElement2( jdomSchemaElement2, child ));
+ }
+ }
+ } else {
+ buf.append(createXMLForJDOMElement2( jdomSchemaElement, jdomElement ));
+ }
+
+ return buf.toString();
+ }
+
+ private static org.jdom.Element findJDOMTypeInSchema ( org.jdom.Element schemaElement, String typeName ) {
+ if (schemaElement != null) {
+ String nstypename = null;
+ if (typeName.indexOf(':') > -1) {
+ nstypename = typeName.substring(typeName.indexOf(':') + 1, typeName.length());
+ } else {
+ nstypename = typeName;
+ }
+ List<?> kids = schemaElement.getChildren();
+ for (Iterator<?> kidsIter = kids.iterator(); kidsIter.hasNext(); ) {
+ Object kid = kidsIter.next();
+ if (kid instanceof org.jdom.Element) {
+ org.jdom.Element kidelement = (org.jdom.Element)kid;
+ if (kidelement.getName().equals("complexType")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(nstypename)) //$NON-NLS-1$
+ return kidelement;
+ }
+ if (kidelement.getName().equals("attribute")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(nstypename)) //$NON-NLS-1$
+ return kidelement;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static org.jdom.Element findJDOMTypeInSchemaByNameAttr ( org.jdom.Element schemaElement, String name ) {
+ if (schemaElement != null) {
+ List<?> kids = schemaElement.getChildren();
+ for (Iterator<?> kidsIter = kids.iterator(); kidsIter.hasNext(); ) {
+ Object kid = kidsIter.next();
+ if (kid instanceof org.jdom.Element) {
+ org.jdom.Element kidelement = (org.jdom.Element)kid;
+ if (kidelement.getName().equals("complexType")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(name)) //$NON-NLS-1$
+ return kidelement;
+ }
+ if (kidelement.getName().equals("attribute")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(name)) //$NON-NLS-1$
+ return kidelement;
+ }
+ if (kidelement.getName().equals("element")) { //$NON-NLS-1$
+ if (kidelement.getAttributeValue("name").equals(name)) //$NON-NLS-1$
+ return kidelement;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static org.jdom.Element findJDOMElementInSchema ( org.jdom.Element schemaElement, String typeName ) {
+ if (schemaElement != null) {
+ List<?> kids = schemaElement.getChildren();
+ for (Iterator<?> kidsIter = kids.iterator(); kidsIter.hasNext(); ) {
+ Object kid = kidsIter.next();
+ if (kid instanceof org.jdom.Element) {
+ org.jdom.Element kidelement = (org.jdom.Element)kid;
+ if (kidelement.getName().equals("element")) { //$NON-NLS-1$
+ String attrvalue = kidelement.getAttributeValue("type"); //$NON-NLS-1$
+ if (attrvalue != null && attrvalue.equals(typeName)) {
+ kidelement = findJDOMTypeInSchema(schemaElement, typeName);
+ return kidelement;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static org.jdom.Element findJDOMElementInSchemaByName ( org.jdom.Element schemaElement, String typeName ) {
+ if (schemaElement != null) {
+ List<?> kids = schemaElement.getChildren();
+ for (Iterator<?> kidsIter = kids.iterator(); kidsIter.hasNext(); ) {
+ Object kid = kidsIter.next();
+ if (kid instanceof org.jdom.Element) {
+ org.jdom.Element kidelement = (org.jdom.Element)kid;
+ if (kidelement.getName().equals("element")) { //$NON-NLS-1$
+ String attrvalue = kidelement.getAttributeValue("name"); //$NON-NLS-1$
+ if (attrvalue != null && attrvalue.equals(typeName)) {
+ String elemType = kidelement.getAttributeValue("type"); //$NON-NLS-1$
+ if (elemType != null) {
+ String nsprefix = elemType.substring(0, elemType.indexOf(':'));
+ String testUri = getURIForNamespacePrefix(nsprefix);
+ XSDSchema importXSD = getSchemaForNamespace(testUri);
+ if (importXSD != null) {
+ DOMBuilder domBuilder = new DOMBuilder();
+ importXSD.updateElement(true);
+ org.jdom.Element importXSDSchema = domBuilder.build(importXSD.getElement());
+ org.jdom.Element element2 = findJDOMTypeInSchema(importXSDSchema, elemType);
+ if (element2 != null) {
+ return element2;
+ } else {
+ element2 = findJDOMElementInSchema(importXSDSchema, elemType);
+ if (element2 != null) {
+ return element2;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static String handleAttributes ( org.jdom.Element element ) {
+ StringBuffer buf = new StringBuffer();
+ List<?> kids = element.getChildren();
+ boolean isQualified = false;
+ for (Iterator<?> kidIter = kids.iterator(); kidIter.hasNext(); ) {
+ Element kid = (Element) kidIter.next();
+ if (kid.getName().equals("attribute") ) {//$NON-NLS-1$
+// <xs:attribute ref="ns3:C" use="required" />
+ if (kid.getAttribute("ref") != null) {//$NON-NLS-1$
+ String elemType = kid.getAttributeValue("ref");//$NON-NLS-1$
+ String nsprefix = elemType.substring(0, elemType.indexOf(':'));
+ String typename = elemType.substring(elemType.indexOf(':') + 1, elemType.length());
+ if (elemType.indexOf(':') > -1) {
+ if (!(elemType.startsWith("xs:") || elemType.startsWith("xsd:"))) //$NON-NLS-1$ //$NON-NLS-2$
+ isQualified = true;
+ }
+
+ String testUri = getURIForNamespacePrefix(nsprefix);
+ XSDSchema importXSD = getSchemaForNamespace(testUri);
+ if (importXSD != null) {
+ DOMBuilder domBuilder = new DOMBuilder();
+ importXSD.updateElement(true);
+ org.jdom.Element importXSDSchema = domBuilder.build(importXSD.getElement());
+ org.jdom.Element element2 = findJDOMTypeInSchema(importXSDSchema, typename);
+ if (element2 != null) {
+ element = element2;
+ } else {
+ element2 = findJDOMElementInSchema(importXSDSchema, typename);
+ if (element2 != null) {
+ element = element2;
+ }
+ }
+ if (element != null) {
+ if (isQualified) {
+ String prefix = makePrefixFromURI(testUri);
+ // xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
+ if (!namespacesAndPrefixes_.containsKey(prefix)) {
+ buf.append(" xmlns:" + prefix + "=\"" + testUri + "\""); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ namespacesAndPrefixes_.put(prefix, testUri);
+ }
+ buf.append(' ' + prefix + ':');
+ }
+ String name = element.getAttributeValue("name"); //$NON-NLS-1$
+ buf.append(name + "=\"?\" "); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+ return buf.toString();
+ }
+
+ private static boolean namespacePrefixListContainsURI ( String uri ) {
+ if (namespacesAndPrefixes_ != null) {
+ if (namespacesAndPrefixes_.containsValue(uri)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static String makePrefixFromURI ( String uri ) {
+
+ if (namespacePrefixListContainsURI(uri)) {
+ Iterator<Entry<String, String>> iter = namespacesAndPrefixes_.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry<String, String> entry = iter.next();
+ if (entry.getValue().equals(uri)) {
+ return entry.getKey();
+ }
+ }
+ }
+
+ String tnsprefix = uri.substring(uri.indexOf("://") + 3, uri.length()); //$NON-NLS-1$
+ if (tnsprefix.length() > 4) {
+ if (tnsprefix.endsWith("/")) { //$NON-NLS-1$
+ tnsprefix = tnsprefix.substring(0, tnsprefix.length() - 1);
+ }
+ if (tnsprefix.lastIndexOf('/') > -1) {
+ tnsprefix = tnsprefix.substring(tnsprefix.lastIndexOf('/') + 1, tnsprefix.length());
+ }
+ if (tnsprefix.length() > 4) {
+ tnsprefix = tnsprefix.substring(0, 4);
+ }
+ tnsprefix = tnsprefix.toLowerCase();
+
+ if (namespacesAndPrefixes_.containsKey(tnsprefix)) {
+ int i = 1;
+ String test = tnsprefix + i;
+ while (namespacesAndPrefixes_.containsKey(test)) {
+ i++;
+ test = tnsprefix + i;
+ }
+ tnsprefix = test;
+ }
+ }
+ return tnsprefix;
+ }
+
+ private static boolean elementHasChildren ( org.jdom.Element element ) {
+ boolean rtnflag = false;
+ if (element.getChildren() != null && element.getChildren().size() > 0) {
+ List<?> kids = element.getChildren();
+ for (Iterator<?> kidIter = kids.iterator(); kidIter.hasNext(); ) {
+ Element kid = (Element) kidIter.next();
+ if (kid.getName().equals("element")) { //$NON-NLS-1$
+ rtnflag = true;
+ }
+ boolean kidflag = elementHasChildren(kid);
+ if (kidflag)
+ rtnflag = true;
+ }
+ }
+ return rtnflag;
+ }
+
+ private static String createXMLForJDOMElement2 ( org.jdom.Element schemaElement, org.jdom.Element element ) {
+ StringBuffer buf = new StringBuffer();
+ String nstypename = null;
+
+ String tns = null;
+ String tnsprefix = null;
+ if (schemaElement.getNamespace("tns") != null) {//$NON-NLS-1$
+ tns = schemaElement.getNamespace("tns").getURI();//$NON-NLS-1$
+ tnsprefix = makePrefixFromURI(tns);
+ }
+
+ boolean isQualified = false;
+
+ if (element.getAttribute("name") != null) {//$NON-NLS-1$
+ nstypename = element.getAttributeValue("name");//$NON-NLS-1$
+ }
+ if (element.getAttribute("type") != null) {//$NON-NLS-1$
+ String type2FindName = element.getAttributeValue("type");//$NON-NLS-1$
+ if (type2FindName.indexOf(':') > -1) {
+ if (!(type2FindName.startsWith("xs:") || type2FindName.startsWith("xsd:"))) //$NON-NLS-1$ //$NON-NLS-2$
+ isQualified = true;
+ }
+ org.jdom.Element element2 = findJDOMTypeInSchema(schemaElement, type2FindName);
+ if (element2 != null) {
+ element = element2;
+ if (element.getParentElement() != null) {
+ org.jdom.Element parent = element.getParentElement();
+ if (parent.getNamespace("tns") != null) {//$NON-NLS-1$
+ tns = parent.getNamespace("tns").getURI();//$NON-NLS-1$
+ tnsprefix = makePrefixFromURI(tns);
+ }
+ }
+ }
+ }
+ if (element.getAttribute("ref") != null) {//$NON-NLS-1$
+ String ref2FindName = element.getAttributeValue("ref");//$NON-NLS-1$
+ if (ref2FindName.indexOf(':') > -1) {
+ if (!(ref2FindName.startsWith("xs:") || ref2FindName.startsWith("xsd:"))) //$NON-NLS-1$ //$NON-NLS-2$
+ isQualified = true;
+ }
+ org.jdom.Element element2 = findJDOMTypeInSchema(schemaElement, ref2FindName);
+ if (element2 != null) {
+ element = element2;
+ if (element.getParentElement() != null) {
+ org.jdom.Element parent = element.getParentElement();
+ if (parent.getNamespace("tns") != null) {//$NON-NLS-1$
+ tns = parent.getNamespace("tns").getURI();//$NON-NLS-1$
+ tnsprefix = makePrefixFromURI(tns);
+ }
+ }
+ } else {
+ element2 = findJDOMElementInSchema(schemaElement, ref2FindName);
+ if (element2 != null) {
+ element = element2;
+ if (element.getParentElement() != null) {
+ org.jdom.Element parent = element.getParentElement();
+ if (parent.getNamespace("tns") != null) {//$NON-NLS-1$
+ tns = parent.getNamespace("tns").getURI();//$NON-NLS-1$
+ tnsprefix = makePrefixFromURI(tns);
+ }
+ }
+ }
+ }
+ }
+ Integer minOccurs = 1;
+ String elemType = null;
+
+ if (element.getAttributes().size() > 0) {
+ if (element.getAttribute("minOccurs") != null) {//$NON-NLS-1$
+ String value = element.getAttributeValue("minOccurs");//$NON-NLS-1$
+ minOccurs = Integer.decode(value);
+ }
+ if (element.getAttribute("type") != null) {//$NON-NLS-1$
+ elemType = element.getAttributeValue("type");//$NON-NLS-1$
+ String nsprefix = elemType.substring(0, elemType.indexOf(':'));
+ String testUri = getURIfromSchemaPrefix(element, nsprefix);
+ if (elemType.indexOf(':') > -1) {
+ if (!(elemType.startsWith("xs:") || elemType.startsWith("xsd:"))){ //$NON-NLS-1$ //$NON-NLS-2$
+ isQualified = true;
+ }
+ }
+ XSDSchema importXSD = getSchemaForNamespace(testUri);
+ if (importXSD != null) {
+ DOMBuilder domBuilder = new DOMBuilder();
+ importXSD.updateElement(true);
+ org.jdom.Element importXSDSchema = domBuilder.build(importXSD.getElement());
+ org.jdom.Element element2 = findJDOMTypeInSchema(importXSDSchema, elemType);
+ if (element2 != null) {
+ element = element2;
+ } else {
+ element2 = findJDOMElementInSchema(importXSDSchema, elemType);
+ if (element2 != null) {
+ element = element2;
+ }
+ }
+ }
+ }
+ if (element.getAttribute("ref") != null) {//$NON-NLS-1$
+ elemType = element.getAttributeValue("ref");//$NON-NLS-1$
+ String nsprefix = elemType.substring(0, elemType.indexOf(':'));
+ String typename = elemType.substring(elemType.indexOf(':') + 1, elemType.length());
+ nstypename = typename;
+
+ String testUri = getURIfromSchemaPrefix(element, nsprefix);
+ if (elemType.indexOf(':') > -1) {
+ if (!elemType.startsWith("xs:")) { //$NON-NLS-1$
+ isQualified = true;
+ tns = testUri;
+ tnsprefix = makePrefixFromURI(tns);
+ }
+ }
+ XSDSchema importXSD = getSchemaForNamespace(testUri);
+ if (importXSD != null) {
+ DOMBuilder domBuilder = new DOMBuilder();
+ importXSD.updateElement(true);
+ org.jdom.Element importXSDSchema = domBuilder.build(importXSD.getElement());
+ org.jdom.Element element2 = findJDOMTypeInSchema(importXSDSchema, elemType);
+ if (element2 != null) {
+ element = element2;
+ } else {
+ element2 = findJDOMElementInSchema(importXSDSchema, elemType);
+ if (element2 != null) {
+ element = element2;
+ } else {
+ element2 = findJDOMElementInSchemaByName(importXSDSchema, nstypename);
+ if (element2 != null) {
+ element = element2;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ boolean hasKids = false;
+ if (elementHasChildren(element)) {
+ hasKids = true;
+ }
+
+ boolean isSimpleType = false;
+ if (elemType != null && isTypeBaseXSDOrSimple(tns, elemType)) {
+ isSimpleType = true;
+ }
+
+ boolean includeTNSInRoot = false;
+ if (rootIsQualified_ && !isQualified) {
+ includeTNSInRoot = true;
+ isQualified = true;
+ tnsprefix = "tns"; //$NON-NLS-1$
+ } else if (isQualified) {
+ rootIsQualified_ = false;
+ }
+
+ boolean isSequence = element.getName().equals("sequence"); //$NON-NLS-1$
+ if (!isSequence) {
+ // open tag
+ if (minOccurs.intValue() == 0) {
+ buf.append("<!-- optional -->\n");//$NON-NLS-1$
+ }
+ buf.append('<');
+ if (isQualified) {
+ buf.append(tnsprefix + ':');
+ }
+
+ buf.append(nstypename);
+ String attributes = handleAttributes(element);
+ if (attributes != null && attributes.trim().length() > 0) {
+ buf.append(' ');
+ buf.append(attributes);
+ }
+
+ if (isQualified) {
+ // xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
+ if (includeTNSInRoot && !namespacePrefixListContainsURI(rootURI_)) {
+ buf.append(" xmlns:tns=\"" + rootURI_ + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ namespacesAndPrefixes_.put(tnsprefix, rootURI_);
+ }
+ else if (!namespacesAndPrefixes_.containsKey(tnsprefix)) {
+ buf.append(" xmlns:" + tnsprefix + "=\"" + tns + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ namespacesAndPrefixes_.put(tnsprefix, tns);
+ }
+ }
+
+
+ if (hasKids || isSimpleType)
+ buf.append(">"); //$NON-NLS-1$
+ else
+ buf.append("/>");//$NON-NLS-1$
+ }
+
+ if (hasKids) {
+ if (!isSequence) {
+ buf.append('\n');
+ }
+ List<?> kids = element.getChildren();
+ for (Iterator<?> kidIter = kids.iterator(); kidIter.hasNext(); ) {
+ Element kid = (Element) kidIter.next();
+ if (kid.getName().equals("complexType") || kid.getName().equals("sequence")) {//$NON-NLS-1$//$NON-NLS-2$
+ List<?> innerkids = kid.getChildren();
+ for (Iterator<?> kidIter2 = innerkids.iterator(); kidIter2.hasNext(); ) {
+ Element innerkid = (Element) kidIter2.next();
+ String out = createXMLForJDOMElement2 ( schemaElement, innerkid );
+ buf.append(out);
+ }
+ } else if (kid.getName().equals("element")) {//$NON-NLS-1$
+ String out = createXMLForJDOMElement2 (schemaElement, kid);
+ buf.append(out);
+ }
+ }
+ }
+
+ if (!isSequence && ( hasKids || isSimpleType )) {
+ // add ? for value
+ if (!hasKids || isSimpleType)
+ buf.append('?');
+
+ // close tag
+ buf.append("</");//$NON-NLS-1$
+
+ if (isQualified) {
+ buf.append(tnsprefix + ':');
+ }
+ buf.append(nstypename);
+ buf.append(">\n"); //$NON-NLS-1$
+ }
+
+ return buf.toString();
+ }
+
+ private static HashMap<String, String> getDefinitionNamespaces ( Definition wsdlDefinition) {
+ HashMap<String, String> namespaceMap = new HashMap<String, String>();
+ namespaceMap.put(SOAP_NS_URI, SOAP_PREFIX);
+ namespaceMap.put(SOAP12_ENVELOPE_NS_URI, SOAP12_PREFIX);
+ namespaceMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi"); //$NON-NLS-1$//$NON-NLS-2$
+ namespaceMap.put("http://www.w3.org/2001/XMLSchema", "xsd"); //$NON-NLS-1$//$NON-NLS-2$
+
+ Map<?,?> namespaces = wsdlDefinition.getNamespaces();
+ Set<?> namespaceKeys = namespaces.keySet();
+ int i = 1;
+ for ( Iterator<?> it = namespaceKeys.iterator(); it.hasNext(); ) {
+ String prefix = (String) it.next();
+ String url = wsdlDefinition.getNamespace(prefix);
+ if (!namespaceMap.containsKey(url)) {
+ String newprefix = "ns" + i++; //$NON-NLS-1$
+ namespaceMap.put(url, newprefix);
+ }
+ }
+ return namespaceMap;
+ }
+
+ private static String getNSURI ( String inPrefix, Definition wsdlDefinition) {
+ HashMap<String, String> map = getDefinitionNamespaces(wsdlDefinition);
+ if (map.containsValue(inPrefix)) {
+ for (Iterator<Entry<String, String>> mapIter = map.entrySet().iterator(); mapIter.hasNext(); ) {
+ Map.Entry<String, String> test = (Entry<String, String>) mapIter.next();
+ if (test.getValue().equals(inPrefix))
+ return test.getKey();
+ }
+ }
+ return null;
+ }
+
+
+
+ private static String getURIfromSchemaPrefix(Element el, String prefix) {
+ Element e = el;
+ while (e.getParentElement() != null) {
+ e = e.getParentElement();
+ }
+ if (e.getNamespace(prefix) != null) {
+ return e.getNamespace(prefix).getURI();
+ }
+ return null;
+ }
+
+ private static boolean isTypeBaseXSDOrSimple ( String uri, String type ) {
+
+ if (uri != null) {
+ XSDSchema schema = getSchemaForNamespace(uri);
+ DOMBuilder domBuilder = new DOMBuilder();
+ schema.updateElement(true);
+ org.jdom.Element importXSDSchema = domBuilder.build(schema.getElement());
+ if (type.indexOf(':') > -1) {
+ String typename = type.substring(type.indexOf(':') + 1, type.length());
+ org.jdom.Element element = findJDOMTypeInSchemaByNameAttr(importXSDSchema, typename);
+ if (element != null) {
+ if (element.getAttribute("type") != null) { //$NON-NLS-1$
+ type = element.getAttributeValue("type"); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ // typically the type starts with a namespace prefix, so
+ // we want to compare the end of the string with the actual
+ // type name
+ if (type.endsWith(STRING_TYPE_NAME) ||
+ type.endsWith(BOOLEAN_TYPE_NAME) ||
+ type.endsWith(DECIMAL_TYPE_NAME) ||
+ type.endsWith(INT_TYPE_NAME) ||
+ type.endsWith(DOUBLE_TYPE_NAME) ||
+ type.endsWith(FLOAT_TYPE_NAME) ||
+ type.endsWith(DURATION_TYPE_NAME) ||
+ type.endsWith(DATE_TYPE_NAME) ||
+ type.endsWith(TIME_TYPE_NAME) ||
+ type.endsWith(DATETIME_TYPE_NAME) ||
+ type.endsWith(ANYURI_TYPE_NAME) ||
+ type.endsWith(BASE64BINARY_TYPE_NAME) ||
+ type.endsWith(GDAY_TYPE_NAME) ||
+ type.endsWith(GMONTH_TYPE_NAME) ||
+ type.endsWith(GMONTHDAY_TYPE_NAME) ||
+ type.endsWith(GYEAR_TYPE_NAME) ||
+ type.endsWith(GYEARMONTH_TYPE_NAME) ||
+ type.endsWith(HEXBINARY_TYPE_NAME) ||
+ type.endsWith(NOTATION_TYPE_NAME) ||
+ type.endsWith(PRECISION_DECIMAL_TYPE_NAME)
+ ) {
+ return true;
+ } else if (type.contains(SIMPLE_TYPE_NAME)) {
+ return true;
+ }
+ return false;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -15,29 +15,21 @@
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.Vector;
import javax.wsdl.Binding;
import javax.wsdl.BindingOperation;
import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Message;
import javax.wsdl.Operation;
-import javax.wsdl.Part;
import javax.wsdl.Port;
import javax.wsdl.PortType;
import javax.wsdl.Service;
-import javax.wsdl.Types;
import javax.wsdl.WSDLException;
import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.schema.SchemaImport;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.extensions.soap12.SOAP12Address;
@@ -46,51 +38,19 @@
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
-//import org.jdom.Attribute;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-import org.jdom.Namespace;
-import org.jdom.input.DOMBuilder;
import com.ibm.wsdl.Constants;
/**
+ * Cleaned up and separated WSDL from Schema utilities
* @author bfitzpat
*
*/
public class TesterWSDLUtils {
- private static final String IMPORT_TAG = "import"; //$NON-NLS-1$
- private static final String VALUE_ATTR = "value"; //$NON-NLS-1$
- private static final String SEQUENCE_NAME = "sequence"; //$NON-NLS-1$
- private static final String COMPLEX_TYPE_NAME = "complexType"; //$NON-NLS-1$
- private static final String ENUMERATION_NAME = "enumeration"; //$NON-NLS-1$
- private static final String RESTRICTION_NAME = "restriction"; //$NON-NLS-1$
- private static final String SIMPLE_TYPE_NAME = "simpleType"; //$NON-NLS-1$
- private static final String DOUBLE_TYPE_NAME = "double"; //$NON-NLS-1$
- private static final String INT_TYPE_NAME = "int"; //$NON-NLS-1$
- private static final String STRING_TYPE_NAME = "string"; //$NON-NLS-1$
- private static final String BOOLEAN_TYPE_NAME = "boolean"; //$NON-NLS-1$
- private static final String DECIMAL_TYPE_NAME = "decimal"; //$NON-NLS-1$
- private static final String PRECISION_DECIMAL_TYPE_NAME = "precisionDecimal"; //$NON-NLS-1$
- private static final String FLOAT_TYPE_NAME = "float"; //$NON-NLS-1$
- private static final String DURATION_TYPE_NAME = "duration"; //$NON-NLS-1$
- private static final String DATETIME_TYPE_NAME = "dateTime"; //$NON-NLS-1$
- private static final String DATE_TYPE_NAME = "date"; //$NON-NLS-1$
- private static final String TIME_TYPE_NAME = "time"; //$NON-NLS-1$
- private static final String GYEARMONTH_TYPE_NAME = "gYearMonth"; //$NON-NLS-1$
- private static final String GYEAR_TYPE_NAME = "gYear"; //$NON-NLS-1$
- private static final String GMONTHDAY_TYPE_NAME = "gMonthDay"; //$NON-NLS-1$
- private static final String GDAY_TYPE_NAME = "gDay"; //$NON-NLS-1$
- private static final String GMONTH_TYPE_NAME = "gMonth"; //$NON-NLS-1$
- private static final String HEXBINARY_TYPE_NAME = "hexBinary"; //$NON-NLS-1$
- private static final String BASE64BINARY_TYPE_NAME = "base64Binary"; //$NON-NLS-1$
- private static final String ANYURI_TYPE_NAME = "anyURI"; //$NON-NLS-1$
- private static final String NOTATION_TYPE_NAME = "NOTATION"; //$NON-NLS-1$
- private static final String MIN_OCCURS_ATTR = "minOccurs"; //$NON-NLS-1$
- private static final String TYPE_ATTR = "type"; //$NON-NLS-1$
- private static final String NAME_ATTR = "name"; //$NON-NLS-1$
private final static String DEF_FACTORY_PROPERTY_NAME =
"javax.wsdl.factory.DefinitionFactory"; //$NON-NLS-1$
@@ -210,77 +170,6 @@
return false;
}
- public static String getSampleSOAPInputMessage ( Definition wsdlDefinition, String serviceName, String portName, String bindingName, String opName ) {
- Map<?, ?> services = wsdlDefinition.getServices();
- Set<?> serviceKeys = services.keySet();
- for( Iterator<?> it = serviceKeys.iterator(); it.hasNext(); ) {
- QName serviceKey = (QName) it.next();
- if (serviceName != null && serviceKey.getLocalPart().contentEquals(serviceName)) {
- Service service = (Service) services.get( serviceKey );
- Map<?, ?> ports = service.getPorts();
- Set<?> portKeys = ports.keySet();
- for( Iterator<?> it2 = portKeys.iterator(); it2.hasNext(); ) {
- String portKey = (String) it2.next();
- if (portName != null && portKey.contentEquals(portName)) {
- Port port = (Port) ports.get( portKey );
- Binding wsdlBinding = port.getBinding();
- PortType portType = wsdlBinding.getPortType();
- String ns = portType.getQName().getNamespaceURI();
- List<?> operations = portType.getOperations();
- for (Iterator<?> it3 = operations.iterator(); it3.hasNext();){
- Operation operation = (Operation) it3.next();
- if (opName != null && operation.getName().contentEquals(opName)) {
- Message inputMsg = operation.getInput().getMessage();
- Collection<?> parts = inputMsg.getParts().values();
- StringBuffer buf = new StringBuffer();
- if (parts.size() > 1) {
- buf.append('<' + operation.getName());
- buf.append(" xmlns = \"" + ns + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append(">\n"); //$NON-NLS-1$
- }
- for( Iterator<?> it4 = parts.iterator(); it4.hasNext(); ) {
- Part part = (Part) it4.next();
- String schemaName = null;
- if (part.getElementName() != null) {
- schemaName = part.getElementName().getLocalPart();
- } else {
- schemaName = part.getName();
- }
- if (parts.size() > 1) {
- if (part != null && part.getTypeName() != null && !part.getTypeName().getNamespaceURI().
- equalsIgnoreCase("http://www.w3.org/2001/XMLSchema")) { //$NON-NLS-1$
- buf.append(createMessageForSchemaElement(wsdlDefinition, part.getName(), part.getTypeName().getLocalPart(), ns));
- } else {
- buf.append('<' + part.getName());
- // buf.append(" xmlns = \"" + ns + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append(">?"); //$NON-NLS-1$
- buf.append("</" + part.getName() + ">\n");//$NON-NLS-1$//$NON-NLS-2$
- }
- } else {
- String partName = part.getName();
- if (parts.size() == 1) partName = null;
- String out = createMessageForSchemaElement(wsdlDefinition, partName, schemaName, ns);
- if (out == null) {
- StringBuffer tempBuffer = new StringBuffer();
- tempBuffer.append('<' + part.getName());
- // tempBuffer.append(" xmlns = \"" + ns + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- tempBuffer.append(">?"); //$NON-NLS-1$
- tempBuffer.append("</" + part.getName() + ">\n");//$NON-NLS-1$//$NON-NLS-2$
- out = tempBuffer.toString();
- }
- return out;
- }
- }
- return buf.toString();
- }
- }
- }
- }
- }
- }
- return null;
- }
-
public static String[] getNSServiceNameAndMessageNameArray (Definition wsdlDefinition, String serviceName, String portName, String bindingName, String opName ) {
Map<?, ?> services = wsdlDefinition.getServices();
Set<?> serviceKeys = services.keySet();
@@ -380,421 +269,6 @@
return null;
}
- private static org.jdom.Element getNamedSchemaElement (Definition wsdlDefinition, Types types, String elementName) {
- if (types != null &&types.getExtensibilityElements().size() > 0) {
- Schema schema = (Schema) types.getExtensibilityElements().get(0);
- DOMBuilder domBuilder = new DOMBuilder();
- org.jdom.Element jdomSchemaElement = domBuilder.build(schema.getElement());
- if (elementName.indexOf(":") > 0 ) { //$NON-NLS-1$
- elementName = elementName.substring(elementName.indexOf(":") + 1, elementName.length()); //$NON-NLS-1$
- }
- List<?> list = jdomSchemaElement.getChildren();
- if (list.size() > 0) {
- org.jdom.Element checkForImport = (org.jdom.Element) list.get(0);
- if (checkForImport.getName().equals(IMPORT_TAG)) {
- Map<?, ?> imports = schema.getImports();
- Iterator<?> importIter = imports.values().iterator();
- while (importIter.hasNext()) {
- Object obj = importIter.next();
- Vector<?> schemaImportVector = (Vector<?>) obj;
- Iterator<?> vectorIter = schemaImportVector.iterator();
- while (vectorIter.hasNext()) {
- SchemaImport schemaImport = (SchemaImport) vectorIter.next();
- org.jdom.Element jdomSchemaImportElement = domBuilder.build(schemaImport.getReferencedSchema().getElement());
- List<?> innerList = jdomSchemaImportElement.getChildren();
- for (int i = 0; i < innerList.size(); i++){
- org.jdom.Element temp = (org.jdom.Element) innerList.get(i);
- String rootName = null;
- if (temp.getAttribute(NAME_ATTR) != null)
- rootName = temp.getAttribute(NAME_ATTR).getValue();
- String tempName = temp.getNamespacePrefix() + ":" + rootName; //$NON-NLS-1$
- if (rootName.equalsIgnoreCase(elementName)) {
- return temp;
- } else if (tempName.equalsIgnoreCase(elementName) ) {
- return temp;
- }
- }
- }
- }
- } else {
- for (int i = 0; i < list.size(); i++){
- org.jdom.Element temp = (org.jdom.Element) list.get(i);
- String rootName = null;
- if (temp.getAttribute(NAME_ATTR) != null)
- rootName = temp.getAttribute(NAME_ATTR).getValue();
- String tempName = temp.getNamespacePrefix() + ":" + rootName; //$NON-NLS-1$
- if (rootName.equalsIgnoreCase(elementName)) {
- return temp;
- } else if (tempName.equalsIgnoreCase(elementName) ) {
- return temp;
- }
- }
- }
- }
- }
- return null;
- }
-
- private static org.jdom.Element getNamedSchemaElement ( Definition wsdlDefinition, String messageName ) {
- Types types = wsdlDefinition.getTypes();
-
- if (types == null) {
- Map<?, ?> imports = wsdlDefinition.getImports();
- Set<?> importKeys = imports.keySet();
- for( Iterator<?> it2 = importKeys.iterator(); it2.hasNext(); ) {
- String importKey = (String) it2.next();
- Vector<?> importVector = (Vector<?>) imports.get(importKey);
- Iterator<?> iter = importVector.iterator();
- while (iter.hasNext()) {
- Import importInstance = (Import) iter.next();
- if (importInstance.getDefinition().getTypes() != null) {
- types = importInstance.getDefinition().getTypes();
- org.jdom.Element attempt = getNamedSchemaElement(wsdlDefinition, types, messageName);
- if (attempt != null)
- return attempt;
- } else if (importInstance.getDefinition().getImports() != null) {
- org.jdom.Element attempt = getNamedSchemaElement(importInstance.getDefinition(), messageName);
- if (attempt != null)
- return attempt;
- }
- }
- }
- } else {
- org.jdom.Element attempt = getNamedSchemaElement(wsdlDefinition, types, messageName);
- if (attempt != null)
- return attempt;
- }
- return null;
- }
-
- private static String createMessageForSchemaElementFromTypes ( Definition wsdlDefinition, Types types, String partName, String messageName, String namespace ) {
- if (types != null &&types.getExtensibilityElements().size() > 0) {
- Schema schema = (Schema) types.getExtensibilityElements().get(0);
- DOMBuilder domBuilder = new DOMBuilder();
- org.jdom.Element jdomSchemaElement = domBuilder.build(schema.getElement());
-
- List<?> list = jdomSchemaElement.getChildren();
- if (list.size() > 0) {
- org.jdom.Element checkForImport = (org.jdom.Element) list.get(0);
- if (checkForImport.getName().equals(IMPORT_TAG)) {
- Map<?, ?> imports = schema.getImports();
- Iterator<?> importIter = imports.values().iterator();
- while (importIter.hasNext()) {
- Object obj = importIter.next();
- Vector<?> schemaImportVector = (Vector<?>) obj;
- Iterator<?> vectorIter = schemaImportVector.iterator();
- while (vectorIter.hasNext()) {
- SchemaImport schemaImport = (SchemaImport) vectorIter.next();
- if (schemaImport.getReferencedSchema() != null) {
- org.jdom.Element jdomSchemaImportElement = domBuilder.build(schemaImport.getReferencedSchema().getElement());
- List<?> innerList = jdomSchemaImportElement.getChildren();
-
- for (int i = 0; i < innerList.size(); i++){
- org.jdom.Element temp = (org.jdom.Element) innerList.get(i);
- String rootName = null;
- if (temp.getAttribute(NAME_ATTR) != null)
- rootName = temp.getAttribute(NAME_ATTR).getValue();
-
- if (rootName != null && rootName.equalsIgnoreCase(messageName)) {
- StringBuffer buf = new StringBuffer();
- buf.append('<' + rootName);
- buf.append(" xmlns = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append(">\n"); //$NON-NLS-1$
- if (!temp.getChildren().isEmpty()){
- org.jdom.Element temp2 = (org.jdom.Element)temp.getChildren().get(0);
- if (temp2.getName().contains(COMPLEX_TYPE_NAME)) {
- String elementStr = processComplexType(wsdlDefinition, temp2);
- buf.append(elementStr);
- } else if (temp2.getName().contains(RESTRICTION_NAME)){
- String elementStr = processType(wsdlDefinition, temp2, RESTRICTION_NAME, false);
- buf.append(elementStr);
- } else {
- String elementStr = processChild(wsdlDefinition, temp2);
- buf.append(elementStr);
- }
- }
- buf.append("</" + rootName + ">\n");//$NON-NLS-1$//$NON-NLS-2$
- return buf.toString();
- }
- }
- }
- }
- }
- } else {
- for (int i = 0; i < list.size(); i++){
- org.jdom.Element temp = (org.jdom.Element) list.get(i);
- String rootName = null;
- if (temp.getAttribute(NAME_ATTR) != null)
- rootName = temp.getAttribute(NAME_ATTR).getValue();
-
- if (rootName.equalsIgnoreCase(messageName)) {
- if (temp.getParentElement().getAdditionalNamespaces() != null && temp.getParentElement().getAdditionalNamespaces().size() > 0) {
- @SuppressWarnings("unchecked")
- List<Namespace> addlNamespaces = temp.getParentElement().getAdditionalNamespaces();
- for (int j = 0; j < addlNamespaces.size(); j++) {
- Namespace addlNS = addlNamespaces.get(j);
- if (addlNS.getPrefix().equalsIgnoreCase("tns")) { //$NON-NLS-1$
- if (!addlNS.getURI().equalsIgnoreCase(namespace)) {
- namespace = addlNS.getURI();
- break;
- }
- }
- }
- }
-
- StringBuffer buf = new StringBuffer();
- buf.append('<');
- if (partName != null) {
- buf.append(partName);
- }
- else {
- buf.append(rootName);
- buf.append(" xmlns = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- buf.append(">\n"); //$NON-NLS-1$
- if (temp.getChildren().isEmpty()) {
- String nstemp = namespace;
- String typeName = temp.getAttributeValue(TYPE_ATTR);
- String prefix = null;
- if (typeName.indexOf(':') > 0) {
- prefix = typeName.substring(0, typeName.indexOf(':'));
- nstemp = temp.getNamespace(prefix).getURI();
- typeName = typeName.substring(typeName.indexOf(':') + 1, typeName.length());
- }
- temp = getNodeFromSchema(temp.getParentElement(), typeName, nstemp, prefix);
- }
- if (temp != null && !temp.getChildren().isEmpty()){
- org.jdom.Element temp2 = (org.jdom.Element)temp.getChildren().get(0);
- if (temp2.getName().contains(COMPLEX_TYPE_NAME)) {
- String elementStr = processComplexType(wsdlDefinition, temp2);
- buf.append(elementStr);
- } else {
- String elementStr = processChild(wsdlDefinition, temp2);
- buf.append(elementStr);
- }
- }
- buf.append("</");//$NON-NLS-1$
- if (partName != null)
- buf.append(partName);
- else
- buf.append(rootName);
- buf.append(">\n");//$NON-NLS-1$
- return buf.toString();
- } else {
- Message msg = wsdlDefinition.getMessage(new QName(namespace, messageName));
- if (msg != null) {
- StringBuffer buf = new StringBuffer();
- buf.append('<');
- if (partName != null)
- buf.append(partName);
- else
- buf.append(rootName);
- buf.append(" xmlns = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append(">?"); //$NON-NLS-1$
- buf.append("</");//$NON-NLS-1$
- if (partName != null)
- buf.append(partName);
- else
- buf.append(rootName);
- buf.append(">\n");//$NON-NLS-1$
- return buf.toString();
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- private static org.jdom.Element getNodeFromSchema ( org.jdom.Element root, String name, String ns, String prefix) {
- if (root != null) {
- List<?> childList = root.getChildren();
- Iterator<?> iter1 = childList.iterator();
- while (iter1.hasNext()) {
- Object test = iter1.next();
- if (test instanceof org.jdom.Element) {
- org.jdom.Element childEl = (org.jdom.Element) test;
- if (childEl.getAttributeValue(NAME_ATTR, ns).equalsIgnoreCase(name)) {
- String typeName = childEl.getAttributeValue(TYPE_ATTR);
- if (typeName == null || !typeName.equalsIgnoreCase(prefix + ':' + name))
- return childEl;
- }
- }
- }
- }
- return null;
- }
-
- private static String processComplexType (Definition wsdlDefinition, org.jdom.Element childEl ) {
- StringBuffer buf = new StringBuffer();
- if (!childEl.getChildren().isEmpty()) {
- org.jdom.Element temp3 = (org.jdom.Element)childEl.getChildren().get(0);
- if (temp3.getName().contains(SEQUENCE_NAME)) {
- for (int j = 0; j < temp3.getChildren().size(); j++) {
- org.jdom.Element tempEl = (org.jdom.Element) temp3.getChildren().get(j);
- String elementStr = processChild(wsdlDefinition, tempEl);
- buf.append(elementStr);
- }
- } else {
- String elementStr = processChild(wsdlDefinition, temp3);
- buf.append(elementStr);
- }
- }
- return buf.toString();
- }
-
- private static boolean isTypeBaseXSDOrSimple ( String type ) {
- // typically the type starts with a namespace prefix, so
- // we want to compare the end of the string with the actual
- // type name
- if (type.endsWith(STRING_TYPE_NAME) ||
- type.endsWith(BOOLEAN_TYPE_NAME) ||
- type.endsWith(DECIMAL_TYPE_NAME) ||
- type.endsWith(INT_TYPE_NAME) ||
- type.endsWith(DOUBLE_TYPE_NAME) ||
- type.endsWith(FLOAT_TYPE_NAME) ||
- type.endsWith(DURATION_TYPE_NAME) ||
- type.endsWith(DATE_TYPE_NAME) ||
- type.endsWith(TIME_TYPE_NAME) ||
- type.endsWith(DATETIME_TYPE_NAME) ||
- type.endsWith(ANYURI_TYPE_NAME) ||
- type.endsWith(BASE64BINARY_TYPE_NAME) ||
- type.endsWith(GDAY_TYPE_NAME) ||
- type.endsWith(GMONTH_TYPE_NAME) ||
- type.endsWith(GMONTHDAY_TYPE_NAME) ||
- type.endsWith(GYEAR_TYPE_NAME) ||
- type.endsWith(GYEARMONTH_TYPE_NAME) ||
- type.endsWith(HEXBINARY_TYPE_NAME) ||
- type.endsWith(NOTATION_TYPE_NAME) ||
- type.endsWith(PRECISION_DECIMAL_TYPE_NAME)
- ) {
- return true;
- } else if (type.contains(SIMPLE_TYPE_NAME)) {
- return true;
- }
- return false;
- }
-
- private static String processType (Definition wsdlDefinition, org.jdom.Element childEl, String type, boolean isOptional) {
- StringBuffer buf = new StringBuffer();
- if (isTypeBaseXSDOrSimple(type)) {
- buf.append("?"); //$NON-NLS-1$
- } else if (type.contains(RESTRICTION_NAME)) {
- for (int j = 0; j < childEl.getChildren().size(); j++) {
- org.jdom.Element tempEl = (org.jdom.Element) childEl.getChildren().get(j);
- String innerType = tempEl.getName();
- String elementStr = processType(wsdlDefinition, tempEl, innerType, isOptional );
- buf.append(elementStr);
- }
- } else if (type.contains(ENUMERATION_NAME)) {
- String enumerationType = null;
- if (childEl.getAttribute(VALUE_ATTR) != null) {
- enumerationType = childEl.getAttribute(VALUE_ATTR).getValue();
- buf.append(enumerationType + " | "); //$NON-NLS-1$
- }
- } else {
- org.jdom.Element typeEl = getNamedSchemaElement(wsdlDefinition, type);
- if (typeEl != null) {
- if (typeEl.getName().contains(COMPLEX_TYPE_NAME) || typeEl.getName().contains(SEQUENCE_NAME)) {
- String elementStr = processComplexType(wsdlDefinition, typeEl);
- buf.append(elementStr);
- } else {
- String elementStr = processChild(wsdlDefinition, typeEl);
- buf.append(elementStr);
- }
- } else {
- buf.append("?"); //$NON-NLS-1$
- }
- }
- return buf.toString();
- }
-
- private static String processChild ( Definition wsdlDefinition, org.jdom.Element childEl ) {
- StringBuffer buf = new StringBuffer();
- String innerChildName = null;
- if (childEl.getAttribute(NAME_ATTR) != null) {
- innerChildName = childEl.getAttribute(NAME_ATTR).getValue();
- }
- String innerChildType = null;
- if (childEl.getAttribute(TYPE_ATTR) != null) {
- innerChildType = childEl.getAttribute(TYPE_ATTR).getValue();
- }
- String innerMinOccurs = null;
- Integer innerMinOccursNum = null;
- if (childEl.getAttribute(MIN_OCCURS_ATTR) != null) {
- innerMinOccurs = childEl.getAttribute(MIN_OCCURS_ATTR).getValue();
- innerMinOccursNum = Integer.decode(innerMinOccurs);
- }
- if (innerChildName != null && !childEl.getName().contains(SIMPLE_TYPE_NAME)){
- buf.append('<' + innerChildName);
- buf.append(">"); //$NON-NLS-1$
- }
-
- if (childEl.getChildren().size() > 0) {
- if (childEl.getName().contains(SIMPLE_TYPE_NAME)) {
- String elementStr = processType(wsdlDefinition, childEl, SIMPLE_TYPE_NAME, (innerMinOccursNum == null || innerMinOccursNum.intValue() == 0));
- buf.append(elementStr);
- } else {
- for (int j = 0; j < childEl.getChildren().size(); j++) {
- org.jdom.Element tempEl = (org.jdom.Element) childEl.getChildren().get(j);
- if (tempEl.getName().contains(COMPLEX_TYPE_NAME)) {
- String elementStr = processComplexType(wsdlDefinition, tempEl);
- buf.append(elementStr);
- } else {
- String elementStr = processChild(wsdlDefinition, tempEl);
- buf.append(elementStr);
- }
- }
- }
- } else if ((innerMinOccursNum == null || innerMinOccursNum.intValue() == 0) && (innerChildType != null)) {
- String elementStr = processType(wsdlDefinition, childEl, innerChildType, true);
- buf.append(elementStr);
- } else if (innerChildType != null){
- String elementStr = processType(wsdlDefinition, childEl, innerChildType, false);
- buf.append(elementStr);
- }
- if (innerChildName != null && !childEl.getName().contains(SIMPLE_TYPE_NAME))
- buf.append("</" + innerChildName + ">\n"); //$NON-NLS-1$//$NON-NLS-2$
- return buf.toString();
- }
-
- public static String createMessageForSchemaElement ( Definition wsdlDefinition, String partName, String messageName, String namespace ) {
- Types types = wsdlDefinition.getTypes();
- if (types == null || wsdlDefinition.getImports().size() > 0) {
- Map<?, ?> imports = wsdlDefinition.getImports();
- Set<?> importKeys = imports.keySet();
- for( Iterator<?> it2 = importKeys.iterator(); it2.hasNext(); ) {
- String importKey = (String) it2.next();
- Vector<?> importVector = (Vector<?>) imports.get(importKey);
- Iterator<?> iter = importVector.iterator();
- while (iter.hasNext()) {
- Import importInstance = (Import) iter.next();
-// namespace = importInstance.getNamespaceURI();
- if (importInstance.getDefinition().getTypes() != null) {
- Types temptypes = importInstance.getDefinition().getTypes();
- String attempt = createMessageForSchemaElementFromTypes(wsdlDefinition, temptypes, partName, messageName, namespace);
- if (attempt != null)
- return attempt;
- } else if (importInstance.getDefinition().getImports() != null) {
- String attempt = createMessageForSchemaElement(importInstance.getDefinition(), partName, messageName, namespace);
- if (attempt != null)
- return attempt;
- }
- }
- }
- // if we got this far, it wasn't found in the imports
- String attempt = createMessageForSchemaElementFromTypes(wsdlDefinition, types, partName, messageName, namespace);
- if (attempt != null)
- return attempt;
- } else {
- String attempt = createMessageForSchemaElementFromTypes(wsdlDefinition, types, partName, messageName, namespace);
- if (attempt != null)
- return attempt;
- }
- return null;
- }
-
public static String getFileContents (URL inURL){
try {
BufferedReader in = new BufferedReader(
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URIEncoder.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URIEncoder.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URIEncoder.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ * Jens Lukowski/Innoopract - initial renaming/restructuring
+ *******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.BitSet;
+
+/**
+ * This class is a modified version of java.lang.URLEncoder.
+ */
+public class URIEncoder
+{
+ static BitSet dontNeedEncoding;
+ static final int caseDiff = ('a' - 'A');
+ static String dfltEncName = null;
+
+
+ static
+ {
+ dontNeedEncoding = new BitSet(256);
+ int i;
+ for (i = 'a'; i <= 'z'; i++)
+ {
+ dontNeedEncoding.set(i);
+ }
+ for (i = 'A'; i <= 'Z'; i++)
+ {
+ dontNeedEncoding.set(i);
+ }
+ for (i = '0'; i <= '9'; i++)
+ {
+ dontNeedEncoding.set(i);
+ }
+
+ //dontNeedEncoding.set(' '); // cs.. removed so that space character will be replaced by %20
+ dontNeedEncoding.set('-');
+ dontNeedEncoding.set('_');
+ dontNeedEncoding.set('.');
+ dontNeedEncoding.set('*');
+ dontNeedEncoding.set(':'); // cs.. added
+ dontNeedEncoding.set('/'); // cs.. added so that slashes don't get encoded as %2F
+
+ // dfltEncName = (String)AccessController.doPrivileged(new GetPropertyAction("file.encoding"));
+ // As discussed with Sandy, we should encode URIs with UTF8
+ dfltEncName = "UTF8"; //$NON-NLS-1$
+ //System.out.println("dfltEncName " + dfltEncName);
+ }
+
+ /**
+ * You can't call the constructor.
+ */
+ private URIEncoder() { }
+
+ /**
+ * Translates a string into <code>x-www-form-urlencoded</code>
+ * format. This method uses the platform's default encoding
+ * as the encoding scheme to obtain the bytes for unsafe characters.
+ *
+ * @param s <code>String</code> to be translated.
+ * @deprecated The resulting string may vary depending on the platform's
+ * default encoding. Instead, use the encode(String,String)
+ * method to specify the encoding.
+ * @return the translated <code>String</code>.
+ */
+ public static String encode(String s)
+ {
+ String str = null;
+ try
+ {
+ str = encode(s, dfltEncName);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // The system should always have the platform default
+ }
+ return str;
+ }
+
+ /**
+ * Translates a string into <code>application/x-www-form-urlencoded</code>
+ * format using a specific encoding scheme. This method uses the
+ * supplied encoding scheme to obtain the bytes for unsafe
+ * characters.
+ * <p>
+ * <em><strong>Note:</strong> The <a href=
+ * "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars">
+ * World Wide Web Consortium Recommendation</a> states that
+ * UTF-8 should be used. Not doing so may introduce
+ * incompatibilites.</em>
+ *
+ * @param s <code>String</code> to be translated.
+ * @param enc The name of a supported
+ * <a href="../lang/package-summary.html#charenc">character
+ * encoding</a>.
+ * @return the translated <code>String</code>.
+ * @exception UnsupportedEncodingException
+ * If the named encoding is not supported
+ * @see java.net.URLDecoder#decode(java.lang.String, java.lang.String)
+ */
+ public static String encode(String s, String enc) throws UnsupportedEncodingException
+ {
+ boolean needToChange = false;
+ boolean wroteUnencodedChar = false;
+ int maxBytesPerChar = 10; // rather arbitrary limit, but safe for now
+ StringBuffer out = new StringBuffer(s.length());
+ ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar);
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(buf, enc));
+
+ for (int i = 0; i < s.length(); i++)
+ {
+ int c = s.charAt(i);
+ //System.out.println("Examining character: " + c);
+ if (dontNeedEncoding.get(c))
+ {
+ //if (c == ' ')
+ //{
+ // c = '+';
+ // needToChange = true;
+ //}
+ //System.out.println("Storing: " + c);
+ out.append((char)c);
+ wroteUnencodedChar = true;
+ }
+ else
+ {
+ // convert to external encoding before hex conversion
+ try
+ {
+ if (wroteUnencodedChar)
+ { // Fix for 4407610
+ writer = new BufferedWriter(new OutputStreamWriter(buf, enc));
+ wroteUnencodedChar = false;
+ }
+ writer.write(c);
+
+ // If this character represents the start of a Unicode
+ // surrogate pair, then pass in two characters. It's not
+ // clear what should be done if a bytes reserved in the
+ // surrogate pairs range occurs outside of a legal
+ // surrogate pair. For now, just treat it as if it were
+ // any other character.
+ //
+ if (c >= 0xD800 && c <= 0xDBFF)
+ {
+ // System.out.println(Integer.toHexString(c) + " is high surrogate");
+ if ( (i+1) < s.length())
+ {
+ int d = s.charAt(i+1);
+ // System.out.println("\tExamining " + Integer.toHexString(d));
+ if (d >= 0xDC00 && d <= 0xDFFF)
+ {
+ // System.out.println("\t" + Integer.toHexString(d) + " is low surrogate");
+ writer.write(d);
+ i++;
+ }
+ }
+ }
+ writer.flush();
+ }
+ catch(IOException e)
+ {
+ buf.reset();
+ continue;
+ }
+ byte[] ba = buf.toByteArray();
+
+ for (int j = 0; j < ba.length; j++)
+ {
+ out.append('%');
+ char ch = Character.forDigit((ba[j] >> 4) & 0xF, 16);
+ // converting to use uppercase letter as part of
+ // the hex value if ch is a letter.
+ if (Character.isLetter(ch))
+ {
+ ch -= caseDiff;
+ }
+ out.append(ch);
+ ch = Character.forDigit(ba[j] & 0xF, 16);
+ if (Character.isLetter(ch))
+ {
+ ch -= caseDiff;
+ }
+ out.append(ch);
+ }
+ buf.reset();
+ needToChange = true;
+ }
+ }
+ return (needToChange? out.toString() : s);
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URIEncoder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URLUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URLUtils.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URLUtils.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20081119 255374 mahutch(a)ca.ibm.com - Mark Hutchinson
+ *******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+
+/**
+ * This class contains utility methods for managing URLs
+ * as used by the Web Services Explorer Web application.
+ * @author cbrealey(a)ca.ibm.com
+ */
+public final class URLUtils
+{
+ /**
+ * Objects of this class should not be constructed.
+ */
+ private URLUtils ()
+ {
+ }
+
+ /**
+ * UTF-8
+ */
+ public static final String UTF8 = "UTF-8"; //$NON-NLS-1$
+
+ /**
+ * Equivalent to {@link #encode(String,String)}
+ * with second parameter set to the "UTF-8" encoding.
+ * @param s The string to encode.
+ * @return The encoded string.
+ */
+ public static String encode(String s)
+ {
+ return encode(s,UTF8);
+ }
+
+ /**
+ * Equivalent to {@link URLEncoder#encode(String,String)},
+ * only throws an unchecked {@link RuntimeException} wrapped
+ * around an {@link UnsupportedEncodingException} instead of
+ * an {@link UnsupportedEncodingException}.
+ * @param s The string to encode.
+ * @param enc The encoding to use.
+ * @return The encoded string.
+ */
+ public static String encode(String s, String enc)
+ {
+ try
+ {
+ return URLEncoder.encode(s,enc);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // TODO: MSG_BROKEN_VM_DOES_NOT_SUPPORT_UTF-8
+ throw new RuntimeException("%MSG_BROKEN_VM_DOES_NOT_SUPPORT_UTF-8",e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Equivalent to {@link #decode(String,String)}
+ * with second parameter set to the "UTF-8" encoding.
+ * @param s The string to decode.
+ * @return The decoded string.
+ */
+ public static String decode(String s)
+ {
+ return decode(s,UTF8);
+ }
+
+ /**
+ * Equivalent to {@link URLEncoder#decode(String,String)},
+ * only throws an unchecked {@link RuntimeException} wrapped
+ * around an {@link UnsupportedEncodingException} instead of
+ * an {@link UnsupportedEncodingException}.
+ * @param s The string to decode.
+ * @param enc The encoding to use.
+ * @return The decoded string.
+ */
+ public static String decode(String s, String enc)
+ {
+ try
+ {
+ return URLDecoder.decode(s,enc);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // TODO: MSG_BROKEN_VM_DOES_NOT_SUPPORT_UTF-8
+ throw new RuntimeException("%MSG_BROKEN_VM_DOES_NOT_SUPPORT_UTF-8",e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Encodes non-ASCII characters in a URL string.
+ * @param urlString The URL string to encode
+ * @return The URL as an encoded string
+ */
+ public static String encodeURLString(String urlString) {
+ try {
+ URI uri = new URI(urlString);
+ return uri.toASCIIString();
+ } catch (Exception e) {
+ //do nothing, we will just return the original string
+ }
+ return urlString;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/URLUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/Validator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/Validator.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/Validator.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20060612 142290 gilberta(a)ca.ibm.com - Gilbert Andrews
+ *******************************************************************************/
+
+package org.jboss.tools.ws.ui.utils;
+
+public class Validator
+{
+ public static final boolean validateString(String input)
+ {
+ return ((input != null) && (input.trim().length() > 0));
+ }
+
+ public static final boolean validateURL(String input)
+ {
+ return (input != null && input.matches("[a-zA-Z\\+\\-\\.]++:.*")); //$NON-NLS-1$
+ }
+
+ public static final boolean validateInteger(String input)
+ {
+ try
+ {
+ Integer.parseInt(input);
+ return true;
+ }
+ catch (NumberFormatException e)
+ {
+ return false;
+ }
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/Validator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/WSDLPartsToXSDTypeMapper.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/WSDLPartsToXSDTypeMapper.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/WSDLPartsToXSDTypeMapper.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
+import javax.wsdl.Part;
+import javax.xml.namespace.QName;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public class WSDLPartsToXSDTypeMapper
+{
+ private final char POUND = '#';
+ private Vector<Object> xsdSchemaList_;
+ private Hashtable<String, XSDNamedComponent> partToXSDCache_;
+
+ public WSDLPartsToXSDTypeMapper() {
+ xsdSchemaList_ = new Vector<Object>();
+ partToXSDCache_ = new Hashtable<String, XSDNamedComponent>();
+ }
+
+ public void addSchemas(Vector<?> schemaList) {
+ for (int i=0;i<schemaList.size();i++) {
+ Object schema = schemaList.elementAt(i);
+ if (schema != null)
+ xsdSchemaList_.addElement(schema);
+ }
+ }
+
+ public XSDNamedComponent getXSDType(Part part, String id) {
+ XSDNamedComponent component = getXSDTypeFromCache(id);
+ if (component != null)
+ return component;
+ component = getXSDTypeFromSchema(part);
+ if (component != null)
+ addToCache(id, component);
+ return component;
+ }
+
+ public XSDNamedComponent getXSDTypeFromCache(String id) {
+ return (XSDNamedComponent)partToXSDCache_.get(id);
+ }
+
+ public XSDNamedComponent getXSDTypeFromSchema(Part part) {
+ boolean isElementDeclaration = (part.getTypeName() == null);
+ QName qName = isElementDeclaration ? part.getElementName() : part.getTypeName();
+ return getXSDTypeFromSchema(qName.getNamespaceURI(), qName.getLocalPart(), isElementDeclaration);
+ }
+
+ public XSDNamedComponent getXSDTypeFromSchema(String namespaceURI, String localName, boolean isElementDeclaration) {
+ for (int i = 0; i < xsdSchemaList_.size(); i++) {
+ XSDSchema xsdSchema = (XSDSchema)xsdSchemaList_.elementAt(i);
+ Vector<Object> components = new Vector<Object>();
+ if (isElementDeclaration)
+ components.addAll(xsdSchema.getElementDeclarations());
+ else
+ components.addAll(xsdSchema.getTypeDefinitions());
+ for (Iterator<Object> it = components.iterator(); it.hasNext(); ) {
+ XSDNamedComponent component = (XSDNamedComponent)it.next();
+ String compNSURI = component.getTargetNamespace();
+ String compLocalname = component.getName();
+ if (compNSURI != null && compLocalname != null && compNSURI.equals(namespaceURI) && compLocalname.equals(localName))
+ return component;
+ }
+ }
+ return null;
+ }
+
+ public XSDNamedComponent resolveXSDNamedComponent(XSDNamedComponent component)
+ {
+ if (component != null)
+ {
+ String uri = component.getURI();
+ String qname = component.getQName();
+ for (int i = 0; i < xsdSchemaList_.size(); i++)
+ {
+ XSDSchema xsdSchema = (XSDSchema)xsdSchemaList_.elementAt(i);
+ if (xsdSchema != null)
+ {
+ String targetNS = xsdSchema.getTargetNamespace();
+ if (targetNS != null && targetNS.equals(trimQName(uri, qname)))
+ {
+ XSDNamedComponent resolvedComponent = null;
+ if (component instanceof XSDTypeDefinition)
+ resolvedComponent = xsdSchema.resolveTypeDefinition(qname);
+ else if (component instanceof XSDElementDeclaration)
+ resolvedComponent = xsdSchema.resolveElementDeclaration(qname);
+ else if (component instanceof XSDModelGroupDefinition)
+ resolvedComponent = xsdSchema.resolveModelGroupDefinition(qname);
+ if (isComponentResolvable(resolvedComponent))
+ return resolvedComponent;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private String trimQName(String uri, String qname)
+ {
+ int index = uri.indexOf(qname);
+ if (index != -1)
+ {
+ String ns = uri.substring(0, index);
+ if (ns.charAt(index-1) == POUND)
+ return ns.substring(0, index-1);
+ else
+ return ns;
+ }
+ else
+ return uri;
+ }
+
+ private void addToCache(String id, XSDNamedComponent component) {
+ partToXSDCache_.put(id,component);
+ }
+
+ protected boolean isComponentResolvable(XSDComponent component)
+ {
+ if (component == null)
+ return false;
+ XSDSchema schema = component.getSchema();
+ if (schema == null)
+ return false;
+ if (schema.getTargetNamespace() == null)
+ return false;
+ return true;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/WSDLPartsToXSDTypeMapper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/AddMonitorDialog.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/AddMonitorDialog.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/AddMonitorDialog.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -1,18 +0,0 @@
-package org.jboss.tools.ws.ui.views;
-
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorDialog;
-
-@SuppressWarnings("restriction")
-public class AddMonitorDialog extends MonitorDialog {
-
- public AddMonitorDialog(Shell parentShell) {
- super(parentShell);
- }
-
- public IMonitorWorkingCopy getMonitor() {
- return this.monitor;
- }
-
-}
Deleted: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -1,1071 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.views;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-
-import javax.wsdl.Definition;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-
-import org.apache.axis.utils.XMLUtils;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.MonitorCore;
-import org.jboss.tools.ws.ui.JBossWSUIPlugin;
-import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-import org.jboss.tools.ws.ui.utils.JAXRSTester;
-import org.jboss.tools.ws.ui.utils.JAXWSTester2;
-import org.jboss.tools.ws.ui.utils.ResultsXMLStorage;
-import org.jboss.tools.ws.ui.utils.ResultsXMLStorageInput;
-import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
-import org.jboss.tools.ws.ui.utils.WSTestUtils;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * View for testing web services (JAX-WS & JAX-RS)
- * @author bfitzpat
- *
- */
-@SuppressWarnings("restriction")
-public class JAXRSWSTestView extends ViewPart {
-
- private static final String DEFAULT_TEXT_EDITOR_ID = "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
- private static final String XML_EDITOR_ID = "org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"; //$NON-NLS-1$
- private static final String TCPIP_VIEW_ID = "org.eclipse.wst.internet.monitor.view";//$NON-NLS-1$
- private static final String DELETE = "DELETE";//$NON-NLS-1$
- private static final String PUT = "PUT";//$NON-NLS-1$
- private static final String POST = "POST";//$NON-NLS-1$
- private static final String GET = "GET";//$NON-NLS-1$
- private static final String JAX_WS = "JAX-WS"; //$NON-NLS-1$
- private static final String JAX_RS = "JAX-RS"; //$NON-NLS-1$
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- private static final String RESULT_HEADER_DELIMITER = "%";//$NON-NLS-1$
-
- /**
- * The ID of the view as specified by the extension.
- */
- public static final String ID = "org.jboss.tools.ws.ui.tester.views.TestWSView";//$NON-NLS-1$
-
- /* UI controls */
- private Button testButton = null;
- private Button wsdlButton = null;
- private Text actionText;
- private Text resultsText;
- private Combo urlCombo;
- private DelimitedStringList dlsList;
- private Combo methodCombo;
- private Combo wsTypeCombo;
- private Text bodyText;
- private TabFolder tabGroup;
- private TabItem bodyTab;
- private TabItem headerTab;
- private List resultHeadersList;
- private TabItem resultHeadersTab;
- private TabItem resultTab;
- private TabFolder resultTabGroup;
-
- private TabItem parmsTab;
-
- private DelimitedStringList parmsList;
- private Button openTCPIPMonitorButton;
- private Button addTCPIPMonitorButton;
-
- private SOAPEnvelope envelope;
- private SOAPBody soapbody;
- private MenuItem openInXMLEditorAction;
- private MenuItem openResponseTagInXMLEditor;
- private Menu resultsTextMenu;
- private MenuItem copyMenuAction;
- private Menu resultsHeaderMenu;
- private MenuItem copyResultHeaderMenuAction;
-
- private boolean showSampleButton = false;
- private String[] serviceNSMessage = null;
-
- /**
- * The constructor.
- */
- public JAXRSWSTestView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
-
- Composite innerComposite = new Composite (parent, SWT.NONE);
- innerComposite.setLayout(new FillLayout());
-
- SashForm sashForm = new SashForm(innerComposite, SWT.BORDER);
- sashForm.setOrientation(SWT.HORIZONTAL);
-
- Composite topHalf = new Composite (sashForm, SWT.NONE);
- topHalf.setLayout(new GridLayout(2, false));
-
- Label typeLabel = new Label(topHalf, SWT.NONE);
- typeLabel.setText(JBossWSUIMessages.JAXRSWSTestView_Web_Service_Type_Label);
- typeLabel.setLayoutData(new GridData());
-
- wsTypeCombo = new Combo(topHalf, SWT.DROP_DOWN | SWT.READ_ONLY);
- wsTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- wsTypeCombo.add(JAX_WS);
- wsTypeCombo.add(JAX_RS);
- wsTypeCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- setControlsForWSType(wsTypeCombo.getText());
- setControlsForMethodType(methodCombo.getText());
- setControlsForSelectedURL();
- }
- });
-
- Label methodLabel = new Label(topHalf, SWT.NONE);
- methodLabel.setText(JBossWSUIMessages.JAXRSWSTestView_HTTP_Method_Label);
- methodLabel.setLayoutData(new GridData());
-
- methodCombo = new Combo(topHalf, SWT.DROP_DOWN | SWT.READ_ONLY);
- methodCombo.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- methodCombo.add(GET);
- methodCombo.add(POST);
- methodCombo.add(PUT);
- methodCombo.add(DELETE);
- methodCombo.setText(GET);
- methodCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- setControlsForMethodType(methodCombo.getText());
- }
- });
-
- Label urlLabel = new Label(topHalf, SWT.NONE);
- urlLabel.setText(JBossWSUIMessages.JAXRSWSTestView_Service_URL_Label);
- urlLabel.setLayoutData(new GridData());
-
- urlCombo = new Combo(topHalf, SWT.BORDER | SWT.DROP_DOWN);
- urlCombo.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- urlCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- setControlsForSelectedURL();
- }
- });
- urlCombo.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- }
-
- public void keyReleased(KeyEvent e) {
- setControlsForSelectedURL();
- if (e.keyCode == SWT.CR && e.stateMask == SWT.CTRL) {
- handleTest(wsTypeCombo.getText());
- }
- }
- });
-
- Label actionLabel = new Label(topHalf, SWT.NONE);
- actionLabel.setText(JBossWSUIMessages.JAXRSWSTestView_Action_URL_Label);
- actionLabel.setLayoutData(new GridData());
-
- actionText = new Text(topHalf, SWT.BORDER);
- actionText.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
-
- tabGroup = new TabFolder(topHalf, SWT.BORDER);
-
- bodyTab = new TabItem(tabGroup, SWT.NONE, 0);
- bodyTab.setText(JBossWSUIMessages.JAXRSWSTestView_Request_Body_Label);
-
- parmsTab = new TabItem(tabGroup, SWT.NONE, 1);
- parmsTab.setText(JBossWSUIMessages.JAXRSWSTestView_Request_Parameters_Label);
-
- parmsList = new DelimitedStringList(tabGroup, SWT.None);
- parmsTab.setControl(parmsList);
- GridData parmsListGD = new GridData(SWT.FILL, SWT.FILL, true, true);
- parmsListGD.horizontalSpan = 2;
- parmsList.setLayoutData(parmsListGD);
-
- headerTab = new TabItem(tabGroup, SWT.NONE, 2);
- bodyText = new Text(tabGroup, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
- GridData btGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- bodyText.setLayoutData(btGridData);
- bodyTab.setControl(bodyText);
-
- headerTab.setText(JBossWSUIMessages.JAXRSWSTestView_Request_Header_Label);
- GridData hgGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- hgGridData.horizontalSpan = 2;
- tabGroup.setLayoutData(hgGridData);
-
- dlsList = new DelimitedStringList(tabGroup, SWT.None);
- headerTab.setControl(dlsList);
- GridData dlsListGD = new GridData(SWT.FILL, SWT.FILL, true, true);
- dlsListGD.horizontalSpan = 2;
- dlsList.setLayoutData(dlsListGD);
-
- Composite buttonBar = new Composite ( topHalf, SWT.NONE);
- GridData buttonBarGD = new GridData(SWT.FILL, SWT.NONE, true, false);
- buttonBarGD.horizontalSpan = 2;
- buttonBar.setLayoutData(buttonBarGD);
- buttonBar.setLayout(new RowLayout());
-
- testButton = new Button (buttonBar, SWT.PUSH);
- testButton.setText(JBossWSUIMessages.JAXRSWSTestView_Invoke_Label);
-
- testButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- handleTest(wsTypeCombo.getText());
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- wsdlButton = new Button (buttonBar, SWT.PUSH);
- wsdlButton.setText(JBossWSUIMessages.JAXRSWSTestView_Button_Get_From_WSDL);
-
- wsdlButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- WSDLBrowseDialog wbDialog = new WSDLBrowseDialog(getSite().getShell());
- int rtnCode = wbDialog.open();
- if (rtnCode == Window.OK){
- serviceNSMessage = null;
- Definition wsdlDef = wbDialog.getWSDLDefinition();
- String output = TesterWSDLUtils.getSampleSOAPInputMessage(wsdlDef,
- wbDialog.getServiceTextValue(),
- wbDialog.getPortTextValue(),
- wbDialog.getBindingValue(),
- wbDialog.getOperationTextValue());
- String endpointURL = TesterWSDLUtils.getEndpointURL(wsdlDef,
- wbDialog.getServiceTextValue(),
- wbDialog.getPortTextValue(),
- wbDialog.getBindingValue(),
- wbDialog.getOperationTextValue());
- String actionURL = TesterWSDLUtils.getActionURL(wsdlDef,
- wbDialog.getServiceTextValue(),
- wbDialog.getPortTextValue(),
- wbDialog.getBindingValue(),
- wbDialog.getOperationTextValue());
- serviceNSMessage = TesterWSDLUtils.getNSServiceNameAndMessageNameArray(wsdlDef,
- wbDialog.getServiceTextValue(),
- wbDialog.getPortTextValue(),
- wbDialog.getBindingValue(),
- wbDialog.getOperationTextValue());
- String soapIn = generateSampleSOAP(output);
- bodyText.setText(soapIn);
- urlCombo.setText(endpointURL);
- actionText.setText(actionURL);
- setControlsForWSType(wsTypeCombo.getText());
- setControlsForMethodType(methodCombo.getText());
- setControlsForSelectedURL();
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- addTCPIPMonitorButton = new Button(buttonBar, SWT.PUSH);
- addTCPIPMonitorButton.setText(JBossWSUIMessages.JAXRSWSTestView_Configure_Monitor_Button);
-
- addTCPIPMonitorButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- configureMonitor();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- openTCPIPMonitorButton = new Button(buttonBar, SWT.PUSH);
- openTCPIPMonitorButton.setText(JBossWSUIMessages.JAXRSWSTestView_Open_Monitor_Button);
-
- openTCPIPMonitorButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- openMonitor();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Button sampleButton = new Button(buttonBar, SWT.PUSH);
- sampleButton.setText(JBossWSUIMessages.JAXRSWSTestView_Set_Sample_Data_Label);
- sampleButton.setVisible(showSampleButton);
-
- sampleButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- setupSample();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Composite bottomHalf = new Composite (sashForm, SWT.NONE);
- bottomHalf.setLayout(new GridLayout(2, false));
-
- resultTabGroup = new TabFolder(bottomHalf, SWT.BORDER);
- GridData rtGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- rtGridData.horizontalSpan = 2;
- resultTabGroup.setLayoutData(rtGridData);
-
- resultTab = new TabItem(resultTabGroup, SWT.NONE, 0);
- resultTab.setText(JBossWSUIMessages.JAXRSWSTestView_Results_Body_Label);
- resultsText = new Text(resultTabGroup, SWT.BORDER | SWT.V_SCROLL | SWT.WRAP | SWT.READ_ONLY );
- resultsText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- resultsTextMenu = new Menu(resultsText.getShell(), SWT.POP_UP);
-
- copyMenuAction = new MenuItem(resultsTextMenu, SWT.PUSH);
- copyMenuAction.setText(JBossWSUIMessages.JAXRSWSTestView_CopyResultsMenu);
- copyMenuAction.setAccelerator(SWT.CTRL + 'C');
- copyMenuAction.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent arg0) {
- if (resultsText.getSelectionCount() == 0)
- resultsText.selectAll();
- resultsText.copy();
- }
-
- public void widgetSelected(SelectionEvent arg0) {
- widgetDefaultSelected(arg0);
- }
- });
- new MenuItem(resultsTextMenu, SWT.SEPARATOR);
-
- openInXMLEditorAction = new MenuItem(resultsTextMenu, SWT.PUSH);
- openInXMLEditorAction.setText(JBossWSUIMessages.JAXRSWSTestView_Open_Result_in_XML_Editor);
- openInXMLEditorAction.setAccelerator(SWT.CTRL + 'O');
- openInXMLEditorAction.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent arg0) {
- String string = resultsText.getText();
- openXMLEditor(string);
- }
-
- public void widgetDefaultSelected(SelectionEvent arg0) {
- widgetSelected(arg0);
- }
- });
-
- openResponseTagInXMLEditor = new MenuItem(resultsTextMenu, SWT.PUSH);
- openResponseTagInXMLEditor.setText(JBossWSUIMessages.JAXRSWSTestView_Open_Response_Tag_Contents_in_XML_Editor);
- openResponseTagInXMLEditor.setAccelerator(SWT.CTRL + 'R');
- openResponseTagInXMLEditor.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent arg0) {
- String string = null;
- try {
- SOAPBody body = null;
- if (envelope != null){
- body = envelope.getBody();
- } else if (soapbody != null) {
- body = soapbody;
- }
-
- NodeList list = body.getChildNodes();
- for (int i = 0; i< list.getLength(); i++){
- Node node = list.item(i);
- if (node.getNodeName().contains("Response")){ //$NON-NLS-1$
- NodeList list2 = node.getChildNodes();
- for (int j = 0; j<list2.getLength(); j++){
- Node node2 = list2.item(j);
- if (node2.getNodeName().contains("Result")){ //$NON-NLS-1$
- Node node3 = node2.getChildNodes().item(0);
- if (node3.getNodeType() == Node.TEXT_NODE) {
- string = node3.getNodeValue();
- break;
- } else if (node3.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node3;
- string = XMLUtils.ElementToString(element);
- break;
- }
- }
- }
- if (string != null) break;
- }
- }
- if (string != null){
- openXMLEditor(string);
- }
- } catch (SOAPException e) {
- JBossWSUIPlugin.log(e);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent arg0) {
- widgetSelected(arg0);
- }
- });
-
- resultsText.setMenu(resultsTextMenu);
-
- resultTab.setControl(resultsText);
-
- resultsText.addFocusListener(new FocusListener() {
-
- public void focusLost(FocusEvent arg0) {
- }
-
- public void focusGained(FocusEvent arg0) {
- setMenusForCurrentState();
- }
- });
-
- resultHeadersTab = new TabItem(resultTabGroup, SWT.NONE, 1);
- resultHeadersTab.setText(JBossWSUIMessages.JAXRSWSTestView_Results_Header_Label);
- resultHeadersList = new List(resultTabGroup, SWT.V_SCROLL);
- resultHeadersTab.setControl(resultHeadersList);
- GridData rdlsListGD = new GridData(SWT.FILL, SWT.FILL, true, true);
- rdlsListGD.horizontalSpan = 2;
- resultHeadersList.setLayoutData(dlsListGD);
-
- resultsHeaderMenu = new Menu(resultHeadersList.getShell(), SWT.POP_UP);
-
- copyResultHeaderMenuAction = new MenuItem(resultsHeaderMenu, SWT.PUSH);
- copyResultHeaderMenuAction.setText(JBossWSUIMessages.JAXRSWSTestView_CopyResultMenu_Text);
- copyResultHeaderMenuAction.setAccelerator(SWT.CTRL + 'C');
- copyResultHeaderMenuAction.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent arg0) {
- if (resultHeadersList.getSelectionCount() == 0)
- resultHeadersList.selectAll();
- Display display = Display.getDefault();
- final Clipboard cb = new Clipboard(display);
- TextTransfer textTransfer = TextTransfer.getInstance();
- cb.setContents(resultHeadersList.getSelection() ,
- new Transfer[] { textTransfer });
- }
-
- public void widgetSelected(SelectionEvent arg0) {
- widgetDefaultSelected(arg0);
- }
- });
-
- resultHeadersList.setMenu(resultsHeaderMenu);
-
- resultHeadersList.addMouseListener(new MouseListener() {
- public void mouseDoubleClick(MouseEvent arg0) {
- }
- public void mouseDown(MouseEvent arg0) {
- setMenusForCurrentState();
- }
- public void mouseUp(MouseEvent arg0) {
- }
- });
-
- wsTypeCombo.setText(JAX_WS);
- setControlsForWSType(wsTypeCombo.getText());
- setControlsForMethodType(methodCombo.getText());
- setControlsForSelectedURL();
- setMenusForCurrentState();
- }
-
- private String generateSampleSOAP ( String innerText ) {
- String soapIn = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n" + //$NON-NLS-1$
- "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " + //$NON-NLS-1$
- "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + //$NON-NLS-1$
- "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " + //$NON-NLS-1$
- ">\n" + //$NON-NLS-1$
- "<soap:Body>\n";//$NON-NLS-1$
- if (innerText != null)
- soapIn = soapIn + innerText;
- soapIn = soapIn +
- "</soap:Body>\n" + //$NON-NLS-1$
- "</soap:Envelope>"; //$NON-NLS-1$
- return soapIn;
- }
-
- private void setMenusForCurrentState() {
- if (resultsText!= null && !resultsText.isDisposed()){
- boolean enabled = resultsText.getText().trim().length() > 0;
- copyMenuAction.setEnabled(enabled);
- openInXMLEditorAction.setEnabled(enabled);
- if (wsTypeCombo.getText().equalsIgnoreCase(JAX_WS)) {
- openResponseTagInXMLEditor.setEnabled(enabled);
- } else if (wsTypeCombo.getText().equalsIgnoreCase(JAX_RS) ){
- openResponseTagInXMLEditor.setEnabled(false);
- }
- }
- if (resultHeadersList != null && !resultHeadersList.isDisposed()) {
- boolean enabled = resultHeadersList.getItemCount() > 0;
- copyResultHeaderMenuAction.setEnabled(enabled);
- }
- }
-
- private void openXMLEditor (String text){
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- IStorage storage = new ResultsXMLStorage(text);
- IStorageEditorInput input = new ResultsXMLStorageInput(storage);
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- try {
- if (window.getWorkbench().getEditorRegistry().findEditor(XML_EDITOR_ID) != null) {
- page.openEditor(input, XML_EDITOR_ID);
- } else {
- page.openEditor(input, DEFAULT_TEXT_EDITOR_ID);
- }
- } catch (PartInitException e) {
- JBossWSUIPlugin.log(e);
- }
- }
- }
-
- private void setControlsForSelectedURL() {
- if (urlCombo.getText().trim().length() > 0) {
- String urlText = urlCombo.getText();
- try {
- new URL(urlText);
- testButton.setEnabled(true);
- addTCPIPMonitorButton.setEnabled(true);
- } catch (MalformedURLException mue) {
- testButton.setEnabled(false);
- addTCPIPMonitorButton.setEnabled(false);
-
- return;
- }
- } else {
- testButton.setEnabled(false);
- addTCPIPMonitorButton.setEnabled(false);
- }
- }
-
- /*
- * Open the TCP/IP Monitor View
- */
- private void openMonitor() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().
- getActivePage().showView(TCPIP_VIEW_ID);
- } catch (PartInitException e) {
- JBossWSUIPlugin.log(e);
- }
- }
-
- private IMonitor findMonitor(String urlToCheck) {
- IMonitor monitor = null;
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- if (monitors != null && monitors.length > 0) {
- for (int i= 0; i < monitors.length; i++) {
- if (urlToCheck.contains(monitors[i].getRemoteHost())) {
- monitor = monitors[i];
- break;
- }
- }
- }
- return monitor;
- }
-
- /*
- * Configure a TCP/IP Monitor entry so we can monitor it
- */
- private void configureMonitor() {
- if (urlCombo.getText().trim().length() > 0) {
- String oldUrl = urlCombo.getText();
- IMonitor monitor = findMonitor(oldUrl);
- if (monitor == null) {
-
- URL tempURL = null;
- try {
- tempURL = new URL(oldUrl);
- } catch (MalformedURLException e) {
- // ignore
- }
- AddMonitorDialog dialog = new AddMonitorDialog(getSite().getShell());
- if (tempURL != null) {
- dialog.getMonitor().setRemoteHost(tempURL.getHost());
- if (tempURL.getPort() > 0)
- dialog.getMonitor().setRemotePort(tempURL.getPort());
- }
- if (dialog.open() == Window.CANCEL)
- return;
- monitor = dialog.getMonitor();
- }
-
- if (monitor != null) {
- monitor = findMonitor(oldUrl);
- if (monitor != null) {
- if (!monitor.isRunning()) {
- try {
- monitor.start();
- int port = monitor.getLocalPort();
- int remotePort = monitor.getRemotePort();
- String host = monitor.getRemoteHost();
- String newUrl = null;
- if (oldUrl.contains(host + ':' + remotePort)) {
- newUrl = oldUrl.replace(host + ':' + remotePort, "localhost:" + port); //$NON-NLS-1$
- } else if (oldUrl.contains(host + ':' + port)) {
- // do nothing - host/port combo is already correct
- newUrl = oldUrl;
- } else {
- newUrl = oldUrl.replace(host, "localhost:" + port); //$NON-NLS-1$
- }
- urlCombo.setText(newUrl);
- } catch (CoreException e) {
- // if we hit an error, open a dialog
- ErrorDialog dialog = new ErrorDialog(this.getSite().getShell(),
- JBossWSUIMessages.JAXRSWSTestView_Error_Title_Starting_Monitor,
- JBossWSUIMessages.JAXRSWSTestView_Error_Msg_Starting_Monitor,
- new Status(IStatus.ERROR, JBossWSUIPlugin.PLUGIN_ID,
- e.getLocalizedMessage(), e), IStatus.ERROR);
- dialog.open();
- }
- }
- }
- }
- }
- }
-
- /*
- * Enable/disable controls based on the WS technology type
- * and the method.
- *
- * @param methodType
- */
- private void setControlsForMethodType ( String methodType ) {
- if (wsTypeCombo.getText().equalsIgnoreCase(JAX_RS) &&
- methodType.equalsIgnoreCase(GET)) {
- bodyText.setEnabled(false);
- } else {
- bodyText.setEnabled(true);
- }
- }
-
- /*
- * Enable/disable controls based on the WS technology type
- * @param wsType
- */
- private void setControlsForWSType ( String wsType ) {
- if (wsType.equalsIgnoreCase(JAX_WS)) {
- actionText.setEnabled(true);
- bodyText.setEnabled(true);
- methodCombo.setEnabled(false);
- parmsList.setEnabled(false);
- parmsList.removeAll();
- dlsList.setEnabled(false);
- parmsTab.getControl().setEnabled(false);
- headerTab.getControl().setEnabled(true);
- methodCombo.setText(POST);
-
- String emptySOAP = "<?xml version=\"1.0\" standalone=\"yes\" ?>" + //$NON-NLS-1$
- "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " + //$NON-NLS-1$
- "xmlns:ns=\"INSERT_URL_HERE\">" + //$NON-NLS-1$
- "<soap:Body>" + //$NON-NLS-1$
- "</soap:Body>" + //$NON-NLS-1$
- "</soap:Envelope>"; //$NON-NLS-1$
- emptySOAP = WSTestUtils.addNLsToXML(emptySOAP);
-
- if (bodyText.getText().trim().length() == 0) {
- bodyText.setText(emptySOAP);
- }
- wsdlButton.setEnabled(true);
- }
- else if (wsType.equalsIgnoreCase(JAX_RS)) {
- actionText.setEnabled(false);
- bodyText.setEnabled(true);
- methodCombo.setEnabled(true);
- parmsList.setEnabled(true);
- dlsList.setEnabled(true);
- parmsTab.getControl().setEnabled(true);
- headerTab.getControl().setEnabled(true);
- methodCombo.setText(GET);
- wsdlButton.setEnabled(false);
-
- if (bodyText.getText().trim().length() > 0) {
- bodyText.setText(""); //$NON-NLS-1$
- }
- }
- setMenusForCurrentState();
- }
-
- /*
- * Sets up the controls to call a public sample RESTful WS that does
- * a postal code lookup or a JAX-WS service that does a
- * Shakespeare lookup.
- */
- private void setupSample() {
- // go to http://www.geonames.org/export/web-services.html for example
- //http://ws.geonames.org/postalCodeSearch?postalcode=9011&maxRows=10
- if (wsTypeCombo.getText().equalsIgnoreCase(JAX_RS)) {
- urlCombo.setText("http://ws.geonames.org/postalCodeSearch?"); //$NON-NLS-1$
- parmsList.setSelection("postalcode=80920,maxRows=10"); //$NON-NLS-1$
- dlsList.setSelection("content-type=application/xml"); //$NON-NLS-1$
- methodCombo.setText(GET);
- tabGroup.setSelection(parmsTab);
- bodyText.setText(EMPTY_STRING);
- }
- else if (wsTypeCombo.getText().equalsIgnoreCase(JAX_WS)) {
- String soapIn = "<?xml version=\"1.0\" standalone=\"yes\" ?>" + //$NON-NLS-1$
- "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " + //$NON-NLS-1$
- "xmlns:ns=\"http://xmlme.com/WebServices\">" + //$NON-NLS-1$
- "<soap:Body>" + //$NON-NLS-1$
- "<ns:GetSpeech>" + //$NON-NLS-1$
- "<ns:Request>slings and arrows</ns:Request>"+ //$NON-NLS-1$
- "</ns:GetSpeech>"+ //$NON-NLS-1$
- "</soap:Body>" + //$NON-NLS-1$
- "</soap:Envelope>"; //$NON-NLS-1$
- soapIn = WSTestUtils.addNLsToXML(soapIn);
-
- urlCombo.setText("http://www.xmlme.com/WSShakespeare.asmx"); //$NON-NLS-1$
- actionText.setText("http://xmlme.com/WebServices/GetSpeech"); //$NON-NLS-1$
- bodyText.setText(soapIn);
- parmsList.setSelection(EMPTY_STRING);
- dlsList.setSelection(EMPTY_STRING);
- tabGroup.setSelection(bodyTab);
- }
- setControlsForWSType(wsTypeCombo.getText());
- setControlsForMethodType(methodCombo.getText());
- setControlsForSelectedURL();
- }
-
- /*
- * Actually perform the test based on which type of activity it is
- */
- private void handleTest(final String wsTech) {
-
- String urlText = urlCombo.getText();
- try {
- new URL(urlText);
- } catch (MalformedURLException mue) {
- // do nothing, but return since we don't have a working URL
- return;
- }
-
- if (urlCombo.getItemCount() > 0) {
- java.util.List<String> aList = Arrays.asList(urlCombo.getItems());
- if (!aList.contains(urlCombo.getText())) {
- urlCombo.add(urlCombo.getText());
- }
- } else {
- urlCombo.add(urlCombo.getText());
- }
-
- final String url = urlCombo.getText();
- final String action = actionText.getText();
- final String body = bodyText.getText();
- final String method = methodCombo.getText();
- final String headers = dlsList.getSelection();
- final String parms = parmsList.getSelection();
-
- Job aJob = new Job(JBossWSUIMessages.JAXRSWSTestView_Invoking_WS_Status) {
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- // execute the task ...
- if (wsTech.equalsIgnoreCase(JAX_RS)) {
- status = handleRSTest(monitor, url, method, body, parms, headers);
- }
- else if (wsTech.equalsIgnoreCase(JAX_WS)) {
- status = handleWSTest(monitor, url, action, body);
- }
- monitor.done();
- return status;
- }
- };
- // true to indicate that this job was initiated by a UI end user
- aJob.setUser(true);
- aJob.addJobChangeListener(new IJobChangeListener() {
-
- public void sleeping(IJobChangeEvent event) {};
- public void scheduled(IJobChangeEvent event) {};
- public void running(IJobChangeEvent event) {};
- public void done(final IJobChangeEvent event) {
- if (event.getResult() instanceof WSTestStatus) {
- final WSTestStatus status = (WSTestStatus) event.getResult();
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- public void run() {
- if (status.getResultsText() != null)
- resultsText.setText(status.getResultsText());
- else if (status.getMessage() != null)
- resultsText.setText(status.getMessage());
- resultHeadersList.removeAll();
- String[] headers =
- DelimitedStringList.parseString(status.getHeadersList(), RESULT_HEADER_DELIMITER);
- if (headers != null && headers.length > 0) {
- for (int i = 0; i < headers.length; i++) {
- resultHeadersList.add(headers[i]);
- }
- }
- }
- });
- }
- }
-
- public void awake(IJobChangeEvent event) {};
- public void aboutToRun(IJobChangeEvent event) {};
- });
- aJob.schedule();
-
- setMenusForCurrentState();
- }
-
- /*
- * Actually call the WS and displays the result
- */
- private IStatus handleWSTest(final IProgressMonitor monitor, String url, String action, String body) {
- try {
-
- envelope = null;
- soapbody = null;
- monitor.worked(10);
-// JAXWSTester tester = new JAXWSTester();
-// tester.doTest(url, action, body);
- JAXWSTester2 tester = new JAXWSTester2();
- boolean itRan = false;
- while (!monitor.isCanceled()) {
- try {
- if (!itRan && serviceNSMessage != null && serviceNSMessage.length == 3) {
- itRan = true;
- // call the service
- tester.doTest(monitor, url, action, serviceNSMessage[0], serviceNSMessage[1], serviceNSMessage[2], body);
- } else {
- break;
- }
- } catch (InterruptedException ie) {
- monitor.setCanceled(true);
- }
- }
- if (monitor.isCanceled()) {
- WSTestStatus status = new WSTestStatus(IStatus.OK,
- JBossWSUIPlugin.PLUGIN_ID,
- JBossWSUIMessages.JAXRSWSTestView_Message_Service_Invocation_Cancelled);
- return status;
- }
- if (!itRan) {
- WSTestStatus status = new WSTestStatus(IStatus.OK,
- JBossWSUIPlugin.PLUGIN_ID,
- JBossWSUIMessages.JAXRSWSTestView_Message_Unsuccessful_Test);
- return status;
- }
-// tester.doTest(url, action, serviceNSMessage[0], serviceNSMessage[1], serviceNSMessage[2], body);
- monitor.worked(70);
- String result = tester.getResultBody();
- envelope = tester.getResultSOAP();
- soapbody = tester.getResultSOAPBody();
- String cleanedUp = WSTestUtils.addNLsToXML(result);
-
- WSTestStatus status = new WSTestStatus(IStatus.OK,
- JBossWSUIPlugin.PLUGIN_ID,
- JBossWSUIMessages.JAXRSWSTestView_JAXWS_Success_Status);
- status.setResultsText(cleanedUp);
- monitor.worked(10);
-
- String listText = EMPTY_STRING;
- if (tester.getResultHeaders() != null) {
- Iterator<?> iter = tester.getResultHeaders().entrySet().iterator();
- while (iter.hasNext()) {
- String text = EMPTY_STRING;
- Entry<?, ?> entry = (Entry<?, ?>) iter.next();
- if (entry.getKey() == null)
- text = entry.getValue().toString();
- else
- text = text + entry.toString();
- listText = listText + text;
- if (iter.hasNext()) {
- listText = listText + RESULT_HEADER_DELIMITER;
- }
- }
- }
- status.setHeadersList(listText);
- monitor.worked(10);
- return status;
- } catch (Exception e) {
- WSTestStatus status = new WSTestStatus(IStatus.OK,
- JBossWSUIPlugin.PLUGIN_ID,
- JBossWSUIMessages.JAXRSWSTestView_Exception_Status + e.getLocalizedMessage());
- status.setResultsText(e.toString());
- JBossWSUIPlugin.log(e);
- return status;
- }
- }
-
- /*
- * Actually call the RESTful WS to test it
- */
- private IStatus handleRSTest(final IProgressMonitor monitor, String address, String method, String body, String parms, String headersStr) {
-
- if (method.equalsIgnoreCase(GET))
- body = EMPTY_STRING;
-
- // if no actual text in the request body, set to null
- if (body.trim().length() == 0) body = null;
-
- monitor.worked(10);
-
- // Process parameters for web service call
- HashMap<String, String> parameters = new HashMap<String, String>();
- if (parms != null && parms.length() > 0) {
- String[] parsedList = DelimitedStringList.parseString(parms , ","); //$NON-NLS-1$
- if (parsedList != null && parsedList.length > 0) {
- for (int i = 0; i < parsedList.length; i++) {
- String nameValuePair = parsedList[i];
- String[] nameAndValue = DelimitedStringList.parseString(nameValuePair, "="); //$NON-NLS-1$
- if (nameAndValue != null && nameAndValue.length == 2) {
- parameters.put(nameAndValue[0], nameAndValue[1]);
- }
- }
- }
- }
-
- monitor.worked(10);
- // Process headers for web service call
- HashMap<String, String> headers = new HashMap<String, String>();
- if (headersStr != null && headersStr.length() > 0) {
- String[] parsedList = DelimitedStringList.parseString(headersStr , ","); //$NON-NLS-1$
- if (parsedList != null && parsedList.length > 0) {
- for (int i = 0; i < parsedList.length; i++) {
- String nameValuePair = parsedList[i];
- String[] nameAndValue = DelimitedStringList.parseString(nameValuePair, "="); //$NON-NLS-1$
- if (nameAndValue != null && nameAndValue.length == 2) {
- headers.put(nameAndValue[0], nameAndValue[1]);
- }
- }
- }
- }
-
- JAXRSTester tester = new JAXRSTester();
-
- // now actually call it
- try {
-
- // call the service
- tester.doTest(address, parameters, headers, method, body);
-
- String result = tester.getResultBody();
-
- // put the results in the result text field
- String cleanedUp = WSTestUtils.addNLsToXML(result);
-
- WSTestStatus status = new WSTestStatus(IStatus.OK,
- JBossWSUIPlugin.PLUGIN_ID,
- JBossWSUIMessages.JAXRSWSTestView_JAXRS_Success_Status);
- status.setResultsText(cleanedUp);
-
- String listText = EMPTY_STRING;
- if (tester.getResultHeaders() != null) {
- Iterator<?> iter = tester.getResultHeaders().entrySet().iterator();
- while (iter.hasNext()) {
- String text = EMPTY_STRING;
- Entry<?, ?> entry = (Entry<?, ?>) iter.next();
- if (entry.getKey() == null)
- text = entry.getValue().toString();
- else
- text = text + entry.toString();
- listText = listText + text;
- if (iter.hasNext()) {
- listText = listText + RESULT_HEADER_DELIMITER;
- }
- }
- }
-
- status.setHeadersList(listText);
- monitor.worked(10);
- return status;
-
- } catch (Exception e) {
- String result = tester.getResultBody();
-
- // put the results in the result text field
- String cleanedUp = WSTestUtils.addNLsToXML(result);
-
- WSTestStatus status = new WSTestStatus(IStatus.OK,
- JBossWSUIPlugin.PLUGIN_ID,
- JBossWSUIMessages.JAXRSWSTestView_JAXRS_Success_Status);
- status.setResultsText(cleanedUp);
-
- String listText = EMPTY_STRING;
- if (tester.getResultHeaders() != null) {
- Iterator<?> iter = tester.getResultHeaders().entrySet().iterator();
- while (iter.hasNext()) {
- String text = EMPTY_STRING;
- Entry<?, ?> entry = (Entry<?, ?>) iter.next();
- if (entry.getKey() == null)
- text = entry.getValue().toString();
- else
- text = text + entry.toString();
- listText = listText + text;
- if (iter.hasNext()) {
- listText = listText + RESULT_HEADER_DELIMITER;
- }
- }
- }
-
- status.setHeadersList(listText);
- monitor.worked(10);
- return status;
- }
- }
-
- /**
- * Passing the focus request to the control.
- */
- public void setFocus() {
- // set initial focus to the URL text combo
- urlCombo.setFocus();
- }
-
-}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -109,6 +109,7 @@
import org.jboss.tools.ws.ui.utils.JAXWSTester2;
import org.jboss.tools.ws.ui.utils.ResultsXMLStorage;
import org.jboss.tools.ws.ui.utils.ResultsXMLStorageInput;
+import org.jboss.tools.ws.ui.utils.SchemaUtils;
import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
import org.jboss.tools.ws.ui.utils.WSTestUtils;
import org.w3c.dom.Element;
@@ -421,7 +422,6 @@
getCurrentHistoryEntry().setOperationName(null);
serviceNSMessage = null;
-// actionText = null;
Definition wsdlDef = wbDialog.getWSDLDefinition();
getCurrentHistoryEntry().setWsdlDef(wsdlDef);
@@ -432,7 +432,7 @@
getCurrentHistoryEntry().setUrl(wbDialog.getWSDLText());
urlCombo.setText(wbDialog.getWSDLText());
- String output = TesterWSDLUtils.getSampleSOAPInputMessage(wsdlDef,
+ String output = SchemaUtils.getSampleSOAPInputMessage(wsdlDef,
wbDialog.getServiceTextValue(),
wbDialog.getPortTextValue(),
wbDialog.getBindingValue(),
@@ -463,8 +463,14 @@
wbDialog.getServiceTextValue(),
wbDialog.getPortTextValue());
getCurrentHistoryEntry().setSOAP12(isSOAP12);
+
+ String headerText = SchemaUtils.getSampleSOAPMessageHeader(wsdlDef,
+ wbDialog.getServiceTextValue(),
+ wbDialog.getPortTextValue(),
+ wbDialog.getBindingValue(),
+ wbDialog.getOperationTextValue());
- String soapIn = generateSampleSOAP(output, isSOAP12);
+ String soapIn = generateSampleSOAP(headerText, output, isSOAP12);
if (opName != null) {
if (bodyText.getText().length() > 0) {
@@ -487,15 +493,6 @@
}
}
}
-// if (MessageDialog.openQuestion(getSite().getShell(),
-// JBossWSUIMessages.JAXRSWSTestView2_Title_Msg_May_Be_Out_of_Date,
-// JBossWSUIMessages.JAXRSWSTestView2_Text_Msg_May_Be_Out_of_Date)) {
-//
-// bodyText.setText(soapIn);
-// getCurrentHistoryEntry().setBody(soapIn);
-// getCurrentHistoryEntry().setAction(actionURL);
-//
-// }
} else if (bodyText.getText().length() > 0) {
String opNameInBody = getOpNameFromRequestBody();
@@ -520,9 +517,6 @@
}
}
-// urlCombo.setText(endpointURL);
-// actionText = actionURL;
-
setControlsForWSType(getCurrentTestType());
setControlsForMethodType(methodCombo.getText());
setControlsForSelectedURL();
@@ -984,25 +978,40 @@
super.dispose();
}
- private String generateSampleSOAP ( String innerText, boolean isSOAP12 ) {
+ private String generateSampleSOAP ( String headerText, String innerText, boolean isSOAP12 ) {
String prefix = TesterWSDLUtils.SOAP_PREFIX;
String soapURI = TesterWSDLUtils.SOAP_NS_URI;
if (isSOAP12) {
prefix = TesterWSDLUtils.SOAP12_PREFIX;
soapURI = TesterWSDLUtils.SOAP12_ENVELOPE_NS_URI;
}
- String soapIn = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n" + //$NON-NLS-1$
- "<" + prefix + ":Envelope xmlns:" + prefix + "=\"" + soapURI + "\" " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + //$NON-NLS-1$
- "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " + //$NON-NLS-1$
- ">\n" + //$NON-NLS-1$
- "<" + prefix + ":Body>\n";//$NON-NLS-1$ //$NON-NLS-2$
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n");//$NON-NLS-1$
+ buffer.append("<" + prefix + ":Envelope xmlns:" + prefix + "=\"" + soapURI + "\" ");//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ buffer.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " );//$NON-NLS-1$
+ buffer.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >\n");//$NON-NLS-1$
+ buffer.append("<" + prefix + ":Header>\n");//$NON-NLS-1$ //$NON-NLS-2$
+ if (headerText != null)
+ buffer.append(headerText);
+ buffer.append("</" + prefix + ":Header>\n");;//$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("<" + prefix + ":Body>\n");//$NON-NLS-1$ //$NON-NLS-2$
if (innerText != null)
- soapIn = soapIn + innerText;
- soapIn = soapIn +
- "</" + prefix + ":Body>\n" + //$NON-NLS-1$ //$NON-NLS-2$
- "</" + prefix + ":Envelope>"; //$NON-NLS-1$ //$NON-NLS-2$
- return soapIn;
+ buffer.append(innerText);
+ buffer.append("</" + prefix + ":Body>\n");;//$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("</" + prefix + ":Envelope>");//$NON-NLS-1$ //$NON-NLS-2$
+
+// String soapIn = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n" + //$NON-NLS-1$
+// "<" + prefix + ":Envelope xmlns:" + prefix + "=\"" + soapURI + "\" " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+// "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + //$NON-NLS-1$
+// "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " + //$NON-NLS-1$
+// ">\n" + //$NON-NLS-1$
+// "<" + prefix + ":Body>\n";//$NON-NLS-1$ //$NON-NLS-2$
+// if (innerText != null)
+// soapIn = soapIn + innerText;
+// soapIn = soapIn +
+// "</" + prefix + ":Body>\n" + //$NON-NLS-1$ //$NON-NLS-2$
+// "</" + prefix + ":Envelope>"; //$NON-NLS-1$ //$NON-NLS-2$
+ return buffer.toString();
}
private void setMenusForCurrentState() {
@@ -1087,7 +1096,7 @@
dlsList.setEnabled(false);
String emptySOAP =
- generateSampleSOAP(null, false);
+ generateSampleSOAP(null, null, false);
emptySOAP = WSTestUtils.addNLsToXML(emptySOAP);
if (bodyText.getText().trim().length() == 0) {
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -24,7 +24,6 @@
private String portName;
private String bindingName;
private String operationName;
-// private String wsMethod;
private Definition wsdlDef = null;
private String[] serviceNSMessage = null;
private boolean isSOAP12 = false;
@@ -126,14 +125,6 @@
this.operationName = operationName;
}
-// public void setWsMethod(String wsMethod) {
-// this.wsMethod = wsMethod;
-// }
-//
-// public String getWsMethod() {
-// return wsMethod;
-// }
-
public void setWsdlDef(Definition wsdlDef) {
this.wsdlDef = wsdlDef;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java 2011-05-10 16:55:18 UTC (rev 31191)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java 2011-05-10 17:05:54 UTC (rev 31192)
@@ -173,21 +173,25 @@
* @param arg0
*/
private void validateLocation ( ModifyEvent arg0 ) {
- this.getContents().getDisplay().asyncExec( new Runnable() {
- public void run() {
- setMessage(JBossWSUIMessages.WSDLBrowseDialog_Message);
- IStatus status = validate(false);
- if (status != Status.OK_STATUS) {
- setMessage(status.getMessage(), IMessageProvider.WARNING);
- if (showServicePortOperaton)
- setGroupEnabled(false);
- } else {
- setMessage(JBossWSUIMessages.WSDLBrowseDialog_Message);
- if (showServicePortOperaton)
- setGroupEnabled(true);
- }
+ if (this.getContents() != null) {
+ if (this.getContents().getDisplay() != null) {
+ this.getContents().getDisplay().asyncExec( new Runnable() {
+ public void run() {
+ setMessage(JBossWSUIMessages.WSDLBrowseDialog_Message);
+ IStatus status = validate(false);
+ if (status != Status.OK_STATUS) {
+ setMessage(status.getMessage(), IMessageProvider.WARNING);
+ if (showServicePortOperaton)
+ setGroupEnabled(false);
+ } else {
+ setMessage(JBossWSUIMessages.WSDLBrowseDialog_Message);
+ if (showServicePortOperaton)
+ setGroupEnabled(true);
+ }
+ }
+ });
}
- });
+ }
}
@Override
13 years, 5 months