teiid SVN: r2209 - sqlquerywebservice.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-06-08 17:28:18 -0400 (Tue, 08 Jun 2010)
New Revision: 2209
Removed:
sqlquerywebservice/.project
sqlquerywebservice/target/
Log:
Deleted: sqlquerywebservice/.project
===================================================================
--- sqlquerywebservice/.project 2010-06-08 21:26:55 UTC (rev 2208)
+++ sqlquerywebservice/.project 2010-06-08 21:28:18 UTC (rev 2209)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>soap</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
14 years, 6 months
teiid SVN: r2208 - in sqlquerywebservice: src and 55 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-06-08 17:26:55 -0400 (Tue, 08 Jun 2010)
New Revision: 2208
Added:
sqlquerywebservice/.project
sqlquerywebservice/pom.xml
sqlquerywebservice/src/
sqlquerywebservice/src/main/
sqlquerywebservice/src/main/java/
sqlquerywebservice/src/main/java/org/
sqlquerywebservice/src/main/java/org/teiid/
sqlquerywebservice/src/main/java/org/teiid/dqp/
sqlquerywebservice/src/main/java/org/teiid/dqp/client/
sqlquerywebservice/src/main/java/org/teiid/dqp/client/impl/
sqlquerywebservice/src/main/java/org/teiid/dqp/client/impl/ServerRequest.java
sqlquerywebservice/src/main/java/org/teiid/soap/
sqlquerywebservice/src/main/java/org/teiid/soap/SOAPPlugin.java
sqlquerywebservice/src/main/java/org/teiid/soap/security/
sqlquerywebservice/src/main/java/org/teiid/soap/security/Credential.java
sqlquerywebservice/src/main/java/org/teiid/soap/service/
sqlquerywebservice/src/main/java/org/teiid/soap/service/BasicConnectionPoolFactory.java
sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionPoolFactory.java
sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionSource.java
sqlquerywebservice/src/main/java/org/teiid/soap/service/PoolingConnectionSource.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/handler/
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/handler/PWCBHandler.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Cell.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ColumnMetadata.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Connection.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionContextualRequest.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionlessRequest.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/CursorType.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Data.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/LogInParameters.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Property.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestId.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestInfo.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestType.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Results.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ResultsRequest.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Row.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlQueryWebServiceFault.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlWarning.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/TransactionAutoWrapType.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/log/
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/log/LogUtil.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebService.java
sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebServiceFault.java
sqlquerywebservice/src/main/java/org/teiid/soap/util/
sqlquerywebservice/src/main/java/org/teiid/soap/util/ErrorMessageKeys.java
sqlquerywebservice/src/main/java/org/teiid/soap/util/SOAPConstants.java
sqlquerywebservice/src/main/java/org/teiid/soap/util/ServletClientConstants.java
sqlquerywebservice/src/main/java/org/teiid/soap/util/WebServiceUtil.java
sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslationException.java
sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslator.java
sqlquerywebservice/src/main/resources/
sqlquerywebservice/src/main/resources/com/
sqlquerywebservice/src/main/resources/com/teiid/
sqlquerywebservice/src/main/resources/com/teiid/soap/
sqlquerywebservice/src/main/resources/com/teiid/soap/i18n.properties
sqlquerywebservice/src/main/webapp/
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorData.class
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorFilter.class
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorPage.class
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorTableModel.class
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorTextArea.class
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$ServiceFilterPanel.class
sqlquerywebservice/src/main/webapp/SOAPMonitorApplet.class
sqlquerywebservice/src/main/webapp/WEB-INF/
sqlquerywebservice/src/main/webapp/WEB-INF/classes/
sqlquerywebservice/src/main/webapp/WEB-INF/classes/commons-logging.properties
sqlquerywebservice/src/main/webapp/WEB-INF/classes/log4j.properties
sqlquerywebservice/src/main/webapp/WEB-INF/conf/
sqlquerywebservice/src/main/webapp/WEB-INF/conf/axis2.xml
sqlquerywebservice/src/main/webapp/WEB-INF/lib/
sqlquerywebservice/src/main/webapp/WEB-INF/lib/soapmonitor-1.3.jar
sqlquerywebservice/src/main/webapp/WEB-INF/modules/
sqlquerywebservice/src/main/webapp/WEB-INF/modules/addressing-1.3.mar
sqlquerywebservice/src/main/webapp/WEB-INF/modules/modules.list
sqlquerywebservice/src/main/webapp/WEB-INF/modules/rahas-1.3.mar
sqlquerywebservice/src/main/webapp/WEB-INF/modules/rampart-1.3.mar
sqlquerywebservice/src/main/webapp/WEB-INF/modules/soapmonitor-1.3.mar
sqlquerywebservice/src/main/webapp/WEB-INF/org/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/handlers/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/handlers/soapmonitor/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorConstants.class
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService$ConnectionThread.class
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService$ServerSocketThread.class
sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService.class
sqlquerywebservice/src/main/webapp/WEB-INF/services/
sqlquerywebservice/src/main/webapp/WEB-INF/services/SqlQueryWebService.aar
sqlquerywebservice/src/main/webapp/WEB-INF/services/service.aar
sqlquerywebservice/src/main/webapp/WEB-INF/services/services.list
sqlquerywebservice/src/main/webapp/WEB-INF/services/version.aar
sqlquerywebservice/src/main/webapp/WEB-INF/web.xml
sqlquerywebservice/src/main/webapp/WEB-INF/weblogic.xml
sqlquerywebservice/src/main/webapp/axis2-web/
sqlquerywebservice/src/main/webapp/axis2-web/ActivateService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/EngageToServiceGroup.jsp
sqlquerywebservice/src/main/webapp/axis2-web/Error/
sqlquerywebservice/src/main/webapp/axis2-web/Error/AuthError.html
sqlquerywebservice/src/main/webapp/axis2-web/Error/GenError.html
sqlquerywebservice/src/main/webapp/axis2-web/Error/error404.jsp
sqlquerywebservice/src/main/webapp/axis2-web/Error/error500.jsp
sqlquerywebservice/src/main/webapp/axis2-web/HappyAxis.jsp
sqlquerywebservice/src/main/webapp/axis2-web/InActivateService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/LeftFrame.jsp
sqlquerywebservice/src/main/webapp/axis2-web/ListServiceGroup.jsp
sqlquerywebservice/src/main/webapp/axis2-web/Login.jsp
sqlquerywebservice/src/main/webapp/axis2-web/MainFrame.jsp
sqlquerywebservice/src/main/webapp/axis2-web/SelectService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/ServiceParaEdit.jsp
sqlquerywebservice/src/main/webapp/axis2-web/TopFrame.jsp
sqlquerywebservice/src/main/webapp/axis2-web/ViewContexts.jsp
sqlquerywebservice/src/main/webapp/axis2-web/ViewGlobalHandlers.jsp
sqlquerywebservice/src/main/webapp/axis2-web/ViewServiceHandlers.jsp
sqlquerywebservice/src/main/webapp/axis2-web/admin.jsp
sqlquerywebservice/src/main/webapp/axis2-web/css/
sqlquerywebservice/src/main/webapp/axis2-web/css/axis-style.css
sqlquerywebservice/src/main/webapp/axis2-web/disengage.jsp
sqlquerywebservice/src/main/webapp/axis2-web/engagingglobally.jsp
sqlquerywebservice/src/main/webapp/axis2-web/engagingtoanoperation.jsp
sqlquerywebservice/src/main/webapp/axis2-web/engagingtoaservice.jsp
sqlquerywebservice/src/main/webapp/axis2-web/error.jsp
sqlquerywebservice/src/main/webapp/axis2-web/errorModule.jsp
sqlquerywebservice/src/main/webapp/axis2-web/globalModules.jsp
sqlquerywebservice/src/main/webapp/axis2-web/images/
sqlquerywebservice/src/main/webapp/axis2-web/images/asf-logo.gif
sqlquerywebservice/src/main/webapp/axis2-web/images/axis.gif
sqlquerywebservice/src/main/webapp/axis2-web/images/axis.jpg
sqlquerywebservice/src/main/webapp/axis2-web/images/axis_l.jpg
sqlquerywebservice/src/main/webapp/axis2-web/include/
sqlquerywebservice/src/main/webapp/axis2-web/include/adminfooter.inc
sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.inc
sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.jsp
sqlquerywebservice/src/main/webapp/axis2-web/include/footer.inc
sqlquerywebservice/src/main/webapp/axis2-web/include/header.inc
sqlquerywebservice/src/main/webapp/axis2-web/include/httpbase.jsp
sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.inc
sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.jsp
sqlquerywebservice/src/main/webapp/axis2-web/index.jsp
sqlquerywebservice/src/main/webapp/axis2-web/listFaultyService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/listGroupService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/listModules.jsp
sqlquerywebservice/src/main/webapp/axis2-web/listService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/listServices.jsp
sqlquerywebservice/src/main/webapp/axis2-web/listSingleService.jsp
sqlquerywebservice/src/main/webapp/axis2-web/upload.jsp
sqlquerywebservice/src/main/webapp/axis2-web/viewServiceContext.jsp
sqlquerywebservice/src/main/webapp/axis2-web/viewServiceGroupContext.jsp
sqlquerywebservice/src/main/webapp/axis2-web/viewphases.jsp
sqlquerywebservice/src/main/webapp/images/
sqlquerywebservice/src/main/webapp/images/mmlogo.gif
sqlquerywebservice/src/main/webapp/index.jsp
sqlquerywebservice/src/main/webapp/wsdlurlframe.htm
sqlquerywebservice/src/main/webapp/wsdlurlgen.jsp
sqlquerywebservice/src/main/webapp/wsdlurls.jsp
sqlquerywebservice/src/main/wsdl/
sqlquerywebservice/src/main/wsdl/SqlQueryWebService.wsdl
sqlquerywebservice/src/test/
sqlquerywebservice/src/test/java/
sqlquerywebservice/src/test/java/org/
sqlquerywebservice/src/test/java/org/metamatrix/
sqlquerywebservice/src/test/java/org/metamatrix/soap/
sqlquerywebservice/src/test/java/org/metamatrix/soap/handler/
sqlquerywebservice/src/test/java/org/metamatrix/soap/handler/TestActionUpdateHandler.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/service/
sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestBasicConnectionPoolFactory.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestDataServiceWebServiceImpl.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestPoolingConnectionSource.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/
sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetVDBResourceServlet.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetWSDLServlet.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/sqlquerywebservice/
sqlquerywebservice/src/test/java/org/metamatrix/soap/sqlquerywebservice/TestSqlQueryWebService.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/util/
sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestEndpointUrlTranslatorStrategyImpl.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWSDLServletUtil.java
sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWebServiceUtil.java
sqlquerywebservice/src/test/resources/
sqlquerywebservice/target/
sqlquerywebservice/target/classes/
sqlquerywebservice/target/classes/com/
sqlquerywebservice/target/classes/com/teiid/
sqlquerywebservice/target/classes/com/teiid/soap/
sqlquerywebservice/target/classes/com/teiid/soap/i18n.properties
Log:
Adding SqlQueryWebService code
Added: sqlquerywebservice/.project
===================================================================
--- sqlquerywebservice/.project (rev 0)
+++ sqlquerywebservice/.project 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>soap</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Added: sqlquerywebservice/pom.xml
===================================================================
--- sqlquerywebservice/pom.xml (rev 0)
+++ sqlquerywebservice/pom.xml 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-soap</artifactId>
+ <packaging>war</packaging>
+ <name>SOAP</name>
+ <description>SOAP interface for web services.</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client-jdbc</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>beanshell</groupId>
+ <artifactId>bsh</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon-dom</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>antlr</groupId>
+ <artifactId>stringtemplate</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ <version>1.3</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- axis 2 (1.3) dependencies -->
+
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-kernel</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.rampart</groupId>
+ <artifactId>rampart-core</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xbean</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-mtompolicy</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-xmlbeans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sandesha2</groupId>
+ <artifactId>sandesha2-core</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-mtompolicy</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sandesha2</groupId>
+ <artifactId>sandesha2-policy</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-mtompolicy</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sandesha2</groupId>
+ <artifactId>sandesha2-client-constants</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-mtompolicy</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sandesha2</groupId>
+ <artifactId>sandesha2-rampart-integration</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-mtompolicy</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-adapters</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-java2wsdl</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: sqlquerywebservice/src/main/java/org/teiid/dqp/client/impl/ServerRequest.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/dqp/client/impl/ServerRequest.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/dqp/client/impl/ServerRequest.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,241 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.dqp.client.impl;
+
+import java.io.Serializable;
+import java.sql.ResultSet;
+
+
+/**
+ * @since 4.2
+ */
+public class ServerRequest {
+
+ public static final int REQUEST_TYPE_STATEMENT = 0;
+ public static final int REQUEST_TYPE_PREPARED_STATEMENT = 1;
+ public static final int REQUEST_TYPE_CALLABLE_STATEMENT = 2;
+
+ public static final int AUTOWRAP_OFF = 0;
+ public static final int AUTOWRAP_ON = 1;
+ public static final int AUTOWRAP_OPTIMISTIC = 2;
+ public static final int AUTOWRAP_PESSIMISTIC = 3;
+
+ private String sql;
+ private int requestType = REQUEST_TYPE_STATEMENT;
+ private Object[] bindParameters;
+ private int cursorType = ResultSet.TYPE_FORWARD_ONLY;
+ private int fetchSize;
+ private boolean partialResults;
+ private boolean xmlValidationMode;
+ private String xmlFormat;
+ private String xmlStyleSheet;
+ private int transactionAutoWrapMode = AUTOWRAP_OFF;
+ private boolean useResultSetCache;
+ private Serializable commandPayload;
+
+ public String getSql() {
+ return sql;
+ }
+ /**
+ * @since 4.2
+ */
+ public void setSql(String sql) {
+ this.sql = sql;
+ }
+
+ public int getRequestType() {
+ return requestType;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setRequestType(int type) {
+ this.requestType = type;
+ }
+
+ public Object[] getBindParameters() {
+ return bindParameters;
+ }
+ /**
+ * @since 4.2
+ */
+ public void setBindParameters(Object[] params) {
+ this.bindParameters = params;
+ }
+
+ public int getCursorType() {
+ return cursorType;
+ }
+ /**
+ * @since 4.2
+ */
+ public void setCursorType(int type) {
+ this.cursorType = type;
+ }
+
+ public int getFetchSize() {
+ return fetchSize;
+ }
+ /**
+ * @since 4.2
+ */
+ public void setFetchSize(int size) {
+ this.fetchSize = size;
+ }
+
+ public boolean getPartialResults() {
+ return partialResults;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setPartialResults(boolean flag) {
+ this.partialResults = flag;
+ }
+
+ public boolean getXMLValidationMode() {
+ return xmlValidationMode;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setXMLValidationMode(boolean flag) {
+ this.xmlValidationMode = flag;
+ }
+
+ public String getXMLFormat() {
+ return xmlFormat;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setXMLFormat(String format) {
+ this.xmlFormat = format;
+ }
+
+ public String getXMLStyleSheet() {
+ return xmlStyleSheet;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setXMLStyleSheet(String styleSheet) {
+ this.xmlStyleSheet = styleSheet;
+ }
+
+ public int getTransactionAutoWrapMode() {
+ return transactionAutoWrapMode;
+ }
+ /**
+ * @since 4.2
+ */
+ public void setTransactionAutoWrapMode(int autoWrapMode) {
+ this.transactionAutoWrapMode = autoWrapMode;
+ }
+
+ public boolean getUseResultSetCache() {
+ return useResultSetCache;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setUseResultSetCache(boolean flag) {
+ this.useResultSetCache = flag;
+ }
+
+ Serializable getCommandPayload() {
+ return commandPayload;
+ }
+
+ /**
+ * @since 4.2
+ */
+ public void setCommandPayload(Serializable payload) {
+ this.commandPayload = payload;
+ }
+
+// String getPortableString() {
+// StringBuffer buf = new StringBuffer("ServerRequest:")
+// .append("sql").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(sql)).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("requestType").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Integer.toString(requestType))).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("cursorType").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Integer.toString(cursorType))).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("fetchSize").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Integer.toString(fetchSize))).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("partialResults").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Boolean.toString(partialResults))).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("xmlValidationMode").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Boolean.toString(xmlValidationMode))).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("transactionAutoWrapMode").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Integer.toString(transactionAutoWrapMode))).append(PortableStringUtil.PROP_SEPARATOR)
+// .append("useResultSetCache").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(Boolean.toString(useResultSetCache)));
+// if (xmlFormat != null) {
+// buf.append(PortableStringUtil.PROP_SEPARATOR).append("xmlFormat").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(xmlFormat));
+// }
+// if (xmlStyleSheet != null) {
+// buf.append(PortableStringUtil.PROP_SEPARATOR).append("xmlStyleSheet").append(PortableStringUtil.EQUALS).append(PortableStringUtil.escapeString(xmlStyleSheet));
+// }
+// if (commandPayload != null) {
+// buf.append(PortableStringUtil.PROP_SEPARATOR).append("commandPayload").append(PortableStringUtil.EQUALS).append(PortableStringUtil.encode(commandPayload));
+// }
+// if (bindParameters != null) {
+// buf.append(PortableStringUtil.PROP_SEPARATOR).append("bindParameters").append(PortableStringUtil.EQUALS).append(PortableStringUtil.encode(bindParameters));
+// }
+// return buf.toString();
+// }
+//
+// static ServerRequest createServerRequestFromPortableString(String portableString) throws MetaMatrixProcessingException {
+// String[] parts = PortableStringUtil.getParts(portableString, PortableStringUtil.PROP_SEPARATOR);
+// if (parts == null || parts.length < 8 || parts.length > 12 || !parts[0].startsWith(HEADER)) {
+// throw new MetaMatrixProcessingException("");
+// }
+// parts[0] = parts[0].substring(HEADER.length());
+//
+// ServerRequest request = new ServerRequest();
+// request.sql = PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[0], PortableStringUtil.EQUALS)[1]);
+// request.requestType = Integer.parseInt(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[1], PortableStringUtil.EQUALS)[1]));
+// request.cursorType = Integer.parseInt(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[2], PortableStringUtil.EQUALS)[1]));
+// request.fetchSize = Integer.parseInt(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[3], PortableStringUtil.EQUALS)[1]));
+// request.partialResults = Boolean.valueOf(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[4], PortableStringUtil.EQUALS)[1])).booleanValue();
+// request.xmlValidationMode = Boolean.valueOf(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[5], PortableStringUtil.EQUALS)[1])).booleanValue();
+// request.transactionAutoWrapMode = Integer.parseInt(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[6], PortableStringUtil.EQUALS)[1]));
+// request.useResultSetCache = Boolean.valueOf(PortableStringUtil.unescapeString(PortableStringUtil.getParts(parts[7], PortableStringUtil.EQUALS)[1])).booleanValue();
+//
+// for (int i = 8; i < parts.length; i++) {
+// String[] propValPair = PortableStringUtil.getParts(parts[i], PortableStringUtil.EQUALS);
+// if (propValPair[0].equals("xmlFormat")) {
+// request.xmlFormat = PortableStringUtil.unescapeString(propValPair[1]);
+// } else if (propValPair[0].equals("xmlStyleSheet")) {
+// request.xmlStyleSheet = PortableStringUtil.unescapeString(propValPair[1]);
+// } else if (propValPair[0].equals("commandPayload")) {
+// request.commandPayload = (Serializable)PortableStringUtil.decode(propValPair[1]);
+// } else if (propValPair[0].equals("bindParameters")) {
+// request.bindParameters = (Object[])PortableStringUtil.decode(propValPair[1]);
+// }
+// }
+//
+// return request;
+// }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/SOAPPlugin.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/SOAPPlugin.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/SOAPPlugin.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap;
+
+import java.util.ResourceBundle;
+
+import org.teiid.core.BundleUtil;
+
+
+public class SOAPPlugin {
+ private static final String PLUGIN_ID = "org.teiid.soap" ; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = PLUGIN_ID + ".i18n"; //$NON-NLS-1$
+ public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,BUNDLE_NAME,ResourceBundle.getBundle(BUNDLE_NAME));
+
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/security/Credential.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/security/Credential.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/security/Credential.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.security;
+
+import com.metamatrix.core.util.StringUtil;
+
+public class Credential {
+
+ private String userName = StringUtil.Constants.EMPTY_STRING;
+ private byte[] password = StringUtil.Constants.EMPTY_STRING.getBytes();
+
+ public Credential(String name, byte[] password) {
+ this.password = password;
+ this.userName = name;
+ }
+
+ public byte[] getPassword() {
+ return password;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/service/BasicConnectionPoolFactory.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/service/BasicConnectionPoolFactory.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/service/BasicConnectionPoolFactory.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import com.metamatrix.common.jdbc.JDBCUtil;
+import com.metamatrix.common.jdbc.SimplePooledConnectionSource;
+
+/**
+ * This is the basic implementation of the ConnectionPoolFactory interface.
+ *
+ * @since 4.3
+ */
+public class BasicConnectionPoolFactory implements
+ ConnectionPoolFactory {
+
+ /*
+ * This is the set of default properties that are used to drive the way that the pools produced by this factory behaves.
+ */
+ private static final Properties defaultProperties = new Properties();
+ public static final String MMPOOL_PROPERTIES_FILENAME = "/teiidpool.properties"; //$NON-NLS-1$
+
+ static {
+ /*
+ * check for system property overrides and if none exist, use the defaults.
+ */
+ defaultProperties.setProperty(INITIAL_POOL_SIZE_PROPERTY_KEY, String.valueOf(INITIAL_POOL_SIZE_PROPERTY_DEFAULT));
+ defaultProperties.setProperty(MAX_ACTIVE_CONNECTIONS_PROPERTY_KEY, String.valueOf(MAX_ACTIVE_CONNECTIONS_DEFAULT));
+ defaultProperties.setProperty(MAX_IDLE_CONNECTIONS_PROPERTY_KEY, String.valueOf(MAX_IDLE_CONNECTIONS_DEFAULT));
+ defaultProperties.setProperty(MAX_WAIT_PROPERTY_KEY, String.valueOf(MAX_WAIT_PROPERTY_DEFAULT));
+ defaultProperties.setProperty(MIN_IDLE_COUNT_PROPERTY_KEY, String.valueOf(MIN_IDLE_COUNT_PROPERTY_DEFAULT));
+ defaultProperties.setProperty(MIN_EVICTABLE_IDLE_TIME_MILLIS_KEY, String.valueOf(MIN_EVICTABLE_IDLE_TIME_MILLIS_DEFAULT));
+ defaultProperties.setProperty(TIME_BETWEEN_EVICTION_THREAD_RUNS_KEY,
+ String.valueOf(TIME_BETWEEN_EVICTION_THREAD_RUNS_DEFAULT));
+ defaultProperties.setProperty(TIME_BETWEEN_EVICTION_THREAD_RUNS_KEY,
+ String.valueOf(TIME_BETWEEN_EVICTION_THREAD_RUNS_DEFAULT));
+ defaultProperties.setProperty(ConnectionSource.DRIVER_CLASS, "com.metamatrix.jdbc.MMDriver"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see com.metamatrix.soap.service.ConnectionPoolFactory#createConnectionPool(java.util.Properties)
+ * @since 4.3
+ */
+ public DataSource createConnectionPool(final Properties poolProperties) {
+ if (poolProperties == null) {
+ return null;
+ }
+ Properties p = new Properties(poolProperties);
+ /* 1. 'mergedProperties' will contain the available properties, constructed in the correct sequence
+ * so that propery values that should override other values, will override them.
+ * 2. 'mergedProperties' must be recreated from scratch every time 'createConnectionPool' is called.
+ */
+ Properties mergedProperties = createMergedProperties( poolProperties );
+
+ p.setProperty(JDBCUtil.DRIVER, mergedProperties.getProperty(ConnectionSource.DRIVER_CLASS));
+ p.setProperty(JDBCUtil.USERNAME, mergedProperties.getProperty(ConnectionSource.USERNAME));
+ p.setProperty(JDBCUtil.PASSWORD, mergedProperties.getProperty(ConnectionSource.PASSWORD));
+ p.setProperty(JDBCUtil.DATABASE, poolProperties.getProperty(ConnectionSource.SERVER_URL));
+ p.setProperty(SimplePooledConnectionSource.MAXIMUM_RESOURCE_POOL_SIZE, mergedProperties.getProperty(MAX_ACTIVE_CONNECTIONS_PROPERTY_KEY));
+ p.setProperty(SimplePooledConnectionSource.WAIT_TIME_FOR_RESOURCE, mergedProperties.getProperty(MAX_WAIT_PROPERTY_KEY));
+ return new SimplePooledConnectionSource(p);
+ }
+
+ protected static Properties createMergedProperties( Properties poolProperties ) {
+
+ // 1. start with the default properties
+ Properties mergedProperties = new Properties( defaultProperties );
+
+ // 2. add properties from mmpool.properties
+ mergedProperties.putAll( getMMPoolProperties() );
+
+ // 3. add System.properties
+ mergedProperties.putAll(System.getProperties());
+
+ // 4. add specific poolProperties
+ mergedProperties.putAll( poolProperties );
+
+ return mergedProperties;
+ }
+
+ protected static Properties getMMPoolProperties() {
+ Properties p = new Properties();
+
+ InputStream is = BasicConnectionPoolFactory.class.getClassLoader().getResourceAsStream( MMPOOL_PROPERTIES_FILENAME ); //$NON-NLS-1$
+
+ if ( is != null ) {
+ try {
+ p.load( is );
+ } catch( IOException ioe ) {
+ return new Properties();
+ }
+ }
+
+ return p;
+ }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionPoolFactory.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionPoolFactory.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionPoolFactory.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+/**
+ * This interface defined the constants and methods used to create connection pools.
+ *
+ * @since 4.3
+ */
+public interface ConnectionPoolFactory {
+
+ /**
+ * This property defines how many connections will be created when the pool is instantiated.
+ */
+ public static final String INITIAL_POOL_SIZE_PROPERTY_KEY = "com.metamatrix.soap.service.initpoolsize"; //$NON-NLS-1$
+
+ /**
+ * The value for this property defines the maximum number of connections that can be available in the pool at any one time.
+ */
+ public static final String MAX_ACTIVE_CONNECTIONS_PROPERTY_KEY = "com.metamatrix.soap.service.maxactiveconnections";//$NON-NLS-1$
+
+ /**
+ * This value for this property defines the maximum number of connections that are idle in the pool at one time.
+ */
+ public static final String MAX_IDLE_CONNECTIONS_PROPERTY_KEY = "com.metamatrix.soap.service.maxidleconnections";//$NON-NLS-1$
+
+ /**
+ * The value for this property defines the maximum amount of time to block a client that requests a connection from the pool.
+ * An Exception will be throw to the client if this amount of time is exceeded.
+ */
+ public static final String MAX_WAIT_PROPERTY_KEY = "com.metamatrix.soap.service.maxwait";//$NON-NLS-1$
+
+ /**
+ * The value for this property defines the minimum number of idle connections that will be available in the pool at any time.
+ */
+ public static final String MIN_IDLE_COUNT_PROPERTY_KEY = "com.metamatrix.soap.service.minidlecount"; //$NON-NLS-1$
+
+ /**
+ * The value for this property defines the amount of time a connection can be idle in the pool before being 'destroyed'.
+ */
+ public static final String MIN_EVICTABLE_IDLE_TIME_MILLIS_KEY = "com.metamatrix.soap.service.minevictableidletime"; //$NON-NLS-1$
+
+ /**
+ * The value for this property defines the amount of time between checks for connections that have exceeded the
+ * MIN_EVICTABLE_IDLE_TIME.
+ */
+ public static final String TIME_BETWEEN_EVICTION_THREAD_RUNS_KEY = "com.metamatrix.soap.service.timebetweenevictionthreadruns"; //$NON-NLS-1$
+
+ /*
+ * These are the DBCP pool property defaults we will use for all pools created by this factory instance. These properties can
+ * be overridden by setting them as JVM properties. property keys are located in the interface of this class
+ * ConnectionPoolFactory.
+ */
+ public static final int INITIAL_POOL_SIZE_PROPERTY_DEFAULT = 1;
+ public static final int MAX_ACTIVE_CONNECTIONS_DEFAULT = 25;
+ public static final int MAX_IDLE_CONNECTIONS_DEFAULT = 10;
+ public static final int MAX_WAIT_PROPERTY_DEFAULT = 30000;
+ public static final int MIN_IDLE_COUNT_PROPERTY_DEFAULT = 0;
+ public static final int MIN_EVICTABLE_IDLE_TIME_MILLIS_DEFAULT = 600000;
+ public static final int TIME_BETWEEN_EVICTION_THREAD_RUNS_DEFAULT = 60000;
+
+ public DataSource createConnectionPool(Properties connectionProperties);
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionSource.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionSource.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/service/ConnectionSource.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Properties;
+
+/**
+ * This is the interface that the Data Service feature uses to get Connections.
+ */
+public interface ConnectionSource {
+
+ /*
+ * These property keys are intended to be used to denote property values in the Properties object passed to the getConnection ()
+ * method of this interface.
+ */
+
+ /**
+ * This is a key that is used for the JDBC Connection URL for an MM Server.
+ */
+ public static final String SERVER_URL = "ServerURL"; //$NON-NLS-1$
+
+ /**
+ * This is a property key that is used for the username used to connect to an MM Server.
+ */
+ public static final String USERNAME = "Username"; //$NON-NLS-1$
+
+ /**
+ * This is a property key that is used for the password used to connect to an MM Server.
+ */
+ public static final String PASSWORD = "Password"; //$NON-NLS-1$
+
+ /**
+ * This is a property key that is used for the driver class used to connect to an MM Server.
+ */
+ public static final String DRIVER_CLASS = "DriverClass"; //$NON-NLS-1$
+
+ public Connection getConnection(Properties connectionProperties) throws SQLException;
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/service/PoolingConnectionSource.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/service/PoolingConnectionSource.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/service/PoolingConnectionSource.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import com.metamatrix.soap.SOAPPlugin;
+
+/**
+ * This implmentation of ConnectionSource uses a HashMap to cache instances of Connection Pools with their connection properties
+ * as the key.
+ */
+public class PoolingConnectionSource implements
+ ConnectionSource {
+
+ private static PoolingConnectionSource INSTANCE = new PoolingConnectionSource();
+
+ /**
+ * The internal factory used to create pools.
+ */
+ private ConnectionPoolFactory poolFactory;
+
+ /**
+ * The internal Map of Connection pools keyed by the connection properties used to create them.
+ */
+ private Map pools = new HashMap();
+
+ /**
+ * Constructor that instantiates a BasicConnectionPoolFactory for pool creation duties.
+ *
+ *
+ */
+ public PoolingConnectionSource() {
+ poolFactory = new BasicConnectionPoolFactory();
+ }
+
+ /**
+ * Constructor that allows the user to pass in their own implementation of ConnectionPoolFactory.
+ *
+ * @param poolFactory the connection pool factory that will be used to create connection pools.
+ *
+ */
+ public PoolingConnectionSource(final ConnectionPoolFactory poolFactory) {
+ this.poolFactory = poolFactory;
+ }
+
+ public static PoolingConnectionSource getInstance() {
+ return INSTANCE;
+ }
+
+ /**
+ * @see com.metamatrix.soap.service.ConnectionSource#getConnection(java.util.Properties)
+ * @since 4.3
+ */
+ public Connection getConnection(final Properties connectionProperties) throws SQLException {
+ if (poolFactory == null) {
+ throw new SQLException(
+ SOAPPlugin.Util
+ .getString("BasicConnectionPool.The_connection_pool_factory_given_the_Pooling_Connection_Source")); //$NON-NLS-1$
+ }
+
+ Object pool = pools.get(connectionProperties);
+
+ if (pool == null) {
+ pool = createPool(connectionProperties);
+ pools.put(connectionProperties, pool);
+ }
+
+
+
+ final DataSource source = (DataSource)pool;
+ if (source != null) {
+ return source.getConnection();
+ }
+
+ throw new SQLException(SOAPPlugin.Util.getString("PoolingConnectionSource.The_DataSource_instance_pulled_from_the")); //$NON-NLS-1$
+
+ }
+
+ /**
+ * This method will create a Connection Pool.
+ * @param properties the connection properties to be used to create connections in the pool.
+ * See ConnectionSource for key values.
+ * @return A connection pool instance as an Object.
+ * @throws SQLException
+ *
+ */
+ private Object createPool(final Properties properties) throws SQLException {
+ return poolFactory.createConnectionPool(properties);
+ }
+
+ /**
+ * This method can be used to check to see if this Connection Source has a poool with
+ * the passed in properties
+ * @param connectionProperties The properties to check to see if there is a matching pool for in
+ * this connection source.
+ * @return true if a pool is found with the matching passed in properties.
+ *
+ */
+ protected boolean hasPool(final Properties connectionProperties) {
+ return pools.get(connectionProperties)!=null;
+ }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/handler/PWCBHandler.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/handler/PWCBHandler.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/handler/PWCBHandler.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.sqlquerywebservice.handler;
+
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+/**
+ * This class is required for JAAS Security. We will just default to the
+ * username/password set by the username token.
+ */
+public class PWCBHandler implements CallbackHandler {
+
+ /* (non-Javadoc)
+ * @see javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[])
+ */
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ }
+
+}
\ No newline at end of file
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Cell.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Cell.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Cell.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Bean representing the value of a row/column.
+ */
+public class Cell {
+
+ protected java.lang.String value;
+
+ public java.lang.String getValue() {
+ return value;
+ }
+
+ public void setValue(java.lang.String value) {
+ this.value = value;
+ }
+
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ColumnMetadata.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ColumnMetadata.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ColumnMetadata.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,202 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * This class contains metamdata values for a given result set.
+ */
+public class ColumnMetadata {
+
+ protected boolean autoIncrement;
+
+ public boolean isAutoIncrement() {
+ return autoIncrement;
+ }
+
+ public void setAutoIncrement(boolean autoIncrement) {
+ this.autoIncrement = autoIncrement;
+ }
+
+ protected boolean caseSensitive;
+
+ public boolean isCaseSensitive() {
+ return caseSensitive;
+ }
+
+ public void setCaseSensitive(boolean caseSensitive) {
+ this.caseSensitive = caseSensitive;
+ }
+
+ protected java.lang.String columnClassName;
+
+ public java.lang.String getColumnClassName() {
+ return columnClassName;
+ }
+
+ public void setColumnClassName(java.lang.String columnClassName) {
+ this.columnClassName = columnClassName;
+ }
+
+ protected java.lang.String columnDataType;
+
+ public java.lang.String getColumnDataType() {
+ return columnDataType;
+ }
+
+ public void setColumnDataType(java.lang.String columnDataType) {
+ this.columnDataType = columnDataType;
+ }
+
+ protected int columnDisplaySize;
+
+ public int getColumnDisplaySize() {
+ return columnDisplaySize;
+ }
+
+ public void setColumnDisplaySize(int columnDisplaySize) {
+ this.columnDisplaySize = columnDisplaySize;
+ }
+
+ protected java.lang.String columnName;
+
+ public java.lang.String getColumnName() {
+ return columnName;
+ }
+
+ public void setColumnName(java.lang.String columnName) {
+ this.columnName = columnName;
+ }
+
+ protected boolean currency;
+
+ public boolean isCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(boolean currency) {
+ this.currency = currency;
+ }
+
+ protected java.lang.String getColumnLabel;
+
+ public java.lang.String getGetColumnLabel() {
+ return getColumnLabel;
+ }
+
+ public void setGetColumnLabel(java.lang.String getColumnLabel) {
+ this.getColumnLabel = getColumnLabel;
+ }
+
+ protected boolean nullable;
+
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ protected int precision;
+
+ public int getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(int precision) {
+ this.precision = precision;
+ }
+
+ protected boolean readOnly;
+
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly) {
+ this.readOnly = readOnly;
+ }
+
+ protected int scale;
+
+ public int getScale() {
+ return scale;
+ }
+
+ public void setScale(int scale) {
+ this.scale = scale;
+ }
+
+ protected boolean searchable;
+
+ public boolean isSearchable() {
+ return searchable;
+ }
+
+ public void setSearchable(boolean searchable) {
+ this.searchable = searchable;
+ }
+
+ protected boolean signed;
+
+ public boolean isSigned() {
+ return signed;
+ }
+
+ public void setSigned(boolean signed) {
+ this.signed = signed;
+ }
+
+ protected java.lang.String tableName;
+
+ public java.lang.String getTableName() {
+ return tableName;
+ }
+
+ public void setTableName(java.lang.String tableName) {
+ this.tableName = tableName;
+ }
+
+ protected java.lang.String virtualDatabaseName;
+
+ public java.lang.String getVirtualDatabaseName() {
+ return virtualDatabaseName;
+ }
+
+ public void setVirtualDatabaseName(java.lang.String virtualDatabaseName) {
+ this.virtualDatabaseName = virtualDatabaseName;
+ }
+
+ protected java.lang.String virtualDatabaseVersion;
+
+ public java.lang.String getVirtualDatabaseVersion() {
+ return virtualDatabaseVersion;
+ }
+
+ public void setVirtualDatabaseVersion(
+ java.lang.String virtualDatabaseVersion) {
+ this.virtualDatabaseVersion = virtualDatabaseVersion;
+ }
+
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Connection.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Connection.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Connection.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Class to hold contextual connection string.
+ */
+public class Connection {
+
+ protected java.lang.String connectionId;
+
+ public java.lang.String getConnectionId() {
+ return connectionId;
+ }
+
+ public void setConnectionId(java.lang.String connectionId) {
+ this.connectionId = connectionId;
+ }
+
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionContextualRequest.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionContextualRequest.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionContextualRequest.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Class to hold connection request information.
+ */
+public class ConnectionContextualRequest {
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.Connection connection;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.Connection getConnection() {
+ return connection;
+ }
+
+ public void setConnection(
+ com.metamatrix.soap.sqlquerywebservice.helper.Connection connection) {
+ this.connection = connection;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo requestInfo;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo getRequestInfo() {
+ return requestInfo;
+ }
+
+ public void setRequestInfo(
+ com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo requestInfo) {
+ this.requestInfo = requestInfo;
+ }
+
+}
+
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionlessRequest.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionlessRequest.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ConnectionlessRequest.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Class containing all required information to create a
+ * connection and submit a SQL statement. This class is used
+ * for executeBlocking() in SQLQueryWebService.
+ */
+public class ConnectionlessRequest {
+
+ protected boolean includeMetadata;
+
+ public boolean isIncludeMetadata() {
+ return includeMetadata;
+ }
+
+ public void setIncludeMetadata(boolean includeMetadata) {
+ this.includeMetadata = includeMetadata;
+ }
+
+ protected int maxRowsReturned;
+
+ public int getMaxRowsReturned() {
+ return maxRowsReturned;
+ }
+
+ public void setMaxRowsReturned(int maxRowsReturned) {
+ this.maxRowsReturned = maxRowsReturned;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.LogInParameters parameters;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.LogInParameters getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(
+ com.metamatrix.soap.sqlquerywebservice.helper.LogInParameters parameters) {
+ this.parameters = parameters;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo requestInfo;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo getRequestInfo() {
+ return requestInfo;
+ }
+
+ public void setRequestInfo(
+ com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo requestInfo) {
+ this.requestInfo = requestInfo;
+ }
+
+ protected int timeToWait;
+
+ public int getTimeToWait() {
+ return timeToWait;
+ }
+
+ public void setTimeToWait(int timeToWait) {
+ this.timeToWait = timeToWait;
+ }
+
+}
\ No newline at end of file
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/CursorType.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/CursorType.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/CursorType.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * This class is used to describe the value for 'cursor type' as part of
+ * the RequestInfo domain type. Cursor Type allowed values are:
+ * value 1003=FORWARD_ONLY,
+ * value 1004= SCROLL_INSENSITIVE and
+ * value 1005=SCROLL_SENSITIVE
+ *
+ */
+public class CursorType {
+
+ private String value;
+
+ public CursorType() {
+ }
+
+ public CursorType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String toString() {
+ return "enum:" + value; //$NON-NLS-1$
+ }
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Data.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Data.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Data.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+
+/**
+ * Domain object containing metadata and column/row information.
+ */
+public class Data {
+
+ protected boolean last;
+
+ public boolean isLast() {
+ return last;
+ }
+
+ public void setLast(boolean last) {
+ this.last = last;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.ColumnMetadata[] metadataArray = new ColumnMetadata[0];
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.ColumnMetadata[] getMetadataArray() {
+ return metadataArray;
+ }
+
+ public void setMetadataArray(
+ com.metamatrix.soap.sqlquerywebservice.helper.ColumnMetadata[] metadataArray) {
+ this.metadataArray = metadataArray;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.Row[] rows;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.Row[] getRows() {
+ return rows;
+ }
+
+ public void setRows(com.metamatrix.soap.sqlquerywebservice.helper.Row[] rows) {
+ this.rows = rows;
+ }
+
+}
+
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/LogInParameters.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/LogInParameters.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/LogInParameters.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Url values for a MetaMatrix VDB connection.
+ */
+public class LogInParameters {
+
+ protected java.lang.String connectionPayload;
+
+ public java.lang.String getConnectionPayload() {
+ return connectionPayload;
+ }
+
+ public void setConnectionPayload(java.lang.String connectionPayload) {
+ this.connectionPayload = connectionPayload;
+ }
+
+ protected java.lang.String mmServerUrl;
+
+ public java.lang.String getMmServerUrl() {
+ return mmServerUrl;
+ }
+
+ public void setMmServerUrl(java.lang.String mmServerUrl) {
+ this.mmServerUrl = mmServerUrl;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.Property[] optionalProperties;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.Property[] getOptionalProperties() {
+ return optionalProperties;
+ }
+
+ public void setOptionalProperties(
+ com.metamatrix.soap.sqlquerywebservice.helper.Property[] optionalProperties) {
+ this.optionalProperties = optionalProperties;
+ }
+
+ protected java.lang.String vdbName;
+
+ public java.lang.String getVdbName() {
+ return vdbName;
+ }
+
+ public void setVdbName(java.lang.String vdbName) {
+ this.vdbName = vdbName;
+ }
+
+ protected java.lang.String vdbVersion;
+
+ public java.lang.String getVdbVersion() {
+ return vdbVersion;
+ }
+
+ public void setVdbVersion(java.lang.String vdbVersion) {
+ this.vdbVersion = vdbVersion;
+ }
+
+}
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Property.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Property.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Property.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Property holder used for a connection's optional property values.
+ */
+public class Property {
+
+ protected java.lang.String propertyName;
+
+ public java.lang.String getPropertyName() {
+ return propertyName;
+ }
+
+ public void setPropertyName(java.lang.String propertyName) {
+ this.propertyName = propertyName;
+ }
+
+ protected java.lang.String propertyValue;
+
+ public java.lang.String getPropertyValue() {
+ return propertyValue;
+ }
+
+ public void setPropertyValue(java.lang.String propertyValue) {
+ this.propertyValue = propertyValue;
+ }
+
+}
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestId.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestId.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestId.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Class to hold contextual request string.
+ */
+public class RequestId {
+
+ protected java.lang.String connectionId;
+
+ public java.lang.String getConnectionId() {
+ return connectionId;
+ }
+
+ public void setConnectionId(java.lang.String connectionId) {
+ this.connectionId = connectionId;
+ }
+
+ protected java.lang.String id;
+
+ public java.lang.String getId() {
+ return id;
+ }
+
+ public void setId(java.lang.String id) {
+ this.id = id;
+ }
+
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestInfo.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestInfo.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestInfo.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Request information used for a specific query.
+ */
+public class RequestInfo {
+
+ protected java.lang.String[] bindParameters;
+
+ public java.lang.String[] getBindParameters() {
+ return bindParameters;
+ }
+
+ public void setBindParameters(java.lang.String[] bindParameters) {
+ this.bindParameters = bindParameters;
+ }
+
+ protected java.lang.String commandPayload;
+
+ public java.lang.String getCommandPayload() {
+ return commandPayload;
+ }
+
+ public void setCommandPayload(java.lang.String commandPayload) {
+ this.commandPayload = commandPayload;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.CursorType cursorType;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.CursorType getCursorType() {
+ return cursorType;
+ }
+
+ public void setCursorType(
+ com.metamatrix.soap.sqlquerywebservice.helper.CursorType cursorType) {
+ this.cursorType = cursorType;
+ }
+
+ protected int fetchSize;
+
+ public int getFetchSize() {
+ return fetchSize;
+ }
+
+ public void setFetchSize(int fetchSize) {
+ this.fetchSize = fetchSize;
+ }
+
+ protected boolean partialResults;
+
+ public boolean isPartialResults() {
+ return partialResults;
+ }
+
+ public void setPartialResults(boolean partialResults) {
+ this.partialResults = partialResults;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.RequestType requestType;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.RequestType getRequestType() {
+ return requestType;
+ }
+
+ public void setRequestType(
+ com.metamatrix.soap.sqlquerywebservice.helper.RequestType requestType) {
+ this.requestType = requestType;
+ }
+
+ protected java.lang.String sqlString;
+
+ public java.lang.String getSqlString() {
+ return sqlString;
+ }
+
+ public void setSqlString(java.lang.String sqlString) {
+ this.sqlString = sqlString;
+ }
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.TransactionAutoWrapType transactionAutoWrapMode;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.TransactionAutoWrapType getTransactionAutoWrapMode() {
+ return transactionAutoWrapMode;
+ }
+
+ public void setTransactionAutoWrapMode(
+ com.metamatrix.soap.sqlquerywebservice.helper.TransactionAutoWrapType transactionAutoWrapMode) {
+ this.transactionAutoWrapMode = transactionAutoWrapMode;
+ }
+
+ protected boolean useResultSetCache;
+
+ public boolean isUseResultSetCache() {
+ return useResultSetCache;
+ }
+
+ public void setUseResultSetCache(boolean useResultSetCache) {
+ this.useResultSetCache = useResultSetCache;
+ }
+
+ protected java.lang.String xmlFormat;
+
+ public java.lang.String getXmlFormat() {
+ return xmlFormat;
+ }
+
+ public void setXmlFormat(java.lang.String xmlFormat) {
+ this.xmlFormat = xmlFormat;
+ }
+
+ protected java.lang.String xmlStyleSheet;
+
+ public java.lang.String getXmlStyleSheet() {
+ return xmlStyleSheet;
+ }
+
+ public void setXmlStyleSheet(java.lang.String xmlStyleSheet) {
+ this.xmlStyleSheet = xmlStyleSheet;
+ }
+
+ protected boolean xmlValidationMode;
+
+ public boolean isXmlValidationMode() {
+ return xmlValidationMode;
+ }
+
+ public void setXmlValidationMode(boolean xmlValidationMode) {
+ this.xmlValidationMode = xmlValidationMode;
+ }
+
+}
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestType.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestType.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/RequestType.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Used to describe the allowed values for 'statement type' as part of the
+ * RequestInfo domain type. Statement type allowed values are:
+ * value 0=Statement, value 1=PreparedStatement
+ */
+public class RequestType {
+
+ private String value;
+
+ public RequestType() {
+ }
+
+ public RequestType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String toString() {
+ return "enum:" + value ; //$NON-NLS-1$
+ }
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Results.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Results.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Results.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Container for returned results values.
+ */
+public class Results {
+
+ protected boolean hasData;
+
+ public boolean isHasData() {
+ return hasData;
+ }
+
+ public void setHasData(boolean hasData) {
+ this.hasData = hasData;
+ }
+
+ protected java.lang.String[] outputParameters = new java.lang.String[0];
+
+ public java.lang.String[] getOutputParameters() {
+ return outputParameters;
+ }
+
+ public void setOutputParameters(java.lang.String[] outputParameters) {
+ this.outputParameters = outputParameters;
+ }
+
+ protected org.teiid.soap.sqlquerywebservice.helper.SqlWarning[] sqlWarnings;
+
+ public org.teiid.soap.sqlquerywebservice.helper.SqlWarning[] getSqlWarnings() {
+ return sqlWarnings;
+ }
+
+ public void setSqlWarnings(
+ org.teiid.soap.sqlquerywebservice.helper.SqlWarning[] sqlWarnings) {
+ this.sqlWarnings = sqlWarnings;
+ }
+
+ protected java.lang.Integer beginRow;
+
+ public java.lang.Integer getBeginRow() {
+ return beginRow;
+ }
+
+ public void setBeginRow(java.lang.Integer beginRow) {
+ this.beginRow = beginRow;
+ }
+
+ protected org.teiid.soap.sqlquerywebservice.helper.Data data;
+
+ public org.teiid.soap.sqlquerywebservice.helper.Data getData() {
+ return data;
+ }
+
+ public void setData(org.teiid.soap.sqlquerywebservice.helper.Data data) {
+ this.data = data;
+ }
+
+ protected java.lang.Integer endRow;
+
+ public java.lang.Integer getEndRow() {
+ return endRow;
+ }
+
+ public void setEndRow(java.lang.Integer endRow) {
+ this.endRow = endRow;
+ }
+
+ protected java.lang.Integer updateCount;
+
+ public java.lang.Integer getUpdateCount() {
+ return updateCount;
+ }
+
+ public void setUpdateCount(java.lang.Integer updateCount) {
+ this.updateCount = updateCount;
+ }
+
+}
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ResultsRequest.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ResultsRequest.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/ResultsRequest.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Results request information used for submitting requests to server.
+ */
+public class ResultsRequest {
+
+ protected int startRow;
+
+ public int getStartRow() {
+ return startRow;
+ }
+
+ public void setStartRow(int startRow) {
+ this.startRow = startRow;
+ }
+
+ protected int endRow;
+
+ public int getEndRow() {
+ return endRow;
+ }
+
+ public void setEndRow(int endRow) {
+ this.endRow = endRow;
+ }
+
+ protected boolean includeMetadata;
+
+ public boolean isIncludeMetadata() {
+ return includeMetadata;
+ }
+
+ public void setIncludeMetadata(boolean includeMetadata) {
+ this.includeMetadata = includeMetadata;
+ }
+
+ protected org.teiid.soap.sqlquerywebservice.helper.RequestId requestId;
+
+ public org.teiid.soap.sqlquerywebservice.helper.RequestId getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(
+ org.teiid.soap.sqlquerywebservice.helper.RequestId requestId) {
+ this.requestId = requestId;
+ }
+
+ protected int timeToWait;
+
+ public int getTimeToWait() {
+ return timeToWait;
+ }
+
+ public void setTimeToWait(int timeToWait) {
+ this.timeToWait = timeToWait;
+ }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Row.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Row.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/Row.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Row domain object containing cell values.
+ */
+public class Row {
+
+ protected com.metamatrix.soap.sqlquerywebservice.helper.Cell[] cells;
+
+ public com.metamatrix.soap.sqlquerywebservice.helper.Cell[] getCells() {
+ return cells;
+ }
+
+ public void setCells(
+ com.metamatrix.soap.sqlquerywebservice.helper.Cell[] cells) {
+ this.cells = cells;
+ }
+
+}
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlQueryWebServiceFault.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlQueryWebServiceFault.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlQueryWebServiceFault.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Soap fault container.
+ */
+public class SqlQueryWebServiceFault extends java.lang.Exception {
+
+
+ public SqlQueryWebServiceFault(java.lang.String message) {
+ super(message);
+
+ }
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlWarning.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlWarning.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/SqlWarning.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * SqlWarning domain object.
+ */
+public class SqlWarning {
+
+ protected java.lang.String message;
+
+ public java.lang.String getMessage() {
+ return message;
+ }
+
+ public void setMessage(java.lang.String message) {
+ this.message = message;
+ }
+
+}
+
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/TransactionAutoWrapType.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/TransactionAutoWrapType.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/helper/TransactionAutoWrapType.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.helper;
+
+/**
+ * Used to describe the allowed values for 'transaction auto wrap
+ * mode' as part of the RequestInfo domain type. Transaction auto wrap allowed
+ * values are:
+ * value 0=OFF, value 1= ON, value 2=OPTIMISTIC, value 3=PESSIMISTIC
+ */
+public class TransactionAutoWrapType {
+
+ private String value;
+
+ public TransactionAutoWrapType() {
+ }
+
+ public TransactionAutoWrapType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String toString() {
+ return "enum:" + value; //$NON-NLS-1$
+ }
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/log/LogUtil.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/log/LogUtil.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/log/LogUtil.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.log;
+
+import org.teiid.soap.SOAPPlugin;
+import org.teiid.logging.LogManager;
+
+/**
+ * This is going to console, if needs to be file based, a log listener needs to be added to this.
+ */
+public class LogUtil {
+
+ // =========================================================================
+ // Static Members
+ // =========================================================================
+ private static final LogUtil INSTANCE = new LogUtil();
+
+ PlatformLog log = new PlatformLog("Teiid SOAP log"); //$NON-NLS-1$
+
+ /**
+ * Get an instance of this class.
+ */
+ public static LogUtil getInstance() {
+ return INSTANCE;
+ }
+
+ public static void log(int severity, String message) {
+ INSTANCE.log.logMessage(new LogMessage(SOAPPlugin.PLUGIN_ID, severity, new Object[] {message}));
+ }
+
+ public static void log(int severity, Throwable t, String message) {
+ INSTANCE.log.logMessage(new LogMessage(SOAPPlugin.PLUGIN_ID, severity, t, new Object[] {message}));
+ }
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebService.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebService.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebService.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,477 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.service;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.ParameterMetaData;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+
+import org.teiid.admin.AdminPlugin;
+import org.teiid.api.exception.MetaMatrixProcessingException;
+import org.teiid.common.api.MMURL;
+import org.teiid.core.log.MessageLevel;
+import org.teiid.dqp.client.impl.ServerRequest;
+import org.teiid.jdbc.MMCallableStatement;
+import org.teiid.jdbc.MMPreparedStatement;
+import org.teiid.jdbc.MMStatement;
+import org.teiid.jdbc.api.ExecutionProperties;
+import org.teiid.jdbc.api.ResultSetMetaData;
+import org.teiid.jdbc.api.SQLStates;
+import org.teiid.jdbc.api.Statement;
+import org.teiid.soap.SOAPPlugin;
+import org.teiid.soap.security.Credential;
+import org.teiid.soap.service.ConnectionSource;
+import org.teiid.soap.service.PoolingConnectionSource;
+import org.teiid.soap.sqlquerywebservice.helper.Cell;
+import org.teiid.soap.sqlquerywebservice.helper.ColumnMetadata;
+import org.teiid.soap.sqlquerywebservice.helper.ConnectionlessRequest;
+import org.teiid.soap.sqlquerywebservice.helper.Data;
+import org.teiid.soap.sqlquerywebservice.helper.LogInParameters;
+import org.teiid.soap.sqlquerywebservice.helper.Results;
+import org.teiid.soap.sqlquerywebservice.helper.Row;
+import org.teiid.soap.sqlquerywebservice.helper.SqlWarning;
+import org.teiid.soap.sqlquerywebservice.log.LogUtil;
+import org.teiid.soap.util.WebServiceUtil;
+
+/**
+ * This class is designed to support the querying of the MetaMatrix Server via a SOAP web service node. This class is also
+ * designed in such a way as to produce a resulting web service interface that is complaint with the WS-I profile.
+ */
+public class SqlQueryWebService {
+
+ public static final String APP_NAME = "SQL Query Web Service"; //$NON-NLS-1$
+
+ /**
+ * Contextually aware credential provider. Abstracted to facilitate testing.
+ */
+ public interface CredentialProvider {
+ Credential getCredentials() throws SqlQueryWebServiceFault;
+ }
+
+ private ConnectionSource connectionSource = PoolingConnectionSource.getInstance();
+ private CredentialProvider credentialProvider = new CredentialProvider() {
+ @Override
+ public Credential getCredentials() throws SqlQueryWebServiceFault {
+ MessageContext msgCtx = MessageContext.getCurrentMessageContext();
+ if (msgCtx == null) {
+ throwFaultException(true, new Exception(SOAPPlugin.Util.getString("SqlQueryWebService.0"))); //$NON-NLS-1$
+ }
+
+ Credential credential = null;
+ try {
+ credential = WebServiceUtil.getCredentials(msgCtx);
+ } catch (AxisFault e) {
+ throwFaultException(true, e);
+ }
+ return credential;
+ }
+ };
+
+ /**
+ * This method is used as a shortcut when no Connection state is required on the server side. It will simply make a connection
+ * using the information supplied in the passed in object, and execute the query as defined also in the passed in object. This
+ * method saves server round trips, but sacrifices the performance of keeping a Connection open on the server side when
+ * multiple queries are to be executed. The returned Data contains all of the results retrieved from the server as a result of
+ * executing the query defined in the ConnectionlessRequest object. This method also sacrifices the �batching� functionality
+ * that is available when using the execute, getResults asynchronous method combination. The first x number of rows from the
+ * results will be returned in the return message as specified in the ConnectionlessRequest object. ResultsMetadata will also
+ * be returned in the result set by default.
+ *
+ * @return Results
+ */
+ public Results executeBlocking( final ConnectionlessRequest connectionlessRequest ) throws SqlQueryWebServiceFault {
+ Connection conn = null;
+ Results results = null;
+ Statement stmt = null;
+ try {
+ Properties connectionProperties = getConnectionInfo(connectionlessRequest.getParameters());
+ conn = connectionSource.getConnection(connectionProperties);
+ ServerRequest request = getRequestInfo(connectionlessRequest);
+
+ if (request.getRequestType() == ServerRequest.REQUEST_TYPE_PREPARED_STATEMENT) {
+ MMPreparedStatement pStmt = conn.prepareStatement(request.getSql(), request.getCursorType(), ResultSet.CONCUR_READ_ONLY).unwrap(MMPreparedStatement.class);
+ stmt = pStmt;
+ setParameterValues(request, pStmt);
+ } else if (request.getRequestType() == ServerRequest.REQUEST_TYPE_CALLABLE_STATEMENT) {
+ MMCallableStatement cStmt = conn.prepareCall(request.getSql(), request.getCursorType(), ResultSet.CONCUR_READ_ONLY).unwrap(MMCallableStatement.class);
+ stmt = cStmt;
+ setParameterValues(request, cStmt);
+ } else {
+ stmt = conn.createStatement(request.getCursorType(), ResultSet.CONCUR_READ_ONLY).unwrap(MMStatement.class);
+ }
+ if (connectionlessRequest.getMaxRowsReturned() > 0) {
+ stmt.setMaxRows(connectionlessRequest.getMaxRowsReturned());
+ }
+ if (request.getFetchSize() > 0) {
+ stmt.setFetchSize(request.getFetchSize());
+ }
+ if (connectionlessRequest.getTimeToWait() > 0) {
+ stmt.setQueryTimeout(connectionlessRequest.getTimeToWait()/1000);
+ }
+ stmt.setExecutionProperty(ExecutionProperties.PLAN_NOT_ALLOWED, Boolean.TRUE.toString());
+
+ if (request.getXMLStyleSheet() != null) {
+ try {
+ stmt.attachStylesheet(new StringReader(request.getXMLStyleSheet()));
+ } catch (IOException e) {
+ throwFaultException(true, e);
+ }
+ }
+ stmt.setExecutionProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE, String.valueOf(request.getPartialResults()));
+ stmt.setExecutionProperty(ExecutionProperties.PROP_XML_VALIDATION, String.valueOf(request.getXMLValidationMode()));
+ stmt.setExecutionProperty(ExecutionProperties.XML_TREE_FORMAT, String.valueOf(request.getXMLFormat()));
+
+ // Get transaction auto-wrap mode
+ int transactionAutowrap = request.getTransactionAutoWrapMode();
+ String autowrap = null;
+ switch(transactionAutowrap) {
+ case ServerRequest.AUTOWRAP_OFF: autowrap = ExecutionProperties.AUTO_WRAP_OFF; break;
+ case ServerRequest.AUTOWRAP_ON: autowrap = ExecutionProperties.AUTO_WRAP_ON; break;
+ case ServerRequest.AUTOWRAP_OPTIMISTIC: autowrap = ExecutionProperties.AUTO_WRAP_OPTIMISTIC; break;
+ case ServerRequest.AUTOWRAP_PESSIMISTIC: autowrap = ExecutionProperties.AUTO_WRAP_PESSIMISTIC; break;
+ default: throwFaultException(true, new MetaMatrixProcessingException(AdminPlugin.Util.getString("ServerFacadeImpl.invalid_txnautowrap", transactionAutowrap))); //$NON-NLS-1$
+ }
+
+ stmt.setExecutionProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP, autowrap);
+ stmt.setExecutionProperty(ExecutionProperties.RESULT_SET_CACHE_MODE, String.valueOf(request.getUseResultSetCache()));
+
+ ResultSet rs = null;
+
+ if (request.getRequestType() == ServerRequest.REQUEST_TYPE_PREPARED_STATEMENT || request.getRequestType() == ServerRequest.REQUEST_TYPE_PREPARED_STATEMENT) {
+ if (((PreparedStatement)stmt).execute()) {
+ rs = stmt.getResultSet();
+ }
+ } else {
+ if (stmt.execute(request.getSql())) {
+ rs = stmt.getResultSet();
+ }
+ }
+
+ results = buildResults(stmt, rs, connectionlessRequest, connectionlessRequest.isIncludeMetadata());
+ } catch (SQLException e) {
+ throwFaultException(e.getSQLState() == null?true:SQLStates.isUsageErrorState(e.getSQLState()), e);
+ } finally {
+ if (stmt != null) {
+ try {
+ stmt.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ }
+ return results;
+ }
+
+ private void setParameterValues(ServerRequest request,
+ MMPreparedStatement pStmt) throws SQLException {
+ Object [] params = request.getBindParameters();
+ if (params != null) {
+ for (int i = 0; i < params.length; i++) {
+ pStmt.setObject(i + 1, params[i]);
+ }
+ }
+ }
+
+ private Properties getConnectionInfo( final LogInParameters params ) throws SqlQueryWebServiceFault {
+ Properties connectionInfo = new Properties();
+ if (params.getMmServerUrl() != null) {
+ connectionInfo.setProperty(MMURL.CONNECTION.SERVER_URL, params.getMmServerUrl());
+ }
+ if (params.getVdbName() != null) {
+ connectionInfo.setProperty(MMURL.JDBC.VDB_NAME, params.getVdbName());
+ }
+ if (params.getVdbVersion() != null) {
+ connectionInfo.setProperty(MMURL.JDBC.VDB_VERSION, params.getVdbVersion());
+ }
+ if (params.getConnectionPayload() != null) {
+ connectionInfo.setProperty(MMURL.CONNECTION.CLIENT_TOKEN_PROP, params.getConnectionPayload());
+ }
+
+ /*
+ * Set the additional property for the application name.
+ */
+ connectionInfo.setProperty(MMURL.CONNECTION.APP_NAME, APP_NAME);
+
+ /*
+ * Set additional properties, if any, on the ConnectionInfo object.
+ */
+ if (params.getOptionalProperties() != null) {
+
+ for (int i = 0; i < params.getOptionalProperties().length; i++) {
+ String propName = params.getOptionalProperties()[i].getPropertyName();
+ String propValue = params.getOptionalProperties()[i].getPropertyValue();
+ connectionInfo.setProperty(propName, propValue);
+ }
+ }
+
+ Credential credential = this.credentialProvider.getCredentials();
+
+ connectionInfo.setProperty(MMURL.CONNECTION.USER_NAME, credential.getUserName());
+ connectionInfo.setProperty(MMURL.CONNECTION.PASSWORD, new String(credential.getPassword()));
+
+ return connectionInfo;
+ }
+
+ /**
+ * This method is used to get an instance of RequestInfo.
+ *
+ * @return PortableContext
+ */
+ private ServerRequest getRequestInfo( final ConnectionlessRequest request ) {
+ org.teiid.soap.sqlquerywebservice.helper.RequestInfo info = request.getRequestInfo();
+ ServerRequest domainInfo = new ServerRequest();
+ domainInfo.setBindParameters(info.getBindParameters());
+ domainInfo.setCommandPayload(info.getCommandPayload());
+ domainInfo.setCursorType(Integer.parseInt(info.getCursorType().getValue()));
+ domainInfo.setFetchSize(info.getFetchSize());
+ domainInfo.setPartialResults(info.isPartialResults());
+ domainInfo.setRequestType(Integer.parseInt(info.getRequestType().getValue()));
+ domainInfo.setSql(info.getSqlString());
+ domainInfo.setTransactionAutoWrapMode(Integer.parseInt(info.getTransactionAutoWrapMode().getValue()));
+ domainInfo.setUseResultSetCache(info.isUseResultSetCache());
+ domainInfo.setXMLFormat(info.getXmlFormat());
+ domainInfo.setXMLStyleSheet(info.getXmlStyleSheet());
+ domainInfo.setXMLValidationMode(info.isXmlValidationMode());
+
+ return domainInfo;
+ }
+
+ /**
+ * This method is used to construct a results object for a given context. This is used for synchronous query execution to get
+ * all results.
+ *
+ * @return Results
+ * @throws SQLException
+ */
+ protected Results buildResults( final Statement stmt,
+ final ResultSet rs,
+ final ConnectionlessRequest request,
+ final boolean includeMetadata ) throws SQLException {
+
+ final Results soapResults = new Results();
+
+ getData(soapResults, rs, includeMetadata);
+
+ /*
+ * Get warnings If there are no SQLWarnings, we will stick a "holder" value to prevent NPE's in the Axis2 ADB
+ * client.
+ */
+ soapResults.setSqlWarnings(getWarnings(stmt.getWarnings()));
+
+ soapResults.setUpdateCount(stmt.getUpdateCount());
+
+ /*
+ * Add any output parmeters to the SOAP Results If there are no output parms, we will stick a "holder" value to
+ * prevent NPE's in the Axis2 ADB client.
+ */
+ soapResults.setOutputParameters(getOutputParameters(stmt));
+
+ return soapResults;
+ }
+
+ /**
+ * Get SQL Warnings from results
+ *
+ * @return SqlWarning[] - Array of SQLWarnings
+ */
+ private SqlWarning[] getWarnings( SQLWarning warning ) {
+ if (warning == null) {
+ return new SqlWarning[] { new SqlWarning() };
+ }
+ List<SqlWarning> warnings = new ArrayList<SqlWarning>();
+ do {
+ final SqlWarning toAdd = new SqlWarning();
+ toAdd.setMessage(warning.getMessage());
+ warnings.add(toAdd);
+ warning = warning.getNextWarning();
+ } while (warning != null);
+ return (SqlWarning[])warnings.toArray();
+ }
+
+ private String[] getOutputParameters( final Statement stmt ) throws SQLException {
+ String[] result = null;
+ if (stmt instanceof CallableStatement) {
+ CallableStatement cs = (CallableStatement)stmt;
+
+ ParameterMetaData metadata = cs.getParameterMetaData();
+
+ int count = metadata.getParameterCount();
+
+ final ArrayList<String> outputParametersList = new ArrayList<String>();
+ for (int k = 1; k <= count; k++) {
+ final int parameterType = metadata.getParameterType(k);
+ if (parameterType == ParameterMetaData.parameterModeOut
+ || parameterType == ParameterMetaData.parameterModeInOut) {
+ outputParametersList.add(cs.getString(k));
+ }
+ }
+ result = (String[])outputParametersList.toArray();
+ }
+
+ if (result == null || result.length == 0) {
+ return new String[] {"none"}; //$NON-NLS-1$
+ }
+ return result;
+ }
+
+ /**
+ * This method is used create a data object from the results returned from the server.
+ *
+ * @return Data
+ * @throws SQLException
+ */
+ private void getData( final Results soapResults,
+ final ResultSet rs,
+ final boolean includeMetadata ) throws SQLException {
+ Data data = new Data();
+
+ soapResults.setBeginRow(0);
+
+ /*
+ * Set boolean indicating whether or not this is the last batch.
+ */
+ data.setLast(true);
+
+ Row[] rowArray = null;
+ int rowCounter = 0;
+
+ if (rs != null) {
+ soapResults.setHasData(true);
+
+ // Metadata is only valid for non-update results.
+ ResultSetMetaData metadata = rs.getMetaData().unwrap(ResultSetMetaData.class);
+ if (includeMetadata) {
+ data.setMetadataArray(getColumnMetaData(metadata));
+ }
+
+ List<Row> rows = new ArrayList<Row>();
+ /*
+ * Need to return at least one rowArray value to assure the response message conforms to the structure expected by the
+ * Axis2 ADB client.
+ */
+ while (rs.next()) {
+ Row row = new Row();
+ Cell[] cellArray = new Cell[metadata.getColumnCount()];
+ for (int j = 1; j <= cellArray.length; j++) {
+ Cell cell = new Cell();
+ String value = rs.getString(j);
+ cell.setValue(value);
+ cellArray[j - 1] = cell;
+ }
+ row.setCells(cellArray);
+ rows.add(row);
+ rowCounter++;
+ }
+
+ rowArray = (Row[])rows.toArray();
+ }
+
+ soapResults.setEndRow(rowCounter);
+ /*
+ * Need to return at least one row/cell value(s) to assure the response message conforms to the structure expected by the
+ * Axis2 ADB client.
+ */
+ if (rowCounter == 0) {
+ Row emptyRow = new Row();
+ rowArray = new Row[] {emptyRow};
+ Cell emptyCell = new Cell();
+ emptyRow.setCells(new Cell[] {emptyCell});
+ }
+
+ data.setRows(rowArray);
+
+ soapResults.setData(data);
+ }
+
+ /**
+ * This method is used create a ColumnMetaData object array from the results returned from the server.
+ *
+ * @return ColumnMetaData
+ * @throws SQLException
+ */
+ private ColumnMetadata[] getColumnMetaData( final ResultSetMetaData metadata ) throws SQLException {
+
+ final int columnCount = metadata.getColumnCount();
+ ColumnMetadata[] metadataArray = new ColumnMetadata[columnCount];
+
+ for (int i = 1; i <= metadata.getColumnCount(); i++) {
+ ColumnMetadata columnMetadata = new ColumnMetadata();
+ columnMetadata.setColumnName(metadata.getColumnName(i));
+ columnMetadata.setColumnDataType(metadata.getColumnTypeName(i));
+ columnMetadata.setColumnClassName(metadata.getColumnClassName(i));
+ columnMetadata.setColumnDisplaySize(metadata.getColumnDisplaySize(i));
+ columnMetadata.setCurrency(metadata.isCurrency(i));
+ columnMetadata.setGetColumnLabel(metadata.getColumnLabel(i));
+ columnMetadata.setNullable(metadata.isNullable(i) == ResultSetMetaData.columnNullable);
+ columnMetadata.setPrecision(metadata.getPrecision(i));
+ columnMetadata.setReadOnly(metadata.isReadOnly(i));
+ columnMetadata.setScale(metadata.getScale(i));
+ columnMetadata.setSearchable(metadata.isSearchable(i));
+ columnMetadata.setSigned(metadata.isSigned(i));
+ columnMetadata.setTableName(metadata.getTableName(i));
+ columnMetadata.setVirtualDatabaseName(metadata.getVirtualDatabaseName(i));
+ columnMetadata.setVirtualDatabaseVersion(metadata.getVirtualDatabaseVersion(i));
+
+ metadataArray[i - 1] = columnMetadata;
+
+ }
+ return metadataArray;
+ }
+
+ private void throwFaultException( boolean client, Throwable e ) throws SqlQueryWebServiceFault {
+
+ SqlQueryWebServiceFault fault = SqlQueryWebServiceFault.create(client, e);
+
+ LogUtil.log(MessageLevel.ERROR, e, e.getMessage());
+
+ throw fault;
+ }
+
+ public void setConnectionSource(ConnectionSource connectionSource) {
+ this.connectionSource = connectionSource;
+ }
+
+ public void setCredentialProvider(CredentialProvider credentialProvider) {
+ this.credentialProvider = credentialProvider;
+ }
+
+}
\ No newline at end of file
Added: sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebServiceFault.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebServiceFault.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/sqlquerywebservice/service/SqlQueryWebServiceFault.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.sqlquerywebservice.service;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.AxisFault;
+
+/**
+ * This is an exception class that is thrown from the SqlQueryWebService implementation that repesents a SOAP fault.
+ *
+ * @since 4.2
+ */
+public class SqlQueryWebServiceFault extends AxisFault{
+
+ /*
+ * This is a namespace for the faultcodes for the metamatrix server api. It will be used when a fault is thrown from the api
+ * as the namespace for the faultcode in the returned fault.
+ */
+ public static final String SOAP_11_FAULTCODES_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/"; //$NON-NLS-1$
+ public static final String SOAP_11_STANDARD_CLIENT_FAULT_CODE = "Client"; //$NON-NLS-1$
+ public static final String SOAP_11_STANDARD_SERVER_FAULT_CODE = "Server"; //$NON-NLS-1$
+
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public SqlQueryWebServiceFault(String message, QName code) {
+ super(message, code);
+ }
+
+
+ public static final SqlQueryWebServiceFault create(boolean client, Throwable e) {
+
+ String faultCodeString = null;
+
+ /*
+ * if the exception being thrown is due to the inputs that the client gave us, then the fault code should be 'Client' per
+ * the SOAP 1.1 specification. If there is some 'internal' server side reason for not being able to fulfill the request,
+ * then the fault code should be 'Server' per the SOAP 1.1 specification.
+ */
+ if (client) {
+ faultCodeString = SOAP_11_STANDARD_CLIENT_FAULT_CODE;
+ } else {
+ /*
+ * if this is not a MetaMatrixProcessingException we make the assumption that this exception
+ * is not a result of some invalid client input, but that it is an exception thrown because
+ * of an invalid server state.
+ */
+ faultCodeString = SOAP_11_STANDARD_SERVER_FAULT_CODE;
+ }
+
+
+ QName faultCode = new QName(SOAP_11_FAULTCODES_NAMESPACE, faultCodeString);
+
+
+ SqlQueryWebServiceFault fault = new SqlQueryWebServiceFault(e.getMessage(), faultCode);
+
+ return fault;
+ }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/util/ErrorMessageKeys.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/util/ErrorMessageKeys.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/util/ErrorMessageKeys.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.util;
+
+/**
+ */
+public class ErrorMessageKeys {
+
+ /* auth (001) */
+ public static final String AUTH_0001 = "ERR.018.001.0001"; //$NON-NLS-1$
+ public static final String AUTH_0002 = "ERR.018.001.0002"; //$NON-NLS-1$
+ public static final String AUTH_0003 = "ERR.018.001.0003"; //$NON-NLS-1$
+ public static final String AUTH_0004 = "ERR.018.001.0004"; //$NON-NLS-1$
+
+
+ public static final String SERVICE_0001 = "ERR.018.002.0001"; //$NON-NLS-1$
+ public static final String SERVICE_0002 = "ERR.018.002.0002"; //$NON-NLS-1$
+ public static final String SERVICE_0003 = "ERR.018.002.0003"; //$NON-NLS-1$
+ public static final String SERVICE_0004 = "ERR.018.002.0004"; //$NON-NLS-1$
+ public static final String SERVICE_0005 = "ERR.018.002.0005"; //$NON-NLS-1$
+ public static final String SERVICE_0006 = "ERR.018.002.0006"; //$NON-NLS-1$
+ public static final String SERVICE_0007 = "ERR.018.002.0007"; //$NON-NLS-1$
+ public static final String SERVICE_0008 = "ERR.018.002.0008"; //$NON-NLS-1$
+ public static final String SERVICE_0009 = "ERR.018.002.0009"; //$NON-NLS-1$
+ public static final String SERVICE_0010 = "ERR.018.002.0010"; //$NON-NLS-1$
+ public static final String SERVICE_0011 = "ERR.018.002.0011"; //$NON-NLS-1$
+ public static final String SERVICE_0012 = "ERR.018.002.0012"; //$NON-NLS-1$
+ public static final String SERVICE_0013 = "ERR.018.002.0013"; //$NON-NLS-1$
+ public static final String SERVICE_0014 = "ERR.018.002.0014"; //$NON-NLS-1$
+ public static final String SERVICE_0015 = "ERR.018.002.0015"; //$NON-NLS-1$
+ public static final String SERVICE_0016 = "ERR.018.002.0016"; //$NON-NLS-1$
+ public static final String SERVICE_0017 = "ERR.018.002.0017"; //$NON-NLS-1$
+ public static final String SERVICE_0018 = "ERR.018.002.0018"; //$NON-NLS-1$
+ public static final String SERVICE_0019 = "ERR.018.002.0019"; //$NON-NLS-1$
+ public static final String SERVICE_0020 = "ERR.018.002.0020"; //$NON-NLS-1$
+ public static final String SERVICE_0021 = "ERR.018.002.0021"; //$NON-NLS-1$
+ public static final String SERVICE_0022 = "ERR.018.002.0022"; //$NON-NLS-1$
+ public static final String SERVICE_0023 = "ERR.018.002.0023"; //$NON-NLS-1$
+ public static final String SERVICE_0024 = "ERR.018.002.0024"; //$NON-NLS-1$
+ public static final String SERVICE_0025 = "ERR.018.002.0025"; //$NON-NLS-1$
+ public static final String SERVICE_0026 = "ERR.018.002.0026"; //$NON-NLS-1$
+
+ /** xml (011) */
+ public static final String xml_0001 = "ERR.018.011.0001"; //$NON-NLS-1$
+ public static final String xml_0002 = "ERR.018.011.0002"; //$NON-NLS-1$
+ public static final String xml_0003 = "ERR.018.011.0003"; //$NON-NLS-1$
+ public static final String xml_0004 = "ERR.018.011.0004"; //$NON-NLS-1$
+ public static final String xml_0005 = "ERR.018.011.0005"; //$NON-NLS-1$
+ public static final String xml_0006 = "ERR.018.011.0006"; //$NON-NLS-1$
+ public static final String xml_0007 = "ERR.018.011.0007"; //$NON-NLS-1$
+ public static final String xml_0008 = "ERR.018.011.0008"; //$NON-NLS-1$
+ public static final String xml_0009 = "ERR.018.011.0009"; //$NON-NLS-1$
+ public static final String xml_0010 = "ERR.018.011.0010"; //$NON-NLS-1$
+ public static final String xml_0011 = "ERR.018.011.0011"; //$NON-NLS-1$
+ public static final String xml_0012 = "ERR.018.011.0012"; //$NON-NLS-1$
+ public static final String xml_0013 = "ERR.018.011.0013"; //$NON-NLS-1$
+ public static final String xml_0014 = "ERR.018.011.0014"; //$NON-NLS-1$
+ public static final String xml_0015 = "ERR.018.011.0015"; //$NON-NLS-1$
+ public static final String xml_0016 = "ERR.018.011.0016"; //$NON-NLS-1$
+ public static final String xml_0017 = "ERR.018.011.0017"; //$NON-NLS-1$
+ public static final String xml_0018 = "ERR.018.011.0018"; //$NON-NLS-1$
+ public static final String xml_0019 = "ERR.018.011.0019"; //$NON-NLS-1$
+ public static final String xml_0020 = "ERR.018.011.0020"; //$NON-NLS-1$
+ public static final String xml_0021 = "ERR.018.011.0021"; //$NON-NLS-1$
+ public static final String xml_0022 = "ERR.018.011.0022"; //$NON-NLS-1$
+ public static final String xml_0023 = "ERR.018.011.0023"; //$NON-NLS-1$
+ public static final String xml_0024 = "ERR.018.011.0024"; //$NON-NLS-1$
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/util/SOAPConstants.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/util/SOAPConstants.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/util/SOAPConstants.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,349 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import com.metamatrix.common.api.MMURL;
+
+/**
+ * This file will contain all of the constants used by the MetaMatrix SOAP service
+ */
+public final class SOAPConstants {
+
+ /**
+ * Private constructor
+ */
+ private SOAPConstants() {
+ }
+
+ /**
+ * Name of property used to set the application name in a MetaMatrix connection.
+ */
+ public static final String APP_NAME = MMURL.CONNECTION.APP_NAME;
+
+ /**
+ * Non-secure MetaMatrix Protocol.
+ */
+ public static final String NON_SECURE_PROTOCOL = MMURL.CONNECTION.NON_SECURE_PROTOCOL;
+
+ /**
+ * Non-secure MetaMatrix Protocol.
+ */
+ public static final String SECURE_PROTOCOL = MMURL.CONNECTION.SECURE_PROTOCOL;
+
+ /**
+ * Indicates that the client did not have enough information to process the authentication or that the authentication message
+ * was incorrectly formed.
+ */
+ public static final String CLIENT_AUTHENTICATION_FAULT = "Client.Authentication"; //$NON-NLS-1$
+
+ /**
+ * Indicates that there was an authentication failure when attempting to authenticate
+ */
+ public static final String SERVER_AUTHENTICATION_FAULT = "Server.Authentication"; //$NON-NLS-1$
+
+ /**
+ * Indicates that there was a failure when attempting to establish a connection on the server side to the MetaMatrixServer
+ */
+ public static final String SERVER_CONNECTION_FAULT = "Server.Connection"; //$NON-NLS-1$
+
+ /**
+ * Indicates that there was a failure when attempting to establish a connection to the SOAP Connection architecture
+ */
+ public static final String CLIENT_CONNECTION_FAULT = "Client.Connection"; //$NON-NLS-1$
+
+ /**
+ * Indicates that the client did not have enough information in the request to submit a query to the MetaMatrix server
+ */
+ public static final String CLIENT_QUERY_EXECUTION_FAULT = "Client.QueryExecution"; //$NON-NLS-1$
+
+ /**
+ * Indicates that there was a failure when attempting to execute the query against the MetaMatrix server
+ */
+ public static final String SERVER_QUERY_EXECUTION_FAULT = "Server.QueryExecution"; //$NON-NLS-1$
+
+ /**
+ * Indicates that there was a translation error when attempting to translate the results into a SOAP specific return message
+ * on the server
+ */
+ public static final String SERVER_TRANSLATION_FAULT = "Server.Translation"; //$NON-NLS-1$
+
+ /**
+ * Indicates that the server is not licensed for the MetaMatrix SOAP API
+ */
+ public static final String SERVER_LICENSE_EXCEPTION = "Server.LicenseException"; //$NON-NLS-1$
+
+ /**
+ * Indicates that the client did not have enough information to submit an insert, update, or delete statement to the
+ * MetaMatrix server
+ */
+ public static final String CLIENT_UPDATE_EXECUTION_FAULT = "Client.UpdateExecution"; //$NON-NLS-1$
+
+ /**
+ * Indicates that there was a failure executing the insert,update, or delete against the MetaMatrix server
+ */
+ public static final String SERVER_UPDATE_EXECUTION_FAULT = "Server.UpdateExecution"; //$NON-NLS-1$
+
+ /**
+ * Indicates that the client did not have enough information to process a Stored procedure execution request against the
+ * MetaMatrix server.
+ */
+ public static final String CLIENT_STOREDPROCEDURE_EXECUTION_FAULT = "Client.StoredProcedureExecution"; //$NON-NLS-1$
+
+ /**
+ * Indicates that an error occurred in the MetaMatrix server while executing the Stored procedure execution
+ */
+ public static final String SERVER_STOREDPROCEDURE_EXECUTION_FAULT = "Server.StoredProcedureExecution"; //$NON-NLS-1$
+
+ /**
+ * A timeout has occured on the Client side
+ */
+ public static final String CLIENT_TIMEOUT = "Client.Timeout"; //$NON-NLS-1$
+
+ /**
+ * A timeout has occured on the Server side
+ */
+ public static final String SERVER_TIMEOUT = "Server.Timeout"; //$NON-NLS-1$
+
+ /**
+ * A general server fault
+ */
+ public static final String SERVER_FAULT = "Server"; //$NON-NLS-1$
+
+ /**
+ * A general client fault
+ */
+ public static final String CLIENT_FAULT = "Client"; //$NON-NLS-1$
+
+ /**
+ * This class contains the literal XML tag names and attributes for the session id
+ */
+ public static final class SESSION_ID {
+
+ public static final class TAGS {
+
+ public static final String SESSION_ID_TAG = "session"; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * This class contains the literal XML tag names and attributes tags for the authentication XML used in the MetaMatrix SOAP
+ * service.
+ */
+ public static final class AUTHENTICATION {
+
+ public static final class TAGS {
+
+ public static final String AUTHENTICATION_TAG = "authentication"; //$NON-NLS-1$
+
+ public static final class USERNAME {
+
+ public static final String USERNAME_TAG = "username"; //$NON-NLS-1$
+
+ public static final class ATTRIBUTES {
+ }
+ }
+
+ public static final class PASSWORD {
+
+ public static final String PASSWORD_TAG = "password"; //$NON-NLS-1$
+
+ public static final class ATTRIBUTES {
+
+ public static final String IS_ENCRYPTED_TAG = "isencrypted"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class VDB {
+
+ public static final String VDB_TAG = "vdb"; //$NON-NLS-1$
+
+ public static final class ATTRIBUTES {
+
+ public static final String VERSION_TAG = "version"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class SERVERURL {
+
+ public static final String SERVER_URL_TAG = "serverurl"; //$NON-NLS-1$
+
+ public static final class ATTRIBUTES {
+
+ public static final String APPSERVER_TAG = "appserver"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class TRUSTED {
+
+ public static final String TRUSTED_TAG = "trusted"; //$NON-NLS-1$
+
+ public static final class ATTRIBUTES {
+ }
+ }
+ }
+ }
+
+ public static final class STORED_PROCEDURE_PARAMETERS {
+
+ public static final String PARAMETERS_TAG = "parameters"; //$NON-NLS-1$
+
+ public static final class Param {
+
+ public static final String PARAM_TAG = "param"; //$NON-NLS-1$
+
+ public static final class Attributes {
+
+ public static final String INDEX_TAG = "index"; //$NON-NLS-1$
+ }
+ }
+ }
+
+ public static final class METADATA_TYPES {
+
+ public static final class CROSS_REFERENCES {
+
+ public static final String NAME = "crossreferences"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String PRIMARY_GROUP_NAME = "cr_primarygroupname"; //$NON-NLS-1$
+ public static final String FOREIGN_GROUP_NAME = "cr_foreigngroupname"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class DATATYPES {
+
+ public static final String NAME = "datatypes"; //$NON-NLS-1$
+
+ public static final class Parameters {
+ }
+ }
+
+ public static final class ELEMENTS {
+
+ public static final String NAME = "elements"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String GROUP_PATTERN = "e_grouppattern"; //$NON-NLS-1$
+ public static final String ELEMENT_PATTERN = "e_elementpattern"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class EXPORTED_KEYS {
+
+ public static final String NAME = "exportedkeys"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String PRIMARY_GROUP_NAME = "ek_primarygroupname"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class FOREIGN_KEYS {
+
+ public static final String NAME = "foreignkeys"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String GROUP_NAME = "fk_groupname"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class GROUPS {
+
+ public static final String NAME = "groups"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String GROUP_PATTERN = "g_grouppattern"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class IMPORTED_KEYS {
+
+ public static final String NAME = "importedkeys"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String FOREIGN_GROUP_NAME = "ik_foreigngroupname"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class MODELS {
+
+ public static final String NAME = "models"; //$NON-NLS-1$
+
+ public static final class Parameters {
+ }
+ }
+
+ public static final class PRIMARY_KEYS {
+
+ public static final String NAME = "primarykeys"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String GROUP_NAME = "pk_groupname"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class PROCEDURES {
+
+ public static final String NAME = "procedures"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String PROCEDURE_PATTERN = "p_procedurepattern"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class PROCEDURE_PARAMETERS {
+
+ public static final String NAME = "procedureparameters"; //$NON-NLS-1$
+
+ public static final class Parameters {
+
+ public static final String PROCEDURE_NAME_PATTERN = "pp_procedurenamepattern"; //$NON-NLS-1$
+ public static final String PARAMETER_NAME_PATTERN = "pp_parameternamepattern"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class USER_DEFINED_DATATYPES {
+
+ public static final String NAME = "userdefineddatatypes"; //$NON-NLS-1$
+
+ public static final class Parameters {
+ }
+ }
+
+ public static final class VIRTUALDATABASES {
+
+ public static final String NAME = "virtualdatabases"; //$NON-NLS-1$
+
+ public static final class Parameters {
+ }
+ }
+ }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/util/ServletClientConstants.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/util/ServletClientConstants.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/util/ServletClientConstants.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import com.metamatrix.soap.util.SOAPConstants;
+
+/**
+ * This file is used for constants to be displayed on the SOAP Client .jsp page.
+ * It is used by the com.metamatrix.soap.service.MMSOAPClientServlet to pull
+ * the form values from the .jsp page in order to submit a soap service query
+ */
+
+public final class ServletClientConstants {
+
+ private ServletClientConstants(){
+ }
+ /**
+ * General keys
+ */
+ public static final String LOGON_KEY = "Logon"; //$NON-NLS-1$
+ public static final String PASSWORD_KEY = "Password"; //$NON-NLS-1$
+ public static final String SESSIONID_KEY = "SessionID"; //$NON-NLS-1$
+ public static final String SERVER_URL_KEY = "ServerURL"; //$NON-NLS-1$
+ public static final String SOAP_URL_KEY = "SOAPURL"; //$NON-NLS-1$
+ public static final String SOAP_SERVICE_URN_KEY = "SOAPServiceURN"; //$NON-NLS-1$
+ public static final String VDB_NAME_KEY = "VDBName"; //$NON-NLS-1$
+ public static final String VDB_VERSION_KEY = "VDBVersion"; //$NON-NLS-1$
+ public static final String FETCH_SIZE_KEY = "FetchSize"; //$NON-NLS-1$
+ public static final String FULL_METADATA_KEY = "FullMetadata"; //$NON-NLS-1$
+ public static final String PARTIAL_RESULTS_KEY = "PartialResults"; //$NON-NLS-1$
+ public static final String TIMEOUT_KEY = "TimeOut"; //$NON-NLS-1$
+
+ public static final String DEBUG_KEY = "Debug"; //$NON-NLS-1$
+
+ /**
+ * The execute parameters
+ */
+ public static final String EXECUTE_QUERY_KEY = "executeQuery"; //$NON-NLS-1$
+ public static final String EXECUTE_UPDATE_KEY = "executeUpdate"; //$NON-NLS-1$
+ public static final String EXECUTE_STORED_PROCEDURE_KEY = "executeStoredProcedure"; //$NON-NLS-1$
+
+ public static final String EXECUTE_METADATA_KEY = "executeMetadata"; //$NON-NLS-1$
+ public static final String EXECUTE_LOGON_KEY = "executeLogon"; //$NON-NLS-1$
+ public static final String EXECUTE_LOGOFF_KEY = "executeLogoff"; //$NON-NLS-1$
+ public static final String EXECUTE_STORED_QUERY = "executeStoredQuery"; //$NON-NLS-1$
+ /*
+ * For the stored queries to query through the MetaMatrixServerAPI vs the
+ * DataService web service
+ */
+ public static final String EXECUTE_STORED_QUERY_API_KEY = "executeStoredQueryAPI"; //$NON-NLS-1$
+
+ /**
+ * For the metadata
+ */
+ public static final String METADATA_RADIO_BUTTON_KEY ="rdo_metadata"; //$NON-NLS-1$
+ public static final String METADATA_PREPEND_KEY = "METADATA_"; //$NON-NLS-1$
+ public static final String CR_PRIMARY_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.CROSS_REFERENCES.Parameters.PRIMARY_GROUP_NAME;
+ public static final String CR_FOREIGN_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.CROSS_REFERENCES.Parameters.FOREIGN_GROUP_NAME;
+ public static final String ELEMENTS_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.ELEMENTS.Parameters.GROUP_PATTERN;
+ public static final String ELEMENTS_ELEMENT_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.ELEMENTS.Parameters.ELEMENT_PATTERN;
+ public static final String EK_PRIMARY_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.EXPORTED_KEYS.Parameters.PRIMARY_GROUP_NAME;
+ public static final String FK_PRIMARY_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.FOREIGN_KEYS.Parameters.GROUP_NAME;
+ public static final String IK_FOREIGN_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.IMPORTED_KEYS.Parameters.FOREIGN_GROUP_NAME;
+ public static final String GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.GROUPS.Parameters.GROUP_PATTERN;
+ public static final String PK_GROUP_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.PRIMARY_KEYS.Parameters.GROUP_NAME;
+ public static final String GP_PROCEDURE_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.PROCEDURE_PARAMETERS.Parameters.PROCEDURE_NAME_PATTERN;
+ public static final String GP_PARAMETER_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.PROCEDURE_PARAMETERS.Parameters.PARAMETER_NAME_PATTERN;
+ public static final String P_PROCEDURE_NAME_KEY = METADATA_PREPEND_KEY+SOAPConstants.METADATA_TYPES.PROCEDURES.Parameters.PROCEDURE_PATTERN;
+
+ /**
+ * For the XML
+ *
+ */
+ public static final String CB_RETURN_SCHEMA = "cb_returnSchema"; //$NON-NLS-1$
+ public static final String CB_VALIDATE_DOCUMENT = "cb_validateDocument"; //$NON-NLS-1$
+
+ public static final String COMPACT_FORMAT_KEY = "xml_compact_format"; //$NON-NLS-1$
+ /**
+ * For standard quering
+ */
+ public static final String SQL_KEY = "SQL"; //$NON-NLS-1$
+
+ /**
+ * For the Stored Procedures
+ */
+ public static final String SP_PREPEND = "sp_"; //$NON-NLS-1$
+ public static final String SEP_STRING = "."; //$NON-NLS-1$
+ public static final String SP_PROCEDURE_PARAM_VALUE_KEY = SP_PREPEND+"sp_procedure_param_value_key"; //$NON-NLS-1$
+ public static final String SP_PROCEDURE_NAME_KEY = SP_PREPEND+"sp_procedure_name_key"; //$NON-NLS-1$
+
+ /**
+ * For the Stored Queries
+ */
+ public static final String SQ_PREPEND = "sq_"; //$NON-NLS-1$
+ public static final String SQ_SEP_STRING = "."; //$NON-NLS-1$
+ public static final String SQ_PARAM_VALUE_KEY = "sq_param_value_key"; //$NON-NLS-1$
+ public static final String SQ_NAME_KEY = "sq_name_key"; //$NON-NLS-1$
+
+
+ /**
+ * For the Stored Queries through the MetamatrixServerAPI Web service
+ */
+ public static final String SQ_PREPEND_API = "sq_api"; //$NON-NLS-1$
+ public static final String SQ_SEP_STRING_API = "."; //$NON-NLS-1$
+ public static final String SQ_PARAM_VALUE_KEY_API = "sq_api_param_value_key"; //$NON-NLS-1$
+ public static final String SQ_NAME_KEY_API = "sq_api_name_key"; //$NON-NLS-1$
+}
+
Added: sqlquerywebservice/src/main/java/org/teiid/soap/util/WebServiceUtil.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/util/WebServiceUtil.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/util/WebServiceUtil.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.soap.util;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.WSSecurityEngineResult;
+import org.apache.ws.security.WSUsernameTokenPrincipal;
+import org.apache.ws.security.handler.WSHandlerConstants;
+import org.apache.ws.security.handler.WSHandlerResult;
+import org.teiid.admin.api.core.Admin;
+import org.teiid.admin.api.exception.AdminException;
+import org.teiid.admin.api.objects.VDB;
+import org.teiid.api.exception.security.LogonException;
+import org.teiid.common.comm.platform.client.ServerAdminFactory;
+import org.teiid.core.CoreConstants;
+import org.teiid.core.util.StringUtil;
+import org.teiid.soap.SOAPPlugin;
+import org.teiid.soap.exceptions.SOAPProcessingException;
+import org.teiid.soap.object.MMServerInfo;
+import org.teiid.soap.object.WSDLUrl;
+import org.teiid.soap.security.Credential;
+
+/**
+ * This class contains utility methods for MetaMatrix Web Services.
+ */
+public class WebServiceUtil {
+
+ /*
+ * This is the username and password for the WSDL user account. This account is strictly used
+ * for getting VDB resources (like the WSDL and schemas). There is a check in place in the Request
+ * to assure that the getUpdatedVDBResources is the only procedure used by this account. The password
+ * is not checked so it's value is not important, it just can't be blank.
+ */
+ public static final String WSDLUSER = CoreConstants.DEFAULT_ANON_USERNAME;
+ public static final String WSDLPASSWORD = "mmx"; //$NON-NLS-1$
+
+ /**
+ * This method will validate that the action value is set. If the value is not set a SOAPException will be thrown. The value
+ * should contain the fully qualified procedure name. For 5.5 WSDL and greater the value should also contain the server
+ * connection properties in order to support non-HTTP transports (like JMS).
+ *
+ * @param action - Action string
+ * @return boolean (true if set)
+ * @exception SOAPProcessingException (if value not set)
+ */
+ public static void validateActionIsSet( String action ) throws SOAPProcessingException {
+
+ if (action == null || action.trim().equals(StringUtil.Constants.EMPTY_STRING)) {
+ throw new SOAPProcessingException(SOAPPlugin.Util.getString("WebServiceUtil.0")); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * This method gets the user credentials containg username and password to use for a server connection. It will return a
+ * WSUsernameTokenPrincipal if WS-Security was used and a string containing encrypted username and password if HTTPBasic was
+ * used. If neither was used an exception will be thrown.
+ *
+ * @return Object (WSUsernameTokenPrincipal or String)
+ * @throws AxisFault
+ * @since 5.5
+ */
+ public static Credential getCredentials( final MessageContext msgCtx ) throws AxisFault {
+
+ WSUsernameTokenPrincipal principal = null;
+ String basicAuthenticationString = null;
+
+ /*
+ * These are thread contextual calls that we can make in this web service implementation to get the authorization
+ * information for the current call.
+ */
+
+ Vector results = null;
+
+ if ((results = (Vector)msgCtx.getProperty(WSHandlerConstants.RECV_RESULTS)) != null) {
+ for (int i = 0; i < results.size(); i++) {
+ WSHandlerResult rResult = (WSHandlerResult)results.get(i);
+ Vector wsSecEngineResults = rResult.getResults();
+
+ for (int j = 0; j < wsSecEngineResults.size(); j++) {
+ WSSecurityEngineResult wser = (WSSecurityEngineResult)wsSecEngineResults.get(j);
+ if (((java.lang.Integer)wser.get(WSSecurityEngineResult.TAG_ACTION)).intValue() == WSConstants.UT
+ && wser.get(WSSecurityEngineResult.TAG_PRINCIPAL) != null) {
+
+ // Extract the principal
+ principal = (WSUsernameTokenPrincipal)wser.get(WSSecurityEngineResult.TAG_PRINCIPAL);
+ }
+ }
+ }
+ }
+
+ // If WS-Security token was not found, check for HTTPBasic
+ if (principal == null) {
+ HttpServletRequest req = (HttpServletRequest)msgCtx.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
+
+ // Acquiring Authorization Header from servlet request
+ basicAuthenticationString = req.getHeader("Authorization"); //$NON-NLS-1$
+
+ if (basicAuthenticationString != null) {
+ basicAuthenticationString = basicAuthenticationString.substring(basicAuthenticationString.indexOf(" ")); //$NON-NLS-1$
+ }
+ }
+
+ if (principal == null && basicAuthenticationString == null) {
+ throw (new AxisFault(SOAPPlugin.Util.getString("WebServiceUtil.1"))); //$NON-NLS-1$
+ }
+
+ Credential credential = null;
+ if (principal != null) {
+ credential = new Credential(principal.getName(), principal.getPassword().getBytes());
+ } else {
+ // Assume Basic
+ credential = getBasicUserNameAndPassword(basicAuthenticationString);
+ }
+
+ return credential;
+ }
+
+ /**
+ * This decodes and parses the username and password from an encrypted string derived from HTTPBasic and returns in a <@link
+ * come.metamatrix.soap.security.Credential> instance.
+ *
+ * @return userName - String
+ */
+ public static Credential getBasicUserNameAndPassword( final Object creds ) {
+
+ // Decoding the authorization header...
+ String decoded = new String(org.apache.axiom.om.util.Base64.decode(creds.toString()));
+
+ // decoded now contains username:password in plain text.
+ int i = decoded.indexOf(":"); //$NON-NLS-1$
+
+ // so we take the username from it ( everything until the ':' )
+ String userName = decoded.substring(0, i);
+
+ // and the password
+ String password = decoded.substring(i + 1, decoded.length());
+
+ return new Credential(userName, password.getBytes());
+ }
+
+ /**
+ * @param userName
+ * @param password
+ * @param serverUrlInfo
+ * @return Admin
+ * @throws LogonException, AdminException
+ * @since 5.5.3
+ */
+ public static Admin getAdminAPI( final String userName,
+ final String password,
+ final MMServerInfo serverUrlInfo ) throws AdminException {
+ Admin serverAdmin = null;
+
+ org.teiid.common.comm.platform.client.ServerAdminFactory factory = ServerAdminFactory.getInstance();
+ serverAdmin = factory.createAdmin(userName, password.toCharArray(), serverUrlInfo.toString());
+
+ return serverAdmin;
+ }
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslationException.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslationException.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslationException.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import com.metamatrix.api.exception.MetaMatrixException;
+
+/**
+ *
+ *
+ */
+public class XMLTranslationException extends MetaMatrixException {
+
+ /**
+ * No-arg constructor required by Externalizable semantics.
+ */
+ public XMLTranslationException() {
+ super();
+ }
+
+ /**
+ * Constructor for XMLTranslationException.
+ * @param message
+ */
+ public XMLTranslationException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor for XMLTranslationException.
+ * @param code
+ * @param message
+ */
+ public XMLTranslationException(String code, String message) {
+ super(code, message);
+ }
+
+ /**
+ * Constructor for XMLTranslationException.
+ * @param e
+ * @param message
+ */
+ public XMLTranslationException(Throwable e, String message) {
+ super(e, message);
+ }
+
+ /**
+ * Constructor for XMLTranslationException.
+ * @param e
+ * @param code
+ * @param message
+ */
+ public XMLTranslationException(Throwable e, String code, String message) {
+ super(e, code, message);
+ }
+
+}
Added: sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslator.java
===================================================================
--- sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslator.java (rev 0)
+++ sqlquerywebservice/src/main/java/org/teiid/soap/util/XMLTranslator.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,870 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.metamatrix.jdbc.MMResultSet;
+import com.metamatrix.soap.SOAPPlugin;
+
+/**
+ * ResultDocuments is an organized way of structuring XML documents
+ * The following illustrates an example of an XML document
+ * <xmldoc>
+ * <xmlschema isprimary="true">
+ * <xml .... </xml>
+ * </xmlschema>
+ * </xmldoc>
+ *
+ *
+ * Stored Procedure Parameters are an organized way of structuring data necessary
+ * for executing a stored procedure (SP) call against the MetaMatrix server
+ * The following illustrates an example of 2 stored procedure parameters with a value of 1 and null
+ * <paramaters>
+ * <param index="1">1</param>
+ * <param index="2"></param>
+ * </parameters>
+ *
+ *
+ * Tabular Results (TR) is an organized way of structuring results data. The following example illustrates
+ * the TR format with full metadata from a ResultSet with two columns and 3 rows of data.
+ * <resultset>
+ * <metadata elementCount=�2� >
+ * <column datatype="float" VDBName=�MyVDB� VDBVersion=�1� groupName=�MyTable�
+ * precision=�1� radix=�� scale=�2� searchable=�true� isAutoIncrementing=�false�
+ * isCaseSensitive=�false� isCurrency=�false� isNullable=�true� isSigned=�true�>FloatNum
+ * </column>
+ *
+ * <column datatype="int" VDBName=�MyVDB� VDBVersion=�1� groupName=�MyTable�
+ * precision=�1� scale=�0� radix=�� searchable=�true� isAutoIncrementing=�false�
+ * isCaseSensitive=�false� isCurrency=�false� isNullable=�true� isSigned=�true�>IntNum
+ * </column>
+ * </metadata>
+ * <data>
+ * <row><cell>5.0</cell><cell>5</cell</row>
+ * <row><cell>8.0</cell><cell>5</cell></row>
+ * <row><cell>3.5</cell><cell>6</cell></row>
+ * </data>
+ * </resultset>
+ *
+ * The following example illustrates limited metadata (which is the default) of the same result set
+ *
+ * <resultset>
+ * <metadata elementCount=�2�>
+ * <column datatype="float">FloatNum</column>
+ * <column datatype="int">IntNum</column>
+ * </metadata>
+ * <data>
+ * <row><cell>5.0</cell><cell>5</cell</row>
+ * <row><cell>8.0</cell><cell>5</cell></row>
+ * <row><cell>3.5</cell><cell>6</cell></row>
+ * </data>
+ * </resultset>
+ *
+ *
+ */
+public class XMLTranslator {
+
+ /**
+ * Constructor for XMLTranslator.
+ */
+ public XMLTranslator() {
+ super();
+ }
+
+ private Document document;
+
+ /**
+ * Translate a results document into a w3c Element
+ * @param documents The documents to translate
+ * @param returnSchema whether to include the schema within the document
+ * @return resultsElement
+ * @throws SOAPTranslationException if a translation error occurs
+ *
+ */
+ public Element translateResultDocuments(ResultSet documents) throws SQLException, XMLTranslationException {
+ Element resultsElement = getNewElement(XMLTranslator.Constant_TAGS.XMLDOCUMENTS_RESULTS_TAG);
+ try{
+ while(documents.next()){
+ //create a document element
+ Element documentElement = getNewElement(XMLTranslator.Constant_TAGS.XMLDOCUMENTS.XMLDOCUMENTS_TAG);
+ // get the document
+ String documentString = documents.getString(1);
+ documentString = documentString.substring(XMLTranslator.Constant_TAGS.XML_TAG.length());
+ // create a text node
+ Node documentNode = getNewTextNode(XMLTranslator.Constant_TAGS.XMLDOCUMENTS.XMLDOCUMENTS_TAG);
+ documentNode.setNodeValue(documentString);
+ // add the node to the document element
+ documentElement.appendChild(documentNode);
+ // add the element to the results
+ resultsElement.appendChild(documentElement);
+ }
+ } catch(Exception e){
+ throw new XMLTranslationException(e,ErrorMessageKeys.xml_0009, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0009));
+ }
+
+ resultsElement = addWarningsAndExceptions(resultsElement, documents);
+ return resultsElement;
+ }
+
+ /**
+ * Translate the schema into a w3c Element
+ * @param schema The String schema of the the XML document
+ * @boolean isPrimary whether this schema is the priimary document
+ * @return Element
+ * @throws XMLTranslationException
+ *
+ */
+ public Element translateXMLSchema(String schema, boolean isPrimary) throws XMLTranslationException {
+ if(schema == null){
+ throw new XMLTranslationException(ErrorMessageKeys.xml_0010, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0010));
+ }
+ Element schemaElement = getNewElement(XMLTranslator.Constant_TAGS.XMLSCHEMA.XMLSCHEMA_TAG);
+ // get a new text node
+ Node xmlNode = getNewTextNode(XMLTranslator.Constant_TAGS.XMLSCHEMA.XMLSCHEMA_TAG);
+ xmlNode.setNodeValue(schema);
+ schemaElement.setAttribute(XMLTranslator.Constant_TAGS.XMLSCHEMA.Attributes.IS_PRIMARY_TAG,""+isPrimary); //$NON-NLS-1$
+ // add the schema to the element
+ schemaElement.appendChild(xmlNode);
+ return schemaElement;
+ }
+
+ /**
+ * This method will translate a list of XML String Schemas into a w3c Element
+ * If the schema is null then it will return a schema of "Schema is not available" in the message node
+ * @param schemas a list of XML String schemas
+ * @return Element containing all the schemas
+ * @throws XMLTranslationException
+ *
+ */
+ public Element translateXMLSchemas(Element root, Collection schemas) throws XMLTranslationException {
+ if(root == null){
+ root = getNewElement(XMLTranslator.Constant_TAGS.XMLSCHEMA.XMLSCHEMA_TAG);
+ }
+ if(schemas == null){
+ Element schemaElement = translateXMLSchema(SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0011), true);
+ root.appendChild(schemaElement);
+ } else {
+ // create a new element
+ Iterator iter = schemas.iterator();
+ boolean isPrimary = true;
+ while(iter.hasNext()){
+ String schema = (String)iter.next();
+ Element schemaElement = translateXMLSchema(schema, isPrimary);
+ // add the element to the main element
+ root.appendChild(schemaElement);
+ isPrimary = false;
+ }
+ }
+ return root;
+ }
+
+
+ /**
+ * Translates a literal XML parameter element into a Map with Int
+ * @param parameters (index and value) parameters in an XML format
+ */
+ public Map translateStoredProcedureParameters(Element parameters) throws XMLTranslationException{
+ Map parameterMap = new HashMap();
+ // get the list of children
+ NodeList list = parameters.getChildNodes();
+ int numberOfParameters = list.getLength();
+ Integer index = null;
+ Object value = null;
+ for(int itemIndex=0;itemIndex<numberOfParameters;itemIndex++){
+ Node parameterNode = list.item(itemIndex);
+ // get the index attribute
+ NamedNodeMap attributes = parameterNode.getAttributes();
+ Node indexAttribute = attributes.getNamedItem(XMLTranslator.Constant_TAGS.StoredProcedureParameters.Param.Attributes.INDEX_TAG);
+ if(indexAttribute != null){
+ // get the index value
+ String indexString = indexAttribute.getNodeValue();
+ try{
+ index = new Integer(indexString);
+ } catch(NumberFormatException nfe){
+ throw new XMLTranslationException(nfe,ErrorMessageKeys.xml_0012, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0012, indexString));
+ }
+ } else {
+ throw new XMLTranslationException(ErrorMessageKeys.xml_0013, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0013));
+ }
+ // now get the value
+ Node valueNode = parameterNode.getFirstChild();
+ if(valueNode != null){
+ value = valueNode.getNodeValue();
+ }
+ // now put the index and value into the Map
+ parameterMap.put(index,value);
+ }
+ return parameterMap;
+ }
+ /**
+ * This method will translate MetaMatrix parameters into a literal XML Element containing
+ * The list of parameters will be a map of Integer indexes to Object values correlating to the
+ * StoredProcedure's modeled information
+ * @param parameters
+ * @return literal xml element containing the parameters
+ * @throws XMLTranslationException if an error occurs
+ *
+ */
+ public Element translateParameters(Map parameters) throws XMLTranslationException{
+ if(parameters == null){
+ // this procedure might not have any parameters so just create an empty list
+ parameters = new HashMap();
+ }
+ Element parametersElement = getNewElement(XMLTranslator.Constant_TAGS.StoredProcedureParameters.PARAMETERS_TAG);
+ try{
+ Iterator iter = parameters.keySet().iterator();
+ while(iter.hasNext()){
+ Integer index = (Integer)iter.next();
+ Object value = parameters.get(index);
+ // construct a parameter element
+ Element parameter = constructParameterElement(index, value);
+ // add the parameter to the root element
+ parametersElement.appendChild(parameter);
+ }
+ } catch(Exception e){
+ throw new XMLTranslationException(e,ErrorMessageKeys.xml_0014, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0014, e.getMessage()));
+ }
+ return parametersElement;
+
+ }
+ /**
+ * Construct a metadata parameter which is used for the metadata method getMetdata
+ * @param parameterName the name of the parameter
+ * @param filter the value to filter on
+ * @return Elemetn
+ * @throws XMLTranslationException
+ */
+ public Element createMetadataParameter(String parameterName, String filter) throws XMLTranslationException{
+ if(parameterName == null){
+ throw new XMLTranslationException(ErrorMessageKeys.xml_0015, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0015));
+ }
+ Element parametersElement = getNewElement(XMLTranslator.Constant_TAGS.MetadataParameter.METADATA_PARAMETER_TAG);
+ parametersElement.setAttribute(XMLTranslator.Constant_TAGS.MetadataParameter.Attributes.NAME_TAG,parameterName);
+
+ Node valueNode = getNewTextNode(XMLTranslator.Constant_TAGS.MetadataParameter.METADATA_PARAMETER_TAG);
+ if(filter == null){
+ filter = new String();
+ }
+ valueNode.setNodeValue(filter);
+ parametersElement.appendChild(valueNode);
+ return parametersElement;
+ }
+
+ /**
+ * Gets the appropriate metadata parameter element based on it it's name
+ * @param parameterName
+ * @return Element
+ * @throws XMLTranslationException
+ */
+ public Element getMetadataParameterElement(Element rootElement, String parameterName) throws XMLTranslationException{
+ NodeList list = rootElement.getChildNodes();
+ int size = list.getLength();
+ for(int i=0;i<size;i++){
+ Node nodeToCheck = list.item(i);
+
+ if(nodeToCheck.getNodeType() == Node.ELEMENT_NODE){
+ String attributeValue = ((Element)nodeToCheck).getAttribute(XMLTranslator.Constant_TAGS.MetadataParameter.Attributes.NAME_TAG);
+ if(parameterName.equalsIgnoreCase(attributeValue)){
+ return (Element)nodeToCheck;
+ }
+ }
+ }
+
+ return rootElement;
+ }
+ /**
+ * Get the metadata parameter name of this element
+ * @return the metadata parameter name
+ * @throws XMLTranslationException
+ */
+ public String getMetadataParameterName(Element metadataParameterElement) throws XMLTranslationException{
+ return metadataParameterElement.getAttribute(XMLTranslator.Constant_TAGS.MetadataParameter.Attributes.NAME_TAG);
+ }
+ /**
+ * Gets the metadata parameter value for a given element
+ * @param metadataParameterElemetn
+ * @throws XMLTranslationException
+ */
+ public String getMetadataParameterValue(Element metadataParameterElement) throws XMLTranslationException{
+ String value = null;
+ Node textNode = metadataParameterElement.getFirstChild();
+ if(textNode != null){
+ value = textNode.getNodeValue();
+ }
+ return value;
+ }
+
+ /**
+ * Construct a parameter element given an Integer index and Object value
+ * @param index
+ * @param value
+ * @return constructed Literal XML element
+ * @throws XMLTranslationException if an error occurs
+ *
+ */
+ private Element constructParameterElement(Integer index, Object value) throws XMLTranslationException{
+ if(index == null){
+ throw new XMLTranslationException(ErrorMessageKeys.xml_0016, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0016));
+ }
+ Element parameterElement = getNewElement(XMLTranslator.Constant_TAGS.StoredProcedureParameters.Param.PARAM_TAG);
+ // add the attribute of index
+ parameterElement.setAttribute(XMLTranslator.Constant_TAGS.StoredProcedureParameters.Param.Attributes.INDEX_TAG,index.toString());
+ // create a value node
+ Node valueNode = getNewTextNode(XMLTranslator.Constant_TAGS.StoredProcedureParameters.Param.PARAM_TAG);
+ if(value == null){
+ // create an empty string to represent a NULL value
+ value = new String();
+ }
+ valueNode.setNodeValue(value.toString());
+ parameterElement.appendChild(valueNode);
+ return parameterElement;
+ }
+
+
+ /**
+ * Given an integer count of the rows affected, create a Literal XML Element
+ * to be returned
+ * @param rowsAffected
+ * @return Element
+ * @throws XMLTranslationException if an error occurs
+ *
+ */
+ public Element translateRowsAffected(int rowsAffected) throws XMLTranslationException {
+ Element rowsAffectedElement = getNewElement(XMLTranslator.Constant_TAGS.ROWS_AFFECTED_TAG);
+ Node rowsAffectedNode = getNewTextNode(XMLTranslator.Constant_TAGS.ROWS_AFFECTED_TAG);
+ rowsAffectedNode.setNodeValue(""+rowsAffected); //$NON-NLS-1$
+ rowsAffectedElement.appendChild(rowsAffectedNode);
+ return rowsAffectedElement;
+ }
+
+
+ /**
+ * Given a MetaMatrix Results object generate the Tabuluar Results
+ *
+ */
+ public Element translateTabularResults(ResultSet results, boolean fullMetadata) throws SQLException, XMLTranslationException {
+ // create the element to return
+ Element resultsElement = getNewElement(XMLTranslator.Constant_TAGS.RESULT_SET_TAG);
+ try {
+ Element metadataElement = createMetadataElement(results.getMetaData());
+
+ List listOfColumnElements = createColumnElements(results.getMetaData(),fullMetadata);
+ Iterator iter = listOfColumnElements.iterator();
+ while(iter.hasNext()){
+ Element columnElement = (Element)iter.next();
+ // add the column element information to the results element
+ metadataElement.appendChild(columnElement);
+ }
+
+ // add the metadata element to the results element
+ resultsElement.appendChild(metadataElement);
+
+ Element dataElement = createDataElement((MMResultSet)results);
+ // add the dataElement to the results Element
+ resultsElement.appendChild(dataElement);
+
+ } catch (Exception e){
+ throw new XMLTranslationException(e,ErrorMessageKeys.xml_0017, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0017, e.getMessage()));
+ }
+ resultsElement = addWarningsAndExceptions(resultsElement, results);
+ return resultsElement;
+ }
+
+ /**
+ * Given a MetaMatrix Results object generate the Tabuluar Results
+ *
+ */
+ public Element translateTabularResults(ResultSet results, boolean fullMetadata, int[] rows) throws SQLException, XMLTranslationException {
+ // create the element to return
+ Element resultsElement = getNewElement(XMLTranslator.Constant_TAGS.RESULT_SET_TAG);
+ try {
+ Element metadataElement = createMetadataElement(results.getMetaData());
+
+ List listOfColumnElements = createColumnElements(results.getMetaData(), fullMetadata);
+ Iterator iter = listOfColumnElements.iterator();
+ while(iter.hasNext()){
+ Element columnElement = (Element)iter.next();
+ // add the column element information to the results element
+ metadataElement.appendChild(columnElement);
+ }
+
+ // add the metadata element to the results element
+ resultsElement.appendChild(metadataElement);
+
+ Element dataElement = createDataElement((MMResultSet)results, rows);
+ // add the dataElement to the results Element
+ resultsElement.appendChild(dataElement);
+
+ } catch (Exception ste){
+ throw new XMLTranslationException(ste,ErrorMessageKeys.xml_0017, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0017, ste.getMessage()));
+ }
+ resultsElement = addWarningsAndExceptions(resultsElement, results);
+ return resultsElement;
+ }
+
+ private Element addWarningsAndExceptions(Element root, ResultSet results) throws SQLException, XMLTranslationException {
+ // add any warnings
+ Element warningElement = translateWarnings(results);
+ if(warningElement != null){
+ root.appendChild(warningElement);
+ }
+ return root;
+ }
+ /**
+ * Helper method to produce a warning element based on results
+ * will return null if there is no warning
+ * @param results
+ * @return element (or null if no warning exists)
+ * @throws XMLTranslationException if an error occurs
+ */
+ private Element translateWarnings(ResultSet results) throws SQLException, XMLTranslationException {
+ Element warningElement = null;
+ SQLWarning warning = results.getWarnings();
+ if(warning != null){
+ // create the root warning element
+ warningElement = getNewElement(XMLTranslator.Constant_TAGS.WARNINGS_TAG);
+ for (;warning != null;
+ warning = warning.getNextWarning()) {
+ String message = warning.getMessage();
+ // create the warning element
+ Element warningChild = getNewElement(XMLTranslator.Constant_TAGS.WARNING_TAG);
+ // create the text node containing the warning message
+ Node childTextNode = getNewTextNode(XMLTranslator.Constant_TAGS.WARNING_TAG);
+ childTextNode.setNodeValue(message);
+ warningChild.appendChild(childTextNode);
+ warningElement.appendChild(warningChild);
+ }
+ }
+
+ return warningElement;
+ }
+
+ /**
+ * This method will create a list of Column element and add all of it's attributes to each one
+ * @param metadata
+ * @param fullMetadata
+ * @throws XMLTranslationException
+ *
+ */
+ private List createColumnElements(ResultSetMetaData metadata, boolean fullMetadata) throws SQLException, XMLTranslationException {
+ List listOfColumns = new ArrayList();
+ int count = metadata.getColumnCount();
+ for(int index=0;index<count;index++){
+ Element columnElement = createColumnElement((com.metamatrix.jdbc.api.ResultSetMetaData)metadata,fullMetadata,index);
+ listOfColumns.add(columnElement);
+ }
+ return listOfColumns;
+ }
+
+ /**
+ * This method will create a data element
+ * e.g.
+ * <data>
+ * <row><cell>5.0</cell><cell>5</cell</row>
+ * <row><cell>8.0</cell><cell>5</cell></row>
+ * <row><cell>3.5</cell><cell>6</cell></row>
+ * </data>
+ * @param results
+ * @return data Element
+ * @throws XMLTranslationException
+ *
+ */
+ private Element createDataElement(MMResultSet results) throws XMLTranslationException {
+ // create the data tag
+ Element dataElement = getNewElement(XMLTranslator.Constant_TAGS.Data.DATA_TAG);
+ try{
+ while(results.next()){
+ List record = results.getCurrentRecord();
+ Element rowElement = createRowElement(record);
+ // add the row to the data Element
+ dataElement.appendChild(rowElement);
+ }
+ } catch(Exception e){
+ throw new XMLTranslationException(e.getMessage());
+ }
+ return dataElement;
+ }
+
+ private Element createDataElement(MMResultSet results, int[] rows) throws XMLTranslationException {
+ if(rows == null) {
+ return createDataElement(results);
+ }
+ // create the data tag
+ Element dataElement = getNewElement(XMLTranslator.Constant_TAGS.Data.DATA_TAG);
+ try{
+ for(int i=0; i < rows.length; i++) {
+ int rowIndex = rows[i];
+ // move the cursor to the next row to be exported
+ while(results.getRow() != rowIndex) {
+ results.next();
+ }
+ List record = results.getCurrentRecord();
+ Element rowElement = createRowElement(record);
+ // add the row to the data Element
+ dataElement.appendChild(rowElement);
+ }
+ } catch(Exception e){
+ throw new XMLTranslationException(e.getMessage());
+ }
+ return dataElement;
+ }
+
+ /**
+ * This will construct a row element for the current row
+ * @param List of records for the current row
+ * @return Element (row Element)
+ * @throws XMLTranslationException
+ */
+ private Element createRowElement(List record) throws XMLTranslationException {
+ // create the data tag
+ Element rowElement = getNewElement(XMLTranslator.Constant_TAGS.Data.Row.ROW_TAG);
+ // now for each column create a cell and add it to the row element
+ Iterator iter = record.iterator();
+ while(iter.hasNext()){
+ Element cellElement = getNewElement(XMLTranslator.Constant_TAGS.Data.Row.Cell.CELL_TAG);
+ Object value = iter.next();
+ // create the cell element
+ Node cellNode = getNewTextNode(XMLTranslator.Constant_TAGS.Data.Row.Cell.CELL_TAG);
+ if(value == null){
+ value = new String();
+ }
+ cellNode.setNodeValue(value.toString());
+ // add the cell to the row Element
+ cellElement.appendChild(cellNode);
+ rowElement.appendChild(cellElement);
+ }
+ return rowElement;
+ }
+
+
+ /**
+ * This method will create a column element and all of it's attributes to it
+ * @param metadata
+ * @param fullMetadata
+ * @param index
+ * @return columnElement
+ * @throws XMLTranslationException if a MetadataAccessException occurs
+ *
+ */
+ private Element createColumnElement(com.metamatrix.jdbc.api.ResultSetMetaData metadata, boolean fullMetadata, int index)
+ throws SQLException, XMLTranslationException {
+ Element columnElement = getNewElement(XMLTranslator.Constant_TAGS.Column.COLUMN_TAG);
+
+// try{
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.DATATYPE,metadata.getColumnTypeName(index));
+ // create a text node
+ Node columnNameNode = getNewTextNode(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.DATATYPE);
+ columnNameNode.setNodeValue(metadata.getColumnName(index));
+ columnElement.appendChild(columnNameNode);
+
+ if(fullMetadata){
+ // add the following attributes
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.VDBNAME,metadata.getVirtualDatabaseName(index));
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.VDBVERSION,metadata.getVirtualDatabaseVersion(index));
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.GROUPNAME,metadata.getCatalogName(index));
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.PRECISION,""+metadata.getPrecision(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.RADIX,"10"); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.SCALE,""+metadata.getScale(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.SEARCHABLE,""+metadata.isSearchable(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.ISAUTOINCREMENTING,""+metadata.isAutoIncrement(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.ISCASESENSITIVE,""+metadata.isCaseSensitive(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.ISCURRENCY,""+metadata.isCurrency(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.ISNULLABLE,""+metadata.isNullable(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.ISSIGNED,""+metadata.isSigned(index)); //$NON-NLS-1$
+ columnElement.setAttribute(XMLTranslator.Constant_TAGS.Column.COLUMN_ATTRIBUTE_TAGS.ISUPDATEABLE,""+metadata.isWritable(index)); //$NON-NLS-1$
+ }
+// }catch(MetadataAccessException mae){
+// throw new XMLTranslationException(mae);
+// }
+ return columnElement;
+ }
+ /**
+ * This method will create a metadata element and add all of it's attributes to it
+ * @param metadata
+ * @param fullMetadata
+ * @throws XMLTranslationException
+ *
+ */
+ private Element createMetadataElement(ResultSetMetaData metadata) throws SQLException, XMLTranslationException {
+
+ // Create the metadata element
+ Element metadataElement = getNewElement(XMLTranslator.Constant_TAGS.Metadata.METADATA_TAG);
+ // add it's attributes
+ metadataElement = addMetadataElementAttributes(metadataElement,metadata);
+
+ return metadataElement;
+ }
+
+ /**
+ * This will construct an element with a namespace of metadata and an elementCount attribute
+ * @param metadata
+ * @throws XMLTranslationException if an error occurs
+ * an example is:
+ * <metadata elementCount=�2�>
+ */
+ private Element addMetadataElementAttributes(Element metadataElement, ResultSetMetaData metadata) throws SQLException {
+
+ String elementCount = new String(""+ metadata.getColumnCount()); //$NON-NLS-1$
+ metadataElement.setAttribute(XMLTranslator.Constant_TAGS.Metadata.Attributes.ELEMENT_COUNT_TAG,elementCount);
+ return metadataElement;
+ }
+
+
+ /**
+ * This method will create a new w3c Element with a given name
+ * @param elementName
+ * @return Element
+ * @throws XMLTranslationException if it cannot create an Element
+ *
+ */
+ public Element getNewElement(String elementName) throws XMLTranslationException {
+ if(elementName == null){
+ throw new XMLTranslationException(ErrorMessageKeys.xml_0018, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0018) );
+ }
+ Document doc = null;
+ try{
+ doc = getDocument();
+ } catch(ParserConfigurationException pce){
+ throw new XMLTranslationException(pce,ErrorMessageKeys.xml_0019, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0019, pce.getMessage()));
+ }
+ return doc.createElement(elementName);
+ }
+
+ protected Document getDocument() throws ParserConfigurationException{
+ if(document == null){
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ document = builder.newDocument();
+ }
+ return document;
+ }
+
+ /**
+ * This method will create a new w3c Node with a given name
+ * @param nodeName
+ * @return Node
+ * @throws XMLTranslationException if it cannot create a Node
+ *
+ */
+ protected Node getNewTextNode(String nodeName) throws XMLTranslationException {
+ if(nodeName == null){
+ throw new XMLTranslationException(ErrorMessageKeys.xml_0020, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0020));
+ }
+ Document doc = null;
+ try{
+ doc = getDocument();
+ } catch(ParserConfigurationException pce){
+ throw new XMLTranslationException(pce,ErrorMessageKeys.xml_0019, SOAPPlugin.Util.getString(ErrorMessageKeys.xml_0019, pce.getMessage()));
+ }
+ return doc.createTextNode(nodeName);
+ }
+
+
+ public String translateElementToString(Node element)throws XMLTranslationException {
+ StringBuffer result = new StringBuffer();
+ if(element.getNodeType() == Node.TEXT_NODE){
+ result.append(element.getNodeValue());
+ } else {
+ if(element.getParentNode() == null) {
+ result.append(XMLTranslator.Constant_TAGS.XML_TAG);
+ }
+ result.append("<"); //$NON-NLS-1$
+ result.append(element.getNodeName());
+ // check for attributes
+ NamedNodeMap map = element.getAttributes();
+ if(map !=null){
+ int attributes = map.getLength();
+ for(int index=0;index<attributes;index++){
+ // get each attribute
+ Node attr = map.item(index);
+ // get the name of the attribute
+ result.append(" "); //$NON-NLS-1$
+ result.append(attr.getNodeName());
+ result.append("="); //$NON-NLS-1$
+ result.append("\""); //$NON-NLS-1$
+ result.append(attr.getNodeValue());
+ result.append("\""); //$NON-NLS-1$
+
+ if(index < attributes-1){
+ result.append(" "); //$NON-NLS-1$
+ }
+ }
+ }
+ result.append(">"); //$NON-NLS-1$
+ // now get any text for this node
+
+ NodeList list = element.getChildNodes();
+ int numberOfChildren = list.getLength();
+ for(int i=0;i<numberOfChildren;i++){
+ String child = translateElementToString(list.item(i));
+ result.append(child);
+ }
+ result.append("</"); //$NON-NLS-1$
+ result.append(element.getNodeName());
+ result.append(">"); //$NON-NLS-1$
+ }
+
+ return result.toString();
+ }
+ /**
+ * This class contains the Constant tag names used in construction of the XML results
+ *
+ * @author Andrew Martello
+ * @since May 15, 2002
+ */
+ public static final class Constant_TAGS {
+
+ public static final String XML_TAG = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$
+
+ public static final String ROWS_AFFECTED_TAG = "rowsaffected"; //$NON-NLS-1$
+
+ public static final String RESULT_SET_TAG = "resultset"; //$NON-NLS-1$
+
+ public static final String WARNINGS_TAG = "warnings"; //$NON-NLS-1$
+
+ public static final String WARNING_TAG = "warning"; //$NON-NLS-1$
+
+ public static final String EXCEPTION_TAG = "exception"; //$NON-NLS-1$
+
+ public static final String XMLDOCUMENTS_RESULTS_TAG = "xmlresults"; //$NON-NLS-1$
+
+ public static final class XMLDOCUMENTS{
+ public static final String XMLDOCUMENTS_TAG = "xmldoc"; //$NON-NLS-1$
+
+ }
+ public static final class XMLSCHEMA{
+ public static final String XMLSCHEMA_TAG = "xmlschema"; //$NON-NLS-1$
+ public static final class Attributes{
+ public static final String IS_PRIMARY_TAG = "isprimary"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class StoredProcedureParameters{
+ public static final String PARAMETERS_TAG = SOAPConstants.STORED_PROCEDURE_PARAMETERS.PARAMETERS_TAG;
+ public static final class Param{
+ public static final String PARAM_TAG = SOAPConstants.STORED_PROCEDURE_PARAMETERS.Param.PARAM_TAG;
+ public static final class Attributes{
+ public static final String INDEX_TAG = SOAPConstants.STORED_PROCEDURE_PARAMETERS.Param.Attributes.INDEX_TAG;
+ }
+ }
+ }
+
+ public static final class Metadata{
+ public static final String METADATA_TAG = "metadata"; //$NON-NLS-1$
+ public static final class Attributes{
+ // how many elements are in the tabular results
+ public static final String ELEMENT_COUNT_TAG = "elementcount"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class MetadataParameter{
+ public static final String METADATA_PARAMETER_TAG = "metadataparameter"; //$NON-NLS-1$
+ public static final class Attributes{
+ public static final String NAME_TAG = "name"; //$NON-NLS-1$
+ }
+ }
+ public static final class Column{
+
+ public static final String COLUMN_TAG = "column"; //$NON-NLS-1$
+ /**
+ * The following class contains the tag names for the metadata information
+ * that will be in the Tabular Results
+ */
+ public static final class COLUMN_ATTRIBUTE_TAGS{
+ // the data type of the column
+ public static final String DATATYPE = "datatype"; //$NON-NLS-1$
+
+ // the virtual database of the particular column
+ public static final String VDBNAME = "vdbname"; //$NON-NLS-1$
+
+ // the virtual databse version of the particular column
+ public static final String VDBVERSION = "vdbversion"; //$NON-NLS-1$
+
+ // the name of the table
+ public static final String GROUPNAME = "groupname"; //$NON-NLS-1$
+
+ // the number of decimal digits
+ public static final String PRECISION = "precision"; //$NON-NLS-1$
+
+ // the column's radix 10 or 2
+ public static final String RADIX = "radix"; //$NON-NLS-1$
+
+ // the column's scale
+ public static final String SCALE = "scale"; //$NON-NLS-1$
+
+ // whether this column is searchable or not
+ public static final String SEARCHABLE = "searchable"; //$NON-NLS-1$
+
+ // whether this column is auto incrementing or not
+ public static final String ISAUTOINCREMENTING = "isautoincrementing"; //$NON-NLS-1$
+
+ // whether this column is case sensitive or not
+ public static final String ISCASESENSITIVE = "iscasesensitive"; //$NON-NLS-1$
+
+ // whether this column can be a currency value
+ public static final String ISCURRENCY = "iscurrency"; //$NON-NLS-1$
+
+ // whether this column can be nullable or not
+ public static final String ISNULLABLE = "isnullable"; //$NON-NLS-1$
+
+ // whether this column is signed or not
+ public static final String ISSIGNED = "issigned"; //$NON-NLS-1$
+
+ // whether this column is updateable or not
+ public static final String ISUPDATEABLE = "isupdateable"; //$NON-NLS-1$
+ }
+ }
+
+ public static final class Data {
+ public static final String DATA_TAG = "data"; //$NON-NLS-1$
+
+ public static final class Row {
+ public static final String ROW_TAG = "row"; //$NON-NLS-1$
+
+ public static final class Cell {
+ public static final String CELL_TAG = "cell"; //$NON-NLS-1$
+ }
+ }
+ }
+ }
+}
Added: sqlquerywebservice/src/main/resources/com/teiid/soap/i18n.properties
===================================================================
--- sqlquerywebservice/src/main/resources/com/teiid/soap/i18n.properties (rev 0)
+++ sqlquerywebservice/src/main/resources/com/teiid/soap/i18n.properties 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,174 @@
+#
+# JBoss, Home of Professional Open Source.
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+
+# authentication (001)
+ERR.018.001.0001 = Session ID parameter cannot be null.
+ERR.018.001.0002 = Server URL parameter cannot be null.
+ERR.018.001.0003 = Virtual database parameter cannot be null.
+ERR.018.001.0004 = Maximum number of anonymous connections reached.
+
+# servlet (002)
+ERR.018.002.0001 = The metadata type ({0}) is not a valid type.
+ERR.018.002.0002 = Unexpected type for current index for stored procedure parameters received from form page, was expecting type of Integer but was ({0}) instead: {1}
+ERR.018.002.0003 = The SOAP Call failed. The details are: {0}
+ERR.018.002.0004 = Required parameter ({0}) not found in form data.
+ERR.018.002.0005 = Unable to get metadata data types: {0}
+ERR.018.002.0006 = Unable to get a connection.
+ERR.018.002.0007 = Unable to use anonymous login as a dedicated session.
+ERR.018.002.0008 = Unable to obtain the connection pool controller: {0}
+ERR.018.002.0009 = Unable to logoff from server: {0}
+ERR.018.002.0010 = The stored procedure cannot be null.
+ERR.018.002.0011 = The stored procedure name cannot be null
+ERR.018.002.0012 = The results returned from the data service were null.
+ERR.018.002.0013 = SQL cannot be null for SOAP method submitXMLQuery
+ERR.018.002.0014 = Unable to read the returned result set.
+ERR.018.002.0015 = Unable to retreive metadata from the Query Results.
+ERR.018.002.0016 = The current user session is invalid, please login again.
+ERR.018.002.0017 = The user connection cannot be established.
+ERR.018.002.0018 = Connection is not available, check server to make sure it is running.
+ERR.018.002.0019 = Unable to establish a connection: {0}
+ERR.018.002.0020 = The specified port {0} is invalid.
+ERR.018.002.0021 = The specified host {0} is invalid.
+ERR.018.002.0022 = Recheck the parameters provided.\n\nThe generated URL: {0}\n\nCould not be used to get WSDL due to error: {1}
+ERR.018.002.0023 = The user entered a negative number.
+ERR.018.002.0024 = The specified version {0} is invalid.
+ERR.018.002.0025 = Did not find a colon delimiter between the server host and port for the supplied list item {0}
+ERR.018.002.0026 = The supplied server host and port list is invalid.
+
+
+# xml (011)
+ERR.018.011.0001 = No children expected when star is chosen.
+ERR.018.011.0002 = Invalid value for {0} element: "{1}" must be either "{2}" or "{3}"
+ERR.018.011.0003 = Invalid input format
+ERR.018.011.0004 = Unable to parse the value for {0} element: "{1}"
+ERR.018.011.0005 = The starting row cannot be negetive.
+ERR.018.011.0006 = The starting row cannot be less than the ending row.
+ERR.018.011.0007 = Null object reference
+ERR.018.011.0008 = The starting row cannot be less than 1.
+ERR.018.011.0009 = Unable to translate result documents.
+ERR.018.011.0010 = Schema cannot be null when attempting to translate.
+ERR.018.011.0011 = Schema is not available.
+ERR.018.011.0012 = index attribute of {0} in stored procedure parameter is not a valid integer.
+ERR.018.011.0013 = index attribute not found in stored procedure attribute.
+ERR.018.011.0014 = Unable to translate the stored procedure parameters due to: {0}
+ERR.018.011.0015 = Parameter name cannot be null.
+ERR.018.011.0016 = Index cannot be null.
+ERR.018.011.0017 = Unable to translate metadata due to: {0}
+ERR.018.011.0018 = element name cannot be null in getNewElement method.
+ERR.018.011.0019 = Unable to create new w3c document due to a parser configuration exception: {0}
+ERR.018.011.0020 = node name cannot be null in getNewTextNode method.
+ERR.018.011.0021 = Unable to execute Stored Procedure due to: {0}
+ERR.018.011.0022 = Unable to execute query due to: {0}
+ERR.018.011.0023 = Unable to execute update due to: {0}
+ERR.018.011.0024 = Unable to execute XMLQuery due to: {0}
+
+# MMSOAPClientServlet
+MMSOAPClientServlet.There_was_a_problem_creating_the_SOAPAuthentication_object._61=There was a problem creating the SOAPAuthentication object.
+
+# MMSOAPServlet
+MMSOAPServlet.Unexpected_error_while_processing_JMS_SOAP_request._4=Unexpected error while processing JMS SOAP request.
+MMSOAPServlet.Unable_to_get_an_Axis_server_engine._5=Unable to get an Axis server engine.
+MMSOAPServlet.Unable_to_set_the_target_service._The_service_name_is_not_correctly_configured._7=Unable to set the target service. The service name is not correctly configured.
+MMSOAPServlet.Failed_to_retrieve_the_response_destination_from_the_JMS_message._No_response_will_be_sent._8=Failed to retrieve the response destination from the JMS message. No response will be sent.
+MMSOAPServlet.Unable_to_send_a_JMS_response_message_to_the_reply_destination._9=Unable to send a JMS response message to the reply destination.
+MMSOAPServlet.Unable_to_initialize_the_JMS_MessageListener_for_data_service_requests_to___{0}__._The_JMS_transport_will_not_function_properly_for_data_service_requests._11=Unable to initialize the JMS MessageListener for data service requests to {0}. The JMS transport will not function properly for data service requests.
+MMSOAPServlet.Unable_to_start_the_JMS_service._The_JMS_transport_will_not_function_properly_for_SOAP_requests._12=Unable to start the JMS service. The JMS transport will not function properly for SOAP requests.
+MMSOAPServlet.Unable_to_obtain_a_connector_with_connection_factory_{0}._The_JMS_transport_will_not_function._1=Unable to obtain a connector with connection factory {0}. The JMS transport will not function.
+MMSOAPServlet.Unable_to_initialize_the_JMS_MessageListener_for_SOAP_service_requests_to_{0}._The_JMS_transport_will_not_function_properly_for_SOAP_requests._1=Unable to initialize the JMS MessageListener for SOAP service requests to {0}. The JMS transport will not function properly for SOAP requests.
+MMSOAPServlet.MMDriver_init_failed=Teiid SOAP service initialization failed because it could not find the requisite Teiid JDBC driver. Please ensure that this driver is in your classpath
+
+# MMSoapQueryService
+MMSoapQueryService.document_name_cannot_be_null_2=document name cannot be null
+MMSoapQueryService.Unable_to_get_metadata_data_types___{0}_4=Unable to get metadata data types : {0}
+MMSoapQueryService.Exception_when_attempting_to_close_the_ResultSet_2=Exception when attempting to close the ResultSet
+MMSoapQueryService.Exception_when_attempting_to_close_the_statement._1=Exception when attempting to close the statement.
+MMSoapQueryService.Exception_when_attempting_to_close_the_connection._2=Exception when attempting to close the connection.
+
+# BytesMessageInputStream
+BytesMessageInputStream.Unable_to_read_a_byte_from_the_BytesMessage__{0}_1=Unable to read a byte from the BytesMessage: {0}
+
+# DataServiceWebServiceImpl
+DataServiceWebServiceImpl.0=The incoming Message Context was null. Cannot authenticate user.
+DataServiceWebServiceImpl.1=The result message from executing the Web Service operation * {0} * contained more than one xml document in the result returned from the Teiid Server. This behavior is not supported by a Data Service type web service.
+DataServiceWebServiceImpl.2=The input Data Service Request message had more than one root element in the body section. This structural anomaly is not supported by the Data Service web service.
+DataServiceWebServiceImpl.3=Exception closing connection.
+DataServiceWebServiceImpl.4=SOAP Action is not present.
+DataServiceWebServiceImpl.6=Exception in executeDataservice: {0}
+DataServiceWebServiceImpl.7=No response document returned. Please check your inputs.
+DataServiceWebServiceImpl.8=There was no row returned in the ResultSet.
+DataServiceWebServiceImpl.9=A processing error occurred for the following xml document: {0}
+DataServiceWebServiceImpl.10=There was a problem parsing the xml result document returned from the server. Here is the error: {0} Please see the log for more details.
+DataServiceWebServiceImpl.11=No security results. Token was not found.
+DataServiceWebServiceImpl.12=Unable to create connection for username: {0} due to {1}.
+DataServiceWebServiceImpl.16=Query Timeout not set or not a valid integer. Using zero for query timeout (NO TIMOUT).
+
+# MMGetVDBResourceServlet
+MMGetVDBResourceServlet.0=Exception closing connection: {0}
+MMGetVDBResourceServlet.1=IOException in decrypt
+MMGetVDBResourceServlet.2=Exception in decrypt
+MMGetVDBResourceServlet.3=Exception in get decrypt key
+MMGetVDBResourceServlet.4=Exception in Cipher.getInstance()
+MMGetVDBResourceServlet.5=InvalidKeyException in decrypt.init()
+MMGetVDBResourceServlet.6=IllegalStateException in decrypt.doFinal()
+MMGetVDBResourceServlet.7=SQLException retrieving VDB Resource
+MMGetVDBResourceServlet.8=Exception retrieving VDB Resource
+MMGetVDBResourceServlet.9=BadPaddingException in decrypt.doFinal()
+MMGetVDBResourceServlet.10=Class Not Found
+MMGetVDBResourceServlet.11=IllegalBlockSizeException in decrypt.doFinal()
+MMGetVDBResourceServlet.12=No results from procedure
+MMGetVDBResourceServlet.13=FileNotFoundException in decrypt
+MMGetVDBResourceServlet.14=Resource Not Found
+MMGetVDBResourceServlet.15=There was an error encoding the query string.
+MMGetVDBResourceServlet.Application_Name=Teiid WSDL Resource Client
+
+# LicenseInfo
+LicenseInfo.UnverifiedLicenseException=UnverifiedLicenseException: {0}
+LicenseInfo.UnlicensedProductException=UnlicensedProductException: {0}
+LicenseInfo.InvalidLicenseException=InvalidLicenseException: {0}
+LicenseInfo.LicenseVerificationException=LicenseVerificationException: {0}
+LicenseInfo.ErrorMessage= Please contact your System Administrator or Teiid for a valid license.
+
+
+PoolingConnectionSource.The_connection_pool_factory_given_the_Pooling_Connection_Source=The connection pool factory given the Pooling Connection Source for the Data Service implementation was null. Please check configuration properties.
+PoolingConnectionSource.The_DataSource_instance_pulled_from_the=The DataSource instance pulled from the map of connection pools was null.
+
+WebServiceUtil.0=The SOAP Action and WSAW Action are null or empty. Please format the action as follows: VDBName=MyVDB&ServerURL=mm://mmHost:mmPort&VDBVersion=<optional>&AdditionalProperties=<optional>&procedure=fully.qualified.procedureName
+WebServiceUtil.1=The NamePasswordCredentials from the SOAP request message were null. The incoming SOAP request cannot be authenticated.
+
+# MMDiscoverWSDLServlet
+MMDiscoverWSDLServlet.1=Error retrieving WSDL Urls. Please verify that the Teiid Server information is correctly defined in the web.xml.
+MMDiscoverWSDLServlet.2=Error retrieving WSDL Urls:
+
+# SqlQueryWebService
+SqlQueryWebService.0=The incoming Message Context was null. Cannot authenticate user.
+Unable_to_close_session_with_id_due_to=Unable to close session with id {0} due to: {1}
+The_time_to_wait_submitted_with_the_executeBlocking_request=The ''time to wait'' submitted with the executeBlocking request was reached. The request has timed out. If results are desired, please revise the ''time to wait'' parameter in the request message and try again.
+
+# SqlQueryWebServiceFault
+Unable_to_create_the_Detail_for_the_exception_due_to=Unable to create the ''Detail'' for the exception due to the following: {0}
+
+# LicenseInfo
+LicenseInfo.UnverifiedLicenseException=UnverifiedLicenseException: {0}
+LicenseInfo.UnlicensedProductException=UnlicensedProductException: {0}
+LicenseInfo.InvalidLicenseException=InvalidLicenseException: {0}
+LicenseInfo.LicenseVerificationException=LicenseVerificationException: {0}
+
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorData.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorData.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorFilter.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorPage.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorTableModel.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorTableModel.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorTextArea.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$SOAPMonitorTextArea.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$ServiceFilterPanel.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet$ServiceFilterPanel.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/SOAPMonitorApplet.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/classes/commons-logging.properties
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/classes/commons-logging.properties (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/classes/commons-logging.properties 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,27 @@
+# -------------------------------------------------------------------
+# Copyright 2001-2004 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
+
+# This is the logging properties that goes to the war, there are two logging conf kept at the
+# svn, one for developement (one at src/test-resources) and other for producation
+
+# Uncomment the next line to disable all logging.
+#org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
+
+# Uncomment the next line to enable the simple log based logging
+#org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
+
+# Uncomment the next line to enable log4j based logging
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
Added: sqlquerywebservice/src/main/webapp/WEB-INF/classes/log4j.properties
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/classes/log4j.properties (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/classes/log4j.properties 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,32 @@
+# A FileAppender will be added programatically, but this properties file needs to be present
+# to avoid warning messages
+
+# Set root category priority to INFO and its only appender to LOGFILE.
+log4j.rootCategory=INFO, LOGFILE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis2.enterprise=FATAL, CONSOLE
+log4j.logger.de.hunsicker.jalopy.io=FATAL, CONSOLE
+
+# Set the enterprise logger priority to FATAL
+log4j.logger.org.apache.axis2.enterprise=FATAL
+log4j.logger.de.hunsicker.jalopy.io=FATAL
+log4j.logger.httpclient.wire.header=FATAL
+log4j.logger.org.apache.commons.httpclient=FATAL
+
+ # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c - %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=../log/JBEDSPWebServices.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n
+
+
+
Added: sqlquerywebservice/src/main/webapp/WEB-INF/conf/axis2.xml
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/conf/axis2.xml (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/conf/axis2.xml 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,420 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<axisconfig name="AxisJava2.0">
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment">true</parameter>
+ <parameter name="hotupdate">false</parameter>
+ <parameter name="enableMTOM">false</parameter>
+ <parameter name="enableSwA">false</parameter>
+
+ <!--Uncomment if you want to enable file caching for attachments -->
+ <!--parameter name="cacheAttachments">true</parameter>
+ <parameter name="attachmentDIR"></parameter>
+ <parameter name="sizeThreshold">4000</parameter-->
+
+ <!--This will give out the timout of the configuration contexts, in milliseconds-->
+ <parameter name="ConfigContextTimeoutInterval">30000</parameter>
+
+ <!--During a fault, stack trace can be sent with the fault message. The following flag will control -->
+ <!--that behavior.-->
+ <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
+
+ <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
+ <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+ <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+ <!--is set, then Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+ <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+ <parameter name="userName">system</parameter>
+ <parameter name="password">stladmin</parameter>
+
+ <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+ <!--ServicesDirectory only works on the following cases-->
+ <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
+ <!---When creating URL Based configurator with URL “file://� -->
+ <!--- War based configurator with expanded case , -->
+
+ <!--All the other scenarios it will be ignored.-->
+ <!--<parameter name="ServicesDirectory">service</parameter>-->
+ <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+ <!--<parameter name="ModulesDirectory">modules</parameter>-->
+
+
+
+ <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+ <!--root which can configured using the following contextRoot parameter-->
+ <!--<parameter name="contextRoot">teiid-soap</parameter>-->
+
+ <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguiush those endpoints-->
+ <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+ <!--context path to proper Axis2 servlets-->
+ <!--<parameter name="servicePath">services</parameter>-->
+ <!--<parameter name="restPath">rest</parameter>-->
+
+ <!-- Following parameter will completely disable REST handling in Axis2-->
+ <parameter name="disableREST" locked="true">false</parameter>
+
+ <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
+ <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
+
+ <!-- Following parameter will set the host name for the epr-->
+ <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
+
+ <!-- If you have a front end host which exposes this webservice using a different public URL -->
+ <!-- use this parameter to override autodetected url -->
+ <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
+
+
+ <!-- The way of adding listener to the system-->
+ <!-- <listener class="org.apache.axis2.ObserverIMPL">-->
+ <!-- <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
+ <!-- </listener>-->
+
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!--This is the default MessageReceiver for the system , if you want to have MessageReceivers for -->
+ <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+ <!--any operation -->
+ <!--Note : You can override this for a particular service by adding the same element with your requirement-->
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+ class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+ class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+ <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
+ class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+ <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+ class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+ </messageReceivers>
+
+ <!-- ================================================= -->
+ <!-- Message Formatter -->
+ <!-- ================================================= -->
+ <!--Following content type to message formatter mapping can be used to implement support for different message -->
+ <!--format serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+ <messageFormatters>
+ <messageFormatter contentType="application/x-www-form-urlencoded"
+ class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+ <messageFormatter contentType="multipart/form-data"
+ class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+ <messageFormatter contentType="application/xml"
+ class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+ </messageFormatters>
+
+ <!-- ================================================= -->
+ <!-- Message Builders -->
+ <!-- ================================================= -->
+ <!--Following content type to builder mapping can be used to implement support for different message -->
+ <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
+ <messageBuilders>
+ <messageBuilder contentType="application/xml"
+ class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+ <messageBuilder contentType="application/x-www-form-urlencoded"
+ class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+ <messageBuilder contentType="multipart/form-data"
+ class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
+ </messageBuilders>
+
+ <!-- ================================================= -->
+ <!-- Transport Ins -->
+ <!-- ================================================= -->
+ <transportReceiver name="http"
+ class="org.apache.axis2.transport.http.SimpleHTTPServer">
+ <parameter name="port">8080</parameter>
+ <!-- Here is the complete list of supported parameters (see example settings further below):
+ port: the port to listen on (default 6060)
+ hostname: if non-null, url prefix used in reply-to endpoint references (default null)
+ originServer: value of http Server header in outgoing messages (default "Simple-Server/1.1")
+ requestTimeout: value in millis of time that requests can wait for data (default 20000)
+ requestTcpNoDelay: true to maximize performance and minimize latency (default true)
+ false to minimize bandwidth consumption by combining segments
+ requestCoreThreadPoolSize: number of threads available for request processing (unless queue fills up) (default 25)
+ requestMaxThreadPoolSize: number of threads available for request processing if queue fills up (default 150)
+ note that default queue never fills up: see HttpFactory
+ threadKeepAliveTime: time to keep threads in excess of core size alive while inactive (default 180)
+ note that no such threads can exist with default unbounded request queue
+ threadKeepAliveTimeUnit: TimeUnit of value in threadKeepAliveTime (default SECONDS) (default SECONDS)
+ -->
+ <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
+ <!-- <parameter name="originServer">My-Server/1.1</parameter> -->
+ <!-- <parameter name="requestTimeout">10000</parameter> -->
+ <!-- <parameter name="requestTcpNoDelay">false</parameter> -->
+ <!-- <parameter name="requestCoreThreadPoolSize">50</parameter> -->
+ <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter> -->
+ <!-- <parameter name="threadKeepAliveTime">240000</parameter> -->
+ <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter> -->
+ </transportReceiver>
+
+ <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+ <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+ <parameter name="myTopicConnectionFactory">
+ <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
+ </parameter>
+
+ <parameter name="myQueueConnectionFactory">
+ <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+ </parameter>
+
+ <parameter name="default">
+ <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+ </parameter>
+ </transportReceiver>-->
+
+ <!-- ================================================= -->
+ <!-- Non-blocking http/s Transport Listener -->
+
+ <!-- the non blocking http transport based on HttpCore + NIO extensions
+ <transportReceiver name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">
+ <parameter name="port" locked="false">9000</parameter>
+ <parameter name="non-blocking" locked="false">true</parameter>
+ </transportReceiver>-->
+
+ <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions
+ <transportReceiver name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLListener">
+ <parameter name="port" locked="false">9002</parameter>
+ <parameter name="non-blocking" locked="false">true</parameter>
+ <parameter name="keystore" locked="false">
+ <KeyStore>
+ <Location>identity.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ <KeyPassword>password</KeyPassword>
+ </KeyStore>
+ </parameter>
+ <parameter name="truststore" locked="false">
+ <TrustStore>
+ <Location>trust.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ </TrustStore>
+ </parameter>-->
+ <!--<parameter name="SSLVerifyClient">require</parameter>
+ supports optional|require or defaults to none -->
+ <!--</transportReceiver>-->
+
+ <!-- ================================================= -->
+ <!-- Mail Transport Listener -->
+ <!-- This is a sample configuration. It assumes a mail server running in localhost.
+ Listener pops messages that comes to the email address red@localhost. Users
+ password is red. Listener connect to the server every 3000 milliseconds.
+ Parameters with "transport." prefix is Axis2 specific. Others are all from Java Mail API.
+ http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
+ -->
+ <!-- ================================================= -->
+ <!--<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
+ <parameter name="mail.pop3.host">localhost</parameter>
+ <parameter name="mail.pop3.user">red</parameter>
+ <parameter name="mail.store.protocol">pop3</parameter>
+ <parameter name="transport.mail.pop3.password">red</parameter>
+ <parameter name="transport.mail.replyToAddress">red@localhost</parameter>
+ <parameter name="transport.listener.interval">3000</parameter>
+ </transportReceiver>-->
+
+ <!--Uncomment if you want to have TCP transport support-->
+ <!--transportReceiver name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port">6060</parameter-->>
+ <!--If you want to give your own host address for EPR generation-->
+ <!--uncomment the following paramter , and set it as you required.-->
+ <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
+ <!-- /transportReceiver -->
+
+ <!-- ================================================= -->
+ <!-- Transport Outs -->
+ <!-- ================================================= -->
+
+ <transportSender name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+ <transportSender name="local"
+ class="org.apache.axis2.transport.local.LocalTransportSender"/>
+ <transportSender name="http"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding">chunked</parameter>
+
+ <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
+ <!-- <parameter name="OmitSOAP12Action">true</parameter> -->
+ </transportSender>
+
+ <transportSender name="https"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding">chunked</parameter>
+ </transportSender>
+ <!--<transportSender name="jms"-->
+ <!--class="org.apache.axis2.transport.jms.JMSSender"/>-->
+
+ <!-- ================================================= -->
+ <!-- Non-blocking http/s Transport Sender -->
+
+ <!-- the non-blocking http transport sender based on HttpCore + NIO extensions
+ <transportSender name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSender">
+ <parameter name="non-blocking" locked="false">true</parameter>
+ </transportSender>-->
+
+ <!-- the non-blocking https transport sender based on HttpCore + NIO SSL extensions
+ <transportSender name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLSender">
+ <parameter name="non-blocking" locked="false">true</parameter>
+ <parameter name="keystore" locked="false">
+ <KeyStore>
+ <Location>identity.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ <KeyPassword>password</KeyPassword>
+ </KeyStore>
+ </parameter>
+ <parameter name="truststore" locked="false">
+ <TrustStore>
+ <Location>trust.jks</Location>
+ <Type>JKS</Type>
+ <Password>password</Password>
+ </TrustStore>
+ </parameter>-->
+ <!--<parameter name="HostnameVerifier">DefaultAndLocalhost</parameter>
+ supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->
+ <!--</transportSender>-->
+
+ <!-- ================================================= -->
+ <!-- Mail Transport Sender -->
+ <!--Only need to uncomment the sender. Configuration is achieved with every client.
+ At any instant mail host should be given. Sample configuration has been given.
+ http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
+ -->
+ <!-- ================================================= -->
+ <!--<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+ <parameter name="mail.smtp.host">localhost</parameter>
+ </transportSender>-->
+
+ <!-- ================================================= -->
+ <!-- Global Modules -->
+ <!-- ================================================= -->
+ <!-- Comment this to disable Addressing -->
+ <module ref="addressing"/>
+
+ <!--Configuring module , providing parameters for modules whether they refer or not-->
+ <!--<moduleConfig name="addressing">-->
+ <!--<parameter name="addressingPara">N/A</parameter>-->
+ <!--</moduleConfig>-->
+
+ <!-- Comment this to disable WS-Security -->
+ <module ref="rampart"/>
+
+ <!-- ================================================= -->
+ <!-- Phases -->
+ <!-- ================================================= -->
+ <phaseOrder type="InFlow">
+ <!-- System predefined phases -->
+ <phase name="Transport">
+ <handler name="ActionUpdateHandler"
+ class="com.metamatrix.soap.handler.ActionUpdateHandler">
+ <order phase="Transport"/>
+ </handler>
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ </phase>
+ <phase name="Addressing">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+ <order phase="Addressing"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+ <handler name="HTTPLocationBasedDispatcher"
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+ </phase>
+ <phase name="RMPhase"/>
+ <!-- System predefined phases -->
+ <!-- After Postdispatch phase module author or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ <phase name="soapmonitorPhase"/>
+ </phaseOrder>
+ <phaseOrder type="OutFlow">
+ <!-- user can add his own phases to this area -->
+ <phase name="soapmonitorPhase"/>
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="RMPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ <phase name="Security"/>
+ </phaseOrder>
+ <phaseOrder type="InFaultFlow">
+ <phase name="Addressing">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+ <order phase="Addressing"/>
+ </handler>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+ <handler name="HTTPLocationBasedDispatcher"
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+ </phase>
+ <phase name="RMPhase"/>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ <phase name="soapmonitorPhase"/>
+ </phaseOrder>
+ <phaseOrder type="OutFaultFlow">
+ <!-- user can add his own phases to this area -->
+ <phase name="soapmonitorPhase"/>
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="RMPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+</axisconfig>
Added: sqlquerywebservice/src/main/webapp/WEB-INF/lib/soapmonitor-1.3.jar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/lib/soapmonitor-1.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/modules/addressing-1.3.mar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/modules/addressing-1.3.mar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/modules/modules.list
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/modules/modules.list (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/modules/modules.list 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,3 @@
+
+ rampart-1.3.mar
+ addressing-1.3.mar
Added: sqlquerywebservice/src/main/webapp/WEB-INF/modules/rahas-1.3.mar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/modules/rahas-1.3.mar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/modules/rampart-1.3.mar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/modules/rampart-1.3.mar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/modules/soapmonitor-1.3.mar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/modules/soapmonitor-1.3.mar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorConstants.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorConstants.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService$ConnectionThread.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService$ConnectionThread.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService$ServerSocketThread.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService$ServerSocketThread.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService.class
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/org/apache/axis2/soapmonitor/servlet/SOAPMonitorService.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/services/SqlQueryWebService.aar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/services/SqlQueryWebService.aar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/services/service.aar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/services/service.aar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/services/services.list
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/services/services.list (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/services/services.list 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,4 @@
+ service.aar
+ SqlQueryWebService.aar
+ version.aar
+
\ No newline at end of file
Added: sqlquerywebservice/src/main/webapp/WEB-INF/services/version.aar
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/WEB-INF/services/version.aar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/web.xml 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,197 @@
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+<!--
+
+ JBoss, Home of Professional Open Source.
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+-->
+<web-app>
+
+ <!-- The optional BasicAuthInterceptor filter is for use with HTTP Basic authentication. It allows circumvention
+ of preemptive authentication which may not always be desired. Comment/uncomment the filter
+ and it's mapping accordingly to achieve the preferred behavior. -->
+ <!--<filter>
+ <filter-name>BasicAuthInterceptor</filter-name>
+ <filter-class>
+ com.metamatrix.soap.servlet.filter.BasicAuthInterceptor
+ </filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>BasicAuthInterceptor</filter-name>
+ <url-pattern>/services/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>BasicAuthInterceptor</filter-name>
+ <url-pattern>/DataService/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>BasicAuthInterceptor</filter-name>
+ <url-pattern>/DataServices/*</url-pattern>
+ </filter-mapping> -->
+
+ <!-- This parameter is used for making the Data Services endpoint value backwards
+ compatible. This value changed in the 5.5 release. Uncomment to change the generated endpoint
+ in the WSDL for a MetaMatrix Data Service Virtual Database for pre-5.5. Leave commented to use
+ the post 5.5 endpoint value.-->
+ <!-- <context-param>
+ <param-name>endpointOverride</param-name>
+ <param-value>/DataServices</param-value>
+ </context-param> -->
+
+ <!--
+ * mmServer and mmProtocol parameters are used to obtain the WSDL from Web Service VDBs.
+ * They should be set accordingly for your environment.
+ *
+ * mmServer is the target Metamatrix host and port. For a clustered environment, comma delimit server/port combinations
+ * mmProtocol should be set to "mms" if the target MetaMatrix server or cluster has SSL enabled.
+ -->
+ <context-param>
+ <param-name>mmServer</param-name>
+ <param-value>localhost:31000</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>mmProtocol</param-name>
+ <param-value>mm</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>AxisServlet</servlet-name>
+ <display-name>Apache-Axis Servlet</display-name>
+ <servlet-class>
+ org.apache.axis2.transport.http.AxisServlet
+ </servlet-class>
+ <load-on-startup>101</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>AxisAdminServlet</servlet-name>
+ <display-name>Apache-Axis AxisAdmin Servlet (Web Admin)</display-name>
+ <servlet-class>
+ org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>AxisAdminServlet</servlet-name>
+ <url-pattern>/axis2-admin/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>MMGetVDBResource</servlet-name>
+ <display-name>MetaMatrix VDB Resource Servlet</display-name>
+ <servlet-class>com.metamatrix.soap.servlet.MMGetVDBResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>MMDiscoverWSDLServlet</servlet-name>
+ <display-name>MetaMatrix Discover WSDL URLs Servlet</display-name>
+ <servlet-class>com.metamatrix.soap.servlet.MMDiscoverWSDLServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>MMWSDLURLGenerator</servlet-name>
+ <display-name>MetaMatrix WSDL URL Generator Servlet</display-name>
+ <servlet-class>com.metamatrix.soap.servlet.WSDLURLGenerator</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>MMGetWSDLServlet</servlet-name>
+ <display-name>MetaMatrix Get WSDL Servlet</display-name>
+ <servlet-class>com.metamatrix.soap.servlet.MMGetWSDLServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>MMGetVDBResource</servlet-name>
+ <url-pattern>/servlet/ArtifactDocumentService/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>MMWSDLURLGenerator</servlet-name>
+ <url-pattern>/servlet/WSDLURLGenerator</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>MMGetWSDLServlet</servlet-name>
+ <url-pattern>/wsdl/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>/SqlQueryWebService</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>/SqlQueryWebService/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>/servlet/AxisServlet</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>*.jws</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>/services/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>/DataService</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AxisServlet</servlet-name>
+ <url-pattern>/DataService/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>MMDiscoverWSDLServlet</servlet-name>
+ <url-pattern>/servlet/DiscoverWSDLServlet</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+ <!-- currently the W3C havent settled on a media type for WSDL;
+ http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
+ for now we go with the basic 'it's XML' response -->
+
+ <mime-mapping>
+ <extension>wsdl</extension>
+ <mime-type>text/xml</mime-type>
+ </mime-mapping>
+
+ <mime-mapping>
+ <extension>xsd</extension>
+ <mime-type>text/xml</mime-type>
+ </mime-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
\ No newline at end of file
Added: sqlquerywebservice/src/main/webapp/WEB-INF/weblogic.xml
===================================================================
--- sqlquerywebservice/src/main/webapp/WEB-INF/weblogic.xml (rev 0)
+++ sqlquerywebservice/src/main/webapp/WEB-INF/weblogic.xml 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,25 @@
+<!DOCTYPE weblogic-web-app PUBLIC "-//BEA
+Systems, Inc.//DTD Web Application 7.0//EN"
+"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<weblogic-web-app>
+ <container-descriptor>
+ <prefer-web-inf-classes>true</prefer-web-inf-classes>
+ </container-descriptor>
+</weblogic-web-app>
\ No newline at end of file
Added: sqlquerywebservice/src/main/webapp/axis2-web/ActivateService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/ActivateService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/ActivateService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,81 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisService,
+ java.util.Collection,
+ java.util.HashMap,
+ java.util.Iterator"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Turn On Service</h1>
+<form method="get" name="serviceActivate" action="axis2-admin/activateService">
+ <table width="100%" border="0">
+<tr>
+ <td colspan="2" >
+ <p>The services that are inactive are listed below. Although you can activate the services from this page, once system is restarted the services will be inactive again</p>
+ </td>
+ </tr>
+ <tr>
+ <%
+HashMap services = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
+Collection col = services.values();
+String html = "";
+int count = 0;
+
+for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+ AxisService axisServices = (AxisService) iterator.next();
+ if(!axisServices.isActive()){
+ count++;
+ html += "<option value='" + axisServices.getName() + "'>";
+ html += axisServices.getName() + "</option>";
+ }
+}
+request.getSession().setAttribute(Constants.SERVICE_MAP,null);
+if (count > 0) {
+%>
+
+ <td width="20%"> Select Service : </td>
+ <td width="80%">
+ <select name="axisService" class="selectBoxes">
+ <%=html%>
+ </select>
+ </tr>
+ <tr>
+ <td width="20%">Activate Service </td>
+ <td width="80%"><input type="checkbox" name="turnon">
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td>
+ <input name="submit" type="submit" value=" Activate " >
+ <input name="reset" type="reset" value=" Clear " >
+ </td>
+<%
+} else {
+ %>
+ <td colspan="2">No inactive services present.</td>
+ <%
+}
+%>
+ </tr>
+
+</table>
+</form>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/EngageToServiceGroup.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/EngageToServiceGroup.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/EngageToServiceGroup.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,136 @@
+<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule,
+ org.apache.axis2.description.AxisServiceGroup,
+ java.util.Collection" %>
+<%@ page import="java.util.HashMap"%>
+<%@ page import="java.util.Iterator"%>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<%
+ String status = (String)request.getSession().getAttribute(Constants.ENGAGE_STATUS);
+ HashMap moduels = (HashMap)request.getSession().getAttribute(Constants.MODULE_MAP);
+ request.getSession().setAttribute(Constants.MODULE_MAP,null);
+ Collection moduleCol = moduels.values();
+ Iterator servicesGroups = (Iterator)request.getSession().getAttribute(Constants.SERVICE_GROUP_MAP);
+ request.getSession().setAttribute(Constants.SERVICE_GROUP_MAP,null);
+%>
+<h1>Engage Module for a Service Group</h1>
+<p>To engage a module for a set of services grouped as an axis service group,</p>
+
+ <ol>
+ <li>select the module you want to engage </li>
+ <li>select the axis service group you like the module to be engaged.</li>
+ <li>click "Engage".</li>
+ </ol>
+
+
+<%
+ if (!moduleCol.iterator().hasNext()) {%>
+ <p>No modules are present to be engaged.</p>
+ <%} else {
+ if (!servicesGroups.hasNext()) {%>
+ <p>No Axis service groups are present to be engaged.</p>
+ <%} else {
+%>
+<form method="get" name="selectModuleForm" action="axis2-admin/engageToServiceGroup">
+ <table border="0" width="100%" cellspacing="1" cellpadding="1">
+ <tr>
+ <td>Select a Module :</td>
+ </tr>
+ <tr>
+ <td>
+ <select name="modules">
+ <%
+ for (Iterator iterator = moduleCol.iterator(); iterator.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iterator.next();
+ String modulename = axisOperation.getName();
+ %> <option align="left" value="<%=modulename%>"><%=modulename%></option>
+ <%
+ }
+ %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>Select a Service Group :</td>
+ </tr>
+ <tr>
+ <td>
+ <select name="axisService">
+ <%
+
+ while(servicesGroups.hasNext()){
+ AxisServiceGroup axisServiceGroup = (AxisServiceGroup) servicesGroups.next();
+ String serviceName = axisServiceGroup.getServiceGroupName();
+ %> <option align="left" value="<%=serviceName%>"><%=serviceName%></option>
+ <%
+ }
+
+ %>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input name="submit" type="submit" value=" Engage " >
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea cols="50" <%
+ if(status == null){
+ %>
+ style="display:none"
+ <%
+ } %>
+ ><%=status%></textarea>
+ </td>
+ </tr>
+ </table>
+</form>
+<%
+ }
+ }
+%>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
+
Added: sqlquerywebservice/src/main/webapp/axis2-web/Error/AuthError.html
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/Error/AuthError.html (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/Error/AuthError.html 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,43 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<html>
+ <header><title>Error In Admin Application</title></header>
+ <body>
+ <table width="100%">
+ <tr>
+ <td align="left"><img src="../images/asf-logo.gif"/></td>
+ <td align="right"><img src="../images/axis_l.jpg"/></td>
+ </tr>
+</table>
+<table width="100%">
+ <tr>
+ <td align="center">Failure in Authentication! Please check your username and password</td>
+
+ </tr>
+ <tr> <td align="center"><a href="/axis2/Login.jsp">back</a></td></tr>
+</table>
+
+<hr/>
+<table width="100%">
+ <tr>
+ <td align="center">All rights reserved by Apache Software Foundation</td>
+ </tr>
+</table>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/Error/GenError.html
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/Error/GenError.html (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/Error/GenError.html 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,43 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<html>
+ <header><title>Error In Admin Application</title></header>
+ <body>
+ <table width="100%">
+ <tr>
+ <td align="left"><img src="../images/asf-logo.gif"/></td>
+ <td align="right"><img src="../images/axis_l.jpg"/></td>
+ </tr>
+</table>
+<table width="100%">
+ <tr>
+ <td align="center">Server Encountered an Error!</td>
+
+ </tr>
+ <tr> <td align="center"><a href="/">home</a></td></tr>
+</table>
+
+<hr/>
+<table width="100%">
+ <tr>
+ <td align="center">All rights reserved by Apache Software Foundation</td>
+ </tr>
+</table>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/Error/error404.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/Error/error404.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/Error/error404.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,62 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=iso-8859-1" language="java" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <jsp:include page="../include/httpbase.jsp"/>
+ <title>Axis2 :: Resource not found!</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+ </head>
+
+ <body>
+ <table width="100%">
+ <tr>
+ <td align="left"><img src="axis2-web/images/asf-logo.gif" alt=""/></td>
+ <td align="right"><img src="axis2-web/images/axis_l.jpg" alt=""/></td>
+ </tr>
+ </table>
+ <table width="100%">
+ <tr>
+ <td>
+ <h1>Requested resource not found!</h1>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ </td>
+ </tr>
+ <tr><td align="center"><a href="axis2-web/index.jsp">home</a></td></tr>
+ </table>
+ <table width="100%">
+ <tr><td>
+ <table width="950px">
+ <tr><td><hr size="1" noshade=""/></td></tr>
+ <tr>
+ <td align="center">Copyright © 1999-2006, The Apache Software Foundation<br/>Licensed under the <a
+ href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</td>
+ </tr>
+ </table>
+ </td>
+ <td> </td>
+ </tr>
+ </table>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/Error/error500.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/Error/error500.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/Error/error500.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,63 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=iso-8859-1" language="java" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <jsp:include page="../include/httpbase.jsp"/>
+ <title>Axis2 :: Internal server error</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+ </head>
+
+ <body>
+ <table width="100%">
+ <tr>
+ <td align="left"><img src="axis2-web/images/asf-logo.gif" alt=""/></td>
+ <td align="right"><img src="axis2-web/images/axis_l.jpg" alt=""/></td>
+ </tr>
+ </table>
+ <table width="100%">
+ <tr>
+ <td>
+ <h1>Internal server error</h1>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ </td>
+ </tr>
+ <tr><td align="center"><a href="axis2-web/index.jsp">home</a></td></tr>
+ </table>
+ <hr/>
+ <table width="100%">
+ <tr><td>
+ <table width="950px">
+ <tr><td><hr size="1" noshade=""/></td></tr>
+ <tr>
+ <td align="center">Copyright © 1999-2006, The Apache Software Foundation<br/>Licensed under the <a
+ href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</td>
+ </tr>
+ </table>
+ </td>
+ <td> </td>
+ </tr>
+ </table>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/HappyAxis.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/HappyAxis.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/HappyAxis.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,519 @@
+<html>
+<%@ page import="org.apache.axiom.om.OMAbstractFactory,
+ org.apache.axiom.om.OMElement,
+ org.apache.axiom.om.OMFactory,
+ org.apache.axiom.om.OMNamespace,
+ org.apache.axis2.AxisFault,
+ org.apache.axis2.Constants,
+ org.apache.axis2.addressing.EndpointReference,
+ org.apache.axis2.client.Options,
+ org.apache.axis2.client.ServiceClient,
+ org.apache.axis2.context.ConfigurationContext,
+ org.apache.axis2.context.ConfigurationContextFactory,
+ javax.servlet.ServletContext,
+ javax.servlet.http.HttpServletRequest,
+ javax.servlet.http.HttpServletResponse,
+ javax.servlet.jsp.JspWriter,
+ javax.xml.parsers.SAXParser,
+ javax.xml.parsers.SAXParserFactory"
+ session="false" %>
+<%@ page import="javax.xml.stream.XMLOutputFactory" %>
+<%@ page import="javax.xml.stream.XMLStreamException" %>
+<%@ page import="java.io.IOException" %>
+<%@ page import="java.io.InputStream" %>
+<%@ page import="java.io.StringWriter" %>
+<%@ page import="java.lang.Class" %>
+<%@ page import="java.lang.ClassNotFoundException"%>
+<%@ page import="java.lang.Exception" %>
+<%@ page import="java.lang.Integer" %>
+<%@ page import="java.lang.NoClassDefFoundError" %>
+<%@ page import="java.lang.SecurityException" %>
+<%@ page import="java.lang.String" %>
+<%@ page import="java.lang.System" %>
+<%@ page import="java.lang.Throwable" %>
+
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<head>
+ <jsp:include page="include/httpbase.jsp"/>
+ <title>Axis2 Happiness Page</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<jsp:include page="include/header.inc"/>
+<jsp:include page="include/link-footer.jsp"/>
+<%IP = request.getRequestURL().toString();%>
+<%!
+ /*
+ * Happiness tests for axis2. These look at the classpath and warn if things
+ * are missing. Normally addng this much code in a JSP page is mad
+ * but here we want to validate JSP compilation too, and have a drop-in
+ * page for easy re-use
+ */
+ String IP;
+
+ /**
+ * Get a string providing install information.
+ * TODO: make this platform aware and give specific hints
+ */
+ public String getInstallHints(HttpServletRequest request) {
+
+ return "<B><I>Note:</I></B> On Tomcat 4.x and Java1.4, you may need to put libraries that contain "
+ + "java.* or javax.* packages into CATALINA_HOME/common/lib"
+ + "<br>jaxrpc.jar and saaj.jar are two such libraries.";
+ }
+
+ /**
+ * test for a class existing
+ * @param classname
+ * @return class iff present
+ */
+ Class classExists(String classname) {
+ try {
+ return Class.forName(classname);
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
+
+ /**
+ * test for resource on the classpath
+ * @param resource
+ * @return true iff present
+ */
+ boolean resourceExists(String resource) {
+ boolean found;
+ InputStream instream = this.getClass().getResourceAsStream(resource);
+ found = instream != null;
+ if (instream != null) {
+ try {
+ instream.close();
+ } catch (IOException e) {
+ }
+ }
+ return found;
+ }
+
+ /**
+ * probe for a class, print an error message is missing
+ * @param out stream to print stuff
+ * @param category text like "warning" or "error"
+ * @param classname class to look for
+ * @param jarFile where this class comes from
+ * @param errorText extra error text
+ * @param homePage where to d/l the library
+ * @return the number of missing classes
+ * @throws IOException
+ */
+ int probeClass(JspWriter out,
+ String category,
+ String classname,
+ String jarFile,
+ String axisOperation,
+ String errorText,
+ String homePage) throws IOException {
+ try {
+ Class clazz = classExists(classname);
+ if (clazz == null) {
+ String url = "";
+ if (homePage != null) {
+ url = "<br> See <a href=" + homePage + ">" + homePage + "</a>";
+ }
+ out.write("<p>" + category + ": could not find class " + classname
+ + " from file <b>" + jarFile
+ + "</b><br> " + errorText
+ + url
+ + "<p>");
+ return 1;
+ } else {
+ String location = getLocation(out, clazz);
+ if (location == null) {
+ out.write("Found " + axisOperation + " (" + classname + ")<br/>");
+ } else {
+ out.write("Found " + axisOperation + " (" + classname + ") <br/> at " + location + "<br/>");
+ }
+ return 0;
+ }
+ } catch (NoClassDefFoundError ncdfe) {
+ String url = "";
+ if (homePage != null) {
+ url = "<br> See <a href=" + homePage + ">" + homePage + "</a>";
+ }
+ out.write("<p>" + category + ": could not find a dependency"
+ + " of class " + classname
+ + " from file <b>" + jarFile
+ + "</b><br> " + errorText
+ + url
+ + "<br>The root cause was: " + ncdfe.getMessage()
+ + "<br>This can happen e.g. if " + classname + " is in"
+ + " the 'common' classpath, but a dependency like "
+ + " activation.jar is only in the webapp classpath."
+ + "<p>");
+ return 1;
+ }
+ }
+
+ /**
+ * get the location of a class
+ * @param out
+ * @param clazz
+ * @return the jar file or path where a class was found
+ */
+
+ String getLocation(JspWriter out,
+ Class clazz) {
+ try {
+ java.net.URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
+ String location = url.toString();
+ if (location.startsWith("jar")) {
+ url = ((java.net.JarURLConnection) url.openConnection()).getJarFileURL();
+ location = url.toString();
+ }
+
+ if (location.startsWith("file")) {
+ java.io.File file = new java.io.File(url.getFile());
+ return file.getAbsolutePath();
+ } else {
+ return url.toString();
+ }
+ } catch (Throwable t) {
+ }
+ return "an unknown location";
+ }
+
+ /**
+ * a class we need if a class is missing
+ * @param out stream to print stuff
+ * @param classname class to look for
+ * @param jarFile where this class comes from
+ * @param errorText extra error text
+ * @param homePage where to d/l the library
+ * @throws IOException when needed
+ * @return the number of missing libraries (0 or 1)
+ */
+ int needClass(JspWriter out,
+ String classname,
+ String jarFile,
+ String axisOperation,
+ String errorText,
+ String homePage) throws IOException {
+ return probeClass(out,
+ "<b>Error</b>",
+ classname,
+ jarFile,
+ axisOperation,
+ errorText,
+ homePage);
+ }
+
+ /**
+ * print warning message if a class is missing
+ * @param out stream to print stuff
+ * @param classname class to look for
+ * @param jarFile where this class comes from
+ * @param errorText extra error text
+ * @param homePage where to d/l the library
+ * @throws IOException when needed
+ * @return the number of missing libraries (0 or 1)
+ */
+ int wantClass(JspWriter out,
+ String classname,
+ String jarFile,
+ String axisOperation,
+ String errorText,
+ String homePage) throws IOException {
+ return probeClass(out,
+ "<b>Warning</b>",
+ classname,
+ jarFile,
+ axisOperation,
+ errorText,
+ homePage);
+ }
+
+ /**
+ * probe for a resource existing,
+ * @param out
+ * @param resource
+ * @param errorText
+ * @throws Exception
+ */
+ int wantResource(JspWriter out,
+ String resource,
+ String errorText) throws Exception {
+ if (!resourceExists(resource)) {
+ out.write("<p><b>Warning</b>: could not find resource " + resource
+ + "<br>"
+ + errorText);
+ return 0;
+ } else {
+ out.write("found " + resource + "<br>");
+ return 1;
+ }
+ }
+
+
+ /**
+ * get servlet version string
+ *
+ */
+
+ public String getServletVersion() {
+ ServletContext context = getServletConfig().getServletContext();
+ int major = context.getMajorVersion();
+ int minor = context.getMinorVersion();
+ return Integer.toString(major) + '.' + Integer.toString(minor);
+ }
+
+
+ /**
+ * what parser are we using.
+ * @return the classname of the parser
+ */
+ private String getParserName() {
+ SAXParser saxParser = getSAXParser();
+ if (saxParser == null) {
+ return "Could not create an XML Parser";
+ }
+
+ // check to what is in the classname
+ return saxParser.getClass().getName();
+ }
+
+ /**
+ * Create a JAXP SAXParser
+ * @return parser or null for trouble
+ */
+ private SAXParser getSAXParser() {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ if (saxParserFactory == null) {
+ return null;
+ }
+ SAXParser saxParser = null;
+ try {
+ saxParser = saxParserFactory.newSAXParser();
+ } catch (Exception e) {
+ }
+ return saxParser;
+ }
+
+ /**
+ * get the location of the parser
+ * @return path or null for trouble in tracking it down
+ */
+
+ private String getParserLocation(JspWriter out) {
+ SAXParser saxParser = getSAXParser();
+ if (saxParser == null) {
+ return null;
+ }
+ return getLocation(out, saxParser.getClass());
+ }
+
+ private String value;
+
+ private OMElement createEnvelope() {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace omNs = fac.createOMNamespace("http://axisversion.sample/xsd", "ns1");
+ OMElement method = fac.createOMElement("getVersion", omNs);
+ OMElement value = fac.createOMElement("myValue", omNs);
+ method.addChild(value);
+ return method;
+ }
+
+ public boolean invokeTheService() {
+ try {
+ // since this one is an internal request we do not use public frontendHostUrl
+ // for it
+ int lastindex = IP.lastIndexOf('/');
+ IP = IP.substring(0, lastindex);
+ ///axis2/axis2-web/services/version
+ IP = IP.replaceAll("axis2-web", "");
+
+ OMElement payload = createEnvelope();
+ ConfigurationContext configctx =
+ ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
+ ServiceClient client = new ServiceClient(configctx, null);
+ EndpointReference targetEPR = new EndpointReference(IP + configctx.getServicePath() + "/Version");
+ Options options = new Options();
+ client.setOptions(options);
+ options.setTo(targetEPR);
+ options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+ OMElement result = client.sendReceive(payload);
+ StringWriter writer = new StringWriter();
+ result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(writer));
+ writer.flush();
+ value = writer.toString();
+ return true;
+ } catch (AxisFault axisFault) {
+ System.out.println(value);
+ return false;
+ } catch (XMLStreamException e) {
+ value = e.getMessage();
+ return false;
+ }
+ }
+
+ public String getFormatedSystemProperty(String systemProperty){
+ return systemProperty.replaceAll(":", ": ");
+ }
+%>
+
+<h1>Axis2 Happiness Page</h1>
+
+<h2>Examining webapp configuration</h2>
+
+<blockquote>
+
+<h4>Essential Components</h4>
+
+<%
+ int needed = 0,wanted = 0;
+
+ /**
+ * the essentials, without these Axis is not going to work
+ */
+ needed = needClass(out, "org.apache.axis2.transport.http.AxisServlet",
+ "axis2-1.0.jar",
+ "Apache-Axis",
+ "Axis2 will not work",
+ "http://xml.apache.org/axis2/");
+ needed += needClass(out, "org.apache.commons.logging.Log",
+ "commons-logging.jar",
+ "Jakarta-Commons Logging",
+ "Axis2 will not work",
+ "http://jakarta.apache.org/commons/logging.html");
+ needed += needClass(out, "javax.xml.stream.XMLStreamReader",
+ "stax-api-1.0.1.jar",
+ "Streaming API for XML",
+ "Axis2 will not work",
+ "http://dist.codehaus.org/stax/jars/");
+ needed += needClass(out, "org.codehaus.stax2.XMLStreamWriter2",
+ "wstx-asl-3.0.1.jar",
+ "Streaming API for XML implementation",
+ "Axis2 will not work",
+ "http://dist.codehaus.org/stax/jars/");
+
+%>
+<%
+ /*
+ * resources on the classpath path
+ */
+ /* broken; this is a file, not a resource
+ wantResource(out,"/server-config.wsdd",
+ "There is no server configuration file;"
+ +"run AdminClient to create one");
+ */
+ /* add more libraries here */
+
+ //is everything we need here
+ if (needed == 0) {
+ //yes, be happy
+ out.write("<p><font color='green'><strong>The core axis2 libraries are present.</strong></font></p>");
+ } else {
+ //no, be very unhappy
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ out.write("<font color='red'><i>"
+ + needed
+ + " core axis2 librar"
+ + (needed == 1 ? "y is" : "ies are")
+ + " missing</i></font>");
+ }
+ //now look at wanted stuff
+%>
+<p>
+ <B><I>Note:</I></B> Even if everything this page probes for is present,
+ there is no guarantee your Axis Service will work, because there are many configuration options
+ that we do not check for. These tests are <i>necessary</i> but not <i>sufficient</i>
+</p>
+</blockquote>
+<h2>Examining Version Service</h2>
+<%
+ boolean serviceStatus = invokeTheService();
+ if (serviceStatus) {
+%>
+<blockquote>
+ <font color="green"><strong>
+ Found Axis2 default Version service and Axis2 is working
+ properly.</strong></font>
+ <p>Now you can drop a service archive in axis2/WEB-INF/services.
+ Following output was produced while invoking Axis2 version service
+ </p>
+ <p><%= value%></p>
+</blockquote>
+
+<%
+} else {
+%>
+<p>
+ <font color="brown"> There was a problem in Axis2 version service , may be
+ the service not available or some thing has gone wrong. But this does
+ not mean system is not working !
+ Try to upload some other service and check to see whether it is
+ working.
+ <br>
+ </font>
+</p>
+
+<%
+ }
+%>
+<h2>Examining Application Server</h2>
+<blockquote>
+<table>
+ <tr><td>Servlet version</td><td><%=getServletVersion()%></td></tr>
+ <tr><td>Platform</td>
+ <td><%=getServletConfig().getServletContext().getServerInfo()%></td>
+ </tr>
+</table>
+</blockquote>
+<h2>Examining System Properties</h2>
+<%
+ /**
+ * Dump the system properties
+ */
+ java.util.Enumeration e = null;
+ try {
+ e = System.getProperties().propertyNames();
+ } catch (SecurityException se) {
+ }
+ if (e != null) {
+ out.write("<pre>");
+ out.write("<table cellpadding='5px' cellspacing='0px' style='border: .5px blue solid;'>");
+ for (; e.hasMoreElements();) {
+ out.write("<tr>");
+ String key = (String) e.nextElement();
+ out.write("<th style='border: .5px #A3BBFF solid;'>" + key + "</th>");
+ out.write("<td style='border: .5px #A3BBFF solid;'>" + getFormatedSystemProperty(System.getProperty(key)) + " </td>");
+ out.write("<tr>");
+ }
+ out.write("</table>");
+ out.write("</pre><p>");
+ } else {
+ out.write("System properties are not accessible<p>");
+ }
+%>
+
+<jsp:include page="include/footer.inc"/>
+</body>
+</html>
+
+
Added: sqlquerywebservice/src/main/webapp/axis2-web/InActivateService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/InActivateService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/InActivateService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,82 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisService,
+ java.util.Collection,
+ java.util.HashMap,
+ java.util.Iterator"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Deactivate Service</h1>
+<form method="get" name="serviceInActivate" action="axis2-admin/deactivateService">
+ <table width="100%" border="0">
+<tr>
+ <td colspan="2" >
+ <p>Only the services that are active are listed below. Note that although you can activate a service from this page, once system is restarted the service will be active again</p>
+ </td>
+ </tr>
+ <tr>
+<%
+HashMap services = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
+Collection col = services.values();
+String html = "";
+int count = 0;
+
+for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+ AxisService axisServices = (AxisService) iterator.next();
+ if(axisServices.isActive()){
+ count++;
+ html += "<option value='" + axisServices.getName() + "'>";
+ html += axisServices.getName() + "</option>";
+ }
+}
+request.getSession().setAttribute(Constants.SERVICE_MAP,null);
+if (count > 0) {
+%>
+
+ <td width="20%"> Select Service : </td>
+ <td width="80%">
+ <select name="axisService" class="selectBoxes">
+<%=html%>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="20%">Deactivate Service </td>
+ <td width="80%"><input type="checkbox" name="turnoff">
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td>
+ <input name="submit" type="submit" value=" Deactivate " >
+ <input name="reset" type="reset" value=" Clear " >
+ </td>
+<%
+} else {
+ %>
+ <td colspan="2">No active services present.</td>
+ <%
+}
+%>
+ </tr>
+
+</table>
+</form>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/LeftFrame.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/LeftFrame.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/LeftFrame.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,183 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<table width="100%" style="border-right:1px solid #CCCCCC;">
+ <tr>
+ <td colspan="2" >
+ <b>Tools </b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/upload">Upload Service</a>
+ </td>
+ </tr>
+<tr>
+ <td colspan="2" >
+ <b><nobr>System Components </nobr></b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td >
+ <a href="axis2-admin/listService">Available Services</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td >
+ <a href="axis2-admin/listServiceGroups">Available Service Groups</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td >
+ <a href="axis2-admin/listModules">Available Modules</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/globalModules">Globally Engaged Modules</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td >
+ <a href="axis2-admin/listPhases">Available Phases</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" >
+ <b>Execution Chains</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/viewGlobalHandlers">Global Chains</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/selectService">Operation Specific Chains</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" >
+ <b>Engage Module</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/engagingglobally">For all Services</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/engageToServiceGroup">For a Service Group</a>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/engageToService">For a Service</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/listOperation">For an Operation</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" >
+ <b>Services</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/deactivateService">Deactivate Service</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/activateService">Activate Service</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/selectServiceParaEdit">Edit Parameters</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" >
+ <b>Contexts</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <a href="axis2-admin/listContexts">View Hierarchy</a>
+ </td>
+ </tr>
+</table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/ListServiceGroup.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/ListServiceGroup.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/ListServiceGroup.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,68 @@
+<%@ page import="org.apache.axis2.Constants" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="org.apache.axis2.description.AxisServiceGroup" %>
+<%@ page import="javax.xml.namespace.QName" %>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="org.apache.axis2.description.AxisModule" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"/>
+<h1>Available Service Groups</h1>
+<%
+ Iterator axisServiceGroupIter = (Iterator) request.getSession().getAttribute(
+ Constants.SERVICE_GROUP_MAP);
+ request.getSession().setAttribute(Constants.SERVICE_GROUP_MAP,null);
+ while (axisServiceGroupIter.hasNext()) {
+ AxisServiceGroup axisServiceGroup = (AxisServiceGroup) axisServiceGroupIter.next();
+ String groupName = axisServiceGroup.getServiceGroupName();
+ Collection modules = axisServiceGroup.getEngagedModules();
+ Iterator axisServiceIter = axisServiceGroup.getServices();
+%>
+<h2><%=groupName%></h2><ul>
+ <%
+ while (axisServiceIter.hasNext()){
+ AxisService axisService = (AxisService) axisServiceIter.next();
+ String serviceName = axisService.getName();
+ %>
+ <li><font color="blue"><a href="axis2-admin/ListSingleService?serviceName=<%=serviceName%>">
+ <%=serviceName%></a></font></li>
+ <%
+ }
+ %>
+</ul>
+<%
+ if (modules.size() > 0) {
+%>
+<I>Engaged modules</I><ul>
+ <%
+ for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iterator.next();
+ String modulDesc = axisOperation.getName();
+ %>
+ <li><%=modulDesc%></li>
+ <%
+ }
+ %></ul><%
+ }
+ }
+%>
+<jsp:include page="include/adminfooter.inc"/>
Added: sqlquerywebservice/src/main/webapp/axis2-web/Login.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/Login.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/Login.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,89 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<html>
+ <head>
+ <jsp:include page="include/httpbase.jsp"/>
+ <title>Login to Axis2 :: Administration page</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css">
+ </head>
+
+ <body onload="javascript:document.LoginForm.userName.focus();">
+ <jsp:include page="include/header.inc"/>
+ <jsp:include page="include/link-footer.jsp"/>
+ <table class="FULL_BLANK">
+ <tr>
+ <td valign="top">
+ <h2>Welcome :</h2>
+ <p>Welcome to the Axis2 administration console. From inside the Axis2 administration console you can :</p>
+ <ul style="list-style: none;" class="loginUL">
+ <li>Check on the health of your Axis2 deployment.</li>
+ <li>Change any parameters at run time.</li>
+ <li>Upload new services into Axis2 [Service hot-deployment].</li>
+ </ul>
+ <font color="orange">Warning: Please note that configuration changes done through the administration console
+ will be lost when the server is restarted.</font>
+ </td>
+ <td valign="top" align="left">
+ <form method="post" name="LoginForm" action="axis2-admin/login">
+ <table class="LOG_IN_FORM">
+ <tr>
+ <td align="center" colspan="2" bgcolor="#b0b0b0" color="#FFFFFF"><font color="#FFFFFF">Login</font></td>
+ </tr>
+ <tr>
+ <td align="center" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td align="right">Username:</td>
+ <td><input align="left" type="text" name="userName" tabindex="1">
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Password : </td>
+ <td><input align="left" type="password" name="password" tabindex="2">
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <br>
+ </td>
+ </tr>
+ <tr>
+ <td align="center" colspan="2">
+ <input name="cancel" type="reset" value=" Clear ">
+ <input name="submit" type="submit" value=" Login ">
+ </td>
+ </tr>
+ <tr>
+ <td align="center" colspan="2">
+ <font color="red"> <% if (request.getAttribute("errorMessage") != null) {%><%= request.getAttribute("errorMessage")%><% } %> </font>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <br/><br/><br/><br/><br/><br/>
+ </td>
+ </tr>
+ </table>
+ <p>Test</p>
+ <jsp:include page="include/footer.inc"/>
+ </body>
+</html>
+
+
Added: sqlquerywebservice/src/main/webapp/axis2-web/MainFrame.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/MainFrame.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/MainFrame.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,28 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Axis2 Administration </title>
+ <style type="text/css">
+ </style></head>
+
+ <body>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/SelectService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/SelectService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/SelectService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,78 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisService,
+ java.util.Collection,
+ java.util.HashMap,
+ java.util.Iterator"%>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+
+ <%
+ String action ="";
+ String buttonName="" ;
+ String status = (String)request.getSession().getAttribute(Constants.SELECT_SERVICE_TYPE);
+ String heading = "";
+ String disc = "";
+ if(status != null && status.equals("MODULE")) {
+ action = "listOperations";
+ buttonName = " View Operations";
+ heading = "Select a service to view operation specific chains";
+ disc = "Select an Axis service from the combo and click on the 'View Operations' button to view operation specific Chains.";
+ } else if(status != null && status.equals("VIEW")){
+ buttonName = " View ";
+ action = "viewServiceHandlers";
+ heading = "Select a service to view service handlers";
+ disc = "Select an Axis service from the combo and click on the 'View' button to view service handlers.";
+ } else if (status != null && status.equals("SERVICE_PARAMETER")){
+ buttonName = " Edit Parameters ";
+ action = "editServicePara"; // Constants.EDIR_SERVICE_PARA;
+ heading = "Select a Service to Edit Parameters";
+ disc = "Select an Axis service from the combo and click on the 'Edit Parameters' button to edit parameters.";
+ }
+ %>
+<h1><%=heading%></h1>
+<p><%=disc%></p>
+<form method="get" name="selectServiceForm" action="axis2-admin/<%=action%>">
+<table border="0" width="50%" cellspacing="1" cellpadding="1">
+ <tr>
+ <td width="35%">Select a Service :</td><td width="65%">
+ <select name="axisService">
+ <%
+ HashMap services = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
+ Collection serviceCol = services.values();
+ for (Iterator iterator = serviceCol.iterator(); iterator.hasNext();) {
+ AxisService axisService = (AxisService)iterator.next();
+ String serviceName = axisService.getName();
+ %> <option align="left" value="<%=serviceName%>"><%=serviceName%></option>
+ <%
+ }
+ request.getSession().setAttribute(Constants.SERVICE_MAP,null);
+ %>
+ </td>
+ </tr>
+ <tr><td colspan="2"> </td></tr>
+ <tr><td> </td>
+ <td colspan="2" align="left">
+ <input name="submit" type="submit" value="<%=buttonName%>" >
+ </td>
+ </tr>
+ </table>
+ </form>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/ServiceParaEdit.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/ServiceParaEdit.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/ServiceParaEdit.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,121 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisOperation,
+ org.apache.axis2.description.AxisService,
+ org.apache.axis2.description.Parameter,
+ java.util.ArrayList,
+ java.util.Iterator"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Edit Service Parameters</h1>
+ <form method="get" name="editServicepara" action="axis2-admin/editServicepara">
+ <%
+ AxisService axisService = (AxisService)request.getSession().
+ getAttribute(Constants.SERVICE);
+ if(axisService != null ){
+ %> <table width="100%">
+
+ <tr>
+ <td colspan="2" ><b>
+ <%
+ String servicName = axisService.getName();
+ %>Service Parameters :: <%=servicName%>
+ </b></td>
+ </tr>
+ <tr>
+ <td colspan="2" ><input style="display:none" name="axisService" value="<%=servicName%>"></td>
+ </tr>
+ <%
+ ArrayList service_para = axisService.getParameters();
+ for (int i = 0; i < service_para.size(); i++) {
+ Parameter parameter = (Parameter) service_para.get(i);
+ if (parameter.getParameterType()==Parameter.OM_PARAMETER) {
+ continue;
+ }
+ %>
+ <tr>
+ <td><%=parameter.getName()%></td>
+ <td><input type="text" value="<%=parameter.getValue()%>"
+ name="<%=(servicName + "_" + parameter.getName())%>" size="50">
+ </td>
+ </tr>
+ <%
+ }
+ Iterator operations = axisService.getOperations();
+ if(operations.hasNext()){
+ %>
+ <tr>
+ <td> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td colspan="2" > <b>Operation Paramaters :: </b>
+ </td>
+ </tr>
+ <%
+ }
+
+ ArrayList op_paras ;
+ operations = axisService.getOperations();
+ while (operations.hasNext()) {
+ AxisOperation axisOperation = (AxisOperation) operations.next();
+ String operationName = axisOperation.getName().getLocalPart();
+ %>
+ <tr>
+ <td colspan="2" > </td>
+ </tr>
+ <tr>
+ <td colspan="2" ><b>Operation : <%=operationName%></b></td>
+ </tr>
+ <%
+ op_paras = axisOperation.getParameters();
+ for (int i = 0; i < op_paras.size(); i++) {
+ Parameter parameter = (Parameter) op_paras.get(i);
+ if (parameter.getParameterType()==Parameter.OM_PARAMETER) {
+ continue;
+ }
+ %>
+ <tr>
+ <td><%=parameter.getName()%></td>
+ <td><input type="text" value="<%=parameter.getValue()%>"
+ name="<%=(operationName + "_" + parameter.getName())%>" size="50">
+ </td>
+ </tr>
+ <%
+ }
+ }
+ %>
+ <tr>
+ <td> </td>
+ <td>
+ <input name="changePara" type="submit" value=" Change " >
+ </td>
+ </tr>
+ </table>
+ <%
+ } else {
+ %>
+ <p><%=request.getAttribute("status")%></p>
+ <%
+ }
+
+ %>
+ <form>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/TopFrame.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/TopFrame.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/TopFrame.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,30 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Untitled Document</title>
+ <style type="text/css">
+ </style></head>
+
+ <body>
+ <jsp:include page="include/adminheader.inc">
+ </jsp:include>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/ViewContexts.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/ViewContexts.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/ViewContexts.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,64 @@
+<%@ page import="org.apache.axis2.Constants"%>
+<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
+<%@ page import="org.apache.axis2.context.ServiceContext"%>
+<%@ page import="org.apache.axis2.context.ServiceGroupContext"%>
+<%@ page import="java.util.Hashtable"%>
+<%@ page import="java.util.Iterator"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Running Context Hierarchy</h1>
+<%
+ ConfigurationContext configContext = (ConfigurationContext) request.getSession().getAttribute(
+ Constants.CONFIG_CONTEXT);
+
+ String[] serviceGroupIds = configContext.getServiceGroupContextIDs();
+ if (serviceGroupIds.length > 0) {
+%>
+<ul>
+ <%
+
+ for (int i = 0; i < serviceGroupIds.length; i++) {
+ String groupContextID = serviceGroupIds[i];
+ ServiceGroupContext groupContext = configContext.getServiceGroupContext(groupContextID);
+ %>
+ <li><%=groupContextID%><font color="blue"><a href="axis2-admin/viewServiceGroupConetxt?TYPE=VIEW&ID=<%=groupContextID%>">
+ View</a></font> <font color="red"><a href="axis2-admin/viewServiceGroupConetxt?TYPE=DELETE&ID=<%=groupContextID%>">
+ Remove</a> </font></li>
+ <%
+ Iterator serviceContextItr = groupContext.getServiceContexts();
+ %><ul><%
+ while (serviceContextItr.hasNext()) {
+ ServiceContext serviceContext = (ServiceContext)serviceContextItr.next();
+ String serviceConID = serviceContext.getAxisService().getName();
+ %>
+ <li><%=serviceConID%><font color="blue"><a href="axis2-admin/viewServiceContext?TYPE=VIEW&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
+ View</a></font></li>
+ <%
+ }
+ %></ul><hr><%
+ }
+ %> </ul>
+ <%
+ } else {%>
+ <p>No running contexts were found on the system.</p>
+ <%}
+%>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/ViewGlobalHandlers.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/ViewGlobalHandlers.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/ViewGlobalHandlers.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,136 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.engine.AxisConfiguration,
+ org.apache.axis2.engine.Handler,
+ org.apache.axis2.engine.Phase,
+ java.util.ArrayList"%>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>View Global Execution Chains</h1>
+ <%
+ AxisConfiguration axisConfig = (AxisConfiguration)request.getSession().
+ getAttribute(Constants.GLOBAL_HANDLERS);
+ if(axisConfig != null ){
+ ArrayList handlers ;
+ ArrayList phases = axisConfig.getInFlowPhases();
+ %>
+ <h3> In Flow Up To and Including Dispatcher </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ phases = axisConfig.getInFaultFlowPhases();
+ %>
+ <h3> In Fault Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+
+ phases = axisConfig.getOutFlowPhases();
+ %>
+ <h3> Out Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ phases = axisConfig.getOutFaultFlowPhases();
+ %>
+ <h3> Out Fault Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+
+ }
+ %>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/ViewServiceHandlers.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/ViewServiceHandlers.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/ViewServiceHandlers.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,145 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisOperation,
+ org.apache.axis2.description.AxisService,
+ org.apache.axis2.engine.Handler,
+ org.apache.axis2.engine.Phase,
+ java.util.ArrayList,
+ java.util.Iterator"%>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>View Operation Specific Chains</h1>
+ <%
+ AxisService axisService = (AxisService)request.getSession().
+ getAttribute(Constants.SERVICE_HANDLERS);
+ if(axisService != null ){
+ ArrayList handlers ;
+ Iterator operations = axisService.getOperations();
+ while (operations.hasNext()) {
+ AxisOperation axisOperationon = (AxisOperation) operations.next();
+ %><h2>Operation Name : <%=axisOperationon.getName().getLocalPart()%></h2><%
+ ArrayList phases = axisOperationon.getRemainingPhasesInFlow();
+ %>
+ <h3> In Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ phases = axisOperationon.getPhasesInFaultFlow();
+ %>
+ <h3> In Fault Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+
+ phases = axisOperationon.getPhasesOutFlow();
+ %>
+ <h3> Out Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ phases = axisOperationon.getPhasesOutFaultFlow();
+ %>
+ <h3> Out Fault Flow </h3>
+ <ul>
+ <%
+ for (int i = 0; i < phases.size(); i++) {
+ Phase phase = (Phase) phases.get(i);
+ %>
+ <li>Phase Name : <%=phase.getPhaseName()%></li>
+ <ul>
+ <%
+ handlers = phase.getHandlers();
+ for (int j = 0; j < handlers.size(); j++) {
+ Handler handler = (Handler) handlers.get(j);
+ %>
+ <li>Handler Name : <%=handler.getHandlerDesc().getName()%></li>
+ <%
+ }
+ %>
+ </ul>
+ <%
+ }
+ %>
+ </ul>
+ <%
+
+ }
+ }
+
+ %>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/admin.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/admin.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/admin.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,30 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Welcome to Axis2 Web Admin Module !!</h1>
+<p>You are now logged into the Axis2 administration console from inside
+the console you will be able to</p>
+ <ul>
+ <li>to check on the health of your Axis2 deployment.</li>
+ <li>to change any parameters at run time.</li>
+ <li>to upload new services into Axis2 [Service hot-deployment].</li>
+ </ul>
+
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/css/axis-style.css
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/css/axis-style.css (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/css/axis-style.css 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+BODY {
+ background-color : "#FFFFFF";
+ leftmargin:"0";
+ topmargin:"0";
+ font-family:Arial;
+ font-size:11pt;
+}
+h1 { font-family: Arial; font-size: 16pt; font-weight: bold }
+h2 { font-family: Arial; font-size: 13pt; font-weight: bold; color: #5D0D7D }
+ul { font-family: Arial; font-size: 11pt }
+input { font-family: Arial; font-size: 8pt; font-weight: bold }
+td { font-family: Arial; font-size: 10pt }
+h3 { font-family: Arial; font-size: 12pt; font-weight:bold }
+TABLE.FULL_BLANK {
+ width : 100%;
+ height : 100%;
+ border : 0;
+ padding : 0;
+}
+
+TABLE.LOG_IN_FORM{
+ height: 200px%;
+ border:1px solid #000000;
+ width: 300px%;
+ cellspacing:1px;
+ cellpadding:1px;
+ background-color: #f7f7f7 ;
+}
+
+UL.loginUL LI{
+ padding: 10pt;
+}
Added: sqlquerywebservice/src/main/webapp/axis2-web/disengage.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/disengage.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/disengage.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,30 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule" %>
+<%@ page import="org.apache.axis2.description.AxisOperation" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="org.apache.axis2.description.Parameter" %>
+<%@ page import="org.apache.axis2.engine.AxisConfiguration" %>
+<%@ page import="org.apache.axis2.util.JavaUtils" %>
+<%@ page import="java.util.*" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"/>
+<%=request.getSession().getAttribute("status")%>
+<jsp:include page="include/adminfooter.inc" />
Added: sqlquerywebservice/src/main/webapp/axis2-web/engagingglobally.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/engagingglobally.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/engagingglobally.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,68 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule,
+ java.util.Collection,
+ java.util.HashMap,
+ java.util.Iterator" %>
+<html>
+<jsp:include page="include/adminheader.jsp"/>
+<%
+ String status = (String) request.getSession().getAttribute(Constants.ENGAGE_STATUS);
+%>
+<h1>Engage Module Globally</h1>
+
+<p>To engage a module on all services across the system, select a module from the combo box below
+ and click on the "Engage" button. Any module that needs to place handlers into the pre-dispatch
+ phase needs to be engaged globally.</p>
+
+<form method="get" name="selectModuleForm" action="axis2-admin/engagingglobally">
+ <table border="0" width="100%" cellspacing="1" cellpadding="1">
+ <tr>
+ <td width="15%">Select a Module :</td>
+ <td width="75%" align="left">
+ <select name="modules">
+ <%
+ HashMap moduels = (HashMap) request.getSession().getAttribute(Constants.MODULE_MAP);
+ request.getSession().setAttribute(Constants.MODULE_MAP,null);
+ Collection moduleCol = moduels.values();
+ for (Iterator iterator = moduleCol.iterator(); iterator.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iterator.next();
+ String modulename = axisOperation.getName();
+ %> <option align="left" value="<%=modulename%>"><%=modulename%></option>
+ <%
+ }
+ %>
+ </select>
+ </td>
+ </tr>
+ <tr><td> </td>
+ <td>
+ <input name="submit" type="submit" value=" Engage ">
+ </td>
+ </tr>
+ </table>
+</form>
+<%
+ if (status != null) {
+%>
+<p><font color="blue"><%=status%></font></p>
+<%
+ } %>
+<jsp:include page="include/adminfooter.inc"/>
Added: sqlquerywebservice/src/main/webapp/axis2-web/engagingtoanoperation.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/engagingtoanoperation.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/engagingtoanoperation.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,124 @@
+<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule,
+ org.apache.axis2.description.AxisOperation,
+ java.util.Collection,
+ java.util.HashMap,
+ java.util.Iterator"%>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<%
+ String status = (String)request.getSession().getAttribute(Constants.ENGAGE_STATUS);
+%>
+<h1>Engage Module for an Operation</h1>
+<p>To engage a module for an axis operation,</p>
+ <ol>
+ <li>select the module you want to engage </li>
+ <li>select the axis operation you like the module to be engaged.</li>
+ <li>click "Engage".</li>
+ </ol>
+
+<form method="get" name="selectModuleForm" action="axis2-admin/listOperations">
+<table border="0" width="100%" cellspacing="1" cellpadding="1">
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>Select a Module :</td>
+ </tr>
+ <tr>
+ <td>
+ <select name="modules">
+ <%
+ HashMap moduels = (HashMap)request.getSession().getAttribute(Constants.MODULE_MAP);
+ request.getSession().setAttribute(Constants.MODULE_MAP,null);
+ Collection moduleCol = moduels.values();
+ for (Iterator iterator = moduleCol.iterator(); iterator.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iterator.next();
+ String modulename = axisOperation.getName();
+ %> <option align="left" value="<%=modulename%>"><%=modulename%></option>
+ <%
+ }
+ %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>Select an Operation :</td>
+ </tr>
+ <tr>
+ <td>
+ <select name="axisOperation">
+ <%
+ Iterator operations = (Iterator)request.getSession().getAttribute(Constants.OPERATION_MAP);
+ while (operations.hasNext()) {
+ AxisOperation axisOperationtion = (AxisOperation)operations.next();
+ String opname = axisOperationtion.getName().getLocalPart();
+ %> <option align="left" value="<%=opname%>"><%=opname%></option>
+ <%
+ }
+ request.getSession().setAttribute(Constants.OPERATION_MAP,null);
+ %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input name="submit" type="submit" value=" Engage " >
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea cols="50" <%
+ if(status == null){
+ %>
+ style="display:none"
+ <%
+ } %>
+ ><%=status%></textarea>
+ </td>
+ </tr>
+ </table>
+ </form>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/engagingtoaservice.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/engagingtoaservice.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/engagingtoaservice.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,142 @@
+<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule,
+ org.apache.axis2.description.AxisService,
+ java.util.Collection,
+ java.util.HashMap,
+ java.util.Iterator"
+ %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<%
+ String status = (String) request.getSession().getAttribute(Constants.ENGAGE_STATUS);
+%>
+<h1>Engage Module for a Service</h1>
+
+<p>To engage a module for a axis service,</p>
+
+ <ol>
+ <li>select the module you want to engage</li>
+ <li>select the axis service you like the module to be engaged.</li>
+ <li>click "Engage".</li>
+ </ol>
+
+<form method="get" name="selectModuleForm" action="axis2-admin/engageToService">
+ <table border="0" width="100%" cellspacing="1" cellpadding="1">
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>Select a Module :</td>
+ </tr>
+ <tr>
+ <td>
+ <select name="modules">
+ <%
+
+ HashMap moduels = (HashMap)request.getSession().getAttribute(Constants.MODULE_MAP);
+ request.getSession().setAttribute(Constants.MODULE_MAP,null);
+ Collection moduleCol = moduels.values();
+ for (Iterator iterator = moduleCol.iterator(); iterator.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iterator.next();
+ String modulename = axisOperation.getName();
+
+ %>
+ <option align="left" value="<%=modulename%>"><%=modulename%>
+ </option>
+ <%
+
+ }
+
+ %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>Select a Service :</td>
+ </tr>
+ <tr>
+ <td>
+ <select name="axisService">
+ <%
+
+ HashMap services = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
+ Collection serviceCol = services.values();
+ for (Iterator iterator = serviceCol.iterator(); iterator.hasNext();) {
+ AxisService axisService = (AxisService)iterator.next();
+ String serviceName = axisService.getName();
+
+ %>
+ <option align="left" value="<%=serviceName%>"><%=serviceName%>
+ </option>
+ <%
+
+ }
+ request.getSession().setAttribute(Constants.SERVICE_MAP,null);
+
+ %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input name="submit" type="submit" value=" Engage ">
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea cols="50" <%
+ if (status == null) {
+ %>
+ style="display:none"
+ <%
+ } %>
+ ><%=status%>
+ </textarea>
+ </td>
+ </tr>
+ </table>
+</form>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
+
Added: sqlquerywebservice/src/main/webapp/axis2-web/error.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/error.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/error.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,30 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@page isErrorPage="true" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+ <table>
+ <tr>
+ <td align="center">An error has occured!. Please check the details below</td>
+ </tr>
+ <tr>
+ <td align="center"><%=exception.getMessage()%></td>
+ </tr>
+ </table>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/errorModule.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/errorModule.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/errorModule.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,29 @@
+<%@ page import="org.apache.axis2.Constants,
+ java.util.Hashtable"%>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+ <%
+ Hashtable errornessModules =(Hashtable)request.getSession().getAttribute(Constants.ERROR_MODULE_MAP);
+ String moduleName = request.getParameter("moduleName");
+ %> <h3>The Module has deployment faults</h3><%
+ %><font color="red" ><%=(String)errornessModules.get(moduleName) %></font><%
+ %>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/globalModules.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/globalModules.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/globalModules.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,57 @@
+ <%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page import="org.apache.axis2.Constants,
+ javax.xml.namespace.QName,
+ java.util.Collection,
+ java.util.Iterator"%>
+ <%@ page import="org.apache.axis2.description.AxisModule" %>
+ <%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Globally Engaged Modules</h1>
+ <%
+ boolean foundModules = false;
+ boolean wroteUL = false;
+ String modulename = "";
+ Collection moduleCol = (Collection) request.getSession().getAttribute(Constants.MODULE_MAP);
+ request.getSession().setAttribute(Constants.MODULE_MAP, null);
+ if (moduleCol != null && moduleCol.size() > 0) {
+ for (Iterator iterator = moduleCol.iterator(); iterator.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iterator.next();
+ modulename = axisOperation.getName();
+ if (!wroteUL) {
+ wroteUL = true;
+ %>
+ <ul>
+<%
+ }
+ %><li><%=modulename%></li>
+ <br> <%
+ }
+ if (wroteUL){
+%>
+ </ul>
+<%
+ }
+ } else{
+ %>
+ <h2><font color="blue">There are no modules engaged globally</font></h2>
+ <%
+ }
+ %>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/images/asf-logo.gif
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/axis2-web/images/asf-logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/axis2-web/images/axis.gif
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/axis2-web/images/axis.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/axis2-web/images/axis.jpg
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/axis2-web/images/axis.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/axis2-web/images/axis_l.jpg
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/axis2-web/images/axis_l.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/adminfooter.inc
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/adminfooter.inc (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/adminfooter.inc 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+</td></tr>
+</table>
+<jsp:include page="footer.inc"></jsp:include>
+</body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.inc
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.inc (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.inc 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,28 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<table width="100%">
+ <tr>
+ <td align="left"><img src="axis2-web/images/asf-logo.gif"/><h1>Axis 2</h1></td>
+ <td align="right"><img src="axis2-web/images/axis.jpg"/></td>
+ </tr>
+ <tr>
+ <td>.</td>
+ <td align="right"><a href="logout" target="_parent" >Log out</a></td>
+ </tr>
+</table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/adminheader.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,42 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=iso-8859-1" language="java" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <jsp:include page="../include/httpbase.jsp"/>
+ <title>Axis2 :: Administration Page</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+ </head>
+
+ <body>
+ <jsp:include page="header.inc"/>
+ <table class="FULL_BLANK">
+ <tr>
+ <td valign="top" width="20%">
+ <jsp:include page="../LeftFrame.jsp"/>
+ </td>
+ <td valign="top" align="left" width="80%">
+ <table width="100%">
+ <tr>
+ <td align="right" colspan="2"><a href="#" onclick="javaacript:history.back();">Back</a> | <a
+ href="axis2-admin/logout">Log out</a></td>
+ </tr>
+ </table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/footer.inc
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/footer.inc (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/footer.inc 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,37 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+</td>
+</tr>
+<tr height="20px">
+ <td>
+ <table width="100%">
+ <tr><td>
+ <table width="950px">
+ <tr><td><hr size="1" noshade="" /></td></tr>
+ <tr>
+ <td align="center">Copyright © 1999-2006, The Apache Software Foundation<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</td>
+ </tr>
+ </table>
+ </td>
+ <td> </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+</table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/header.inc
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/header.inc (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/header.inc 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,29 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<table class="FULL_BLANK"><tr height="100%"><td valign="top">
+<table width="100%">
+<tr><td>
+<table width="950px">
+ <tr>
+ <td align="left"><img src="axis2-web/images/asf-logo.gif"/></td>
+ <td align="right"><img src="axis2-web/images/axis_l.jpg"/></td>
+ </tr>
+</table>
+</td>
+<td> </td></tr></table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/httpbase.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/httpbase.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/httpbase.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,66 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page import="org.apache.axis2.Constants" %>
+<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
+<%@ page import="org.apache.axis2.description.Parameter" %>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet" %>
+<%@ page import="javax.servlet.ServletContext" %>
+<%@ page import="javax.servlet.http.HttpServletRequest" %>
+<%!
+ private String frontendHostUrl;
+
+ public void jspInit() {
+ ServletContext context = this.getServletConfig().getServletContext();
+ ConfigurationContext configctx = (ConfigurationContext) context.getAttribute(AxisServlet.CONFIGURATION_CONTEXT);
+ if (configctx != null){
+ Parameter parameter = configctx.getAxisConfiguration().getParameter(Constants.HTTP_FRONTEND_HOST_URL);
+ if (parameter != null) {
+ frontendHostUrl = (String) parameter.getValue();
+ }
+ }
+ }
+
+ public String calculateHttpBase(HttpServletRequest aRequest) {
+ StringBuffer stringBuffer = new StringBuffer();
+ if (frontendHostUrl != null) {
+ stringBuffer.append(frontendHostUrl);
+ } else {
+ String scheme = aRequest.getScheme();
+ stringBuffer.append(scheme);
+ stringBuffer.append("://");
+ stringBuffer.append(aRequest.getServerName());
+ if (("http".equalsIgnoreCase(scheme) && aRequest.getServerPort() != 80) || "https".equalsIgnoreCase(scheme) && aRequest.getServerPort() != 443)
+ {
+ stringBuffer.append(":");
+ stringBuffer.append(aRequest.getServerPort());
+ }
+ // I think i saw web containers return null for root web context
+ if (aRequest.getContextPath() != null) {
+ stringBuffer.append(aRequest.getContextPath());
+ }
+ }
+ // append / char if needed
+ if (stringBuffer.charAt(stringBuffer.length() - 1) != '/') {
+ stringBuffer.append("/");
+ }
+ String curentUrl = stringBuffer.toString();
+ aRequest.setAttribute("frontendHostUrl", curentUrl);
+ return curentUrl;
+ }
+%><base href="<%= calculateHttpBase(request)%>"/>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.inc
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.inc (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.inc 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<table width="100%">
+ <tr>
+ <td align="center"><a href="index.jsp">Back Home</a></td>
+ </tr>
+</table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/include/link-footer.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,28 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<table width="100%">
+ <tr><td>
+ <table width="950px">
+ <tr>
+ <td align="right"><a href="axis2-web/index.jsp">Back Home</a> | <a href="#" onclick="javascript:window.location.reload(true);return false;">Refresh</a></td>
+ </tr>
+ </table>
+ </td>
+ <td> </td></tr>
+</table>
Added: sqlquerywebservice/src/main/webapp/axis2-web/index.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/index.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/index.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,57 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+ <head>
+ <jsp:include page="include/httpbase.jsp"/>
+ <title>Axis 2 - Home</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css"/>
+ </head>
+
+ <body>
+ <jsp:include page="include/header.inc" />
+ <br/>
+
+ <h1>Welcome!</h1>
+ Welcome to the new generation of Axis. If you can see this page you have
+ successfully deployed the Axis2 Web Application. However, to ensure that Axis2
+ is properly working, we encourage you to click on the validate link.
+ <br/>
+ <ul>
+ <li><a href="services/listServices">Services</a>
+ <br/>
+ View the list of all the available services deployed in this server.
+ </li>
+ <li><a href="axis2-web/HappyAxis.jsp">Validate</a>
+ <br/>
+ Check the system to see whether all the required libraries are in place
+ and view the system information.
+ </li>
+ <%--<li><a href="interop.jsp">Do an interop test</a>
+ <br/>
+ You can run Interoperability tests here
+ </li>--%>
+ <li><a href="axis2-admin/">Administration</a>
+ <br/>
+ Console for administering this Axis2 installation.
+ </li>
+ </ul>
+ <jsp:include page="include/footer.inc"/>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/listFaultyService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/listFaultyService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/listFaultyService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,85 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisOperation"%>
+<%@ page import="org.apache.axis2.description.AxisService"%>
+<%@ page import="java.util.Hashtable"%>
+<%@ page import="java.util.Iterator"%>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<html>
+ <head>
+ <jsp:include page="include/httpbase.jsp"/>
+ <title>List Single service</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css">
+ </head>
+ <body>
+ <jsp:include page="include/header.inc"></jsp:include>
+ <jsp:include page="include/link-footer.jsp"></jsp:include>
+ <%
+ String prifix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) +"services/";
+ %>
+ <%
+ String isFault = (String)request.getSession().getAttribute(Constants.IS_FAULTY);
+ String servicName = request.getParameter("serviceName");
+ if(Constants.IS_FAULTY.equals(isFault)){
+ Hashtable errornessservices =(Hashtable)request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
+ %>
+ <h3>This Web axisService has deployment faults</h3><%
+ %><font color="red" ><%=(String)errornessservices.get(servicName) %></font>
+ <%
+
+ }else {
+
+ AxisService axisService =
+ (AxisService) request.getSession().getAttribute(Constants.SINGLE_SERVICE);
+ if(axisService!=null){
+ Iterator opItr = axisService.getOperations();
+ //operationsList = operations.values();
+ String serviceName = axisService.getName();
+ %><h2><font color="blue"><a href="<%=prifix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
+ <font color="blue">Service EPR : </font><font color="black"><%=prifix + axisService.getName()%></font><br>
+ <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
+ <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i><br>
+ <%
+ if (opItr.hasNext()) {
+ %><i>Available operations</i><%
+ } else {
+ %><i> There are no Operations specified</i><%
+ }
+ opItr = axisService.getOperations();
+ %><ul><%
+ while (opItr.hasNext()) {
+ AxisOperation axisOperation = (AxisOperation) opItr.next();
+ %><li><%=axisOperation.getName().getLocalPart()%></li>
+ <%
+ }
+ %></ul>
+ <%
+ } else{
+ %>
+ <h3><font color="red" >No services found in this location.</font></h3>
+ <%
+ }
+
+ }
+ %>
+<jsp:include page="include/footer.inc"></jsp:include>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/listGroupService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/listGroupService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/listGroupService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,107 @@
+<%@ page import="org.apache.axis2.Constants" %>
+<%@ page import="org.apache.axis2.description.AxisModule" %>
+<%@ page import="org.apache.axis2.description.AxisOperation" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.HashMap" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<html>
+<head>
+ <jsp:include page="include/httpbase.jsp"/>
+ <title>List Services</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+<jsp:include page="include/adminheader.jsp">
+</jsp:include>
+<h1>Available services</h1>
+<%
+ String prifix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) +"/";
+%>
+<%
+ HashMap serviceMap = (HashMap) request.getSession().getAttribute(Constants.SERVICE_MAP);
+ request.getSession().setAttribute(Constants.SERVICE_MAP,null);
+ String servicName = request.getParameter("serviceName");
+ AxisService axisService = (AxisService) serviceMap.get(servicName);
+ if (axisService != null) {
+ Iterator operations;
+ String serviceName;
+ operations = axisService.getOperations();
+ serviceName = axisService.getName();
+%><hr>
+
+<h2><font color="blue"><a href="<%=prifix + axisService.getName()%>?wsdl"><%=serviceName%></a>
+</font></h2>
+<font color="blue">Service EPR :</font><font color="black"><%=prifix + axisService.getName()%></font>
+<h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
+<i><font color="blue">Service Status : <%=axisService.isActive() ? "Active" : "InActive"%></font></i><br/>
+<%
+ Collection engagedModules = axisService.getEngagedModules();
+ String moduleName;
+ if (engagedModules.size() > 0) {
+%>
+<i>Engaged Modules for the Axis Service</i><ul>
+ <%
+ for (Iterator iteratorm = engagedModules.iterator(); iteratorm.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iteratorm.next();
+ moduleName = axisOperation.getName();
+ %><li><%=moduleName%></li>
+ <%
+ }%>
+</ul>
+<%
+ }
+ if (operations.hasNext()) {
+%><br><i>Available operations</i><%
+} else {
+%><i> There are no operations specified</i><%
+ }
+%><ul><%
+ operations = axisService.getOperations();
+ while (operations.hasNext()) {
+ AxisOperation axisOperation = (AxisOperation) operations.next();
+%><li><%=axisOperation.getName().getLocalPart()%></li>
+ <%
+ engagedModules = axisOperation.getEngagedModules();
+ if (engagedModules.size() > 0) {
+ %>
+ <br><i>Engaged Modules for the Operation</i><ul>
+ <%
+ for (Iterator iterator2 = engagedModules.iterator(); iterator2.hasNext();) {
+ AxisModule moduleDecription = (AxisModule) iterator2.next();
+ moduleName = moduleDecription.getName();
+ %><li><%=moduleName%></li><br><%
+ }
+%></ul><%
+ }
+
+ }
+%></ul>
+<%
+ }
+%>
+<jsp:include page="include/adminfooter.inc">
+</jsp:include>
+</body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/listModules.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/listModules.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/listModules.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,82 @@
+ <%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule,
+ java.util.Collection"%>
+ <%@ page import="java.util.Enumeration"%>
+ <%@ page import="java.util.HashMap"%>
+ <%@ page import="java.util.Hashtable"%>
+ <%@ page import="java.util.Iterator"%>
+ <%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+ <h1>Available Modules</h1>
+ <%
+ boolean foundModules = false;
+ boolean wroteUL = false;
+ HashMap moduleMap = (HashMap)request.getSession().getAttribute(Constants.MODULE_MAP);
+ request.getSession().setAttribute(Constants.MODULE_MAP,null);
+ Hashtable errornesModules =(Hashtable)request.getSession().getAttribute(Constants.ERROR_MODULE_MAP);
+ if (moduleMap!=null && !moduleMap.isEmpty()){
+ String modulename ;
+ String moduleDescription ;
+ Collection moduleNames = moduleMap.values();
+ for (Iterator iterator = moduleNames.iterator(); iterator.hasNext();) {
+ foundModules = true;
+ AxisModule moduleQName = (AxisModule) iterator.next();
+ modulename = moduleQName.getName();
+ moduleDescription = moduleQName.getModuleDescription();
+ if(moduleDescription==null){
+ moduleDescription = "[ -- No module description found --]";
+ }
+ if (!wroteUL){
+ wroteUL = true;
+%>
+ <ul>
+<%
+ }
+ %><li><b><%=modulename%></b> : <%=moduleDescription%></li>
+ <%
+ }
+ if (wroteUL){
+%>
+ </ul>
+<%
+ }
+ }
+ %>
+ <%if(errornesModules.size()>0){
+ %>
+ <h3><font color="red">Faulty Modules</font></h3>
+ <%
+ Enumeration faultyModules = errornesModules.keys();
+ while (faultyModules.hasMoreElements()) {
+ foundModules = true;
+ String faultyModuleName = (String) faultyModules.nextElement();
+ %><a href="errorModule.jsp?moduleName=<%=faultyModuleName%>">
+ <%=faultyModuleName%></a>
+ <%
+ }
+ }
+ if(! foundModules) {
+ %>
+ <h2><font color="blue">There are no modules deployed in the system.</font></h2>
+ <%
+ }
+ %>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/listService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/listService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/listService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,152 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisModule" %>
+<%@ page import="org.apache.axis2.description.AxisOperation" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="org.apache.axis2.description.Parameter" %>
+<%@ page import="org.apache.axis2.engine.AxisConfiguration" %>
+<%@ page import="org.apache.axis2.util.JavaUtils" %>
+<%@ page import="java.util.*" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"/>
+
+<h1>Available Services</h1>
+<% String prefix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) + "/";
+%>
+<%
+ HashMap serviceMap = (HashMap) request.getSession().getAttribute(Constants.SERVICE_MAP);
+ request.getSession().setAttribute(Constants.SERVICE_MAP, null);
+ Hashtable errornessservice = (Hashtable) request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
+ boolean status = false;
+ if (serviceMap != null && !serviceMap.isEmpty()) {
+ Iterator operations;
+ String serviceName;
+ Collection servicecol = serviceMap.values();
+ for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {
+ AxisService axisService = (AxisService) iterator.next();
+ operations = axisService.getOperations();
+ serviceName = axisService.getName();
+%><h2><font color="blue"><a href="<%=prefix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
+<font color="blue">Service EPR : </font><font color="black"><%=prefix + axisService.getName()%></font><br>
+<%
+ // do we need to enable REST in the main servlet so that it handles both REST and SOAP messages
+ boolean disableREST = false;
+ AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();
+
+ Parameter parameter ;
+
+ // do we need to completely disable REST support
+ parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST);
+ if (parameter != null) {
+ disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
+ }
+ if (!disableREST) {
+%>
+
+<%
+%>
+<%
+ }
+
+
+ String serviceDescription = axisService.getServiceDescription();
+ if (serviceDescription == null || "".equals(serviceDescription)) {
+ serviceDescription = "No description available for this service";
+ }
+%>
+ <h4>Service Description : <font color="black"><%=serviceDescription%></h4>
+<i><font color="blue">Service Status : <%=axisService.isActive() ? "Active" : "InActive"%></font></i><br>
+<%
+ Collection engagedModules = axisService.getEngagedModules();
+ String moduleName;
+ boolean modules_present = false;
+ if (engagedModules.size() > 0) {
+%>
+<i>Engaged modules for the service</i>
+<%
+ for (Iterator iteratorm = engagedModules.iterator(); iteratorm.hasNext();) {
+ AxisModule axisOperation = (AxisModule) iteratorm.next();
+ moduleName = axisOperation.getName();
+ if (!modules_present) {
+ modules_present = true;
+%>
+<ul>
+ <% }
+ %><li><%=moduleName%> :: <a href="axis2-admin/disengageModule?type=service&serviceName=<%=serviceName%>&module=<%=moduleName%>">Disengage</a></li>
+ <br>
+ <%
+ }
+ if (modules_present) {%>
+</ul>
+<%
+ }
+ }
+ if (operations.hasNext()) {
+%><br><i>Available operations</i><%
+} else {
+%><i> There are no Operations specified</i><%
+ }
+%><ul><%
+ operations = axisService.getOperations();
+ while (operations.hasNext()) {
+ AxisOperation axisOperation = (AxisOperation) operations.next();
+%><li><%=axisOperation.getName().getLocalPart()%></li>
+ <%-- <br>Operation EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
+ <%
+ engagedModules = axisOperation.getEngagedModules();
+ if (engagedModules.size() > 0) {
+ %>
+ <br><i>Engaged Modules for the Operation</i><ul>
+ <%
+ for (Iterator iterator2 = engagedModules.iterator(); iterator2.hasNext();) {
+ AxisModule moduleDecription = (AxisModule) iterator2.next();
+ moduleName = moduleDecription.getName();
+ %><li><%=moduleName%> :: <a href="axis2-admin/disengageModule?type=operation&serviceName=<%=serviceName%>&operation=<%=axisOperation.getName().getLocalPart()%>&module=<%=moduleName%>">Disengage</a></li><br><%
+ }
+%></ul><%
+ }
+
+ }
+%></ul>
+<%
+ status = true;
+ }
+ }
+ if (errornessservice != null) {
+ if (errornessservice.size() > 0) {
+ request.getSession().setAttribute(Constants.IS_FAULTY, Constants.IS_FAULTY);
+%>
+<h3><font color="red">Faulty Services</font></h3>
+<%
+ Enumeration faultyservices = errornessservice.keys();
+ while (faultyservices.hasMoreElements()) {
+ String faultyserviceName = (String) faultyservices.nextElement();
+%><h3><font color="blue"><a href="services/ListFaultyServices?serviceName=<%=faultyserviceName%>">
+ <%=faultyserviceName%></a></font></h3>
+<%
+ }
+ }
+ status = true;
+ }
+ if (!status) {
+%> No services listed! Try hitting refresh. <%
+ }
+%>
+<jsp:include page="include/adminfooter.inc" />
Added: sqlquerywebservice/src/main/webapp/axis2-web/listServices.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/listServices.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/listServices.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,126 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisOperation" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="org.apache.axis2.description.Parameter" %>
+<%@ page import="org.apache.axis2.engine.AxisConfiguration" %>
+<%@ page import="org.apache.axis2.util.JavaUtils" %>
+<%@ page import="java.util.*" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<jsp:include page="include/httpbase.jsp"/>
+<head><title>List Services</title>
+ <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css"/>
+</head>
+
+<body>
+<jsp:include page="include/header.inc" />
+<jsp:include page="include/link-footer.jsp" />
+<h1>Available services</h1>
+<% String prefix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) + "/";
+%>
+<%
+ HashMap serviceMap = (HashMap) request.getSession().getAttribute(Constants.SERVICE_MAP);
+ request.getSession().setAttribute(Constants.SERVICE_MAP, null);
+ Hashtable errornessservice = (Hashtable) request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
+ boolean status = false;
+ if (serviceMap != null && !serviceMap.isEmpty()) {
+ Iterator opItr;
+ //HashMap operations;
+ String serviceName;
+ Collection servicecol = serviceMap.values();
+ // Collection operationsList;
+ for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {
+ AxisService axisService = (AxisService) iterator.next();
+ opItr = axisService.getOperations();
+ //operationsList = operations.values();
+ serviceName = axisService.getName();
+%><h2><font color="blue"><a href="<%=prefix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
+<font color="blue">Service EPR : </font><font color="black"><%=prefix + axisService.getName()%></font><br>
+<%
+ boolean disableREST = false;
+ AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();
+
+ Parameter parameter ;
+
+ // do we need to completely disable REST support
+ parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST);
+ if (parameter != null) {
+ disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
+ }
+
+ if (!disableREST ) {
+
+%>
+<%
+ }
+
+
+ String serviceDescription = axisService.getServiceDescription();
+ if (serviceDescription == null || "".equals(serviceDescription)) {
+ serviceDescription = "No description available for this service";
+ }
+%>
+<h4>Service Description : <font color="black"><%=serviceDescription%></h4>
+<i><font color="blue">Service Status : <%=axisService.isActive() ? "Active" : "InActive"%></font></i><br>
+<%
+ if (opItr.hasNext()) {
+%><i>Available Operations</i><%
+} else {
+%><i> There are no Operations specified</i><%
+ }
+ opItr = axisService.getOperations();
+%><ul><%
+ while (opItr.hasNext()) {
+ AxisOperation axisOperation = (AxisOperation) opItr.next();
+%><li><%=axisOperation.getName().getLocalPart()%></li>
+ <%-- <br>Operation EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
+ <%
+ }
+ %></ul>
+<%
+ status = true;
+ }
+ }
+ if (errornessservice != null) {
+ if (errornessservice.size() > 0) {
+ request.getSession().setAttribute(Constants.IS_FAULTY, Constants.IS_FAULTY);
+%>
+<hr>
+
+<h3><font color="blue">Faulty Services</font></h3>
+<%
+ Enumeration faultyservices = errornessservice.keys();
+ while (faultyservices.hasMoreElements()) {
+ String faultyserviceName = (String) faultyservices.nextElement();
+%><h3><font color="blue"><a href="services/ListFaultyServices?serviceName=<%=faultyserviceName%>">
+ <%=faultyserviceName%></a></font></h3>
+<%
+ }
+ }
+ status = true;
+ }
+ if (!status) {
+%> No services listed! Try hitting refresh. <%
+ }
+%>
+<jsp:include page="include/footer.inc" />
+</body>
+</html>
Added: sqlquerywebservice/src/main/webapp/axis2-web/listSingleService.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/listSingleService.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/listSingleService.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,103 @@
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.description.AxisOperation" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="org.apache.axis2.description.Parameter" %>
+<%@ page import="org.apache.axis2.engine.AxisConfiguration" %>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet" %>
+<%@ page import="org.apache.axis2.util.JavaUtils" %>
+<%@ page import="java.util.Hashtable" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"/>
+<h1>List Single Service</h1>
+<%
+ String prefix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) + "/";
+%>
+<%
+ String isFault = (String) request.getSession().getAttribute(Constants.IS_FAULTY);
+ String servicName = request.getParameter("serviceName");
+ if (Constants.IS_FAULTY.equals(isFault)) {
+ Hashtable errornessservices = (Hashtable) request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
+%>
+<h3>This Axis service has deployment faults.</h3><%
+%><font color="red"><%=(String) errornessservices.get(servicName) %></font>
+<%
+
+} else {
+
+ AxisService axisService =
+ (AxisService) request.getSession().getAttribute(Constants.SINGLE_SERVICE);
+ if (axisService != null) {
+ Iterator opItr = axisService.getOperations();
+ //operationsList = operations.values();
+ String serviceName = axisService.getName();
+%><h2><font color="blue"><a href="<%=prefix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
+<font color="blue">Service EPR : </font><font color="black"><%=prefix + axisService.getName()%></font><br>
+<%
+ boolean disableREST = false;
+ AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();
+
+ Parameter parameter;
+
+ // do we need to completely disable REST support
+ parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST);
+ if (parameter != null) {
+ disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
+ }
+ if (!disableREST ) {
+%>
+<%
+ }
+
+
+ String serviceDescription = axisService.getServiceDescription();
+ if (serviceDescription == null || "".equals(serviceDescription)) {
+ serviceDescription = "No description available for this service";
+ }
+%>
+<h4>Service Description : <font color="black"><%=serviceDescription%></h4>
+
+<i><font color="blue">Service Status : <%=axisService.isActive() ? "Active" : "InActive"%></font></i><br>
+<%
+ if (opItr.hasNext()) {
+%><i>Available operations</i><%
+} else {
+%><i> There are no Operations specified</i><%
+ }
+ opItr = axisService.getOperations();
+%><ul><%
+ while (opItr.hasNext()) {
+ AxisOperation axisOperation = (AxisOperation) opItr.next();
+%><li><%=axisOperation.getName().getLocalPart()%></li>
+ <%-- <br>Operation EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
+ <%
+ }
+ %></ul>
+<%
+} else {
+%>
+<h3><font color="red">No services found in this location</font></h3>
+<%
+ }
+
+ }
+%>
+<jsp:include page="include/adminfooter.inc"/>
Added: sqlquerywebservice/src/main/webapp/axis2-web/upload.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/upload.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/upload.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,68 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+
+<jsp:include page="include/adminheader.jsp"/>
+<script type="text/javascript">
+<!--
+ function checkFileUpload(){
+ if (document.getElementById('serviceUpload').value == '') {
+ alert('Please select a file before clicking the upload button.');
+ return false;
+ } else {
+ document.Axis2upload.submit();
+ }
+ }
+//-->
+</script>
+<h1>Upload an Axis Service Archive File</h1>
+
+<p>You can upload a packaged Axis2 service from this page in two small steps.</p>
+<ul>
+ <li>Browse to the location and select the axis service archive file you wish to upload</li>
+ <li>Click "Upload" button</li>
+</ul>
+<p>Simple as that!</p>
+
+<% if ("success".equals(request.getAttribute("status"))) { %>
+<font color="green">File <%= request.getAttribute("filename") %> successfully uploaded </font><br/><br/>
+<%
+} else if ("failure".equals(request.getAttribute("status"))) {
+%>
+<font color="red">The following error occurred <br/> <%= request.getAttribute("cause") %></font><br/>
+<% } %>
+
+<form method="post" name="Axis2upload" id="Axis2upload" action="axis2-admin/upload"
+ enctype="multipart/form-data">
+ <table>
+ <tr>
+ <td>Service archive : </td>
+ <td><input id="serviceUpload" type="file" name="filename" size="50"/></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="upload" type="button" onclick="javascript:checkFileUpload();" value=" Upload "/></td>
+ </tr>
+ </table>
+</form>
+<blockquote>
+<p>Hot deployment of new service archives is <%=request.getAttribute("hotDeployment") %></p>
+<p>Hot update of existing service archives is <%=request.getAttribute("hotUpdate") %></p>
+</blockquote>
+<jsp:include page="include/adminfooter.inc"/>
Added: sqlquerywebservice/src/main/webapp/axis2-web/viewServiceContext.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/viewServiceContext.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/viewServiceContext.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,55 @@
+<%@ page import="org.apache.axis2.Constants" %>
+<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
+<%@ page import="org.apache.axis2.context.ServiceContext" %>
+<%@ page import="org.apache.axis2.context.ServiceGroupContext" %>
+<%@ page import="org.apache.axis2.description.AxisService" %>
+<%@ page import="java.util.Hashtable" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.Map" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"/>
+<h1>Running Context Hierarchy</h1>
+<%
+ ServiceContext serviceContext = (ServiceContext) request.getSession().getAttribute("ServiceContext");
+ String type = (String) request.getSession().getAttribute("TYPE");
+ if (serviceContext != null) {
+ if (type != null) {
+ if ("VIEW".equals(type)) {
+ Iterator propertyNames = serviceContext.getPropertyNames();
+%>
+<h4>Persistance Properties</h4><ul>
+ <%
+ while (propertyNames.hasNext()) {
+ String key = (String) propertyNames.next();
+ Object property = serviceContext.getProperty(key);
+ %>
+ <li><%=key%> : <%=property.toString()%></li>
+ <%
+ }
+ %></ul>
+<%
+ }
+} else {
+%> <h4>No Service Context Found</h4><%
+ }
+ }
+%>
+<jsp:include page="include/adminfooter.inc"/>
Added: sqlquerywebservice/src/main/webapp/axis2-web/viewServiceGroupContext.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/viewServiceGroupContext.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/viewServiceGroupContext.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,57 @@
+<%@ page import="org.apache.axis2.Constants"%>
+<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
+<%@ page import="org.apache.axis2.context.ServiceGroupContext"%>
+<%@ page import="java.util.Hashtable"%>
+<%@ page import="java.util.Iterator"%>
+<%@ page import="java.util.Map"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Runing Context hierachy</h1>
+<%
+ String type = (String) request.getSession().getAttribute("TYPE");
+ ConfigurationContext configCtx = (ConfigurationContext) request.getSession().getAttribute("ConfigurationContext");
+ ServiceGroupContext sgContext = (ServiceGroupContext) request.getSession().getAttribute("ServiceGroupContext");
+ if (sgContext != null) {
+ if (type != null) {
+ if ("VIEW".equals(type)) {
+ Iterator propertyNames = sgContext.getPropertyNames();
+%>
+ <h4>Persistance properties</h4><ul>
+ <%
+ while (propertyNames.hasNext()) {
+ String key = (String) propertyNames.next();
+ Object property = sgContext.getProperty(key);
+ %>
+ <li><%=key%> : <%=property.toString()%></li>
+ <%
+ }
+ %></ul>
+ <%
+ } else if("DELETE".equals(type)){
+ configCtx.removeServiceGroupContext(sgContext.getId());
+ %>Removed the context<%
+ }
+ }
+ } else {
+%> <h4>No service group context found</h4><%
+ }
+%>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/axis2-web/viewphases.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/axis2-web/viewphases.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/axis2-web/viewphases.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,112 @@
+ <%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page import="org.apache.axis2.Constants,
+ org.apache.axis2.engine.Phase,
+ java.util.ArrayList"%>
+ <%@ page import="org.apache.axis2.deployment.util.PhasesInfo"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="include/adminheader.jsp"></jsp:include>
+<h1>Available Phases</h1>
+ <%
+ PhasesInfo phases = (PhasesInfo)request.getSession().getAttribute(Constants.PHASE_LIST);
+ request.getSession().setAttribute(Constants.PHASE_LIST,null);
+ ArrayList tempList = phases.getGlobalInflow();
+ %><h2><font color="blue">System Pre-defined Phases</font></h2>
+ <b>InFlow Up to Dispatcher</b>
+ <blockquote>
+ <%
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <b>InFaultFlow </b>
+ <blockquote>
+ <%
+ tempList = phases.getGlobalInFaultPhases();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <b>OutFlow </b>
+ <blockquote>
+ <%
+ tempList = phases.getGlobalOutPhaseList();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <b>OutFaultFlow </b>
+ <blockquote>
+ <%
+ tempList = phases.getOUT_FaultPhases();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <br>
+ <h2><font color="blue">User Defined Phases</font></h2>
+ <b>Inflow after Dispatcher</b>
+ <blockquote>
+ <%
+ tempList = phases.getOperationInPhases();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <b>InFaultFlow after Dispatcher</b>
+ <blockquote>
+ <%
+ tempList = phases.getOperationInFaultPhases();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <b>OutFlow </b>
+ <blockquote>
+ <%
+ tempList = phases.getOperationOutPhases();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+ <b>OutFaultFlow </b>
+ <blockquote>
+ <%
+ tempList = phases.getOperationOutFaultPhases();
+ for (int i = 0; i < tempList.size(); i++) {
+ Phase phase = (Phase) tempList.get(i);
+ %><%=phase.getPhaseName()%><br><%
+ }
+ %>
+ </blockquote>
+<jsp:include page="include/adminfooter.inc"></jsp:include>
Added: sqlquerywebservice/src/main/webapp/images/mmlogo.gif
===================================================================
(Binary files differ)
Property changes on: sqlquerywebservice/src/main/webapp/images/mmlogo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sqlquerywebservice/src/main/webapp/index.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/index.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/index.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,187 @@
+<%@ page import="com.metamatrix.common.util.WSDLServletUtil" %>
+
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+-->
+<html>
+ <head>
+ <title>JBEDSP Web Service Utilities</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <style type="text/css">
+ <!--
+ .MMSOAPTitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 18pt;
+ font-style: normal;
+ font-weight: bold
+ }
+
+ .deprecated {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12pt;
+ font-style: italic;
+ color: red;
+ font-weight: bold
+ }
+
+ a {
+ visited : #666699; link: #666699; active: #666699;
+ hover: #1E90FF; text-decoration: none;
+ }
+}
+
+ -->
+ </style>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <div align="center">
+ <p><table width="900" border="0" cellspacing="0" cellpadding="0">
+ <tr bgcolor="#edf0f6">
+ <td colspan="2" align="center">
+ <span class="MMSOAPTitle"><a href="http://www.jboss.com/products/platforms/dataservices/" target="_blank">JBoss Enterprise Data Services Platform (JBEDSP)</a></span>
+ </td>
+ </tr>
+ <tr bgcolor="#edf0f6">
+ <td colspan="2" align="center">
+ <span class="MMSOAPTitle"> Web Service Utilities</span>
+ </td>
+ </tr>
+ <tr>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2" class="MMSOAPTitle"><b><u>JBEDSP Web Service WSDL URL Generator</u></b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2"><b>VDBs that contain Web Service models expose WSDL when deployed to a JBEDSP Server that describes the web service operations in those models. This form can be used to generate a parameterized WSDL URL for such a VDB.</b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td><a href="wsdlurlframe.htm" target="_self" title="Web Service WSDL URL Generator">Web Service WSDL URL Generator</a><td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2" class="MMSOAPTitle"><b><u>Discover JBEDSP Web Services</u></b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2"><b>To auto discover web service VDB WSDL URLs using predefined JBEDSP server values, the JBEDSP Server or cluster of JBEDSP servers must be defined in the web.xml file of the JBEDSP SOAP web application. This WSDL URL is more concise than the parameterized version, but is only valid with JBEDSP SOAP web applications were the JBEDSP server values have been defined.</b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td><a href="<%= request.getContextPath() %>/servlet/DiscoverWSDLServlet" target="wsdlUrls" title="Discover MetaMatrix Web Services">Discover JBEDSP Web Services</a><td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2" class="MMSOAPTitle"><b><u>SQL Query Web Service WSDL</u></b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2"><b>Click on the link below to view the SQL Query Web Service WSDL for this server.</b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td align="left"><a target="_blank" href="<%= WSDLServletUtil.getSqlQueryWebServiceUrl(request.getServerName(), request.getContextPath(), false) %>" title="SQL Query Web Service WSDL (Non-secure)">SQL Query Web Service WSDL (Non-secure)</a><td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td align="left"><a target="_blank" href="<%= WSDLServletUtil.getSqlQueryWebServiceUrl(request.getServerName(), request.getContextPath(), true) %>" title="SQL Query Web Service WSDL (Secure SSL)">SQL Query Web Service WSDL (Secure SSL)</a><td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td colspan="2"><hr><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+<!-- <tr>
+ <td colspan="2"><b>Click on the link below to view the Web Service Utilites page for the <span class="deprecated">DEPRECATED</span> SQL Query Web Service</b><td>
+ </tr>
+ <tr>
+ <td> <td>
+ <td> <td>
+ </tr>
+ <tr>
+ <td align="left" colspan="2"><a href="deprecated.jsp" alt="Deprecated SQL Query Web Service Utilities Page"><span class="deprecated">(DEPRECATED)</span> SQL Query Web Service Web Service Utilies Page</a><td>
+ </tr>
+ -->
+ </table>
+</div>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/wsdlurlframe.htm
===================================================================
--- sqlquerywebservice/src/main/webapp/wsdlurlframe.htm (rev 0)
+++ sqlquerywebservice/src/main/webapp/wsdlurlframe.htm 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,38 @@
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+-->
+<HTML>
+ <HEAD>
+ <TITLE>Teiid Data Services Platform WSDL URL Generator</TITLE>
+ </HEAD>
+<FRAMESET name="mainframeset" rows="85%,*" framespacing="2" >
+ <FRAME name="form" src="wsdlurlgen.jsp" MARGINHEIGHT="3" frameborder="1">
+ <FRAME name="wsdlUrl" src="" MARGINHEIGHT="3" scrolling=yes frameborder="1">
+</FRAMESET>
+<noframes>
+ <body bgcolor="#FFFFFF" text="#000000">
+ This application requires frame support from the browser.
+ </body>
+</noframes>
+</html>
+
Added: sqlquerywebservice/src/main/webapp/wsdlurlgen.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/wsdlurlgen.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/wsdlurlgen.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,141 @@
+<%@ page import="com.metamatrix.soap.util.ServletClientConstants" %>
+<%@ page import="com.metamatrix.soap.util.SOAPConstants" %>
+<%@ page import="javax.naming.Context" %>
+<%@ page import="javax.naming.InitialContext" %>
+<%@ page import="javax.naming.NamingException" %>
+<html>
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+-->
+<%
+ String targetServer = request.getServerName();
+ int targetPort = request.getServerPort();
+ %>
+ <head>
+
+
+ <title>Teiid Data Services Platform WSDL URL Generator</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <style type="text/css">
+ <!--
+ .MMSOAPTitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 18pt;
+ font-style: normal;
+ font-weight: bold;
+ }
+
+ a {
+ visited : #666699; link: #666699; active: #666699;
+ hover: #1E90FF; text-decoration: none;
+ }
+ -->
+ .required { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: red; font-weight: bold; }
+ </style>
+ </head>
+
+ <body bgcolor="#FFFFFF">
+ <div align="center">
+ <p>
+ <table width="900" border="0" cellspacing="0" cellpadding="0">
+ <tr bgcolor="#edf0f6">
+ <td align="center"><span class="MMSOAPTitle">
+ <a href="http://www.jboss.com/products/platforms/dataservices/" target="_blank">JBoss Enterprise Data Services Platform (JBEDSP)</a></span>
+ </td>
+ </tr>
+ <tr bgcolor="#edf0f6">
+ <td align="center"><span class="MMSOAPTitle"> WSDL URL Generator</span>
+ </td>
+ </tr>
+ </table>
+ </p>
+ <p> </p>
+ <form name="form" method="post" target="wsdlUrl" ACTION="<%= request.getContextPath() %>/servlet/WSDLURLGenerator">
+ <p><b>JBEDSP Server Information</b> (use commas to delimit multiple host:port combinations)</p>
+ <table width="66%" border="0" cellspacing="0" cellpadding="0" bgcolor="#edf0f6">
+ <tr>
+ <td width="48%"><b>JBEDSP Server host:port</b><span class='required'> *</span> </td>
+ <td width="52%">
+ <input type="text" name="MMServerHostAndPort" value="<mmServerHost>:<mmServerPort>" size="80">
+ </td>
+ </tr>
+ </table>
+ <p><b>JBEDSP VDB Information</b> </p>
+ <table width="25%" border="0" cellspacing="0" cellpadding="0" bgcolor="#edf0f6">
+ <tr>
+ <td width="54%">
+ <div align="center"><b>VDB Name</b><span class='required'> *</span> </div>
+ </td>
+ <td width="46%">
+ <div align="center" title="Optional - the latest active version will be used if not entered."><b>VDB Version <br/></b></div>
+ </td>
+ </tr>
+ <tr>
+ <td width="54%">
+ <input type="text" name="VDBName" value="<vdbName>">
+ </td>
+ <td width="46%">
+ <input type="text" name="VDBVersion" value="" title="Optional - the latest active version will be used if not entered.">
+ </td>
+ </tr>
+ </table>
+ <p><b>WSDL URL Options</b></p>
+ <table width="66%" border="0" cellspacing="0" cellpadding="0" bgcolor="#edf0f6">
+ <tr>
+ <td width="48%"><b>Target Webservice Host</b><span class='required'> *</span> </td>
+ <td width="52%">
+ <input type="text" name="TargetHost" value="<%=targetServer%>" size="80">
+ </td>
+ </tr>
+ <tr>
+ <td width="48%"><b>Target Webservice Port</b> </td>
+ <td width="52%">
+ <input type="text" name="TargetPort" value="<%=targetPort%>" size="10">
+ </td>
+ </tr>
+ <tr>
+ <td width="48%"><b>Use Secure JBEDSP Protocol (mms) </b><span class='required'> *</span></td>
+ <td width="52%">
+ <input type="checkbox" name="Secure" value="Secure">
+ </td>
+ </tr>
+ <tr>
+ <TD ALIGN="center" colspan='3'> </TD>
+ </TR>
+ </tr>
+ <TR ALIGN="center" VALIGN="middle">
+ <TD ALIGN="center" colspan='3'><span class='required'>* = Required Field</span></TD>
+ </TR>
+ </div>
+ </table>
+ <p> </p>
+ <p>
+ <input type="submit" name="submit" value="Get WSDL URL">
+ </p>
+ <p>
+ <a href="index.jsp" target="_top">Back to Web Service Utilities page</a>
+ </p>
+ </form>
+ </div>
+ </body>
+</html>
Added: sqlquerywebservice/src/main/webapp/wsdlurls.jsp
===================================================================
--- sqlquerywebservice/src/main/webapp/wsdlurls.jsp (rev 0)
+++ sqlquerywebservice/src/main/webapp/wsdlurls.jsp 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,90 @@
+<%@ page import="com.metamatrix.common.util.WSDLServletUtil"%>
+<%@ page import="com.metamatrix.soap.object.WSDLUrl"%>
+<%@ page import="java.util.List"%>
+<%@ page import="java.util.Iterator"%>
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+-->
+<html>
+<%
+
+ List wsdlUrls = (List) session
+ .getAttribute(WSDLServletUtil.DISCOVERED_WSDL);
+
+ %>
+<head>
+
+
+<title>JBoss Enterprise Data Services Platform (JBEDSP) WSDL URLs for Active Deployed Web Service Virtual
+Databases</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<style type="text/css">
+ <!--
+ .MMSOAPTitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 18pt;
+ font-style: normal;
+ font-weight: bold
+ }
+
+ a {
+ visited : #666699; link: #666699; active: #666699;
+ hover: #1E90FF; text-decoration: none;
+ }
+}
+
+ -->
+ </style>
+</head>
+
+<body bgcolor="#FFFFFF">
+<table width="900" border="0" cellspacing="1" cellpadding="1">
+ <tr bgcolor="#edf0f6">
+ <td width="300"><span class="MMSOAPTitle"><a href="http://www.jboss.com/products/platforms/dataservices/">JBEDSP</a></td>
+ <td width="600">JBEDSP Active Web Service VDB
+ URLs</span></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr width="900">
+ <%Iterator wsdlUrlIter = wsdlUrls.listIterator();
+ if (wsdlUrls.size() == 0) {
+
+ %>
+ <td colspan="2">No active MetaMatrix Web Service VDBs were discovered.</td>
+ <%} else {
+ while (wsdlUrlIter.hasNext()) {
+ WSDLUrl wsdlUrl = (WSDLUrl) wsdlUrlIter.next();
+ %>
+ <td colspan="2"><a href="<%= wsdlUrl.toString() %>"><%=wsdlUrl.toString()%></a></td>
+ </tr>
+ <%}
+ }
+
+ %>
+</table>
+</body>
+</html>
Added: sqlquerywebservice/src/main/wsdl/SqlQueryWebService.wsdl
===================================================================
--- sqlquerywebservice/src/main/wsdl/SqlQueryWebService.wsdl (rev 0)
+++ sqlquerywebservice/src/main/wsdl/SqlQueryWebService.wsdl 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,532 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://service.sqlquerywebservice.soap.metamatrix.com" xmlns:axis2="http://service.sqlquerywebservice.soap.metamatrix.com" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns="http://service.sqlquerywebservice.soap.metamatrix.com/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://helper.sqlquerywebservice.soap.metamatrix.com/xsd" xmlns:ax21="http://helper.sqlquerywebservice.soap.metamatrix.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:element name="LogInParameters" type="ax21:LogInParameters"/>
+<xs:complexType name="LogInParameters">
+<xs:sequence>
+<xs:element name="connectionPayload" nillable="true" type="xs:string"/>
+<xs:element name="mmServerUrl" nillable="true" type="xs:string"/>
+<xs:element maxOccurs="unbounded" name="optionalProperties" nillable="true" type="ax21:Property"/>
+<xs:element name="vdbName" nillable="true" type="xs:string"/>
+<xs:element name="vdbVersion" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="Property" type="ax21:Property"/>
+<xs:complexType name="Property">
+<xs:sequence>
+<xs:element name="propertyName" nillable="true" type="xs:string"/>
+<xs:element name="propertyValue" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="Connection" type="ax21:Connection"/>
+<xs:complexType name="Connection">
+<xs:sequence>
+<xs:element name="connectionId" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="ConnectionContextualRequest" type="ax21:ConnectionContextualRequest"/>
+<xs:complexType name="ConnectionContextualRequest">
+<xs:sequence>
+<xs:element name="connection" nillable="true" type="ax21:Connection"/>
+<xs:element name="requestInfo" nillable="true" type="ax21:RequestInfo"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="RequestInfo" type="ax21:RequestInfo"/>
+<xs:complexType name="RequestInfo">
+<xs:sequence>
+<xs:element maxOccurs="unbounded" name="bindParameters" nillable="true" type="xs:string"/>
+<xs:element name="commandPayload" nillable="true" type="xs:string"/>
+<xs:element name="cursorType" nillable="true" type="ax21:CursorType"/>
+<xs:element name="fetchSize" type="xs:int"/>
+<xs:element name="partialResults" type="xs:boolean"/>
+<xs:element name="requestType" nillable="true" type="ax21:RequestType"/>
+<xs:element name="sqlString" nillable="true" type="xs:string"/>
+<xs:element name="transactionAutoWrapMode" minoccurs="0" nillable="true" type="ax21:TransactionAutoWrapType"/>
+<xs:element name="useResultSetCache" type="xs:boolean"/>
+<xs:element name="xmlFormat" nillable="true" type="xs:string"/>
+<xs:element name="xmlStyleSheet" nillable="true" type="xs:string"/>
+<xs:element name="xmlValidationMode" type="xs:boolean"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="CursorType" type="ax21:CursorType"/>
+<xs:complexType name="CursorType">
+<xs:sequence>
+<xs:element name="discriminator" type="xs:int"/>
+<xs:element name="value" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="RequestType" type="ax21:RequestType"/>
+<xs:complexType name="RequestType">
+<xs:sequence>
+<xs:element name="discriminator" type="xs:int"/>
+<xs:element name="value" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="TransactionAutoWrapType" type="ax21:TransactionAutoWrapType"/>
+<xs:complexType name="TransactionAutoWrapType">
+<xs:sequence>
+<xs:element name="discriminator" type="xs:int"/>
+<xs:element name="value" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="RequestId" type="ax21:RequestId"/>
+<xs:complexType name="RequestId">
+<xs:sequence>
+<xs:element name="connectionId" nillable="true" type="xs:string"/>
+<xs:element name="id" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="ConnectionlessRequest" type="ax21:ConnectionlessRequest"/>
+<xs:complexType name="ConnectionlessRequest">
+<xs:sequence>
+<xs:element name="includeMetadata" type="xs:boolean"/>
+<xs:element name="maxRowsReturned" type="xs:int"/>
+<xs:element name="parameters" nillable="true" type="ax21:LogInParameters"/>
+<xs:element name="requestInfo" nillable="true" type="ax21:RequestInfo"/>
+<xs:element name="timeToWait" type="xs:int"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="Results" type="ax21:Results"/>
+<xs:complexType name="Results">
+<xs:sequence>
+<xs:element name="beginRow" type="xs:int"/>
+<xs:element name="data" nillable="true" type="ax21:Data"/>
+<xs:element name="endRow" type="xs:int"/>
+<xs:element name="hasData" type="xs:boolean"/>
+<xs:element maxOccurs="unbounded" name="outputParameters" type="xs:anyType"/>
+<xs:element maxOccurs="unbounded" name="sqlWarnings" nillable="true" type="ax21:SqlWarning"/>
+<xs:element name="updateCount" type="xs:int"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="Data" type="ax21:Data"/>
+<xs:complexType name="Data">
+<xs:sequence>
+<xs:element name="last" type="xs:boolean"/>
+<xs:element maxOccurs="unbounded" name="metadataArray" nillable="true" type="ax21:ColumnMetadata"/>
+<xs:element maxOccurs="unbounded" name="rows" nillable="true" type="ax21:Row"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="ColumnMetadata" type="ax21:ColumnMetadata"/>
+<xs:complexType name="ColumnMetadata">
+<xs:sequence>
+<xs:element name="autoIncrement" type="xs:boolean"/>
+<xs:element name="caseSensitive" type="xs:boolean"/>
+<xs:element name="columnClassName" nillable="true" type="xs:string"/>
+<xs:element name="columnDataType" nillable="true" type="xs:string"/>
+<xs:element name="columnDisplaySize" type="xs:int"/>
+<xs:element name="columnName" nillable="true" type="xs:string"/>
+<xs:element name="currency" type="xs:boolean"/>
+<xs:element name="getColumnLabel" nillable="true" type="xs:string"/>
+<xs:element name="nullable" type="xs:boolean"/>
+<xs:element name="precision" type="xs:int"/>
+<xs:element name="readOnly" type="xs:boolean"/>
+<xs:element name="scale" type="xs:int"/>
+<xs:element name="searchable" type="xs:boolean"/>
+<xs:element name="signed" type="xs:boolean"/>
+<xs:element name="tableName" nillable="true" type="xs:string"/>
+<xs:element name="virtualDatabaseName" nillable="true" type="xs:string"/>
+<xs:element name="virtualDatabaseVersion" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="Row" type="ax21:Row"/>
+<xs:complexType name="Row">
+<xs:sequence>
+<xs:element maxOccurs="unbounded" name="cells" nillable="true" type="ax21:Cell"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="Cell" type="ax21:Cell"/>
+<xs:complexType name="Cell">
+<xs:sequence>
+<xs:element name="value" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="SqlWarning" type="ax21:SqlWarning"/>
+<xs:complexType name="SqlWarning">
+<xs:sequence>
+<xs:element name="message" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="ResultsRequest" type="ax21:ResultsRequest"/>
+<xs:complexType name="ResultsRequest">
+<xs:sequence>
+<xs:element name="endRow" type="xs:int"/>
+<xs:element name="includeMetadata" type="xs:boolean"/>
+<xs:element name="requestId" nillable="true" type="ax21:RequestId"/>
+<xs:element name="startRow" type="xs:int"/>
+<xs:element name="timeToWait" type="xs:int"/>
+</xs:sequence>
+</xs:complexType>
+</xs:schema>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.sqlquerywebservice.soap.metamatrix.com/xsd" xmlns:ns0="http://helper.sqlquerywebservice.soap.metamatrix.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:element name="getConnectionFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="getConnectionFault" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getConnection">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="params" nillable="true" type="ns0:LogInParameters"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getConnectionResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="ns0:Connection"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="executeFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="executeFault" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="execute">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="request" nillable="true" type="ns0:ConnectionContextualRequest"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="executeResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="ns0:RequestId"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="executeBlockingFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="executeBlockingFault" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="executeBlocking">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="request" nillable="true" type="ns0:ConnectionlessRequest"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="executeBlockingResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="ns0:Results"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getResultsFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="getResultsFault" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getResults">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="resultsRequest" nillable="true" type="ns0:ResultsRequest"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getResultsResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="ns0:Results"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="closeConnectionFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="closeConnectionFault" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="closeConnection">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="connection" nillable="true" type="ns0:Connection"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="terminateRequestFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="terminateRequestFault" type="xs:anyType"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="terminateRequest">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="requestId" nillable="true" type="ns0:RequestId"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+</xs:schema>
+ </wsdl:types>
+ <wsdl:message name="terminateRequestFault">
+ <wsdl:part name="part1" element="ns:terminateRequestFault">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="closeConnectionFault">
+ <wsdl:part name="part1" element="ns:closeConnectionFault">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="executeBlockingMessage">
+ <wsdl:part name="part1" element="ns:executeBlocking">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="executeBlockingResponseMessage">
+ <wsdl:part name="part1" element="ns:executeBlockingResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="closeConnectionMessage">
+ <wsdl:part name="part1" element="ns:closeConnection">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getConnectionMessage">
+ <wsdl:part name="part1" element="ns:getConnection">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="executeFault">
+ <wsdl:part name="part1" element="ns:executeFault">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getResultsMessage">
+ <wsdl:part name="part1" element="ns:getResults">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getResultsResponseMessage">
+ <wsdl:part name="part1" element="ns:getResultsResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="executeBlockingFault">
+ <wsdl:part name="part1" element="ns:executeBlockingFault">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getConnectionFault">
+ <wsdl:part name="part1" element="ns:getConnectionFault">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getResultsFault">
+ <wsdl:part name="part1" element="ns:getResultsFault">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="terminateRequestMessage">
+ <wsdl:part name="part1" element="ns:terminateRequest">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getConnectionResponseMessage">
+ <wsdl:part name="part1" element="ns:getConnectionResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="executeMessage">
+ <wsdl:part name="part1" element="ns:execute">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="executeResponseMessage">
+ <wsdl:part name="part1" element="ns:executeResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="SqlQueryWebServicePortType">
+ <wsdl:operation name="getConnection">
+ <wsdl:input message="axis2:getConnectionMessage">
+ </wsdl:input>
+ <wsdl:output message="axis2:getConnectionResponseMessage">
+ </wsdl:output>
+ <wsdl:fault name="getConnectionFault" message="axis2:getConnectionFault">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="execute">
+ <wsdl:input message="axis2:executeMessage">
+ </wsdl:input>
+ <wsdl:output message="axis2:executeResponseMessage">
+ </wsdl:output>
+ <wsdl:fault name="executeFault" message="axis2:executeFault">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="executeBlocking">
+ <wsdl:input message="axis2:executeBlockingMessage">
+ </wsdl:input>
+ <wsdl:output message="axis2:executeBlockingResponseMessage">
+ </wsdl:output>
+ <wsdl:fault name="executeBlockingFault" message="axis2:executeBlockingFault">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="getResults">
+ <wsdl:input message="axis2:getResultsMessage">
+ </wsdl:input>
+ <wsdl:output message="axis2:getResultsResponseMessage">
+ </wsdl:output>
+ <wsdl:fault name="getResultsFault" message="axis2:getResultsFault">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="closeConnection">
+ <wsdl:input message="axis2:closeConnectionMessage">
+ </wsdl:input>
+ <wsdl:fault name="closeConnectionFault" message="axis2:closeConnectionFault">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="terminateRequest">
+ <wsdl:input message="axis2:terminateRequestMessage">
+ </wsdl:input>
+ <wsdl:fault name="terminateRequestFault" message="axis2:terminateRequestFault">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SqlQueryWebServiceSOAP11Binding" type="axis2:SqlQueryWebServicePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getConnection">
+ <soap:operation soapAction="urn:getConnection" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="getConnectionFault">
+ <soap:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="execute">
+ <soap:operation soapAction="urn:execute" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="executeFault">
+ <soap:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="executeBlocking">
+ <soap:operation soapAction="urn:executeBlocking" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="executeBlockingFault">
+ <soap:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="getResults">
+ <soap:operation soapAction="urn:getResults" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="getResultsFault">
+ <soap:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="closeConnection">
+ <soap:operation soapAction="urn:closeConnection" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:fault name="closeConnectionFault">
+ <soap:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="terminateRequest">
+ <soap:operation soapAction="urn:terminateRequest" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:fault name="terminateRequestFault">
+ <soap:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SqlQueryWebServiceSOAP12Binding" type="axis2:SqlQueryWebServicePortType">
+ <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getConnection">
+ <soap12:operation soapAction="urn:getConnection" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="getConnectionFault">
+ <soap12:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="execute">
+ <soap12:operation soapAction="urn:execute" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="executeFault">
+ <soap12:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="executeBlocking">
+ <soap12:operation soapAction="urn:executeBlocking" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="executeBlockingFault">
+ <soap12:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="getResults">
+ <soap12:operation soapAction="urn:getResults" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:output>
+ <wsdl:fault name="getResultsFault">
+ <soap12:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="closeConnection">
+ <soap12:operation soapAction="urn:closeConnection" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:fault name="closeConnectionFault">
+ <soap12:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="terminateRequest">
+ <soap12:operation soapAction="urn:terminateRequest" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal" namespace="http://service.sqlquerywebservice.soap.metamatrix.com"/>
+ </wsdl:input>
+ <wsdl:fault name="terminateRequestFault">
+ <soap12:body namespace="http://service.sqlquerywebservice.soap.metamatrix.com" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SqlQueryWebService">
+ <wsdl:port name="SqlQueryWebServiceSOAP11port" binding="axis2:SqlQueryWebServiceSOAP11Binding">
+ <soap:address location="http://192.168.10.120:8080/metamatrix-soap/services/SqlQueryWebService"/>
+ </wsdl:port>
+ <wsdl:port name="SqlQueryWebServiceSOAP12port" binding="axis2:SqlQueryWebServiceSOAP12Binding">
+ <soap12:address location="http://slwxp156:8080/metamatrix-soap/services/SqlQueryWebServiceSqlQueryW..."/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/handler/TestActionUpdateHandler.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/handler/TestActionUpdateHandler.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/handler/TestActionUpdateHandler.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.handler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.context.MessageContext;
+
+import com.metamatrix.common.util.WSDLServletUtil;
+
+public class TestActionUpdateHandler extends TestCase{
+
+ public void testgetServerPropertyMap1() {
+
+ Map expectedMap = new HashMap();
+ expectedMap.put(WSDLServletUtil.VDB_NAME_KEY, "BooksWsdl"); //$NON-NLS-1$
+ expectedMap.put(WSDLServletUtil.VDB_VERSION_KEY, "1"); //$NON-NLS-1$
+ expectedMap.put(WSDLServletUtil.ADD_PROPS, null);
+ expectedMap.put(ActionUpdateHandler.VIRTUAL_PROCEDURE, "BooksWebService.Books.getBookCollection"); //$NON-NLS-1$
+
+ MessageContext messageContext = new MessageContext();
+ messageContext.getOptions().setAction("VDBName=BooksWsdl&VDBVersion=1&AdditionalProperties=&procedure=BooksWebService.Books.getBookCollection"); //$NON-NLS-1$
+ Map actualMap = ActionUpdateHandler.getServerPropertyMap(null, messageContext);
+
+ assertEquals(expectedMap.get(WSDLServletUtil.VDB_NAME_KEY), actualMap.get(WSDLServletUtil.VDB_NAME_KEY));
+ assertEquals(expectedMap.get(WSDLServletUtil.VDB_VERSION_KEY), actualMap.get(WSDLServletUtil.VDB_VERSION_KEY));
+ assertEquals(expectedMap.get(WSDLServletUtil.ADD_PROPS), actualMap.get(WSDLServletUtil.ADD_PROPS));
+ assertEquals(expectedMap.get(ActionUpdateHandler.VIRTUAL_PROCEDURE), actualMap.get(ActionUpdateHandler.VIRTUAL_PROCEDURE));
+ }
+
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestBasicConnectionPoolFactory.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestBasicConnectionPoolFactory.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestBasicConnectionPoolFactory.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @since 4.3
+ */
+public class TestBasicConnectionPoolFactory extends TestCase {
+
+
+ private static final String TEST_PROPERTY_VALUE = "test"; //$NON-NLS-1$
+
+ /*
+ * Test method for 'com.metamatrix.soap.service.BasicConnectionPoolFactory.getProperty(String)'
+ */
+ public void testGetPropertyWSystemPropertySet() {
+ System.setProperty(ConnectionPoolFactory.INITIAL_POOL_SIZE_PROPERTY_KEY, TEST_PROPERTY_VALUE);
+ assertEquals(TEST_PROPERTY_VALUE, BasicConnectionPoolFactory.createMergedProperties(new Properties()).getProperty(ConnectionPoolFactory.INITIAL_POOL_SIZE_PROPERTY_KEY));
+ }
+
+ public void testGetPropertyRetreiveDefault() {
+ assertEquals(String.valueOf(BasicConnectionPoolFactory.MAX_ACTIVE_CONNECTIONS_DEFAULT), BasicConnectionPoolFactory.createMergedProperties(new Properties()).getProperty(ConnectionPoolFactory.MAX_ACTIVE_CONNECTIONS_PROPERTY_KEY));
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestDataServiceWebServiceImpl.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestDataServiceWebServiceImpl.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestDataServiceWebServiceImpl.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.AxisFault;
+
+import com.metamatrix.common.util.WSDLServletUtil;
+
+/**
+ *
+ */
+public class TestDataServiceWebServiceImpl extends TestCase {
+
+ private DataServiceWebServiceImpl impl = new DataServiceWebServiceImpl();
+
+
+ public void testGetAuthenticationProperties() {
+ DataServiceWebServiceImpl impl = new DataServiceWebServiceImpl();
+ Properties props = impl.getAuthenticationProperties("test", "this"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if (!("test".equals(props.getProperty(DataServiceWebServiceImpl.USER_NAME)) && "this".equals(props.getProperty(DataServiceWebServiceImpl.PASSWORD)))) { //$NON-NLS-1$ //$NON-NLS-2$
+ fail();
+ }
+
+ }
+
+ public void testGetQueryTimeoutWOutValue() {
+
+ int queryTimeout = getDataServiceWebServiceImpl().getQueryTimeout();
+ assertEquals(0,queryTimeout);
+ }
+
+ public void testCreateFault() {
+ try{
+ getDataServiceWebServiceImpl().createSOAPFaultMessage(new Exception("Something bad happened"),"Really, something bad happened","Server"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }catch(AxisFault fault){
+ assertEquals("Really, something bad happened",fault.getMessage()); //$NON-NLS-1$
+ }
+
+ }
+
+ public void testGetQueryTimeoutWNonIntegerValue() {
+
+ System.setProperty(WSDLServletUtil.MM_WEBSERVICE_QUERY_TIMEOUT, "V");//$NON-NLS-1$
+ int queryTimeout = getDataServiceWebServiceImpl().getQueryTimeout();
+ assertEquals(0,queryTimeout);
+ }
+
+ public void testGetQueryTimeoutWGoodValue() {
+
+ System.setProperty(WSDLServletUtil.MM_WEBSERVICE_QUERY_TIMEOUT, "600000");//$NON-NLS-1$
+ int queryTimeout = getDataServiceWebServiceImpl().getQueryTimeout();
+ assertEquals(600000,queryTimeout);
+ }
+
+ public void testGetQueryTimeoutWNULLValue() {
+
+ System.setProperty(WSDLServletUtil.MM_WEBSERVICE_QUERY_TIMEOUT, "");//$NON-NLS-1$
+ int queryTimeout = getDataServiceWebServiceImpl().getQueryTimeout();
+ assertEquals(0,queryTimeout);
+ }
+
+ private DataServiceWebServiceImpl getDataServiceWebServiceImpl() {
+ return impl;
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestPoolingConnectionSource.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestPoolingConnectionSource.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/service/TestPoolingConnectionSource.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.service;
+
+import java.sql.SQLException;
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.core.util.SimpleMock;
+
+
+/**
+ * @since 4.3
+ */
+public class TestPoolingConnectionSource extends TestCase {
+
+ private static final Properties connectionProperties = new Properties();
+
+ static {
+ connectionProperties.setProperty(ConnectionSource.USERNAME, "fakeUsername"); //$NON-NLS-1$
+ connectionProperties.setProperty(ConnectionSource.PASSWORD, "fakePassword"); //$NON-NLS-1$
+ connectionProperties.setProperty(ConnectionSource.SERVER_URL, "jdbc:metamatrix:vdbName@Host:port;password=xxx"); //$NON-NLS-1$
+
+ }
+
+ /*
+ * Test method for 'com.metamatrix.soap.service.PoolingConnectionSource.getConnection(Properties)'
+ */
+ public void testGetConnection() throws SQLException {
+ PoolingConnectionSource source = new PoolingConnectionSource(new ConnectionPoolFactory() {
+
+ public javax.sql.DataSource createConnectionPool(Properties connectionProperties) {
+ return SimpleMock.createSimpleMock(DataSource.class);
+ }
+
+ });
+
+ assertFalse(source.hasPool(connectionProperties));
+
+ source.getConnection(connectionProperties);
+
+ Properties retreivalProps = new Properties();
+ retreivalProps.setProperty(ConnectionSource.USERNAME, "fakeUsername"); //$NON-NLS-1$
+ retreivalProps.setProperty(ConnectionSource.PASSWORD, "fakePassword"); //$NON-NLS-1$
+ retreivalProps.setProperty(ConnectionSource.SERVER_URL, "jdbc:metamatrix:vdbName@Host:port;password=xxx"); //$NON-NLS-1$
+
+ assertTrue(source.hasPool(retreivalProps));
+
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetVDBResourceServlet.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetVDBResourceServlet.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetVDBResourceServlet.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.servlet;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import com.metamatrix.common.util.WSDLServletUtil;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @since 4.3
+ */
+public class TestMMGetVDBResourceServlet extends TestCase {
+
+ private final MMGetVDBResourceServlet servlet = new MMGetVDBResourceServlet();
+
+ private static String KEY_1 = "key1"; //$NON-NLS-1$
+ private static String KEY_2 = "key2"; //$NON-NLS-1$
+ private static String KEY_3 = "key3"; //$NON-NLS-1$
+ private static String KEY_4 = "key4";//$NON-NLS-1$
+ private static String KEY_5 = "key5";//$NON-NLS-1$
+
+
+ private static String[] VALUE_1 = new String[] {"value1=new"}; //$NON-NLS-1$
+ private static String[] VALUE_1_ENCODED = new String[] {"value1%3Dnew"}; //$NON-NLS-1$
+ private static String[] VALUE_2 = new String[] {"value2"};//$NON-NLS-1$
+ private static String[] VALUE_3 = new String[] {"value3"};//$NON-NLS-1$
+ private static String[] VALUE_4 = new String[] {"value4"};//$NON-NLS-1$
+ private static String[] VALUE_5 = new String[] {"value5"};//$NON-NLS-1$
+
+ private static String EXPECTED_SUFFIX_STRING = KEY_1 + "=" + VALUE_1_ENCODED[0] + "&" + KEY_2 + "=" + VALUE_2[0] + "&" + KEY_3 + "=" + VALUE_3[0] + "&" + KEY_4 + "=" + VALUE_4[0] + "&" + KEY_5 + "=" + VALUE_5[0]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+
+ private static String EXPECTED_HTTP_SUFFIX_STRING = "httptype=http&" + KEY_1 + "=" + VALUE_1_ENCODED[0] + "&" + KEY_2 + "=" + VALUE_2[0] + "&" + KEY_3 + "=" + VALUE_3[0] + "&" + KEY_4 + "=" + VALUE_4[0] + "&" + KEY_5 + "=" + VALUE_5[0]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+
+ public void testBuildEndpointSuffixStringNoHttpTypeParam() {
+ Map map = new TreeMap();
+ map.put(KEY_1, VALUE_1);
+ map.put(KEY_2, VALUE_2);
+ map.put(KEY_3, VALUE_3);
+ map.put(KEY_4, VALUE_4);
+ map.put(KEY_5, VALUE_5);
+ assertEquals(servlet.buildEndpointSuffixString(map), EXPECTED_SUFFIX_STRING);
+
+ }
+
+ public void testBuildEndpointSuffixStringWithHttpTypeParam() {
+ Map map = new TreeMap();
+ map.put(KEY_1, VALUE_1);
+ map.put(KEY_2, VALUE_2);
+ map.put(KEY_3, VALUE_3);
+ map.put(KEY_4, VALUE_4);
+ map.put(KEY_5, VALUE_5);
+ map.put(WSDLServletUtil.HTTP_TYPE_PARAMETER_KEY, new String[] {WSDLServletUtil.HTTP_PARAMETER_VALUE});
+ assertEquals(servlet.buildEndpointSuffixString(map), EXPECTED_HTTP_SUFFIX_STRING);
+
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetWSDLServlet.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetWSDLServlet.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/servlet/TestMMGetWSDLServlet.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.servlet;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.core.util.StringUtil;
+
+
+/**
+ * @since 5.6
+ */
+public class TestMMGetWSDLServlet extends TestCase {
+
+ private static String EXPECTED_VDB_NAME = "myVDB"; //$NON-NLS-1$
+
+ public void testGetVdbName() {
+
+ String vdbName = StringUtil.Constants.EMPTY_STRING;
+ vdbName = MMGetWSDLServlet.getVdbName("/myVDB/1"); //$NON-NLS-1$
+ assertEquals(EXPECTED_VDB_NAME, vdbName);
+ vdbName = MMGetWSDLServlet.getVdbName("/myVDB"); //$NON-NLS-1$
+ assertEquals(EXPECTED_VDB_NAME, vdbName);
+ }
+
+ public void testGetVdbVersion() {
+
+ String vdbVersion = StringUtil.Constants.EMPTY_STRING;
+ vdbVersion = MMGetWSDLServlet.getVdbVersion("/myVDB/2"); //$NON-NLS-1$
+ assertEquals("2", vdbVersion); //$NON-NLS-1$
+ vdbVersion = MMGetWSDLServlet.getVdbVersion("/myVDB"); //$NON-NLS-1$
+ assertEquals("", vdbVersion); //$NON-NLS-1$
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/sqlquerywebservice/TestSqlQueryWebService.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/sqlquerywebservice/TestSqlQueryWebService.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/sqlquerywebservice/TestSqlQueryWebService.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.sqlquerywebservice;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.mockito.Mockito;
+
+import com.metamatrix.common.api.MMURL;
+import com.metamatrix.jdbc.MMConnection;
+import com.metamatrix.jdbc.MMStatement;
+import com.metamatrix.jdbc.api.ResultSet;
+import com.metamatrix.soap.security.Credential;
+import com.metamatrix.soap.service.ConnectionSource;
+import com.metamatrix.soap.sqlquerywebservice.helper.ConnectionlessRequest;
+import com.metamatrix.soap.sqlquerywebservice.helper.CursorType;
+import com.metamatrix.soap.sqlquerywebservice.helper.LogInParameters;
+import com.metamatrix.soap.sqlquerywebservice.helper.RequestInfo;
+import com.metamatrix.soap.sqlquerywebservice.helper.RequestType;
+import com.metamatrix.soap.sqlquerywebservice.helper.Results;
+import com.metamatrix.soap.sqlquerywebservice.helper.TransactionAutoWrapType;
+import com.metamatrix.soap.sqlquerywebservice.service.SqlQueryWebService;
+import com.metamatrix.soap.sqlquerywebservice.service.SqlQueryWebServiceFault;
+import com.metamatrix.soap.sqlquerywebservice.service.SqlQueryWebService.CredentialProvider;
+
+public class TestSqlQueryWebService extends TestCase {
+
+ public void testBlockingExecute_NullLogInParameters() throws SqlQueryWebServiceFault {
+ SqlQueryWebService sqws = new SqlQueryWebService();
+ setFakeCredentialProvider(sqws);
+ sqws.setConnectionSource(new ConnectionSource() {
+ @Override
+ public Connection getConnection(Properties connectionProperties)
+ throws SQLException {
+ assertNull(connectionProperties.getProperty(MMURL.CONNECTION.SERVER_URL));
+ throw new SQLException("expected");
+ }
+ });
+
+ ConnectionlessRequest connectionlessRequest = new ConnectionlessRequest();
+ connectionlessRequest.setParameters(new LogInParameters());
+
+ try {
+ sqws.executeBlocking(connectionlessRequest);
+ fail("exception expected");
+ } catch (SqlQueryWebServiceFault f) {
+ //this will be thrown after we have setup the initial connection properties
+ assertEquals("expected", f.getMessage());
+ }
+ }
+
+ public void testBlockingExecute_BadConnection() throws SqlQueryWebServiceFault {
+ SqlQueryWebService sqws = new SqlQueryWebService();
+
+ sqws.setConnectionSource(new ConnectionSource() {
+
+ @Override
+ public Connection getConnection(Properties connectionProperties)
+ throws SQLException {
+ throw new SQLException("expected");
+ }
+ });
+
+ setFakeCredentialProvider(sqws);
+
+ ConnectionlessRequest connectionlessRequest = new ConnectionlessRequest();
+ connectionlessRequest.setParameters(new LogInParameters());
+
+ try {
+ sqws.executeBlocking(connectionlessRequest);
+ fail("exception expected");
+ } catch (SqlQueryWebServiceFault f) {
+ assertEquals("expected", f.getMessage());
+ assertEquals("Client", f.getFaultCode().getLocalPart());
+ }
+ }
+
+ private void setFakeCredentialProvider(SqlQueryWebService sqws) {
+ sqws.setCredentialProvider(new CredentialProvider() {
+ @Override
+ public Credential getCredentials() throws SqlQueryWebServiceFault {
+ return new Credential("ted", "jones".getBytes());
+ }
+ });
+ }
+
+ public void testBlockingExecute() throws SqlQueryWebServiceFault {
+ SqlQueryWebService sqws = new SqlQueryWebService();
+ setFakeCredentialProvider(sqws);
+
+ sqws.setConnectionSource(new ConnectionSource() {
+ @Override
+ public Connection getConnection(Properties connectionProperties)
+ throws SQLException {
+ assertEquals("ted", connectionProperties.getProperty(MMURL.CONNECTION.USER_NAME));
+ MMConnection conn = Mockito.mock(MMConnection.class);
+ MMStatement stmt = Mockito.mock(MMStatement.class);
+ Mockito.stub(stmt.unwrap(MMStatement.class)).toReturn(stmt);
+ Mockito.stub(stmt.getUpdateCount()).toReturn(1);
+ Mockito.stub(conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)).toReturn(stmt);
+ return conn;
+ }
+ });
+
+ ConnectionlessRequest connectionlessRequest = new ConnectionlessRequest();
+ connectionlessRequest.setParameters(new LogInParameters());
+ RequestInfo ri = new RequestInfo();
+ ri.setCursorType(new CursorType(String.valueOf(ResultSet.TYPE_FORWARD_ONLY)));
+ ri.setRequestType(new RequestType(String.valueOf(0)));
+ ri.setTransactionAutoWrapMode(new TransactionAutoWrapType(String.valueOf(0)));
+
+ connectionlessRequest.setRequestInfo(ri);
+
+ Results results = sqws.executeBlocking(connectionlessRequest);
+
+ assertFalse(results.isHasData());
+ assertEquals(new Integer(1), results.getUpdateCount());
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestEndpointUrlTranslatorStrategyImpl.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestEndpointUrlTranslatorStrategyImpl.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestEndpointUrlTranslatorStrategyImpl.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import com.metamatrix.core.util.StringUtil;
+import com.metamatrix.soap.exceptions.SOAPProcessingException;
+
+import junit.framework.TestCase;
+
+/**
+ * @author jpoulsen
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class TestEndpointUrlTranslatorStrategyImpl extends TestCase {
+ private static final String urlEncoding = "UTF-8"; //$NON-NLS-1$
+
+ public void testCreateJdbcUrlWVDBVersion(){
+ String url1=StringUtil.Constants.EMPTY_STRING;
+ try {
+ url1 = EndpointUriTranslatorStrategyImpl.createJdbcUrl("mm://slntmm05:7000", "DesignTimeCatalog", "1", "txnAutoWrap=PESSIMISTIC");//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ } catch (SOAPProcessingException e) {
+ e.printStackTrace();
+ }
+ assertEquals("jdbc:metamatrix:DesignTimeCatalog@mm://slntmm05:7000;version=1;txnAutoWrap=PESSIMISTIC", url1); //$NON-NLS-1$
+ }
+
+ public void testCreateJdbcUrlWVDBVersionWithUrlEncoding(){
+ String url1=StringUtil.Constants.EMPTY_STRING;
+ try {
+ url1 = EndpointUriTranslatorStrategyImpl.createJdbcUrl(URLEncoder.encode("mm://slntmm05:7000",urlEncoding), URLEncoder.encode("Design&TimeCatalog",urlEncoding), "1", URLEncoder.encode("txnAutoWrap=PESSIMISTIC",urlEncoding));//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ } catch (SOAPProcessingException e) {
+ e.printStackTrace();
+ } catch (UnsupportedEncodingException e){
+ e.printStackTrace();
+ }
+ assertEquals("jdbc:metamatrix:Design&TimeCatalog@mm://slntmm05:7000;version=1;txnAutoWrap=PESSIMISTIC", url1); //$NON-NLS-1$
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWSDLServletUtil.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWSDLServletUtil.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWSDLServletUtil.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.metamatrix.common.util.WSDLServletUtil;
+
+import junit.framework.TestCase;
+
+/**
+ */
+public class TestWSDLServletUtil extends TestCase {
+
+ public static String HTTP = "http"; //$NON-NLS-1$
+ public static String HTTPS = "https"; //$NON-NLS-1$
+ public static String DEFAULT_APP_CONTEXT = "/metamatrix-soap"; //$NON-NLS-1$
+ public static String OTHER_APP_CONTEXT = "/metamatrix-soapiness"; //$NON-NLS-1$
+
+ public TestWSDLServletUtil(String name) {
+ super(name);
+ }
+
+ public void testGetMMSAPIUrlAllNullServerNameSecure() {
+ String url = WSDLServletUtil.getSqlQueryWebServiceUrl(null, DEFAULT_APP_CONTEXT, true);
+ assertEquals("https://null:8443/metamatrix-soap/services/SqlQueryWebService?wsdl", url); //$NON-NLS-1$
+ }
+
+ public void testGetMMSAPIUrlAllNullServerNameNonSecure() {
+ String url = WSDLServletUtil.getSqlQueryWebServiceUrl(null, DEFAULT_APP_CONTEXT, false);
+ assertEquals("http://null:8080/metamatrix-soap/services/SqlQueryWebService?wsdl", url); //$NON-NLS-1$
+ }
+
+ public void testGetMMSAPIUrlValidParametersSecure() {
+ String url = WSDLServletUtil.getSqlQueryWebServiceUrl("slntmm01", DEFAULT_APP_CONTEXT, true); //$NON-NLS-1$
+ assertEquals("https://slntmm01:8443/metamatrix-soap/services/SqlQueryWebService?wsdl", url); //$NON-NLS-1$
+ }
+
+ public void testGetMMSAPIUrlValidParametersNonSecure() {
+ String url = WSDLServletUtil.getSqlQueryWebServiceUrl("slntmm01", OTHER_APP_CONTEXT,false); //$NON-NLS-1$
+ assertEquals("http://slntmm01:8080/metamatrix-soapiness/services/SqlQueryWebService?wsdl", url); //$NON-NLS-1$
+ }
+
+ public void testFormatUrlValidParametersNonSecure() {
+ List serverURLs = new ArrayList();
+ serverURLs.add("mm://chicago:31000"); //$NON-NLS-1$
+ String url = WSDLServletUtil.formatURL(HTTP,"chicago","8080", DEFAULT_APP_CONTEXT, serverURLs,"testVDB","1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ assertEquals("http://chicago:8080/metamatrix-soap/servlet/ArtifactDocumentService/MetaM...", url); //$NON-NLS-1$
+ }
+
+ public void testFormatUrlValidParametersSecure() {
+ List serverURLs = new ArrayList();
+ serverURLs.add("mms://chicago:31000"); //$NON-NLS-1$
+ String url = WSDLServletUtil.formatURL(HTTPS,"chicago","8443", DEFAULT_APP_CONTEXT, serverURLs,"testVDB","1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ assertEquals("https://chicago:8443/metamatrix-soap/servlet/ArtifactDocumentService/Meta...", url); //$NON-NLS-1$
+ }
+
+ public void testFormatUrlValidParametersSecureNoPort() {
+ List serverURLs = new ArrayList();
+ serverURLs.add("mms://chicago:31000"); //$NON-NLS-1$
+ String url = WSDLServletUtil.formatURL(HTTPS,"chicago",null, DEFAULT_APP_CONTEXT, serverURLs,"testVDB","1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ assertEquals("https://chicago/metamatrix-soap/servlet/ArtifactDocumentService/MetaMatri...", url); //$NON-NLS-1$
+ }
+
+ public void testFormatUrlValidParametersSecureNoPortNoVdbVersion() {
+ List serverURLs = new ArrayList();
+ serverURLs.add("mms://chicago:31000"); //$NON-NLS-1$
+ String url = WSDLServletUtil.formatURL(HTTPS,"chicago",null, OTHER_APP_CONTEXT, serverURLs,"testVDB",null); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("https://chicago/metamatrix-soapiness/servlet/ArtifactDocumentService/Meta...", url); //$NON-NLS-1$
+ }
+
+ public void testFormatUrlValidParametersSecureNoVdbVersion() {
+ List serverURLs = new ArrayList();
+ serverURLs.add("mms://chicago:31000"); //$NON-NLS-1$
+ String url = WSDLServletUtil.formatURL(HTTPS,"chicago","8443", DEFAULT_APP_CONTEXT, serverURLs,"testVDB",""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ assertEquals("https://chicago:8443/metamatrix-soap/servlet/ArtifactDocumentService/Meta...", url); //$NON-NLS-1$
+ }
+
+ public void testFormatUrlMultipleServers() {
+ List serverURLs = new ArrayList();
+ serverURLs.add("mm://chicago:31000"); //$NON-NLS-1$
+ serverURLs.add("boston:31000"); //$NON-NLS-1$
+ String url = WSDLServletUtil.formatURL(HTTP,"chicago","8080", DEFAULT_APP_CONTEXT, serverURLs,"testVDB","1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ assertEquals("http://chicago:8080/metamatrix-soap/servlet/ArtifactDocumentService/MetaM...", url); //$NON-NLS-1$
+ }
+
+}
Added: sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWebServiceUtil.java
===================================================================
--- sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWebServiceUtil.java (rev 0)
+++ sqlquerywebservice/src/test/java/org/metamatrix/soap/util/TestWebServiceUtil.java 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.soap.util;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.soap.exceptions.SOAPProcessingException;
+
+public class TestWebServiceUtil extends TestCase {
+
+ private static String ERROR = "The SOAP Action and WSAW Action are null or empty. Please format the action as follows: VDBName=MyVDB&ServerURL=mm://mmHost:mmPort&VDBVersion=<optional>&AdditionalProperties=<optional>&procedure=fully.qualified.procedureName"; //$NON-NLS-1$
+
+ public void testValidateCorrectAction() {
+
+ try {
+ WebServiceUtil.validateActionIsSet("VDBName=MyVDB&ServerURL=mm://mmHost:mmPort&VDBVersion=<optional>&AdditionalProperties=<optional>&procedure=fully.qualified.procedureName");//$NON-NLS-1$
+ } catch (SOAPProcessingException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void testValidateNullAction() {
+ try {
+ WebServiceUtil.validateActionIsSet(null);
+ } catch (SOAPProcessingException e) {
+ assertEquals(ERROR, e.getMessage());
+ }
+ }
+
+ public void testValidateEmptyAction() {
+ try {
+ WebServiceUtil.validateActionIsSet("");//$NON-NLS-1$
+ } catch (SOAPProcessingException e) {
+ assertEquals(ERROR, e.getMessage());
+ }
+ }
+
+ public void testValidateEmptySpacesAction() {
+ try {
+ WebServiceUtil.validateActionIsSet(" ");//$NON-NLS-1$
+ } catch (SOAPProcessingException e) {
+ assertEquals(ERROR, e.getMessage());
+ }
+ }
+}
Added: sqlquerywebservice/target/classes/com/teiid/soap/i18n.properties
===================================================================
--- sqlquerywebservice/target/classes/com/teiid/soap/i18n.properties (rev 0)
+++ sqlquerywebservice/target/classes/com/teiid/soap/i18n.properties 2010-06-08 21:26:55 UTC (rev 2208)
@@ -0,0 +1,174 @@
+#
+# JBoss, Home of Professional Open Source.
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+
+# authentication (001)
+ERR.018.001.0001 = Session ID parameter cannot be null.
+ERR.018.001.0002 = Server URL parameter cannot be null.
+ERR.018.001.0003 = Virtual database parameter cannot be null.
+ERR.018.001.0004 = Maximum number of anonymous connections reached.
+
+# servlet (002)
+ERR.018.002.0001 = The metadata type ({0}) is not a valid type.
+ERR.018.002.0002 = Unexpected type for current index for stored procedure parameters received from form page, was expecting type of Integer but was ({0}) instead: {1}
+ERR.018.002.0003 = The SOAP Call failed. The details are: {0}
+ERR.018.002.0004 = Required parameter ({0}) not found in form data.
+ERR.018.002.0005 = Unable to get metadata data types: {0}
+ERR.018.002.0006 = Unable to get a connection.
+ERR.018.002.0007 = Unable to use anonymous login as a dedicated session.
+ERR.018.002.0008 = Unable to obtain the connection pool controller: {0}
+ERR.018.002.0009 = Unable to logoff from server: {0}
+ERR.018.002.0010 = The stored procedure cannot be null.
+ERR.018.002.0011 = The stored procedure name cannot be null
+ERR.018.002.0012 = The results returned from the data service were null.
+ERR.018.002.0013 = SQL cannot be null for SOAP method submitXMLQuery
+ERR.018.002.0014 = Unable to read the returned result set.
+ERR.018.002.0015 = Unable to retreive metadata from the Query Results.
+ERR.018.002.0016 = The current user session is invalid, please login again.
+ERR.018.002.0017 = The user connection cannot be established.
+ERR.018.002.0018 = Connection is not available, check server to make sure it is running.
+ERR.018.002.0019 = Unable to establish a connection: {0}
+ERR.018.002.0020 = The specified port {0} is invalid.
+ERR.018.002.0021 = The specified host {0} is invalid.
+ERR.018.002.0022 = Recheck the parameters provided.\n\nThe generated URL: {0}\n\nCould not be used to get WSDL due to error: {1}
+ERR.018.002.0023 = The user entered a negative number.
+ERR.018.002.0024 = The specified version {0} is invalid.
+ERR.018.002.0025 = Did not find a colon delimiter between the server host and port for the supplied list item {0}
+ERR.018.002.0026 = The supplied server host and port list is invalid.
+
+
+# xml (011)
+ERR.018.011.0001 = No children expected when star is chosen.
+ERR.018.011.0002 = Invalid value for {0} element: "{1}" must be either "{2}" or "{3}"
+ERR.018.011.0003 = Invalid input format
+ERR.018.011.0004 = Unable to parse the value for {0} element: "{1}"
+ERR.018.011.0005 = The starting row cannot be negetive.
+ERR.018.011.0006 = The starting row cannot be less than the ending row.
+ERR.018.011.0007 = Null object reference
+ERR.018.011.0008 = The starting row cannot be less than 1.
+ERR.018.011.0009 = Unable to translate result documents.
+ERR.018.011.0010 = Schema cannot be null when attempting to translate.
+ERR.018.011.0011 = Schema is not available.
+ERR.018.011.0012 = index attribute of {0} in stored procedure parameter is not a valid integer.
+ERR.018.011.0013 = index attribute not found in stored procedure attribute.
+ERR.018.011.0014 = Unable to translate the stored procedure parameters due to: {0}
+ERR.018.011.0015 = Parameter name cannot be null.
+ERR.018.011.0016 = Index cannot be null.
+ERR.018.011.0017 = Unable to translate metadata due to: {0}
+ERR.018.011.0018 = element name cannot be null in getNewElement method.
+ERR.018.011.0019 = Unable to create new w3c document due to a parser configuration exception: {0}
+ERR.018.011.0020 = node name cannot be null in getNewTextNode method.
+ERR.018.011.0021 = Unable to execute Stored Procedure due to: {0}
+ERR.018.011.0022 = Unable to execute query due to: {0}
+ERR.018.011.0023 = Unable to execute update due to: {0}
+ERR.018.011.0024 = Unable to execute XMLQuery due to: {0}
+
+# MMSOAPClientServlet
+MMSOAPClientServlet.There_was_a_problem_creating_the_SOAPAuthentication_object._61=There was a problem creating the SOAPAuthentication object.
+
+# MMSOAPServlet
+MMSOAPServlet.Unexpected_error_while_processing_JMS_SOAP_request._4=Unexpected error while processing JMS SOAP request.
+MMSOAPServlet.Unable_to_get_an_Axis_server_engine._5=Unable to get an Axis server engine.
+MMSOAPServlet.Unable_to_set_the_target_service._The_service_name_is_not_correctly_configured._7=Unable to set the target service. The service name is not correctly configured.
+MMSOAPServlet.Failed_to_retrieve_the_response_destination_from_the_JMS_message._No_response_will_be_sent._8=Failed to retrieve the response destination from the JMS message. No response will be sent.
+MMSOAPServlet.Unable_to_send_a_JMS_response_message_to_the_reply_destination._9=Unable to send a JMS response message to the reply destination.
+MMSOAPServlet.Unable_to_initialize_the_JMS_MessageListener_for_data_service_requests_to___{0}__._The_JMS_transport_will_not_function_properly_for_data_service_requests._11=Unable to initialize the JMS MessageListener for data service requests to {0}. The JMS transport will not function properly for data service requests.
+MMSOAPServlet.Unable_to_start_the_JMS_service._The_JMS_transport_will_not_function_properly_for_SOAP_requests._12=Unable to start the JMS service. The JMS transport will not function properly for SOAP requests.
+MMSOAPServlet.Unable_to_obtain_a_connector_with_connection_factory_{0}._The_JMS_transport_will_not_function._1=Unable to obtain a connector with connection factory {0}. The JMS transport will not function.
+MMSOAPServlet.Unable_to_initialize_the_JMS_MessageListener_for_SOAP_service_requests_to_{0}._The_JMS_transport_will_not_function_properly_for_SOAP_requests._1=Unable to initialize the JMS MessageListener for SOAP service requests to {0}. The JMS transport will not function properly for SOAP requests.
+MMSOAPServlet.MMDriver_init_failed=Teiid SOAP service initialization failed because it could not find the requisite Teiid JDBC driver. Please ensure that this driver is in your classpath
+
+# MMSoapQueryService
+MMSoapQueryService.document_name_cannot_be_null_2=document name cannot be null
+MMSoapQueryService.Unable_to_get_metadata_data_types___{0}_4=Unable to get metadata data types : {0}
+MMSoapQueryService.Exception_when_attempting_to_close_the_ResultSet_2=Exception when attempting to close the ResultSet
+MMSoapQueryService.Exception_when_attempting_to_close_the_statement._1=Exception when attempting to close the statement.
+MMSoapQueryService.Exception_when_attempting_to_close_the_connection._2=Exception when attempting to close the connection.
+
+# BytesMessageInputStream
+BytesMessageInputStream.Unable_to_read_a_byte_from_the_BytesMessage__{0}_1=Unable to read a byte from the BytesMessage: {0}
+
+# DataServiceWebServiceImpl
+DataServiceWebServiceImpl.0=The incoming Message Context was null. Cannot authenticate user.
+DataServiceWebServiceImpl.1=The result message from executing the Web Service operation * {0} * contained more than one xml document in the result returned from the Teiid Server. This behavior is not supported by a Data Service type web service.
+DataServiceWebServiceImpl.2=The input Data Service Request message had more than one root element in the body section. This structural anomaly is not supported by the Data Service web service.
+DataServiceWebServiceImpl.3=Exception closing connection.
+DataServiceWebServiceImpl.4=SOAP Action is not present.
+DataServiceWebServiceImpl.6=Exception in executeDataservice: {0}
+DataServiceWebServiceImpl.7=No response document returned. Please check your inputs.
+DataServiceWebServiceImpl.8=There was no row returned in the ResultSet.
+DataServiceWebServiceImpl.9=A processing error occurred for the following xml document: {0}
+DataServiceWebServiceImpl.10=There was a problem parsing the xml result document returned from the server. Here is the error: {0} Please see the log for more details.
+DataServiceWebServiceImpl.11=No security results. Token was not found.
+DataServiceWebServiceImpl.12=Unable to create connection for username: {0} due to {1}.
+DataServiceWebServiceImpl.16=Query Timeout not set or not a valid integer. Using zero for query timeout (NO TIMOUT).
+
+# MMGetVDBResourceServlet
+MMGetVDBResourceServlet.0=Exception closing connection: {0}
+MMGetVDBResourceServlet.1=IOException in decrypt
+MMGetVDBResourceServlet.2=Exception in decrypt
+MMGetVDBResourceServlet.3=Exception in get decrypt key
+MMGetVDBResourceServlet.4=Exception in Cipher.getInstance()
+MMGetVDBResourceServlet.5=InvalidKeyException in decrypt.init()
+MMGetVDBResourceServlet.6=IllegalStateException in decrypt.doFinal()
+MMGetVDBResourceServlet.7=SQLException retrieving VDB Resource
+MMGetVDBResourceServlet.8=Exception retrieving VDB Resource
+MMGetVDBResourceServlet.9=BadPaddingException in decrypt.doFinal()
+MMGetVDBResourceServlet.10=Class Not Found
+MMGetVDBResourceServlet.11=IllegalBlockSizeException in decrypt.doFinal()
+MMGetVDBResourceServlet.12=No results from procedure
+MMGetVDBResourceServlet.13=FileNotFoundException in decrypt
+MMGetVDBResourceServlet.14=Resource Not Found
+MMGetVDBResourceServlet.15=There was an error encoding the query string.
+MMGetVDBResourceServlet.Application_Name=Teiid WSDL Resource Client
+
+# LicenseInfo
+LicenseInfo.UnverifiedLicenseException=UnverifiedLicenseException: {0}
+LicenseInfo.UnlicensedProductException=UnlicensedProductException: {0}
+LicenseInfo.InvalidLicenseException=InvalidLicenseException: {0}
+LicenseInfo.LicenseVerificationException=LicenseVerificationException: {0}
+LicenseInfo.ErrorMessage= Please contact your System Administrator or Teiid for a valid license.
+
+
+PoolingConnectionSource.The_connection_pool_factory_given_the_Pooling_Connection_Source=The connection pool factory given the Pooling Connection Source for the Data Service implementation was null. Please check configuration properties.
+PoolingConnectionSource.The_DataSource_instance_pulled_from_the=The DataSource instance pulled from the map of connection pools was null.
+
+WebServiceUtil.0=The SOAP Action and WSAW Action are null or empty. Please format the action as follows: VDBName=MyVDB&ServerURL=mm://mmHost:mmPort&VDBVersion=<optional>&AdditionalProperties=<optional>&procedure=fully.qualified.procedureName
+WebServiceUtil.1=The NamePasswordCredentials from the SOAP request message were null. The incoming SOAP request cannot be authenticated.
+
+# MMDiscoverWSDLServlet
+MMDiscoverWSDLServlet.1=Error retrieving WSDL Urls. Please verify that the Teiid Server information is correctly defined in the web.xml.
+MMDiscoverWSDLServlet.2=Error retrieving WSDL Urls:
+
+# SqlQueryWebService
+SqlQueryWebService.0=The incoming Message Context was null. Cannot authenticate user.
+Unable_to_close_session_with_id_due_to=Unable to close session with id {0} due to: {1}
+The_time_to_wait_submitted_with_the_executeBlocking_request=The ''time to wait'' submitted with the executeBlocking request was reached. The request has timed out. If results are desired, please revise the ''time to wait'' parameter in the request message and try again.
+
+# SqlQueryWebServiceFault
+Unable_to_create_the_Detail_for_the_exception_due_to=Unable to create the ''Detail'' for the exception due to the following: {0}
+
+# LicenseInfo
+LicenseInfo.UnverifiedLicenseException=UnverifiedLicenseException: {0}
+LicenseInfo.UnlicensedProductException=UnlicensedProductException: {0}
+LicenseInfo.InvalidLicenseException=InvalidLicenseException: {0}
+LicenseInfo.LicenseVerificationException=LicenseVerificationException: {0}
+
14 years, 6 months
teiid SVN: r2207 - trunk/connectors/translator-xml/src/test/resources.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-08 17:05:49 -0400 (Tue, 08 Jun 2010)
New Revision: 2207
Removed:
trunk/connectors/translator-xml/src/test/resources/BookCollection.xml
trunk/connectors/translator-xml/src/test/resources/cis.vdb
trunk/connectors/translator-xml/src/test/resources/documents/
trunk/connectors/translator-xml/src/test/resources/xmltest.vdb
Log:
TEIID-1114 removing xml relational test files
Deleted: trunk/connectors/translator-xml/src/test/resources/BookCollection.xml
===================================================================
--- trunk/connectors/translator-xml/src/test/resources/BookCollection.xml 2010-06-08 20:54:45 UTC (rev 2206)
+++ trunk/connectors/translator-xml/src/test/resources/BookCollection.xml 2010-06-08 21:05:49 UTC (rev 2207)
@@ -1,543 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><Books:bookCollection xmlns:Books="http://www.metamatrix.com/XMLSchema/DataSets/Books">
-<!--
-
- JBoss, Home of Professional Open Source.
- See the COPYRIGHT.txt file distributed with this work for information
- regarding copyright ownership. Some portions may be licensed
- to Red Hat, Inc. under one or more contributor license agreements.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
--->
-
- <book isbn="0-7356-0877-7">
- <title>After the Gold Rush</title>
- <subtitle>Creating a True Profession of Software Engineering</subtitle>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-55615-484-4">
- <title>Code Complete</title>
- <subtitle>A Practical Handbook of Software Construction</subtitle>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1993</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-556-15900-5">
- <title>Rapid Development</title>
- <subtitle>Taming Wild Software Schedules</subtitle>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-7356-0631-5">
- <title>Software Requirements</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Wiegers</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-57231-621-7">
- <title>Software Project Survival Guide</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>McConnell</author>
- </authors>
- <publishingInformation>
- <publisher>Microsoft Press</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-43287-0">
- <title>Automated Software Testing</title>
- <subtitle>Introduction, Management, and Performance</subtitle>
- <edition>1</edition>
- <authors>
- <author>Dustin</author>
- <author>Rashka</author>
- <author>Paul</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-31000-7">
- <title>Inside Java 2 Security</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Gong</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="020130998X">
- <title>The Unified Modeling Language Reference Manual</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Rumbaugh</author>
- <author>Jacobson</author>
- <author>Booch</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-70225-8">
- <title>Writing Effective Use Cases</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Cockburn</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2001</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0201877562">
- <title>Software Testing in the Real World</title>
- <subtitle>Improving the Process</subtitle>
- <edition>1</edition>
- <authors>
- <author>Kit</author>
- <author>Finzi</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1995</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-43336-2">
- <title>SQL Queries for Mere Mortals</title>
- <subtitle>A Hands-on Guide to Data Manipulation in SQL</subtitle>
- <edition>1</edition>
- <authors>
- <author>Hernandez</author>
- <author>Viescas</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-65758-9">
- <title>LDAP Programming with Java</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Weltman</author>
- <author>Dahbura</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-44787-8">
- <title>The Practical SQL Handbook</title>
- <subtitle>Using Structured Query Language</subtitle>
- <edition>1</edition>
- <authors>
- <author>Bowman</author>
- <author>Emerson</author>
- <author>Darnovsky</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-10088-6">
- <title>Compilers</title>
- <subtitle>Principles, Techniques, and Tools</subtitle>
- <edition>1</edition>
- <authors>
- <author>Aho</author>
- <author>Sethi</author>
- <author>Ullman</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>1985</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-201-31009-0">
- <title>Concurrent Programming in Java</title>
- <subtitle>Design Principles and Patterns</subtitle>
- <edition>2</edition>
- <authors>
- <author>Lea</author>
- </authors>
- <publishingInformation>
- <publisher>Addison-Wesley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-471-98710-7">
- <title>Concurrency State Models & Java Programs</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Kramer</author>
- <author>Magee</author>
- </authors>
- <publishingInformation>
- <publisher>Wiley</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-471355232">
- <title>Building and Managing the Meta Data Repository</title>
- <subtitle>A Full Life-Cycle Guide</subtitle>
- <edition>1</edition>
- <authors>
- <author>Marco</author>
- </authors>
- <publishingInformation>
- <publisher>Wiley</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-7897-2271-2">
- <title>Complete Idiot's Guide to Project Management with Microsoft Project 2000</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Black</author>
- </authors>
- <publishingInformation>
- <publisher>Que</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-932633-33-1">
- <title>Creating a Software Engineering Culture</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Wiegers</author>
- </authors>
- <publishingInformation>
- <publisher>Dorset House Publishing</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-932633-43-9">
- <title>Peopleware</title>
- <subtitle>Productive Projects and Teams</subtitle>
- <edition>2</edition>
- <authors>
- <author>DeMarco</author>
- <author>Lister</author>
- </authors>
- <publishingInformation>
- <publisher>Dorset House Publishing</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1558605150">
- <title>Database Design for Smarties</title>
- <subtitle>Using UML for Data Modeling</subtitle>
- <edition>1</edition>
- <authors>
- <author>Muller</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-558-60190-2">
- <title>Transaction Processing</title>
- <subtitle>Concepts and Techniques</subtitle>
- <edition>1</edition>
- <authors>
- <author>Gray</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1992</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-55860-415-4">
- <title>Principles of Transaction Processing</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Bernstein</author>
- <author>Newcomer</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1997</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1558605231">
- <title>Readings in Database Systems</title>
- <subtitle/>
- <edition>3</edition>
- <authors>
- <author>Stonebraker</author>
- <author>Hellerstein</author>
- </authors>
- <publishingInformation>
- <publisher>Morgan Kaufman</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-13-239856-7">
- <title>How to Run Successful Projects II</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>O'Connell</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>1996</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-13-014714-1">
- <title>The XML Handbook</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>Goldfarb</author>
- <author>Prescod</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0130273635">
- <title>Thinking in Java</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>Eckel</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="130402648">
- <title>Database System Implementation</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Ullman</author>
- <author>Garcia-Molina</author>
- <author>Widom</author>
- </authors>
- <publishingInformation>
- <publisher>Prentice Hall</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-596-00016-2">
- <title>Java and XML</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>McLaughlin</author>
- <author>Loukides</author>
- </authors>
- <publishingInformation>
- <publisher>O'Reilly</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-56592-487-8">
- <title>Java in a Nutshell</title>
- <subtitle/>
- <edition>3</edition>
- <authors>
- <author>Flanagan</author>
- </authors>
- <publishingInformation>
- <publisher>O'Reilly</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-56592-483-5">
- <title>Java Enterprise in a Nutshell</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Flanagan</author>
- </authors>
- <publishingInformation>
- <publisher>O'Reilly</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-672-31602-1">
- <title>Java Security Handbook</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Jaworski</author>
- <author>Perrone</author>
- </authors>
- <publishingInformation>
- <publisher>Sams</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-672-31983-7">
- <title>Software Testing</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Patton</author>
- </authors>
- <publishingInformation>
- <publisher>Sams</publisher>
- <publishDate>2001</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-861002-77-7">
- <title>Professional Java Server Programming</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Ayers</author>
- <author>Bergsten</author>
- <author>Diamond</author>
- </authors>
- <publishingInformation>
- <publisher>Wrox</publisher>
- <publishDate>1999</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-861-00506-7">
- <title>XSLT Programmer's Reference</title>
- <subtitle/>
- <edition>2</edition>
- <authors>
- <author>Kay</author>
- </authors>
- <publishingInformation>
- <publisher>Wrox</publisher>
- <publishDate>2001</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-861-00312-9">
- <title>XSLT Programmer's Reference</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Kay</author>
- </authors>
- <publishingInformation>
- <publisher>Wrox</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-818-68300-7">
- <title>The Software Project Manager's Handbook</title>
- <subtitle>Principles that Work</subtitle>
- <edition>1</edition>
- <authors>
- <author>Phillips</author>
- </authors>
- <publishingInformation>
- <publisher>IEEE Computer Society</publisher>
- <publishDate>1998</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-884777-84-8">
- <title>Swing</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Robinson</author>
- <author>Vorobiev</author>
- </authors>
- <publishingInformation>
- <publisher>Manning</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-893115-10-0">
- <title>Taming Java Threads</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Holub</author>
- </authors>
- <publishingInformation>
- <publisher>Apress</publisher>
- <publishDate>2000</publishDate>
- </publishingInformation>
- </book>
- <book isbn="1-57870-070-1">
- <title>Understanding and Deploying LDAP Directory Services</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Howes</author>
- <author>Smith</author>
- <author>Good</author>
- </authors>
- <publishingInformation>
- <publisher>Macmillan</publisher>
- <publishDate>1990</publishDate>
- </publishingInformation>
- </book>
- <book isbn="0-7821-1148-3">
- <title>SQL Instant Reference</title>
- <subtitle/>
- <edition>1</edition>
- <authors>
- <author>Gruber</author>
- </authors>
- <publishingInformation>
- <publisher>Sybex</publisher>
- <publishDate>1993</publishDate>
- </publishingInformation>
- </book>
-</Books:bookCollection>
\ No newline at end of file
Deleted: trunk/connectors/translator-xml/src/test/resources/cis.vdb
===================================================================
(Binary files differ)
Deleted: trunk/connectors/translator-xml/src/test/resources/xmltest.vdb
===================================================================
(Binary files differ)
14 years, 6 months
teiid SVN: r2206 - in trunk/engine/src/main: resources/org/teiid/query/execution and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-08 16:54:45 -0400 (Tue, 08 Jun 2010)
New Revision: 2206
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
Log:
TEIID-1102 adding tracking of file name if the file resource adapter is used
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2010-06-08 20:00:16 UTC (rev 2205)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2010-06-08 20:54:45 UTC (rev 2206)
@@ -38,16 +38,14 @@
import org.teiid.common.buffer.TupleBatch;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.types.ClobImpl;
import org.teiid.core.types.ClobType;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.TransformationException;
import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.processor.ProcessorDataManager;
-import org.teiid.query.sql.lang.TableFunctionReference;
import org.teiid.query.sql.lang.TextTable;
import org.teiid.query.sql.lang.TextTable.TextColumn;
-import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.util.CommandContext;
/**
@@ -76,6 +74,7 @@
private BufferedReader reader;
private int textLine = 0;
private Map<String, Integer> nameIndexes;
+ private String systemId;
public TextTableNode(int nodeID) {
super(nodeID);
@@ -180,13 +179,13 @@
index = nameIndexes.get(col.getName());
}
if (index >= vals.size()) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.no_value", col.getName(), textLine)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.no_value", col.getName(), textLine, systemId)); //$NON-NLS-1$
}
val = vals.get(index);
try {
tuple.add(DataTypeManager.transformValue(val, table.getColumns().get(output).getSymbol().getType()));
} catch (TransformationException e) {
- throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("TextTableNode.conversion_error", col.getName(), textLine)); //$NON-NLS-1$
+ throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("TextTableNode.conversion_error", col.getName(), textLine, systemId)); //$NON-NLS-1$
}
}
addBatchRow(tuple);
@@ -217,13 +216,19 @@
setReferenceValues(this.table);
ClobType file = (ClobType)getEvaluator(Collections.emptyMap()).evaluate(table.getFile(), null);
-
if (file == null) {
return;
}
//get the reader
try {
+ this.systemId = "Unknown"; //$NON-NLS-1$
+ if (file.getReference() instanceof ClobImpl) {
+ this.systemId = ((ClobImpl)file.getReference()).getStreamFactory().getSystemId();
+ if (this.systemId == null) {
+ this.systemId = "Unknown"; //$NON-NLS-1$
+ }
+ }
Reader r = file.getCharacterStream();
if (!(r instanceof BufferedReader)) {
reader = new BufferedReader(r);
@@ -262,7 +267,7 @@
for (TextColumn col : table.getColumns()) {
Integer index = nameIndexes.get(col.getName().toUpperCase());
if (index == null) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.header_missing", col.getName())); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.header_missing", col.getName(), systemId)); //$NON-NLS-1$
}
nameIndexes.put(col.getName(), index);
}
@@ -296,7 +301,7 @@
}
line = readLine();
if (line == null) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.unclosed")); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.unclosed", systemId)); //$NON-NLS-1$
}
}
char[] chars = line.toCharArray();
@@ -326,7 +331,7 @@
builder.append(chr);
} else {
if (builder.toString().trim().length() != 0) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.character_not_allowed", textLine)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.character_not_allowed", textLine, systemId)); //$NON-NLS-1$
}
qualified = true;
builder = new StringBuilder(); //start the entry over
@@ -337,11 +342,11 @@
} else {
if (escaped) {
//don't understand other escape sequences yet
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.unknown_escape", chr, textLine)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.unknown_escape", chr, textLine, systemId)); //$NON-NLS-1$
}
if (wasQualified && !qualified) {
if (!Character.isWhitespace(chr)) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.character_not_allowed", textLine)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.character_not_allowed", textLine, systemId)); //$NON-NLS-1$
}
//else just ignore
} else {
@@ -366,7 +371,7 @@
private List<String> parseFixedWidth(String line)
throws TeiidProcessingException {
if (line.length() < lineWidth) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.invalid_width", line.length(), lineWidth, textLine)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.invalid_width", line.length(), lineWidth, textLine, systemId)); //$NON-NLS-1$
}
ArrayList<String> result = new ArrayList<String>();
int beginIndex = 0;
Modified: trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties 2010-06-08 20:00:16 UTC (rev 2205)
+++ trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties 2010-06-08 20:54:45 UTC (rev 2206)
@@ -209,13 +209,13 @@
FileStorageManager.can_not_save_lobs=Can not save *Reference Lobs* into persistent disk storage.
FileStorageManager.batch_error=Error while converting batched data to file storage.
-TextTableNode.no_value=No value found for column \"{0}\" in the row ending on text line {1}.
-TextTableNode.conversion_error=Could not convert value for column \"{0}\" in the row ending on text line {1}.
-TextTableNode.header_missing=HEADER entry missing for column name \"{0}\".
-TextTableNode.unclosed=Text parse error: Unclosed qualifier at end of text.
-TextTableNode.character_not_allowed=Text parse error: Non-whitespace character found between the qualifier and the delimiter in text line {0}.
-TextTableNode.unknown_escape=Text parse error: Unknown escape sequence \\{0} in text line {1}.
-TextTableNode.invalid_width=Text parse error: Fixed width line width {0} is smaller than the expected {1} on text line {2}
+TextTableNode.no_value=No value found for column \"{0}\" in the row ending on text line {1} in {2}.
+TextTableNode.conversion_error=Could not convert value for column \"{0}\" in the row ending on text line {1} in {2}.
+TextTableNode.header_missing=HEADER entry missing for column name \"{0}\" in {1}.
+TextTableNode.unclosed=Text parse error: Unclosed qualifier at end of text in {0}.
+TextTableNode.character_not_allowed=Text parse error: Non-whitespace character found between the qualifier and the delimiter in text line {0} in {1}.
+TextTableNode.unknown_escape=Text parse error: Unknown escape sequence \\{0} in text line {1} in {2}.
+TextTableNode.invalid_width=Text parse error: Fixed width line width {0} is smaller than the expected {1} on text line {2} in {3}.
XMLTableNode.error=Error evaluating XQuery row context for XMLTable: {0}
XMLTableNode.path_error=Error evaluating XMLTable column path expression for column: {0}
14 years, 6 months
teiid SVN: r2205 - /.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-06-08 16:00:16 -0400 (Tue, 08 Jun 2010)
New Revision: 2205
Added:
sqlquerywebservice/
Log:
Adding new folder for SqlQueryWebService
14 years, 6 months
teiid SVN: r2204 - trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-08 15:18:19 -0400 (Tue, 08 Jun 2010)
New Revision: 2204
Modified:
trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties
Log:
TEIID-962 exposing a write method via the file translator
Modified: trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties
===================================================================
--- trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties 2010-06-08 19:17:35 UTC (rev 2203)
+++ trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties 2010-06-08 19:18:19 UTC (rev 2204)
@@ -20,3 +20,6 @@
# 02110-1301 USA.
#
+non_null=Expected non-null values for filePath and file
+unknown_type=Unknown type for file, was expecting an XML, CLOB, or BLOB value
+error_writing=Error writing file
\ No newline at end of file
14 years, 6 months
teiid SVN: r2203 - trunk/connectors/translator-file/src/main/java/org/teiid/translator/file.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-08 15:17:35 -0400 (Tue, 08 Jun 2010)
New Revision: 2203
Modified:
trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
Log:
TEIID-962 exposing a write method via the file translator
Modified: trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
+++ trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-06-08 19:17:35 UTC (rev 2203)
@@ -23,12 +23,17 @@
package org.teiid.translator.file;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
import java.nio.charset.Charset;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.SQLException;
+import java.sql.SQLXML;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import javax.resource.ResourceException;
import javax.resource.cci.ConnectionFactory;
import org.teiid.core.BundleUtil;
@@ -38,9 +43,9 @@
import org.teiid.core.types.ClobImpl;
import org.teiid.core.types.ClobType;
import org.teiid.core.types.InputStreamFactory.FileInputStreamFactory;
+import org.teiid.core.util.ObjectConverterUtil;
+import org.teiid.core.util.ReaderInputStream;
import org.teiid.language.Call;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.Procedure;
import org.teiid.metadata.RuntimeMetadata;
@@ -49,7 +54,6 @@
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.FileConnection;
-import org.teiid.translator.MetadataProvider;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.Translator;
import org.teiid.translator.TranslatorException;
@@ -57,7 +61,7 @@
import org.teiid.translator.TypeFacility;
@Translator(name="file")
-public class FileExecutionFactory extends ExecutionFactory implements MetadataProvider {
+public class FileExecutionFactory extends ExecutionFactory<ConnectionFactory, FileConnection> {
private final class FileProcedureExecution implements ProcedureExecution {
private final Call command;
@@ -84,11 +88,7 @@
@Override
public void close() {
- try {
- fc.close();
- } catch (ResourceException e) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Exception closing"); //$NON-NLS-1$
- }
+
}
@Override
@@ -126,6 +126,7 @@
public static final String GETTEXTFILES = "getTextFiles"; //$NON-NLS-1$
public static final String GETFILES = "getFiles"; //$NON-NLS-1$
+ public static final String SAVEFILE = "saveFile"; //$NON-NLS-1$
private String encoding = Charset.defaultCharset().name();
@@ -141,27 +142,75 @@
//@Override
public ProcedureExecution createProcedureExecution(final Call command,
final ExecutionContext executionContext, final RuntimeMetadata metadata,
- Object connectionFactory) throws TranslatorException {
- final FileConnection fc;
- try {
- fc = (FileConnection)((ConnectionFactory)connectionFactory).getConnection();
- } catch (ResourceException e) {
- throw new TranslatorException(e);
+ final FileConnection fc) throws TranslatorException {
+ if (command.getProcedureName().equalsIgnoreCase(SAVEFILE)) {
+ return new ProcedureExecution() {
+
+ @Override
+ public void execute() throws TranslatorException {
+ String filePath = (String)command.getArguments().get(0).getArgumentValue().getValue();
+ Object file = command.getArguments().get(1).getArgumentValue().getValue();
+ if (file == null || filePath == null) {
+ throw new TranslatorException(UTIL.getString("non_null")); //$NON-NLS-1$
+ }
+ InputStream is = null;
+ try {
+ if (file instanceof SQLXML) {
+ is = ((SQLXML)file).getBinaryStream();
+ } else if (file instanceof Clob) {
+ is = new ReaderInputStream(((Clob)file).getCharacterStream(), Charset.forName(encoding));
+ } else if (file instanceof Blob) {
+ is = ((Blob)file).getBinaryStream();
+ } else {
+ throw new TranslatorException(UTIL.getString("unknown_type")); //$NON-NLS-1$
+ }
+
+ ObjectConverterUtil.write(is, fc.getFile(filePath));
+ } catch (IOException e) {
+ throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
+ } catch (SQLException e) {
+ throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void close() {
+ }
+
+ @Override
+ public void cancel() throws TranslatorException {
+ }
+
+ @Override
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
+ return null;
+ }
+
+ @Override
+ public List<?> getOutputParameterValues() throws TranslatorException {
+ return Collections.emptyList();
+ }
+ };
}
return new FileProcedureExecution(command, fc);
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException {
+ public void getMetadata(MetadataFactory metadataFactory, FileConnection connection) throws TranslatorException {
Procedure p = metadataFactory.addProcedure(GETTEXTFILES);
- metadataFactory.addProcedureParameter("path", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ metadataFactory.addProcedureParameter("pathAndPattern", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
metadataFactory.addProcedureResultSetColumn("file", TypeFacility.RUNTIME_NAMES.CLOB, p); //$NON-NLS-1$
- metadataFactory.addProcedureResultSetColumn("path", TypeFacility.RUNTIME_NAMES.STRING, p); //$NON-NLS-1$
+ metadataFactory.addProcedureResultSetColumn("filePath", TypeFacility.RUNTIME_NAMES.STRING, p); //$NON-NLS-1$
Procedure p1 = metadataFactory.addProcedure(GETFILES);
- metadataFactory.addProcedureParameter("path", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p1); //$NON-NLS-1$
+ metadataFactory.addProcedureParameter("pathAndPattern", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p1); //$NON-NLS-1$
metadataFactory.addProcedureResultSetColumn("file", TypeFacility.RUNTIME_NAMES.BLOB, p1); //$NON-NLS-1$
- metadataFactory.addProcedureResultSetColumn("path", TypeFacility.RUNTIME_NAMES.STRING, p1); //$NON-NLS-1$
+ metadataFactory.addProcedureResultSetColumn("filePath", TypeFacility.RUNTIME_NAMES.STRING, p1); //$NON-NLS-1$
+
+ Procedure p2 = metadataFactory.addProcedure(SAVEFILE);
+ metadataFactory.addProcedureParameter("filePath", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p2); //$NON-NLS-1$
+ //reporting as object, but can be one of xml, clob, blob
+ metadataFactory.addProcedureParameter("file", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p2); //$NON-NLS-1$
}
}
14 years, 6 months
teiid SVN: r2202 - in trunk: api/src/main/java/org/teiid/language and 41 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-08 15:11:59 -0400 (Tue, 08 Jun 2010)
New Revision: 2202
Added:
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java
Removed:
trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CartesienCriteriaGenerator.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CompositeExecution.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/Constants.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CriteriaDesc.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/DocumentBuilder.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ExecutionInfo.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileProcedureExecution.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileResultSetExecution.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/IDGeneratingXmlFilter.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/OutputXPathDesc.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ParameterDescriptor.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/QueryAnalyzer.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestGenerator.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestPreprocessor.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/SAXFilterProvider.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/StremableDocument.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLExecutionFactory.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLPlugin.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLProcedureExecution.java
trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/streaming/
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestElementCollector.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/file/
trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/streaming/
trunk/engine/src/test/java/org/teiid/query/xquery/
Modified:
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicConnection.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
trunk/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java
trunk/common-core/src/main/java/org/teiid/core/types/XMLType.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java
trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
trunk/connectors/translator-xml/pom.xml
trunk/connectors/translator-xml/src/main/resources/org/teiid/translator/xml/i18n.properties
trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
trunk/engine/pom.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java
trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLQuery.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
trunk/pom.xml
trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorUtil.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
Log:
TEIID-1087 TEIID-171 TEIID-1005 TEIID-1114 refining xmltable/xmlquery (removing the returing clause) and updating the docs, updating reserved words to 2006 sql/xml, initial removal of xml/relational, and changing the model of connectionfactory/connection interaction with the execution factory.
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -340,15 +340,22 @@
public static final String XMLAGG = "XMLAGG"; //$NON-NLS-1$
public static final String XMLATTRIBUTES = "XMLATTRIBUTES"; //$NON-NLS-1$
public static final String XMLBINARY = "XMLBINARY"; //$NON-NLS-1$
+ public static final String XMLCAST = "XMLCAST"; //$NON-NLS-1$
+ public static final String XMLCOMMENT = "XMLCOMMENT"; //$NON-NLS-1$
public static final String XMLCONCAT = "XMLCONCAT"; //$NON-NLS-1$
- public static final String XMLCOMMENT = "XMLCOMMENT"; //$NON-NLS-1$
+ public static final String XMLDOCUMENT = "XMLDOCUMENT"; //$NON-NLS-1$
public static final String XMLELEMENT = "XMLELEMENT"; //$NON-NLS-1$
+ public static final String XMLEXISTS = "XMLEXISTS"; //$NON-NLS-1$
public static final String XMLFOREST = "XMLFOREST"; //$NON-NLS-1$
+ public static final String XMLITERATE = "XMLITERATE"; //$NON-NLS-1$
public static final String XMLNAMESPACES = "XMLNAMESPACES"; //$NON-NLS-1$
public static final String XMLPARSE = "XMLPARSE"; //$NON-NLS-1$
public static final String XMLPI = "XMLPI"; //$NON-NLS-1$
- public static final String XMLROOT = "XMLROOT"; //$NON-NLS-1$
+ public static final String XMLQUERY = "XMLQUERY"; //$NON-NLS-1$
public static final String XMLSERIALIZE = "XMLSERIALIZE"; //$NON-NLS-1$
+ public static final String XMLTABLE = "XMLTABLE"; //$NON-NLS-1$
+ public static final String XMLTEXT = "XMLTEXT"; //$NON-NLS-1$
+ public static final String XMLVALIDATE = "XMLVALIDATE"; //$NON-NLS-1$
//SQL/MED
Modified: trunk/api/src/main/java/org/teiid/resource/spi/BasicConnection.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/BasicConnection.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicConnection.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -27,6 +27,7 @@
import javax.resource.cci.Interaction;
import javax.resource.cci.LocalTransaction;
import javax.resource.cci.ResultSetInfo;
+import javax.resource.spi.ManagedConnection;
public abstract class BasicConnection implements Connection {
@@ -50,8 +51,20 @@
throw new ResourceException("This operation not supported"); //$NON-NLS-1$
}
+ /**
+ * Tests the connection to see if it is still valid.
+ * @return
+ */
public boolean isAlive() {
return true;
}
+
+ /**
+ * Called by the {@link ManagedConnection} to indicate the physical connection
+ * should be cleaned up for reuse.
+ */
+ public void cleanUp() {
+
+ }
}
Modified: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -67,6 +67,9 @@
}
handles.clear();
}
+ if (this.physicalConnection != null) {
+ this.physicalConnection.cleanUp();
+ }
ConnectionContext.setSubject(null);
}
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -25,6 +25,10 @@
import java.util.Collection;
import java.util.List;
+import javax.resource.ResourceException;
+import javax.resource.cci.Connection;
+import javax.resource.cci.ConnectionFactory;
+
import org.teiid.core.TeiidException;
import org.teiid.core.util.ReflectionHelper;
import org.teiid.language.BatchedUpdates;
@@ -33,6 +37,9 @@
import org.teiid.language.LanguageFactory;
import org.teiid.language.QueryExpression;
import org.teiid.language.SetQuery;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
@@ -43,7 +50,7 @@
* The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed
* the "start" method is called. This class represents the basic capabilities of the translator.
*/
-public class ExecutionFactory {
+public class ExecutionFactory<F, C> {
public enum SupportedJoinCriteria {
/**
@@ -112,6 +119,54 @@
}
/**
+ * Return a connection object from the given connection factory.
+ *
+ * The default implementation assumes a JCA {@link ConnectionFactory}. Subclasses should override, if they use
+ * another type of connection factory.
+ *
+ * @param factory
+ * @return
+ * @throws TranslatorException
+ */
+ @SuppressWarnings("unchecked")
+ public C getConnection(F factory) throws TranslatorException {
+ if (factory == null) {
+ return null;
+ }
+ if (factory instanceof ConnectionFactory) {
+ try {
+ return (C) ((ConnectionFactory)factory).getConnection();
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
+ }
+ throw new AssertionError("A connection factory was supplied, but no implementation was provided getConnection"); //$NON-NLS-1$
+ }
+
+ /**
+ * Closes a connection object from the given connection factory.
+ *
+ * The default implementation assumes a JCA {@link Connection}. Subclasses should override, if they use
+ * another type of connection.
+ *
+ * @param connection
+ * @param factory
+ */
+ public void closeConnection(C connection, F factory) {
+ if (connection == null) {
+ return;
+ }
+ if (connection instanceof Connection) {
+ try {
+ ((Connection)connection).close();
+ } catch (ResourceException e) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Error closing"); //$NON-NLS-1$
+ }
+ }
+ throw new AssertionError("A connection was created, but no implementation provided for closeConnection"); //$NON-NLS-1$
+ }
+
+ /**
* Throw exception if there are more rows in the result set than specified in the MaxResultRows setting.
* @return
*/
@@ -188,28 +243,28 @@
* @param connection connection factory object to the data source
* @return An execution object that can use to execute the command
*/
- public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
+ public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException {
if (command instanceof QueryExpression) {
- return createResultSetExecution((QueryExpression)command, executionContext, metadata, connectionFactory);
+ return createResultSetExecution((QueryExpression)command, executionContext, metadata, connection);
}
if (command instanceof Call) {
- return createProcedureExecution((Call)command, executionContext, metadata, connectionFactory);
+ return createProcedureExecution((Call)command, executionContext, metadata, connection);
}
- return createUpdateExecution(command, executionContext, metadata, connectionFactory);
+ return createUpdateExecution(command, executionContext, metadata, connection);
}
@SuppressWarnings("unused")
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
+ public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException {
throw new TranslatorException("Unsupported Execution"); //$NON-NLS-1$
}
@SuppressWarnings("unused")
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException {
throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
@SuppressWarnings("unused")
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException {
throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
@@ -690,7 +745,7 @@
return false;
}
- public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws TranslatorException {
+ public static <T> T getInstance(Class<T> expectedType, String className, Collection<?> ctorObjs, Class<? extends T> defaultClass) throws TranslatorException {
try {
if (className == null) {
if (defaultClass == null) {
@@ -706,5 +761,16 @@
} catch(InstantiationException e) {
throw new TranslatorException(e);
}
- }
+ }
+
+ /**
+ * Implement to provide metadata to the metadata for use by the engine. This is the
+ * primary method of creating metadata for dynamic VDBs.
+ * @param metadataFactory
+ * @param conn
+ * @throws TranslatorException
+ */
+ public void getMetadata(MetadataFactory metadataFactory, C conn) throws TranslatorException {
+
+ }
}
Deleted: trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import org.teiid.metadata.MetadataFactory;
-
-public interface MetadataProvider {
-
- void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException;
-
-}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -94,13 +94,13 @@
private File f;
public FileInputStreamFactory(File f) {
- super();
- this.f = f;
+ this(f, Charset.defaultCharset().displayName());
}
public FileInputStreamFactory(File f, String encoding) {
super(encoding);
this.f = f;
+ this.setSystemId(f.toURI().toASCIIString());
}
@Override
Modified: trunk/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -73,7 +73,7 @@
@SuppressWarnings("unchecked")
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException {
if (sourceClass == null || sourceClass == StreamSource.class) {
- return (T)new StreamSource(getBinaryStream());
+ return (T)new StreamSource(getBinaryStream(), this.getStreamFactory().getSystemId());
}
throw new SQLException("Unsupported source type " + sourceClass); //$NON-NLS-1$
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/XMLType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/XMLType.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/common-core/src/main/java/org/teiid/core/types/XMLType.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -46,7 +46,7 @@
public final class XMLType extends Streamable<SQLXML> implements SQLXML {
public enum Type {
- UNKNOWN, DOCUMENT, FRAGMENT, SEQUENCE, COMMENT, PI, TEXT
+ UNKNOWN, DOCUMENT, CONTENT, ELEMENT, COMMENT, PI, TEXT
}
private static final long serialVersionUID = -7922647237095135723L;
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -59,7 +59,7 @@
}
public static Type isXml(Reader reader) throws TransformationException {
- Type type = Type.FRAGMENT;
+ Type type = Type.ELEMENT;
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
try{
XMLEventReader xmlReader = inputFactory.createXMLEventReader(reader);
Modified: trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -90,7 +90,7 @@
}
private void login(String username, String password, URL url, int timeout) throws ResourceException {
- if (!isAlive()) {
+ if (!isValid()) {
LoginResult loginResult = null;
sfSoap = null;
sfService = null;
@@ -137,7 +137,7 @@
}
- public boolean isAlive() {
+ public boolean isValid() {
boolean result = true;
if(sfSoap == null) {
result = false;
Modified: trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java
===================================================================
--- trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnection.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -39,6 +39,10 @@
public WSConnection(WSManagedConnectionFactory mcf) {
this.mcf = mcf;
+ createDelegate();
+ }
+
+ private void createDelegate() {
if (mcf.getInvocationType() == WSManagedConnectionFactory.InvocationType.HTTP_GET) {
this.delegate = createHTTPDispatch("GET"); //$NON-NLS-1$
}
@@ -189,4 +193,11 @@
public void close() throws ResourceException {
this.delegate = null;
}
+
+ @Override
+ public void cleanUp() {
+ //recreate to ensure the proper state
+ //this isn't really a heavy-weight operation
+ createDelegate();
+ }
}
Modified: trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSManagedConnectionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -42,7 +42,7 @@
private String wsSecurityConfigName; // ws-security config name in the above file
private String authPassword; // httpbasic - password
private String authUserName; // httpbasic - username
- private String xmlParamName;
+ private String xmlParamName; // used only in the http get invocation
@Override
public Object createConnectionFactory() throws ResourceException {
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -34,7 +34,7 @@
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
@Translator(name="yahoo")
-public class YahooExecutionFactory extends ExecutionFactory {
+public class YahooExecutionFactory extends ExecutionFactory<Object, Object> {
public static final int YAHOO_MAX_SET_SIZE = 100;
Modified: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -27,8 +27,6 @@
import java.io.File;
import java.util.Arrays;
-import javax.resource.cci.ConnectionFactory;
-
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.core.util.UnitTestUtil;
@@ -45,12 +43,10 @@
@Test public void testGetTextFiles() throws Exception {
FileExecutionFactory fef = new FileExecutionFactory();
- ConnectionFactory cf = Mockito.mock(ConnectionFactory.class);
FileConnection fc = Mockito.mock(FileConnection.class);
- Mockito.stub(cf.getConnection()).toReturn(fc);
Mockito.stub(fc.getFile("*.txt")).toReturn(new File(UnitTestUtil.getTestDataPath(), "*.txt"));
Call call = fef.getLanguageFactory().createCall("getTextFiles", Arrays.asList(new Argument(Direction.IN, new Literal("*.txt", TypeFacility.RUNTIME_TYPES.STRING), TypeFacility.RUNTIME_TYPES.STRING, null)), null);
- ProcedureExecution pe = fef.createProcedureExecution(call, null, null, cf);
+ ProcedureExecution pe = fef.createProcedureExecution(call, null, null, fc);
pe.execute();
int count = 0;
while (true) {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -131,15 +131,7 @@
}
} catch (SQLException e) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Exception closing"); //$NON-NLS-1$
- } finally {
- try {
- if (connection != null) {
- connection.close();
- }
- } catch (SQLException e) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Exception closing"); //$NON-NLS-1$
- }
- }
+ }
}
/*
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -60,14 +60,13 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
-import org.teiid.translator.MetadataProvider;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.TypeFacility;
import org.teiid.translator.UpdateExecution;
@@ -77,7 +76,7 @@
* JDBC implementation of Connector interface.
*/
@Translator(name="jdbc-ansi")
-public class JDBCExecutionFactory extends ExecutionFactory implements MetadataProvider {
+public class JDBCExecutionFactory extends ExecutionFactory<DataSource, Connection> {
public static final int DEFAULT_MAX_IN_CRITERIA = 1000;
@@ -221,64 +220,54 @@
}
@Override
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
+ public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Connection conn)
throws TranslatorException {
- try {
- DataSource ds = (DataSource)connectionFactory;
- Connection conn = ds.getConnection();
- //TODO: This is not correct; this should be only called once for connection creation
- afterConnectionCreation(conn);
- return new JDBCQueryExecution(command, conn, executionContext, this);
- } catch(SQLException e) {
- throw new TranslatorException(e);
- }
+ //TODO: This is not correct; this should be only called once for connection creation
+ afterConnectionCreation(conn);
+ return new JDBCQueryExecution(command, conn, executionContext, this);
}
@Override
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Connection conn)
throws TranslatorException {
- try {
- DataSource ds = (DataSource)connectionFactory;
- Connection conn = ds.getConnection();
- //TODO: This is not correct; this should be only called once for connection creation
- afterConnectionCreation(conn);
- return new JDBCProcedureExecution(command, conn, executionContext, this);
+ //TODO: This is not correct; this should be only called once for connection creation
+ afterConnectionCreation(conn);
+ return new JDBCProcedureExecution(command, conn, executionContext, this);
+ }
+
+ @Override
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Connection conn)
+ throws TranslatorException {
+ //TODO: This is not correct; this should be only called once for connection creation
+ afterConnectionCreation(conn);
+ return new JDBCUpdateExecution(command, conn, executionContext, this);
+ }
+
+ @Override
+ public Connection getConnection(DataSource ds)
+ throws TranslatorException {
+ try {
+ return ds.getConnection();
} catch (SQLException e) {
throw new TranslatorException(e);
}
}
-
+
@Override
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws TranslatorException {
+ public void closeConnection(Connection connection, DataSource factory) {
try {
- DataSource ds = (DataSource)connectionFactory;
- Connection conn = ds.getConnection();
-
- //TODO: This is not correct; this should be only called once for connection creation
- afterConnectionCreation(conn);
- return new JDBCUpdateExecution(command, conn, executionContext, this);
+ connection.close();
} catch (SQLException e) {
- throw new TranslatorException(e);
- }
- }
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Error closing"); //$NON-NLS-1$
+ }
+ }
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException {
+ public void getMetadata(MetadataFactory metadataFactory, Connection conn) throws TranslatorException {
try {
- Connection conn = null;
- try {
- DataSource ds = (DataSource)connectionFactory;
- conn = ds.getConnection();
-
- JDBCMetdataProcessor metadataProcessor = new JDBCMetdataProcessor();
- PropertiesUtils.setBeanProperties(metadataProcessor, metadataFactory.getImportProperties(), "importer"); //$NON-NLS-1$
- metadataProcessor.getConnectorMetadata(conn, metadataFactory);
- } finally {
- if (conn != null) {
- conn.close();
- }
- }
+ JDBCMetdataProcessor metadataProcessor = new JDBCMetdataProcessor();
+ PropertiesUtils.setBeanProperties(metadataProcessor, metadataFactory.getImportProperties(), "importer"); //$NON-NLS-1$
+ metadataProcessor.getConnectorMetadata(conn, metadataFactory);
} catch (SQLException e) {
throw new TranslatorException(e);
}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -22,18 +22,17 @@
package org.teiid.translator.ldap;
import javax.naming.ldap.LdapContext;
-import javax.resource.ResourceException;
import javax.resource.cci.ConnectionFactory;
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.UpdateExecution;
@@ -43,7 +42,7 @@
* a connection factory, and obtaining connections to LDAP.
*/
@Translator(name="ldap")
-public class LDAPExecutionFactory extends ExecutionFactory {
+public class LDAPExecutionFactory extends ExecutionFactory<ConnectionFactory, LdapContext> {
public enum SearchDefaultScope {
SUBTREE_SCOPE,
@@ -83,25 +82,15 @@
}
@Override
- public ResultSetExecution createResultSetExecution(QueryExpression command,ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
+ public ResultSetExecution createResultSetExecution(QueryExpression command,ExecutionContext executionContext, RuntimeMetadata metadata, LdapContext context)
throws TranslatorException {
- try {
- ConnectionFactory cf = (ConnectionFactory)connectionFactory;
- return new LDAPSyncQueryExecution((Select)command, this, (LdapContext)cf.getConnection());
- } catch (ResourceException e) {
- throw new TranslatorException(e);
- }
+ return new LDAPSyncQueryExecution((Select)command, this, context);
}
@Override
- public UpdateExecution createUpdateExecution(Command command,ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
+ public UpdateExecution createUpdateExecution(Command command,ExecutionContext executionContext, RuntimeMetadata metadata, LdapContext context)
throws TranslatorException {
- try {
- ConnectionFactory cf = (ConnectionFactory)connectionFactory;
- return new LDAPUpdateExecution(command, (LdapContext)cf.getConnection());
- } catch (ResourceException e) {
- throw new TranslatorException(e);
- }
+ return new LDAPUpdateExecution(command, context);
}
@Override
Modified: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -38,7 +38,7 @@
* Loopback translator.
*/
@Translator(name="loopback")
-public class LoopbackExecutionFactory extends ExecutionFactory {
+public class LoopbackExecutionFactory extends ExecutionFactory<Object, Object> {
private int waitTime = 0;
private int rowCount = 1;
@@ -53,6 +53,11 @@
setSupportsInnerJoins(true);
}
+ @Override
+ public Object getConnection(Object factory) throws TranslatorException {
+ return null;
+ }
+
@TranslatorProperty(display="Max Random Wait Time", advanced=true)
public int getWaitTime() {
return waitTime;
@@ -95,7 +100,7 @@
}
@Override
- public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionfactory)
+ public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection)
throws TranslatorException {
return new LoopbackExecution(command, this);
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -25,6 +25,8 @@
import java.util.ArrayList;
import java.util.List;
+import javax.resource.cci.ConnectionFactory;
+
import org.teiid.language.Call;
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
@@ -32,13 +34,12 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
-import org.teiid.translator.MetadataProvider;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.UpdateExecution;
import org.teiid.translator.salesforce.execution.DeleteExecutionImpl;
@@ -48,7 +49,7 @@
import org.teiid.translator.salesforce.execution.UpdateExecutionImpl;
@Translator(name="salesforce")
-public class SalesForceExecutionFactory extends ExecutionFactory implements MetadataProvider {
+public class SalesForceExecutionFactory extends ExecutionFactory<ConnectionFactory, SalesforceConnection> {
private String connectorStateClass;
private boolean auditModelFields = false;
@@ -85,33 +86,33 @@
@Override
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
+ public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)
throws TranslatorException {
- return new QueryExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
+ return new QueryExecutionImpl(command, connection, metadata, executionContext);
}
@Override
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection) throws TranslatorException {
UpdateExecution result = null;
if(command instanceof org.teiid.language.Delete) {
- result = new DeleteExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
+ result = new DeleteExecutionImpl(command, connection, metadata, executionContext);
} else if (command instanceof org.teiid.language.Insert) {
- result = new InsertExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
+ result = new InsertExecutionImpl(command, connection, metadata, executionContext);
} else if (command instanceof org.teiid.language.Update) {
- result = new UpdateExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
+ result = new UpdateExecutionImpl(command, connection, metadata, executionContext);
}
return result;
}
@Override
- public ProcedureExecution createProcedureExecution(Call command,ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
+ public ProcedureExecution createProcedureExecution(Call command,ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)
throws TranslatorException {
- return new ProcedureExecutionParentImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
+ return new ProcedureExecutionParentImpl(command, connection, metadata, executionContext);
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException {
- MetadataProcessor processor = new MetadataProcessor((SalesforceConnection)connectionFactory,metadataFactory, this);
+ public void getMetadata(MetadataFactory metadataFactory, SalesforceConnection connection) throws TranslatorException {
+ MetadataProcessor processor = new MetadataProcessor(connection,metadataFactory, this);
processor.processMetadata();
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -41,7 +41,7 @@
public QueryResult queryMore(String queryLocator, int batchSize) throws ResourceException;
- public boolean isAlive();
+ public boolean isValid();
public int delete(String[] ids) throws ResourceException ;
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -72,11 +72,6 @@
@Override
public void close() {
- try {
- connection.close();
- } catch (ResourceException e) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Exception closing"); //$NON-NLS-1$
- }
}
@Override
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -109,11 +109,6 @@
public void close() {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
- try {
- connection.close();
- } catch (ResourceException e) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, "Exception closing"); //$NON-NLS-1$
- }
}
@Override
Modified: trunk/connectors/translator-xml/pom.xml
===================================================================
--- trunk/connectors/translator-xml/pom.xml 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/pom.xml 2010-06-08 19:11:59 UTC (rev 2202)
@@ -42,18 +42,6 @@
<artifactId>connector-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- <version>1.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>nux</groupId>
- <artifactId>nux</artifactId>
- <version>1.6</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
<build>
Added: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java (rev 0)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/SAXFilterProvider.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.ws;
+
+import org.xml.sax.XMLFilter;
+
+public interface SAXFilterProvider {
+ XMLFilter[] getExtendedFilters();
+}
Added: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.ws;
+
+import java.sql.SQLXML;
+import java.util.Collections;
+import java.util.List;
+
+import javax.resource.cci.ConnectionFactory;
+import javax.xml.transform.Source;
+import javax.xml.ws.Dispatch;
+
+import org.teiid.core.BundleUtil;
+import org.teiid.language.Call;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
+import org.teiid.metadata.MetadataFactory;
+import org.teiid.metadata.Procedure;
+import org.teiid.metadata.ProcedureParameter;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.metadata.BaseColumn.NullType;
+import org.teiid.metadata.ProcedureParameter.Type;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
+import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TranslatorProperty;
+import org.teiid.translator.TypeFacility;
+
+@Translator(name="ws")
+public class XMLExecutionFactory extends ExecutionFactory<ConnectionFactory, Dispatch<Source>> {
+
+ public static BundleUtil UTIL = BundleUtil.getBundleUtil(XMLExecutionFactory.class);
+
+ private String saxFilterProviderClass;
+ private String encoding = "ISO-8859-1"; //$NON-NLS-1$
+ private boolean logRequestResponseDocs = false;
+
+ @TranslatorProperty(description="Encoding of the XML documents", display="Encoding Scheme")
+ public String getCharacterEncodingScheme() {
+ return this.encoding;
+ }
+
+ public void setCharacterEncodingScheme(String encoding) {
+ this.encoding = encoding;
+ }
+
+ @TranslatorProperty(description="Must be extension of org.teiid.translator.xml.SAXFilterProvider class", display="SAX Filter Provider Class")
+ public String getSaxFilterProviderClass() {
+ return this.saxFilterProviderClass;
+ }
+
+ public void setSaxFilterProviderClass(String saxFilterProviderClass) {
+ this.saxFilterProviderClass = saxFilterProviderClass;
+ }
+
+ // Can we get rid of this?
+ private String inputStreamFilterClass;
+
+ public String getInputStreamFilterClass() {
+ return this.inputStreamFilterClass;
+ }
+
+ public void setInputStreamFilterClass(String inputStreamFilterClass) {
+ this.inputStreamFilterClass = inputStreamFilterClass;
+ }
+
+ @TranslatorProperty(description="Log the XML request/response documents", display="Log Request/Response Documents")
+ public boolean isLogRequestResponseDocs() {
+ return logRequestResponseDocs && LogManager.isMessageToBeRecorded(LogConstants.CTX_CONNECTOR, MessageLevel.DETAIL);
+ }
+
+ public void setLogRequestResponseDocs(boolean logRequestResponseDocs) {
+ this.logRequestResponseDocs = logRequestResponseDocs;
+ }
+
+ @Override
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Dispatch<Source> connection)
+ throws TranslatorException {
+ return new XMLProcedureExecution(command, metadata, executionContext, this, connection);
+ }
+
+ public SAXFilterProvider getSaxFilterProvider() throws TranslatorException {
+ if (getSaxFilterProviderClass() == null) {
+ return null;
+ }
+ return getInstance(SAXFilterProvider.class, getSaxFilterProviderClass(), null, null);
+ }
+
+ public SQLXML convertToXMLType(Source value) {
+ /*XMLReader reader = XMLReaderFactory.createXMLReader();
+
+ if (getSaxFilterProvider() != null) {
+ XMLFilter[] filters = getSaxFilterProvider().getExtendedFilters();
+ for(int i = 0; i < filters.length; i++) {
+ XMLFilter filter = filters[i];
+ filter.setParent(reader);
+ reader = filter;
+ }
+ }
+
+ SAXSource saxSource = new SAXSource(reader, inputSource);*/
+
+ return (SQLXML)getTypeFacility().convertToRuntimeType(value);
+ }
+
+ @Override
+ public final List getSupportedFunctions() {
+ return Collections.EMPTY_LIST;
+ }
+
+ @Override
+ public void getMetadata(MetadataFactory metadataFactory,
+ Dispatch<Source> conn) throws TranslatorException {
+ Procedure p = metadataFactory.addProcedure("invoke"); //$NON-NLS-1$
+ metadataFactory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
+ ProcedureParameter param = metadataFactory.addProcedureParameter("endpoint", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setNullType(NullType.Nullable);
+ param = metadataFactory.addProcedureParameter("soapaction", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
+ param.setNullType(NullType.Nullable);
+ }
+
+}
Added: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java (rev 0)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/ws/XMLProcedureExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.ws;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.sql.Clob;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Dispatch;
+
+import org.teiid.core.types.ClobType;
+import org.teiid.language.Argument;
+import org.teiid.language.Call;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.translator.DataNotAvailableException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.TranslatorException;
+
+/**
+ * A soap call executor - handles all styles doc/literal, rpc/encoded etc.
+ */
+public class XMLProcedureExecution implements ProcedureExecution {
+
+ RuntimeMetadata metadata;
+ ExecutionContext context;
+ private Call procedure;
+ private boolean returnedResult;
+ private SQLXML returnValue;
+ private Dispatch<Source> dispatch;
+ private XMLExecutionFactory executionFactory;
+
+ /**
+ * @param env
+ */
+ public XMLProcedureExecution(Call procedure, RuntimeMetadata metadata, ExecutionContext context, XMLExecutionFactory executionFactory, Dispatch<Source> dispatch) {
+ this.metadata = metadata;
+ this.context = context;
+ this.procedure = procedure;
+ this.dispatch = dispatch;
+ this.executionFactory = executionFactory;
+ }
+
+ /**
+ * @see org.teiid.connector.api.ProcedureExecution#execute(org.teiid.connector.language.Call, int)
+ */
+ public void execute() throws TranslatorException {
+ List<Argument> arguments = this.procedure.getArguments();
+
+ Object docObject = (Object)arguments.get(0).getArgumentValue().getValue();
+ Source source = null;
+ try {
+ if (docObject instanceof SQLXML) {
+ SQLXML xml = (SQLXML)docObject;
+ source = xml.getSource(null);
+ if (executionFactory.isLogRequestResponseDocs()) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + xml.getString()); //$NON-NLS-1$
+ }
+ } else if (docObject instanceof Clob) {
+ Clob clob = (Clob)docObject;
+ source = new StreamSource(clob.getCharacterStream());
+ if (executionFactory.isLogRequestResponseDocs()) {
+ try {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + ClobType.getString(clob)); //$NON-NLS-1$
+ } catch (IOException e) {
+ }
+ }
+ } else if (docObject instanceof String) {
+ String string = (String)docObject;
+ source = new StreamSource(new StringReader(string));
+ if (executionFactory.isLogRequestResponseDocs()) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Request " + string); //$NON-NLS-1$
+ }
+ } else if (docObject != null) {
+ throw new TranslatorException("Unknown document type, should be one of XML, CLOB, String");
+ }
+ } catch (SQLException e) {
+ throw new TranslatorException(e);
+ }
+
+ String endpoint = (String)arguments.get(1).getArgumentValue().getValue();
+ String soapAction = (String)arguments.get(2).getArgumentValue().getValue();
+
+ if (soapAction != null) {
+ dispatch.getRequestContext().put(Dispatch.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+ dispatch.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, soapAction);
+ }
+
+ if (endpoint != null) {
+ this.dispatch.getRequestContext().put(Dispatch.ENDPOINT_ADDRESS_PROPERTY, endpoint);
+ }
+
+ // execute the request
+ Source result = this.dispatch.invoke(source);
+ this.returnValue = this.executionFactory.convertToXMLType(result);
+ if (executionFactory.isLogRequestResponseDocs()) {
+ try {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Response " + this.returnValue.getString()); //$NON-NLS-1$
+ } catch (SQLException e) {
+ }
+ }
+ }
+
+ @Override
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
+ if (!returnedResult) {
+ returnedResult = true;
+ return Arrays.asList(this.returnValue);
+ }
+ return null;
+ }
+
+ @Override
+ public List<?> getOutputParameterValues() throws TranslatorException {
+ return Collections.emptyList();
+ }
+
+ public void close() {
+
+ }
+
+ public void cancel() throws TranslatorException {
+ // no-op
+ }
+}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CartesienCriteriaGenerator.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CartesienCriteriaGenerator.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CartesienCriteriaGenerator.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * creates a Cartesian product of the Criteria descriptions based on their values.
- */
-public class CartesienCriteriaGenerator {
-
- public static List<List<CriteriaDesc>> generateCartesianCriteria(List<CriteriaDesc> params) {
- List<List<CriteriaDesc>> cartesianProduct = new ArrayList<List<CriteriaDesc>>();
-
- for (CriteriaDesc desc : params) {
- createCartesionProduct(cartesianProduct, desc);
- }
-
- return cartesianProduct;
- }
-
- static void createCartesionProduct(List<List<CriteriaDesc>> cartesianProduct, CriteriaDesc desc) {
-
- List<CriteriaDesc> firstLevel = new ArrayList<CriteriaDesc>();
- if (desc.isUnlimited()) {
- firstLevel.add(desc);
- }
- else {
- for (Object value: desc.getValues()) {
- CriteriaDesc cd = desc.cloneWithoutValues();
- cd.setValue(0, value);
- firstLevel.add(cd);
- }
- }
-
- if (cartesianProduct.isEmpty()) {
- for (CriteriaDesc cd:firstLevel) {
- List<CriteriaDesc> secondLevel = new ArrayList<CriteriaDesc>();
- secondLevel.add(cd);
- cartesianProduct.add(secondLevel);
- }
- }
- else {
- List<List<CriteriaDesc>> newcartesianProduct = new ArrayList<List<CriteriaDesc>>();
-
- for (CriteriaDesc cd:firstLevel) {
- for (List<CriteriaDesc> secondLevel:cartesianProduct) {
-
- List<CriteriaDesc> colnedSecondLevel = makeClone(secondLevel);
- colnedSecondLevel.add(cd);
- newcartesianProduct.add(colnedSecondLevel);
- }
- }
- cartesianProduct.clear();
- cartesianProduct.addAll(newcartesianProduct);
- }
- }
-
- private static List<CriteriaDesc> makeClone(List<CriteriaDesc> original){
- List<CriteriaDesc> clonedList = new ArrayList<CriteriaDesc>();
-
- for (CriteriaDesc cd:original) {
- CriteriaDesc clone = cd.cloneWithoutValues();
- int i = 0;
- for (Object value:cd.getValues()) {
- clone.setValue(i++, value);
- }
- clonedList.add(clone);
- }
- return clonedList;
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CompositeExecution.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CompositeExecution.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CompositeExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.DataNotAvailableException;
-import org.teiid.translator.ResultSetExecution;
-import org.teiid.translator.TranslatorException;
-
-public class CompositeExecution implements ResultSetExecution {
-
- private boolean closed = false;
- private List<ResultSetExecution> executions = new ArrayList<ResultSetExecution>();
- private int currentExecutionNumber = 0;
- private ResultSetExecution currentExecution;
-
- public void addExecution(ResultSetExecution execution) {
- if (this.closed) {
- throw new IllegalStateException("This execution is already closed"); //$NON-NLS-1$
- }
- this.executions.add(execution);
- }
-
- @Override
- public List<?> next() throws TranslatorException, DataNotAvailableException {
- List result = null;
- if (this.currentExecution != null) {
- result = this.currentExecution.next();
- }
-
- if (result == null) {
- if(this.currentExecutionNumber < this.executions.size()) {
- this.currentExecution = this.executions.get(this.currentExecutionNumber++);
- result = this.currentExecution.next();
- }
- }
- return result;
- }
-
- @Override
- public void cancel() throws TranslatorException {
- this.closed = true;
- for(ResultSetExecution exec:this.executions) {
- exec.cancel();
- }
- }
-
- @Override
- public void close() {
- this.closed = true;
- for(ResultSetExecution exec:this.executions) {
- exec.close();
- }
- }
-
- @Override
- public void execute() throws TranslatorException {
- this.closed = true;
- for(ResultSetExecution exec:this.executions) {
- exec.execute();
- }
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/Constants.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/Constants.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/Constants.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,11 +0,0 @@
-package org.teiid.translator.xml;
-
-public class Constants {
-
- static public final String NAMESPACE_PREFIX_PROPERTY_NAME = "NamespacePrefixes"; //$NON-NLS-1$
- static public final String SERVICE_NAME = "ServiceName"; //$NON-NLS-1$
- static public final String SERVICE_NAMESPACE = "ServiceNamespace"; //$NON-NLS-1$
- static public final String PORT_NAME = "PortName"; //$NON-NLS-1$
- static public final String PORT_NAMESPACE = "PortNamespace"; //$NON-NLS-1$
-
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CriteriaDesc.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CriteriaDesc.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/CriteriaDesc.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,473 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.teiid.language.BaseInCondition;
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Comparison;
-import org.teiid.language.Condition;
-import org.teiid.language.Expression;
-import org.teiid.language.In;
-import org.teiid.language.LanguageUtil;
-import org.teiid.language.Literal;
-import org.teiid.language.Select;
-import org.teiid.language.Comparison.Operator;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.Column.SearchType;
-import org.teiid.translator.TranslatorException;
-
-
-public class CriteriaDesc extends ParameterDescriptor {
- // TODO: a lot of this is HTTP/SOAP specific (i.e., do not apply to files).
- // There are various
- // places that we work around that (extension properties being null),
- // but it should be handled properly by moving the code into
- // HTTP and SOAP specific places
-
- // Describes an item in the parameter or criteria structure, and all the
- // attributes of it
- // Added to allow all the attributes of criteira to be managed in a single
- // structure,
- // and to make the code more manageable
-
- private List m_values;
-
- private int m_currentIndexInValuesList = 0;
-
- private Boolean m_parentAttribute = null;
-
- private Boolean m_enumeratedAttribute = null;
-
- private Boolean m_allowEmptyValue = null;
-
- private String m_dataAttributeName = null;
-
- private Properties m_additionalAttributes = null;
-
- private String m_inputXpath = null;
-
- private String nativeType = null;
-
- private boolean m_unlimited = false;
-
- private boolean m_enumerated = false;
-
- private boolean m_multiElement = false;
-
- private boolean m_soapArrayElement = false;
-
- private boolean m_simpleSoapElement;
-
- public static final String PARM_REQUIRED_VALUE_COLUMN_PROPERTY_NAME = "RequiredValue"; //$NON-NLS-1$
-
- public static final String PARM_ALLOWS_EMPTY_VALUES_COLUMN_PROPERTY_NAME = "AllowEmptyInputElement"; //$NON-NLS-1$
-
- public static final String PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME = "MultipleValues"; //$NON-NLS-1$
-
- public static final String PARM_HAS_MULTIPLE_VALUES_COMMA_DELIMITED_NAME = "CommaDelimited"; //$NON-NLS-1$
-
- public static final String PARM_HAS_MULTIPLE_VALUES_MULTI_ELEMENT_NAME = "MultiElement"; //$NON-NLS-1$
-
- public static final String PARM_IS_SIMPLE_SOAP_ARRAY_ELEMENT_NAME = "SimpleSoapArrayElement"; //$NON-NLS-1$
-
- public static final String PARM_IS_COMPLEX_SOAP_ARRAY_ELEMENT_NAME = "ComplexSoapArrayElement"; //$NON-NLS-1$
-
- public static final String PARM_XPATH_INPUT_COLUMN_PROPERTY_NAME = "XPathForInputParameter"; //$NON-NLS-1$
-
- public static final String PARM_AS_PARENT_ATTRIBUTE_COLUMN_PROPERTY_NAME = "AttributeOfParent"; //$NON-NLS-1$
-
- public static final String PARM_AS_NAMED_ATTRIBUTE_COLUMN_PROPERTY_NAME = "DataAttributeName"; //$NON-NLS-1$
-
- //use static method do see if a criteria object needs to be created
- public static CriteriaDesc getCriteriaDescForColumn(Column element,
- Select query) throws TranslatorException {
-
- CriteriaDesc retVal = null;
- List values = parseCriteriaToValues(element, query);
-
- if (values.size() == 0) {
- if (testForParam(element)) {
- //add default value to values if it exists
- //throws exception if no default specified and its required
- handleDefaultValue(element, values);
- }
- }
- //values.size may have changed if default value was added above
- //so we retest
- if (values.size() > 0 || findAllowEmptyValue(element)) {
- retVal = new CriteriaDesc(element, values);
- retVal.setNativeType(element.getNativeType());
- }
- return retVal;
- }
-
- private static void handleDefaultValue(Column element, List values) throws TranslatorException {
- Object defaultVal = element.getDefaultValue();
- if (defaultVal != null) {
- values.add(defaultVal);
- } else if (findIsRequired(element)) {
- throw new TranslatorException(
- XMLPlugin.getString("CriteriaDesc.value.not.found.for.param") //$NON-NLS-1$
- + element.getName());
- }
- }
-
- private static boolean findIsRequired(Column element)
- throws TranslatorException {
- String value = element.getProperties().get(
- PARM_REQUIRED_VALUE_COLUMN_PROPERTY_NAME);
- return Boolean.valueOf(value);
- }
-
- private static boolean findAllowEmptyValue(Column element)
- throws TranslatorException {
- String value = element.getProperties().get(
- PARM_ALLOWS_EMPTY_VALUES_COLUMN_PROPERTY_NAME);
- return Boolean.valueOf(value);
- }
-
- /**
- * @see com.metamatrix.server.datatier.SynchConnectorConnection#submitRequest(java.lang.Object)
- */
- public CriteriaDesc(Column myElement, List myValues)
- throws TranslatorException {
-
- super(myElement);
- m_values = myValues;
- final String enumerated = PARM_HAS_MULTIPLE_VALUES_COMMA_DELIMITED_NAME;
- final String multiElement = PARM_HAS_MULTIPLE_VALUES_MULTI_ELEMENT_NAME;
- String multiplicityStr = getElement().getProperties().get(
- PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- if (multiplicityStr == null) {
- multiplicityStr = ""; //$NON-NLS-1$
- }
- if (multiplicityStr.equals(enumerated)) {
- m_unlimited = true;
- m_enumerated = true;
- } else if (multiplicityStr.equals(multiElement)) {
- m_unlimited = true;
- m_enumerated = false;
- m_multiElement = true;
- } else if (multiplicityStr.equals(PARM_IS_SIMPLE_SOAP_ARRAY_ELEMENT_NAME) ||
- multiplicityStr.equals(PARM_IS_COMPLEX_SOAP_ARRAY_ELEMENT_NAME)) {
- m_unlimited = true;
- m_enumerated = false;
- m_multiElement = true;
- m_soapArrayElement = true;
- if (multiplicityStr.equals(PARM_IS_SIMPLE_SOAP_ARRAY_ELEMENT_NAME)) {
- m_simpleSoapElement = true;
- } else {
- m_simpleSoapElement = false;
- }
- } else {
- m_unlimited = false;
- m_enumerated = false;
- }
- }
-
- private CriteriaDesc(CriteriaDesc other) {
- //from ParameterDescriptor
- setXPath(other.getXPath());
- setIsParameter(other.isParameter());
- setIsResponseId(other.isResponseId());
- setIsLocation(other.isLocation());
- setColumnName(String.valueOf(other.getColumnName()));
- setColumnNumber(other.getColumnNumber());
- setElement(other.getElement());
- setNativeType(other.getNativeType());
-
- m_parentAttribute = other.m_parentAttribute == null ? null : Boolean.valueOf(other.m_parentAttribute);
- m_enumeratedAttribute = other.m_enumeratedAttribute == null ? null : Boolean.valueOf(other.m_enumeratedAttribute);
- m_allowEmptyValue = other.m_allowEmptyValue == null ? null : Boolean.valueOf(other.m_allowEmptyValue);
- m_dataAttributeName = other.m_dataAttributeName == null ? null : String.valueOf(other.m_dataAttributeName);
- m_additionalAttributes = other.m_additionalAttributes == null ? null : new Properties(other.m_additionalAttributes);
- m_inputXpath = other.m_inputXpath == null ? null : String.valueOf(other.m_inputXpath);
- m_unlimited = other.m_unlimited;
- m_enumerated = other.m_enumerated;
- m_multiElement = other.m_multiElement;
- m_soapArrayElement = other.m_soapArrayElement;
- //don't copy the values
- m_values = new ArrayList();
- }
-
- public String getInputXpath() throws TranslatorException {
- if (m_inputXpath == null) {
- findInputXPath();
- }
- return m_inputXpath;
- }
-
- private void findInputXPath() throws TranslatorException {
- m_inputXpath = getElement().getProperties().get(PARM_XPATH_INPUT_COLUMN_PROPERTY_NAME);
- if (m_inputXpath == null || m_inputXpath.trim().length() == 0) {
- m_inputXpath = getColumnName();
- }
- }
-
- public boolean isUnlimited() {
- return m_unlimited;
- }
-
- public boolean isMultiElement() {
- return m_multiElement;
- }
-
- public boolean isSOAPArrayElement() {
- return m_soapArrayElement;
- }
-
- public boolean isAutoIncrement() throws TranslatorException {
- return getElement().isAutoIncremented();
- }
-
- //from model extensions
- public boolean isParentAttribute() throws TranslatorException {
- if (m_parentAttribute == null) {
- findParentAttribute();
- }
- return m_parentAttribute.booleanValue();
- }
-
- private void findParentAttribute() throws TranslatorException {
- String value = getElement().getProperties()
- .get(PARM_AS_PARENT_ATTRIBUTE_COLUMN_PROPERTY_NAME);
- m_parentAttribute = Boolean.valueOf(value);
- }
-
- //from model extensions
- public boolean isEnumeratedAttribute() throws TranslatorException {
- return m_enumerated;
- }
-
- //from model extensions
- public boolean allowEmptyValue() throws TranslatorException {
-
- if (m_allowEmptyValue == null) {
- findAllowEmptyValue();
- }
- return m_allowEmptyValue.booleanValue();
- }
-
- private void findAllowEmptyValue() throws TranslatorException {
- String value = getElement().getProperties()
- .get(PARM_ALLOWS_EMPTY_VALUES_COLUMN_PROPERTY_NAME);
- m_allowEmptyValue = Boolean.valueOf(value);
- }
-
- //from model extensions
- public boolean isDataInAttribute() throws TranslatorException {
- String dataAttribute = getDataAttributeName();
- if (dataAttribute.trim().length() == 0) {
- return false;
- }
- return true;
- }
-
- //from model extensions
- public String getDataAttributeName() throws TranslatorException {
-
- if (m_dataAttributeName == null) {
- findDataAttributeName();
- }
- return m_dataAttributeName;
- }
-
- private void findDataAttributeName() throws TranslatorException {
- m_dataAttributeName = getElement().getProperties().get(
- PARM_AS_NAMED_ATTRIBUTE_COLUMN_PROPERTY_NAME);
- if (m_dataAttributeName == null) {
- m_dataAttributeName = ""; //$NON-NLS-1$
- }
- }
-
- public List getValues() {
- return m_values;
- }
-
- public int getNumberOfValues() {
- return m_values.size();
- }
-
- //This code manages the looping of parameters to make multiple server
- // calls.
- //The current index is used to get a value to be added to the parmString
- public String getCurrentIndexValue() throws TranslatorException {
- final int initialBufferSize = 1000;
- if (m_values.size() == 0 && allowEmptyValue()) {
- return ""; //$NON-NLS-1$
- }
- if (isEnumeratedAttribute()) {
- StringBuffer sb = new StringBuffer(initialBufferSize);
- String startChar = ""; //$NON-NLS-1$
- for (int x = 0; x < m_values.size(); x++) {
- sb.append(startChar);
- sb.append(m_values.get(x));
- startChar = ","; //$NON-NLS-1$
- }
- return sb.toString();
- }
- if (m_values.size() > 0) {
- return (String) m_values.get(m_currentIndexInValuesList);
- }
- return null;
- }
- //if so, it is incremented
- public boolean incrementIndex() throws TranslatorException {
- if (isEnumeratedAttribute()) {
- return false;
- } else if (m_currentIndexInValuesList < m_values.size() - 1) {
- m_currentIndexInValuesList++;
- return true;
- } else {
- return false;
- }
- }
-
- public void resetIndex() {
- m_currentIndexInValuesList = 0;
- }
-
- private static ArrayList parseCriteriaToValues(Column element, Select query) throws TranslatorException {
-
- String fullName = element.getFullName().trim().toUpperCase();
- ArrayList parmPair = new ArrayList();
- if (element.getSearchType() == SearchType.Searchable
- || element.getSearchType() == SearchType.All_Except_Like) {
- // Check and set criteria for the IData input
- Condition criteria = query.getWhere();
- List<Condition> criteriaList = LanguageUtil.separateCriteriaByAnd(criteria);
- for(Condition criteriaSeg: criteriaList) {
- if (criteriaSeg instanceof Comparison) {
- Comparison compCriteria = (Comparison) criteriaSeg;
- if (compCriteria.getOperator() == Operator.EQ) {
- Expression lExpr = compCriteria.getLeftExpression();
- Expression rExpr = compCriteria.getRightExpression();
- handleCompareCriteria(lExpr, rExpr, fullName, parmPair);
- }
- } else if (criteriaSeg instanceof BaseInCondition) {
- handleInCriteria((BaseInCondition) criteriaSeg, fullName, parmPair);
-
- }
- }
- }
- return parmPair;
- }
-
- private static void handleInCriteria(BaseInCondition baseInCriteria, String fullName, ArrayList parmPair) {
- Expression expr = baseInCriteria.getLeftExpression();
- if (expr instanceof ColumnReference) {
- if (nameMatch(expr, fullName)) {
- Iterator vIter = null;
-
- vIter = ((In) baseInCriteria).getRightExpressions().iterator();
- while (vIter.hasNext()) {
- Literal val = (Literal) vIter.next();
- String constantValue = val.getValue()
- .toString();
- constantValue = stringifyCriteria(constantValue);
- parmPair.add(constantValue);
- }
- }
- }
- }
-
- private static void handleCompareCriteria(Expression lExpr, Expression rExpr, String fullName, ArrayList parmPair) {
- checkElement(lExpr, rExpr, fullName, parmPair);
- checkElement(rExpr, lExpr, fullName, parmPair);
- }
-
- private static void checkElement(Expression expression, Expression literalCandidate, String fullName, ArrayList parmPair) {
- if (expression instanceof ColumnReference) {
- if ((nameMatch(expression, fullName))
- && (literalCandidate instanceof Literal)) {
- String constantValue = ((Literal) literalCandidate)
- .getValue().toString();
- constantValue = stringifyCriteria(constantValue);
- parmPair.add(constantValue);
- }
- }
- }
-
- public static boolean nameMatch(Expression expr, String elementName) {
- ColumnReference exprElement = (ColumnReference) expr;
- String symbolName = exprElement.getName().toUpperCase().trim();
- String tempElementName = elementName.toUpperCase();
- int indx = symbolName.lastIndexOf("."); //$NON-NLS-1$
- //. has to be there
- symbolName = symbolName.substring(indx + 1);
- indx = elementName.lastIndexOf("."); //$NON-NLS-1$
- //. has to be there
- tempElementName = tempElementName.substring(indx + 1);
- return symbolName.equals(tempElementName);
- }
-
- public static String stringifyCriteria(String startCriteria) {
- int indx = 0;
- String cStr = startCriteria;
- indx = cStr.indexOf("'"); //$NON-NLS-1$
- if (indx == 0) {
- int indx2 = cStr.substring(1).indexOf("'"); //$NON-NLS-1$
- if (indx2 >= 0) {
- return cStr.substring(1, indx2 + 1);
- }
- }
- indx = cStr.indexOf('"');
- if (indx == 0) {
- int indx2 = cStr.substring(1).indexOf('"');
- if (indx2 > 0) {
- return cStr.substring(1, indx2 + 1);
- }
- }
- return cStr;
- }
-
- public CriteriaDesc cloneWithoutValues() {
- CriteriaDesc newDesc = new CriteriaDesc(this);
- return newDesc;
- }
-
- public void setValue(int i, Object object) {
- if(m_values.size() <= i) {
- m_values.add(i, object);
- } else {
- m_values.set(i, object);
- }
- }
-
- private void setNativeType(String nativeType) {
- this.nativeType = nativeType;
- }
-
- public String getNativeType() {
- return nativeType;
- }
-
- public boolean isSimpleSoapElement() {
- return m_simpleSoapElement;
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/DocumentBuilder.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/DocumentBuilder.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/DocumentBuilder.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,526 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.jdom.Attribute;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.IllegalNameException;
-import org.jdom.Namespace;
-import org.jdom.output.XMLOutputter;
-import org.teiid.translator.TranslatorException;
-
-
-public class DocumentBuilder {
-
- public static final String PARM_INPUT_XPATH_TABLE_PROPERTY_NAME = "XPathRootForInput"; //$NON-NLS-1$
- public static final String ENCODING_STYLE_URL = "http://schemas.xmlsoap.org/soap/encoding/"; //$NON-NLS-1$
-
- private Map m_namespaceMap;
-
- private boolean m_useTypeAttributes;
-
- public DocumentBuilder() {
- m_namespaceMap = new HashMap();
- m_useTypeAttributes = false;
- }
-
- private Map getNamespaces() {
- return m_namespaceMap;
- }
-
- public String buildDocumentString(List contents, String topLevelXPath,
- String nsDecl) throws TranslatorException {
- Document doc = buildDocument(contents, topLevelXPath, nsDecl);
- return outputDocToString(doc);
- }
-
- public Document buildDocument(List contents, String topLevelXPath, String nsDecl) throws TranslatorException {
- Document doc = null;
- setNamespaces(nsDecl);
- // assemble table-level elements
- org.jdom.Element curElement = null;
- try {
- curElement = makeElement(curElement, topLevelXPath, false);
- } catch(IllegalNameException ex) {
- throw new TranslatorException(topLevelXPath + " is not a valid XPath for the root request node." + "Change the Request table " + PARM_INPUT_XPATH_TABLE_PROPERTY_NAME);
- }
- if (curElement == null) {
- throw new TranslatorException(XMLPlugin.getString("HTTPExecutor.root.element.required")); //$NON-NLS-1$
- }
- doc = makeTableLevelElements(curElement);
-
- // loop through each parameter
- processParameters(contents, curElement);
-
- // add all of the namespaces
- Element nsHolder = doc.getRootElement();
- addAllNamespaces(nsHolder);
-
- return doc;
- }
-
- private void addAllNamespaces(Element nsHolder) {
- Map namespaceMap = getNamespaces();
- Iterator nsIter = namespaceMap.values().iterator();
- while (nsIter.hasNext()) {
- nsHolder.addNamespaceDeclaration((Namespace) nsIter.next());
- }
- }
-
- private Document makeTableLevelElements(Element curElement)
- throws TranslatorException {
-
- // this walks up from the current node to the root, so the root can be
- // assigned to a document
- Element walkupElement = curElement;
- Element parentElement;
- // why is this failing?
- // could be due to incompatibilities with core jdom version
- // and the one the connector uses
- while ((parentElement = (Element) walkupElement.getParent()) != null) {
- walkupElement = parentElement;
- }
- Document document = new Document(walkupElement);
- return document;
- }
-
- private void setNamespaces(String nsDecl) throws TranslatorException {
- if (nsDecl != null && nsDecl.trim().length() > 0) {
- String[] nsPairs = nsDecl.trim().replace('\"', '\0').replace('\'',
- '\0').split("xmlns"); //$NON-NLS-1$
- // the first entry will be blank since the string starts with the
- // delimiter
- for (int i = 1; i < nsPairs.length; i++) {
- // remove the ':'
- if (nsPairs[i].startsWith(":"))
- nsPairs[i] = nsPairs[i].substring(1);
- String[] nsSplit = nsPairs[i].split("="); //$NON-NLS-1$
- if (nsSplit.length != 2) {
- throw new TranslatorException(
- XMLPlugin
- .getString("DocumentBuilder.could.not.parse.namespaces")); //$NON-NLS-1$
- }
- Namespace ns = Namespace.getNamespace(nsSplit[0].trim(),
- nsSplit[1].trim());
- m_namespaceMap.put(nsSplit[0], ns);
- }
- }
- }
-
- private Element makeElement(Element colElement, String inputXPath,
- boolean dupLastElement) throws TranslatorException {
- if (inputXPath == null || inputXPath.trim().length() == 0) {
- return colElement;
- }
- Element tempElement = colElement;
- String tempXPath = inputXPath.trim();
- tempElement = visitXPath(colElement, tempXPath, dupLastElement);
- return tempElement;
- }
-
- private Element visitXPath(Element elem, String tempXPath,
- boolean dupLastElement) throws TranslatorException {
- // loop through, searching for path seperators
- int startParmIndx = 0;
- int endParmIndx = tempXPath.indexOf("/", startParmIndx); //$NON-NLS-1$
- int endOfTempXPath = tempXPath.length() - 1;
- while (endParmIndx >= 0 && endParmIndx < endOfTempXPath) {
- elem = setElement(elem, tempXPath, startParmIndx, endParmIndx);
- startParmIndx = endParmIndx + 1;
- endParmIndx = checkForIndexEnd(tempXPath, startParmIndx);
- }
- String finalXpath = getFinalXPath(tempXPath, startParmIndx, endParmIndx);
- if (finalXpath != null) {
- elem = addOneElement(elem, finalXpath, dupLastElement);
- }
- return elem;
-
- }
-
- private int checkForIndexEnd(String tempXPath, int startParmIndx) {
- int endParmIndx;
- if (startParmIndx < tempXPath.length() - 1) {
- endParmIndx = tempXPath.indexOf("/", startParmIndx); //$NON-NLS-1$
- } else {
- endParmIndx = -1;
- }
- return endParmIndx;
- }
-
- private String getFinalXPath(String tempXPath, int startParmIndx,
- int endParmIndx) {
- String finalXpath = null;
- if (endParmIndx > 0) {
- finalXpath = tempXPath.substring(startParmIndx, endParmIndx);
- } else {
- if (startParmIndx <= tempXPath.length() - 1) {
- finalXpath = tempXPath.substring(startParmIndx);
- }
- }
- return finalXpath;
- }
-
- private Element setElement(Element element, String tempXPath,
- int startParmIndx, int endParmIndx) throws TranslatorException {
- Element tempElement = element;
- if (endParmIndx > 0) {
- String tempXP = tempXPath.substring(startParmIndx, endParmIndx);
- if (tempXP.indexOf("..") >= 0) { //$NON-NLS-1$
- throw new TranslatorException(XMLPlugin
- .getString("HTTPExecutor.dot.notation.not.allowed")); //$NON-NLS-1$
- }
-
- if (tempXP != null && tempXP.trim().length() > 0) {
- tempElement = addOneElement(tempElement, tempXP, false);
- }
- }
- return tempElement;
- }
-
- private void processParameters(List<CriteriaDesc> params, Element curElement)
- throws TranslatorException {
-
- for(CriteriaDesc parmCriteria: params) {
- try {
- boolean isAutoIncrement = parmCriteria.isAutoIncrement();
- createParameterXML(curElement, parmCriteria, isAutoIncrement);
- } catch (Exception ex) {
- throw new TranslatorException(XMLPlugin
- .getString("HTTPExecutor.error.building.column") //$NON-NLS-1$
- + parmCriteria.getColumnName() + ": " + ex.toString()); //$NON-NLS-1$
- }
- }
-
- }
-
- private void createParameterXML(Element curElement,
- CriteriaDesc parmCriteria, boolean isAutoIncrement)
- throws TranslatorException {
- if (parmCriteria.isParentAttribute()) {
- // add parameter as attribute of connector
- curElement.setAttribute(parmCriteria.getInputXpath(), parmCriteria
- .getCurrentIndexValue());
- } else if (parmCriteria.isUnlimited()
- && !parmCriteria.isEnumeratedAttribute()) {
- // add parameter as mutliple elements
- createMultipleElementXML(curElement, parmCriteria, isAutoIncrement);
- } else {
- createSingleElementXML(curElement, parmCriteria, isAutoIncrement);
- }
-
- }
-
- private void createSingleElementXML(Element curElement,
- CriteriaDesc parmCriteria, boolean isAutoIncrement)
- throws TranslatorException {
- org.jdom.Element colElement = null;
- if (parmCriteria.isDataInAttribute()) {
- // add parameter as an element and an attribute in the
- // element
- colElement = makeElement(curElement, parmCriteria.getInputXpath(),
- false);
- String attName = parmCriteria.getDataAttributeName();
- String namePart = getNamePart(attName);
- String nsPart = getNamespacePart(attName);
- Namespace attNS = Namespace.NO_NAMESPACE;
- if (nsPart != null) {
- attNS = (Namespace) m_namespaceMap.get(nsPart);
- colElement.setAttribute(namePart, parmCriteria
- .getCurrentIndexValue(), attNS);
- } else {
- colElement.setAttribute(attName, parmCriteria
- .getCurrentIndexValue());
- }
- } else {
- // add parameter as a new element
- colElement = makeElement(curElement, parmCriteria.getInputXpath(),
- false);
- colElement.addContent(parmCriteria.getCurrentIndexValue());
- }
- if (isAutoIncrement) {
- String subscrValue = "[0]"; //$NON-NLS-1$
- colElement.setAttribute("SUBSCR", subscrValue); //$NON-NLS-1$
- }
-
- if (useTypeAttributes()) {
- // if there is a native type in the model use it, otherwise
- // if 5.0 or later, derive from the data type
- String xsdType = parmCriteria.getElement().getNativeType();
- if (xsdType == null) {
- // attempt use the data type
- // this method call does not exist before 5.0 so we have to
- // check for it before we call it.
- try {
- Method method = parmCriteria.getElement().getClass()
- .getMethod("getModeledType", new Class[] {});
- String type = parmCriteria.getElement().getDatatypeID();
- String nsPart = type.substring(0, type.indexOf('#'));
- String namePart = type.substring(type.indexOf('#') + 1);
- Iterator nsIter = getNamespaces().values().iterator();
- String prefix = null;
- while (nsIter.hasNext()) {
- Namespace ns = (Namespace) nsIter.next();
- if (ns.getURI().equals(nsPart))
- prefix = ns.getPrefix();
- }
- if (prefix == null) {
- int prefixInt = 0;
- while (getNamespaces().get("ns" + prefixInt) != null) {
- ++prefixInt;
- }
- prefix = "ns" + prefixInt;
- Namespace newNS = Namespace
- .getNamespace(prefix, nsPart);
- getNamespaces().put(prefix, newNS);
- }
- xsdType = prefix + ":" + namePart;
- } catch (NoSuchMethodException nme) {
- throw new TranslatorException(
- "column "
- + colElement.getName()
- + XMLPlugin
- .getString("DocumentBuilder.encoding.type.required"));
- }
- }
- final String xsiType = "type"; //$NON-NLS-1$
- final String xsiNS = "http://www.w3.org/1999/XMLSchema-instance"; //$NON-NLS-1$
- final String xsiPrefix = "xsi"; //$NON-NLS-1$
- Attribute type = new Attribute(xsiType, xsdType, Namespace
- .getNamespace(xsiPrefix, xsiNS));
- colElement.setAttribute(type);
- }
- }
-
- /**
- *
- */
- private void createMultipleElementXML(Element curElement,
- CriteriaDesc parmCriteria, boolean isAutoIncrement)
- throws TranslatorException {
- if(parmCriteria.isSOAPArrayElement()) {
- createSOAPArrayElement(curElement, parmCriteria);
- } else {
- parmCriteria.resetIndex();
- boolean moreParms = true;
- boolean isDataInAttribute = parmCriteria.isDataInAttribute();
- String inputXpath = parmCriteria.getInputXpath();
- for (int x = 0; moreParms; x++) {
- org.jdom.Element colElement = makeElement(curElement, inputXpath,
- true);
- if (isAutoIncrement) {
- String subscrValue = "[" + Integer.toString(x) //$NON-NLS-1$
- + "]"; //$NON-NLS-1$
- colElement.setAttribute("SUBSCR", subscrValue); //$NON-NLS-1$
- }
- if (isDataInAttribute) {
- colElement.setAttribute(parmCriteria.getDataAttributeName(),
- parmCriteria.getCurrentIndexValue());
- } else {
- colElement.setText(parmCriteria.getCurrentIndexValue());
- }
- moreParms = parmCriteria.incrementIndex();
- }
- }
- }
-
- private void createSOAPArrayElement(Element curElement, CriteriaDesc parmCriteria) throws TranslatorException {
-
- /*
- * loop over the values in the criteriaDesc and create <item> nodes containing them
- *
- * get the imformation for the soapArray element out of the criteriaDesc's
- * nativeType property and create the attributes including the number of items.
- *
- *
- */
- String inputXpath = parmCriteria.getInputXpath();
- curElement = visitXPath(curElement, inputXpath, false);
-
- parmCriteria.resetIndex();
- boolean moreParms = true;
-
- String nativeTypeInfo = parmCriteria.getNativeType();
- StringTokenizer tokenizer = new StringTokenizer(nativeTypeInfo, ";");
- String xsdTypeString = tokenizer.nextToken();
-
- int start,end;
- start = xsdTypeString.indexOf("\"");
- end = xsdTypeString.indexOf("\"", start +1);
- String xsdTypeValue = xsdTypeString.substring(start +1, end);
-
- String arrayType = tokenizer.nextToken();
- start = arrayType.indexOf("\"");
- end = arrayType.indexOf("\"", start +1);
- String arrayTypeValue = arrayType.substring(start +1, end);
-
- end = arrayType.indexOf(":");
- String soapEncodingPrefix = arrayType.substring(0, end);
-
- String arrayNamespace = tokenizer.nextToken();
- start = arrayNamespace.indexOf(":");
- end = arrayNamespace.indexOf("=", start +1);
- start = arrayNamespace.indexOf("\"");
- arrayTypeValue = arrayTypeValue + "[" + parmCriteria.getNumberOfValues() + "]";
-
-
- if(!parmCriteria.isSimpleSoapElement()) {
- Element arrayElement = curElement.getParentElement();
- //See if we have already added the attributes to the array from
- //an earlier array element.
- if(null == arrayElement.getAttribute("type", Namespace.XML_NAMESPACE)) {
- arrayElement.setAttribute("type", xsdTypeValue, Namespace.XML_NAMESPACE);
- Namespace soapEncodingNamespace = Namespace.getNamespace(soapEncodingPrefix, ENCODING_STYLE_URL);
- arrayElement.setAttribute("arrayType", arrayTypeValue, soapEncodingNamespace);
- }
- curElement.detach();
- org.jdom.Element itemElement = arrayElement.getChild("item");
- if(null == itemElement) {
- itemElement = makeElement(arrayElement, "item", true);
- }
- itemElement.addContent(curElement);
- curElement.setText(parmCriteria.getCurrentIndexValue());
-
- } else {
- //See if we have already added the attributes to the array from
- //an earlier array element.
- if(null == curElement.getAttribute("type", Namespace.XML_NAMESPACE)) {
- curElement.setAttribute("type", xsdTypeValue, Namespace.XML_NAMESPACE);
- Namespace soapEncodingNamespace = Namespace.getNamespace(soapEncodingPrefix, ENCODING_STYLE_URL);
- curElement.setAttribute("arrayType", arrayTypeValue, soapEncodingNamespace);
- }
-
- for (int x = 0; moreParms; x++) {
- org.jdom.Element itemElement = makeElement(curElement, "item", true);
- itemElement.setText(parmCriteria.getCurrentIndexValue());
- moreParms = parmCriteria.incrementIndex();
- }
- }
- }
-
- private Element addOneElement(org.jdom.Element colElement,
- String inputXPath, boolean allowDup) throws TranslatorException {
-
- // Create element namespace if needed and use in the get Child and
- // Element ctor
- String tempXPath = inputXPath.trim();
- String elementName = getElementName(tempXPath);
- String nsPart = getNamespacePart(elementName);
- String namePart = getNamePart(elementName);
- Namespace elemNS = Namespace.NO_NAMESPACE;
- if (nsPart != null) {
- elemNS = (Namespace) getNamespaces().get(nsPart);
- }
-
- org.jdom.Element childElement = null;
- if (colElement != null && !allowDup) {
- childElement = colElement.getChild(namePart, elemNS);
- }
-
- // element does not already exist, create it
- if (childElement == null) {
- childElement = new Element(namePart, elemNS);
- // add new element to connector
- if (colElement != null) {
- colElement.addContent(childElement);
- }
- }
-
- addAttributes(childElement, tempXPath);
- return childElement;
- }
-
- private String getNamespacePart(String elemName) {
- int colonIndex = elemName.indexOf(':');
- if (colonIndex < 0) {
- return null;
- }
- return elemName.substring(0, colonIndex);
- }
-
- private String getNamePart(String elemName) {
- int colonIndex = elemName.indexOf(':');
- if (colonIndex < 0) {
- return elemName;
- }
- return elemName.substring(colonIndex + 1);
- }
-
- private void addAttributes(Element childElement, String tempXPath)
- throws TranslatorException {
- // add attribute definitions
- int startAttIndx = tempXPath.indexOf("["); //$NON-NLS-1$
- while (startAttIndx > 0) {
- int equalIndx = tempXPath.indexOf("=", startAttIndx); //$NON-NLS-1$
- int endAttIndx = tempXPath.indexOf("]", startAttIndx); //$NON-NLS-1$
- if (equalIndx > 0 && equalIndx < endAttIndx) {
- String attName = tempXPath.substring(startAttIndx + 1,
- equalIndx);
- String namePart = getNamePart(attName);
- String nsPart = getNamespacePart(attName);
- Namespace attNS = Namespace.NO_NAMESPACE;
- if (nsPart != null) {
- attNS = (Namespace) m_namespaceMap.get(nsPart);
- }
- String attValue = tempXPath
- .substring(equalIndx + 1, endAttIndx);
- childElement.setAttribute(namePart, attValue, attNS);
- } else {
- throw new TranslatorException(XMLPlugin
- .getString("HTTPExecutor.bad.attribute.def")); //$NON-NLS-1$
- }
- startAttIndx = tempXPath.indexOf("[", endAttIndx); //$NON-NLS-1$
- }
- }
-
- private String getElementName(String tempXPath) {
- String elementName;
- int startAttIndx = tempXPath.indexOf("["); //$NON-NLS-1$
- if (startAttIndx > 0) {
- elementName = tempXPath.substring(0, startAttIndx).trim();
- } else {
- elementName = tempXPath;
- }
- return elementName;
- }
-
- public static String outputDocToString(Document doc) {
- XMLOutputter out = new XMLOutputter();
- return out.outputString(doc).trim();
- }
-
- public void setUseTypeAttributes(boolean m_useTypeAttributes) {
- this.m_useTypeAttributes = m_useTypeAttributes;
- }
-
- private boolean useTypeAttributes() {
- return m_useTypeAttributes;
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ExecutionInfo.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ExecutionInfo.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ExecutionInfo.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,205 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.Namespace;
-import org.jdom.input.SAXBuilder;
-import org.teiid.translator.TranslatorException;
-
-
-public class ExecutionInfo {
-// TODO:Refactor. This class was defined when the multiple reqests to an XML service
-// (read HTTP) to satisfy an IN clause were abstacted beneath a single call to Executor.getResult().
-// This case is now satified within the execute call by making a single call to Executor.getResult()
-// for each paramter of the IN clause.
-
- private List columns;
- private int columnCount;
- private List<CriteriaDesc> params;
- private List<CriteriaDesc> criteria;
- private Map<String, String> otherProps;
- private String tablePath;
- private String location;
- private Map<String, String> prefixToNamespace;
- private Map<String, String> namespaceToPrefix;
-
- public ExecutionInfo() {
- this.columnCount = 0;
- this.columns = new ArrayList();
- this.params = new ArrayList<CriteriaDesc>();
- this.criteria = new ArrayList<CriteriaDesc>();
- this.otherProps = new HashMap<String, String>();
- this.tablePath = ""; //$NON-NLS-1$
- }
-
-
- public String getTableXPath() {
- return this.tablePath;
- }
-
- public String getLocation() {
- return this.location;
- }
-
- public List getRequestedColumns() {
- return this.columns;
- }
-
-
- public int getColumnCount() {
- return this.columnCount;
- }
-
-
- public List<CriteriaDesc> getParameters() {
- return this.params;
- }
-
-
- public List<CriteriaDesc> getCriteria() {
- return this.criteria;
- }
-
-
- public Map<String, String> getOtherProperties() {
- return this.otherProps;
- }
-
- public void setTableXPath(String path) {
- if (path == null || path.trim().length() == 0) {
- this.tablePath = null;
- } else {
- this.tablePath = path;
- }
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public void setRequestedColumns(List value) {
- this.columns = value;
- }
-
-
- public void setColumnCount(int count) {
- this.columnCount = count;
- }
-
-
- public void setParameters(List<CriteriaDesc> parameters) {
- this.params = parameters;
- }
-
-
- public void setCriteria(List<CriteriaDesc> criteria) {
- this.criteria = criteria;
- }
-
-
- public void setOtherProperties(Map<String, String> props) {
- if (props == null) {
- this.otherProps = new HashMap<String, String>();
- } else {
- this.otherProps = props;
- }
- }
-
- // It is not enforced that there is only one ResponseId in the parameters, but it is
- // a valid assumption and the modelgenerators will never create a model that has more
- // than one. We could enforce this with a real metamodel.
- public CriteriaDesc getResponseIDCriterion() {
- CriteriaDesc result = null;
- Iterator iter = this.params.iterator();
- while(iter.hasNext()) {
- CriteriaDesc criterion = (CriteriaDesc)iter.next();
- if(criterion.isResponseId()) {
- result = criterion;
- break;
- }
- }
- return result;
- }
-
- public Map<String, String> getNamespaceToPrefixMap() throws TranslatorException {
- if(this.namespaceToPrefix != null) {
- return this.namespaceToPrefix;
- }
- getPrefixToNamespacesMap();
- return this.namespaceToPrefix;
- }
-
- public Map<String, String> getPrefixToNamespacesMap() throws TranslatorException {
- if (this.prefixToNamespace != null) {
- return this.prefixToNamespace;
- }
-
- this.prefixToNamespace = new HashMap<String, String>();
- this.namespaceToPrefix = new HashMap<String, String>();
- String namespacePrefixes = getOtherProperties().get(Constants.NAMESPACE_PREFIX_PROPERTY_NAME);
- if (namespacePrefixes == null || namespacePrefixes.trim().length() == 0) {
- return null;
- }
- String prefix = null;
- String uri = null;
- try {
- String xml = "<e " + namespacePrefixes + "/>"; //$NON-NLS-1$ //$NON-NLS-2$
- Reader reader = new StringReader(xml);
- SAXBuilder builder = new SAXBuilder();
- Document domDoc = builder.build(reader);
- Element elem = domDoc.getRootElement();
- List namespaces = elem.getAdditionalNamespaces();
- for (Iterator iter = namespaces.iterator(); iter.hasNext();) {
- Object o = iter.next();
- Namespace namespace = (Namespace) o;
- prefix = namespace.getPrefix();
- uri = namespace.getURI();
- this.prefixToNamespace.put(prefix, uri);
- this.namespaceToPrefix.put(uri, prefix);
- }
- } catch (JDOMException e) {
- String rawMsg = XMLPlugin.getString("Executor.jaxen.error.on.namespace.pairs"); //$NON-NLS-1$
- Object[] objs = new Object[2];
- objs[0] = prefix;
- objs[1] = uri;
- String msg = MessageFormat.format(rawMsg, objs);
- throw new TranslatorException(e, msg);
- } catch (IOException e) {
- throw new TranslatorException(e, e.getMessage());
- }
- return this.prefixToNamespace;
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileProcedureExecution.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileProcedureExecution.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileProcedureExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLXML;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.core.types.InputStreamFactory;
-import org.teiid.core.types.SQLXMLImpl;
-import org.teiid.language.Call;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.translator.DataNotAvailableException;
-import org.teiid.translator.FileConnection;
-import org.teiid.translator.ProcedureExecution;
-import org.teiid.translator.TranslatorException;
-
-
-/**
- * Execution class for File based XML Source.
- */
-public class FileProcedureExecution implements ProcedureExecution {
-
- private Call procedure;
- private XMLExecutionFactory executionFactory;
- private boolean returnedResult;
- private SQLXML returnValue;
- private FileConnection connection;
-
- /**
- * @param env
- * @param conn
- * @param context
- * @param metadata
- */
- public FileProcedureExecution(Call proc, XMLExecutionFactory executionFactory, FileConnection connection) {
- this.procedure = proc;
- this.executionFactory = executionFactory;
- this.connection = connection;
- }
-
- /**
- * @see org.teiid.connector.api.ProcedureExecution#execute(org.teiid.connector.language.Call, int)
- */
- @Override
- public void execute() throws TranslatorException {
-
- // look for the name of the file to return in the metadata, "Name in Source" property
- AbstractMetadataRecord metaObject = procedure.getMetadataObject();
- String fileName = metaObject.getNameInSource();
-
- // if the source procedure name is not supplied then throw an exception
- if (fileName == null || fileName.length() == 0) {
- throw new TranslatorException(XMLPlugin.Util.getString("source_name_not_supplied", new Object[] {procedure.getProcedureName()})); //$NON-NLS-1$
- }
-
- final File[] files = FileConnection.Util.getFiles(fileName, this.connection);
- if (files.length == 0 || !files[0].exists()) {
- throw new TranslatorException(XMLPlugin.Util.getString("file_not_supplied", new Object[] {fileName, procedure.getProcedureName()})); //$NON-NLS-1$
- }
-
- String encoding = this.executionFactory.getCharacterEncodingScheme();
-
- returnValue = new SQLXMLImpl(new InputStreamFactory.FileInputStreamFactory(files[0], encoding));
-
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, XMLPlugin.Util.getString("executing_procedure", new Object[] {procedure.getProcedureName()})); //$NON-NLS-1$
- }
-
- @Override
- public List<?> next() throws TranslatorException, DataNotAvailableException {
- if (!returnedResult) {
- returnedResult = true;
- return Arrays.asList(returnValue);
- }
- return null;
- }
-
- @Override
- public List<?> getOutputParameterValues() throws TranslatorException {
- throw new TranslatorException(XMLPlugin.Util.getString("No_outputs_allowed")); //$NON-NLS-1$
- }
-
- public void close() {
- // no-op
- }
-
- public void cancel() throws TranslatorException {
- // no-op
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileResultSetExecution.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileResultSetExecution.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/FileResultSetExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,140 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.xml;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.core.types.InputStreamFactory;
-import org.teiid.translator.DataNotAvailableException;
-import org.teiid.translator.FileConnection;
-import org.teiid.translator.ResultSetExecution;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.streaming.InvalidPathException;
-import org.teiid.translator.xml.streaming.StreamingResultsProducer;
-import org.teiid.translator.xml.streaming.XPathSplitter;
-
-public class FileResultSetExecution implements ResultSetExecution {
- public static final String PARM_FILE_NAME_TABLE_PROPERTY_NAME = "FileName"; //$NON-NLS-1$
-
- private ExecutionInfo executionInfo;
- private int docNumber = 0;
- private File[] content;
- private XMLExecutionFactory executionFactory;
- private List<StremableDocument> resultDocuments = null;
- private StreamingResultsProducer streamProducer;
- private List<Object[]> currentRowSet;
- private int currentRow = 0;
-
-
- public FileResultSetExecution(List<CriteriaDesc> requestParams, ExecutionInfo executionInfo, XMLExecutionFactory executionFactory, FileConnection connection) throws TranslatorException {
-
- this.executionInfo = executionInfo;
-
- String tableName = this.executionInfo.getLocation();
- if (tableName == null) {
- tableName = this.executionInfo.getOtherProperties().get(PARM_FILE_NAME_TABLE_PROPERTY_NAME);
- }
-
- this.content = FileConnection.Util.getFiles(tableName, connection);
-
- validateParams();
-
- this.executionInfo.setParameters(requestParams);
- this.executionFactory = executionFactory;
- this.streamProducer = new StreamingResultsProducer(this.executionInfo, this.executionFactory.getSaxFilterProvider());
- }
-
- /**
- * Validates that the query can be supported. Probably better suited to a call out from QueryAnalyzer.
- * @throws ConnectorException
- */
- private void validateParams() throws TranslatorException {
- for (int i = 0; i < this.executionInfo.getRequestedColumns().size(); i++) {
- OutputXPathDesc xPath = (OutputXPathDesc)this.executionInfo.getRequestedColumns().get(i);
- if (xPath.isParameter()) {
- throw new TranslatorException(XMLPlugin.getString("FileExecutor.input.not.supported.on.files")); //$NON-NLS-1$
- }
- }
- }
-
- @Override
- public void execute() throws TranslatorException {
- if (this.content != null) {
- this.resultDocuments = new ArrayList<StremableDocument>();
- int i = 0;
- for(File f:this.content) {
- this.resultDocuments.add(getDocumentStream(f, i++));
- }
- }
- }
-
- @Override
- public List<?> next() throws TranslatorException, DataNotAvailableException {
- if (this.currentRowSet == null) {
- while(this.docNumber < resultDocuments.size()) {
- this.currentRowSet = streamProducer.getResult(this.resultDocuments.get(this.docNumber++), getXPaths());
- this.currentRow = 0;
- if (this.currentRowSet.isEmpty()) {
- continue;
- }
- }
- }
-
- if (this.currentRowSet != null) {
- if (this.currentRow <= this.currentRowSet.size()) {
- List result = Arrays.asList(this.currentRowSet.get(this.currentRow++));
- if(this.currentRow == this.currentRowSet.size()) {
- this.currentRowSet = null;
- }
- return result;
- }
- }
- return null;
- }
-
- private List<String> getXPaths() throws TranslatorException {
- XPathSplitter splitter = new XPathSplitter();
- try {
- return splitter.split(this.executionInfo.getTableXPath());
- } catch (InvalidPathException e) {
- throw new TranslatorException(e);
- }
- }
-
- private StremableDocument getDocumentStream(final File xmlFile, int fileNumber) {
- InputStreamFactory isf = new InputStreamFactory.FileInputStreamFactory(xmlFile);
- return new StremableDocument(this.executionFactory.convertToXMLType(isf), xmlFile.getName()+fileNumber);
- }
-
- @Override
- public void cancel() throws TranslatorException {
-
- }
-
- @Override
- public void close() {
-
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/IDGeneratingXmlFilter.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/IDGeneratingXmlFilter.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/IDGeneratingXmlFilter.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.helpers.XMLFilterImpl;
-
-
-public class IDGeneratingXmlFilter extends XMLFilterImpl
-{
- protected static class PathElement
- {
- protected PathElement(String name, int index)
- {
- this.name = name;
- this.index = index;
- predecessorCounts = new HashMap();
- }
- protected String name;
- protected int index;
- protected Map predecessorCounts; // keys: predecessor sibling names, values: count of times it has appeared
- }
-
- public IDGeneratingXmlFilter(String documentId)
- {
- this.documentId = documentId;
- }
-
- public static final String MM_ID_ATTR_NAME_BY_PATH = "com.metamatrix.xml.xpathpart";
- public static final String MM_ID_ATTR_NAME_BY_INDEX = "com.metamatrix.xml.xpathpart.byindex";
- public static final String MM_ID_ATTR_NAME = MM_ID_ATTR_NAME_BY_PATH;
- public static final String MM_ID_ATTR_VALUE_PREFIX = "";
-
- String documentId;
-
- // This way of doing things seems like cheating, but it will produce the desired results.
- // Only problem: the IDs are completely opaque and meaningless.
- int index = 0;
-
- // This way is nicer
- List path; // a list of PathElement objects
-
- @Override
- public void startDocument() throws SAXException
- {
- path = new ArrayList();
- PathElement newPathElement = new PathElement(documentId, -1);
- path.add(newPathElement);
-
- super.startDocument();
- }
-
- private String getIdFromIndex()
- {
- String retval = MM_ID_ATTR_VALUE_PREFIX + documentId + "/" + index;
- ++index;
- return retval;
- }
-
- private String getIdFromPath(String qName)
- {
- StringBuffer retval = new StringBuffer();
-
- Object oParentPath = path.get(path.size() - 1);
- PathElement parentPath = (PathElement)oParentPath;
- Map predecessorCounts = parentPath.predecessorCounts;
- Object oCount = predecessorCounts.get(qName);
- Integer count = (Integer)oCount;
- int index;
- if (count == null) {
- index = 0;
- }
- else {
- index = count.intValue() + 1;
- }
- predecessorCounts.put(qName, Integer.valueOf(index));
-
- PathElement newPathElement = new PathElement(qName, index);
- path.add(newPathElement);
-
- boolean first = true;
- for (Iterator iter = path.iterator(); iter.hasNext() ; ) {
- Object o = iter.next();
- PathElement pathElement = (PathElement)o;
- if (first) {
- first = false;
- }
- else {
- retval.append('/');
- }
- retval.append(pathElement.name);
- if (pathElement.index >= 0) {
- retval.append('[');
- retval.append(pathElement.index);
- retval.append(']');
- }
- }
-
- return retval.toString();
- }
-
- @Override
- public void startElement(String namespaceURI, String localName,
- String qName, Attributes atts) throws SAXException
- {
- String indexValue = getIdFromIndex();
- String pathValue = getIdFromPath(qName);
- Attributes newAtts = addAttributes(atts, indexValue, pathValue);
- super.startElement(namespaceURI, localName, qName, newAtts);
- }
-
- protected Attributes addAttributes(Attributes atts, String indexValue, String pathValue)
- {
- AttributesImpl newAtts = new AttributesImpl(atts);
- newAtts.addAttribute("", MM_ID_ATTR_NAME, MM_ID_ATTR_NAME, "CDATA", pathValue);
- newAtts.addAttribute("", MM_ID_ATTR_NAME_BY_INDEX, MM_ID_ATTR_NAME_BY_INDEX, "CDATA", indexValue);
- return newAtts;
- }
-
- @Override
- public void endElement(String namespaceURI, String localName, String qName)
- throws SAXException {
- path.remove(path.size() - 1);
- super.endElement(namespaceURI, localName, qName);
- }
-}
\ No newline at end of file
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/OutputXPathDesc.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/OutputXPathDesc.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/OutputXPathDesc.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-package org.teiid.translator.xml;
-
-import java.text.MessageFormat;
-
-import org.teiid.language.Literal;
-import org.teiid.metadata.Column;
-import org.teiid.translator.TranslatorException;
-
-public class OutputXPathDesc extends ParameterDescriptor {
-
- // Describes an item in the xpath structure, and all the attributes of it
- // Added to allow all the attributes of an Xpath to be stored in a single structure,
- // and to make the code more manageable
- private Object m_currentValue = null;
- private Class m_dataType = null;
-
-
- /**
- * @see com.metamatrix.server.datatier.SynchConnectorConnection#submitRequest(java.lang.Object)
- */
- public OutputXPathDesc (Column myElement) throws TranslatorException {
- super(myElement);
- m_dataType = myElement.getJavaType();
- if (getXPath() == null) {
- if (!isSpecial()) {
- String rawMsg = XMLPlugin.getString("OutputXPathDesc.name.in.source.required.on.column"); //$NON-NLS-1$
- String msg = MessageFormat.format(rawMsg, new Object[] {getColumnName()});
- throw new TranslatorException(msg);
- }
- }
- }
-
- public boolean isSpecial() {
- return isParameter() || isResponseId() || isLocation();
- }
-
- public OutputXPathDesc (Literal literal) throws TranslatorException {
- super();
- if (literal.getValue() == null) {
- setCurrentValue(null);
- } else {
- setCurrentValue(literal.getValue().toString());
- }
- m_dataType = literal.getType();
- }
-
-
- public void setCurrentValue(Object obj) {
- m_currentValue = obj;
- }
-
- public Object getCurrentValue() {
- return m_currentValue;
- }
-
-
- public Class getDataType() throws TranslatorException {
- return m_dataType;
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ParameterDescriptor.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ParameterDescriptor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/ParameterDescriptor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,156 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import org.teiid.metadata.Column;
-import org.teiid.translator.TranslatorException;
-
-public abstract class ParameterDescriptor {
-
- private String m_xPath;
- private boolean m_param;
- private boolean m_responseId;
- private boolean m_location;
- private String m_columnName;
- private int m_columnNumber = -1;
- private Column m_element;
-
- public static final String PARM_INPUT_COLUMN_PROPERTY_NAME = "IsInputParameter"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME = "Role"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME_RESPONSE_IN = "ResponseIn"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME_RESPONSE_OUT = "ResponseOut"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME_LOCATION = "Location"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME_DATA = "Data"; //$NON-NLS-1$
-
- public ParameterDescriptor( Column element ) throws TranslatorException {
- setElement(element);
- setIsParameter(testForParam(m_element));
- testRole();
- if (getElement().getNameInSource() != null) {
- setColumnName(getElement().getNameInSource());
- } else {
- setColumnName(getElement().getName().trim());
- }
- String nis = getElement().getNameInSource();
- if (nis != null) {
- nis = nis.trim();
- }
- setXPath(nis);
- }
-
- protected ParameterDescriptor() {
- setIsParameter(false);
- setIsResponseId(false);
- setIsLocation(false);
- setColumnName(null);
- setXPath(null);
- }
-
- public final void setXPath( String xPath ) {
- m_xPath = xPath;
- }
-
- public String getXPath() {
- return m_xPath;
- }
-
- public final void setIsParameter( boolean param ) {
- m_param = param;
- }
-
- public final void setIsResponseId( boolean responseId ) {
- m_responseId = responseId;
- }
-
- public final void setIsLocation( boolean location ) {
- m_location = location;
- }
-
- public final boolean isParameter() {
- return m_param;
- }
-
- public final boolean isResponseId() {
- return m_responseId;
- }
-
- public final boolean isLocation() {
- return m_location;
- }
-
- public final void setColumnName( String columnName ) {
- m_columnName = columnName;
- }
-
- public final String getColumnName() {
- return m_columnName;
- }
-
- public final void setColumnNumber( int columnNumber ) {
- m_columnNumber = columnNumber;
- }
-
- public final int getColumnNumber() {
- return m_columnNumber;
- }
-
- protected void setElement( Column elem ) {
- m_element = elem;
- }
-
- public Column getElement() {
- return m_element;
- }
-
- protected static boolean testForParam( Column element ) throws TranslatorException {
- boolean param = false;
- param = Boolean.valueOf(element.getProperties().get(PARM_INPUT_COLUMN_PROPERTY_NAME)).booleanValue();
- return param;
- }
-
- public String getRole() throws TranslatorException {
- return m_element.getProperties().get(ROLE_COLUMN_PROPERTY_NAME);
- }
-
- protected void testRole() throws TranslatorException {
- String role = getRole();
- if (role == null) {
- setIsResponseId(false);
- setIsLocation(false);
- } else {
- if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_RESPONSE_IN)) {
- setIsResponseId(true);
- setIsLocation(false);
- } else if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_RESPONSE_OUT)) {
- setIsResponseId(true);
- setIsLocation(false);
- } else if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_LOCATION)) {
- setIsResponseId(false);
- setIsLocation(true);
- } else { // if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_DATA))
- setIsResponseId(false);
- setIsLocation(false);
- }
- }
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/QueryAnalyzer.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/QueryAnalyzer.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/QueryAnalyzer.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,208 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.Literal;
-import org.teiid.language.NamedTable;
-import org.teiid.language.Select;
-import org.teiid.language.TableReference;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.Table;
-import org.teiid.translator.TranslatorException;
-
-public class QueryAnalyzer {
-
- private Select command;
- private Table table;
- private ExecutionInfo executionInfo;
-
- public QueryAnalyzer(Select query) throws TranslatorException {
- this.command = query;
- executionInfo = new ExecutionInfo();
- analyze();
- }
-
- public final void analyze() throws TranslatorException {
- setGroupInfo();
- setRequestedColumns();
- setParametersAndCriteria();
- setProperties();
- }
-
-
-
- public ExecutionInfo getExecutionInfo() {
- return this.executionInfo;
- }
-
- private void setGroupInfo() {
- List<TableReference> fromItems = command.getFrom();
- //Can only be one because we do not support joins
- NamedTable group = (NamedTable) fromItems.get(0);
- this.table = group.getMetadataObject();
- this.executionInfo.setTableXPath(table.getNameInSource());
- }
-
- private void setRequestedColumns() throws TranslatorException {
-
- List<OutputXPathDesc> columns = new ArrayList<OutputXPathDesc>();
- //get the request items
- List<DerivedColumn> selectSymbols = this.command.getDerivedColumns();
-
- //setup column numbers
- int projectedColumnCount = 0;
-
- //add projected fields into XPath array and element array for later
- // lookup
-
- for(DerivedColumn selectSymbol : selectSymbols) {
- Expression expr = selectSymbol.getExpression();
- OutputXPathDesc xpath = null;
-
- //build the appropriate structure
- if (expr instanceof Literal) {
- xpath = new OutputXPathDesc((Literal) expr);
- } else if (expr instanceof ColumnReference) {
- Column element = ((ColumnReference)expr).getMetadataObject();
- xpath = new OutputXPathDesc(element);
- }
- if (xpath != null) {
- xpath.setColumnNumber(projectedColumnCount);
- }
-
- // put xpath object into linked list
- columns.add(xpath);
- ++projectedColumnCount;
- }
-
- //set the column count
- this.executionInfo.setColumnCount(projectedColumnCount);
- this.executionInfo.setRequestedColumns(columns);
- }
-
- private void setParametersAndCriteria() throws TranslatorException {
- //Build a linked list of parameters, and a linked list of equivilence
- // and set selection criteria.
- //Each parameter and criteria is itself represented by a linked list,
- // containing names, element (metadata), and equivilence value, or all
- // set values
-
- ArrayList<CriteriaDesc> params = new ArrayList<CriteriaDesc>();
- ArrayList<CriteriaDesc> crits = new ArrayList<CriteriaDesc>();
- ArrayList<CriteriaDesc> responses = new ArrayList<CriteriaDesc>();
- ArrayList<CriteriaDesc> locations = new ArrayList<CriteriaDesc>();
-
- //Iterate through each field in the table
- for (Column element : table.getColumns()) {
- CriteriaDesc criteria = CriteriaDesc.getCriteriaDescForColumn(
- element, command);
- if (criteria != null) {
- mapCriteriaToColumn(criteria, params, crits, responses, locations);
- }
- }
- this.executionInfo.setParameters(params);
- this.executionInfo.setCriteria(crits);
-
- String location = null;
- for (Iterator<CriteriaDesc> iter = locations.iterator(); iter.hasNext(); ) {
- Object o = iter.next();
- CriteriaDesc crtierion = (CriteriaDesc)o;
- List values = crtierion.getValues();
- for (Iterator valuesIter = values.iterator(); valuesIter.hasNext(); ) {
- Object oValue = valuesIter.next();
- String value = (String)oValue;
- if (location != null) {
- if (!(location.equals(value))) {
- throw new TranslatorException(XMLPlugin
- .getString("QueryAnalyzer.multiple.locations.supplied")); //$NON-NLS-1$
- }
- }
- location = value;
- }
- }
- this.executionInfo.setLocation(location);
- }
-
- private void mapCriteriaToColumn(CriteriaDesc criteria, ArrayList<CriteriaDesc> params,
- ArrayList<CriteriaDesc> crits, ArrayList<CriteriaDesc> responses, ArrayList<CriteriaDesc> locations) throws TranslatorException {
- int totalColumnCount = this.executionInfo.getColumnCount();
- //check each criteria to see which projected column it maps to
- String criteriaColName = criteria.getColumnName();
- boolean matchedField = false;
- OutputXPathDesc xpath = null;
- for (int j = 0; j < this.executionInfo.getRequestedColumns().size(); j++) {
- xpath = (OutputXPathDesc) this.executionInfo.getRequestedColumns().get(j);
- String projColName = xpath.getColumnName();
- if (criteriaColName.equals(projColName)) {
- matchedField = true;
- criteria.setColumnNumber(j);
- break;
- }
- }
- if (criteria.isParameter() || criteria.isResponseId() && !criteria.isLocation()) {
- params.add(criteria);
- if (criteria.isResponseId()) {
- responses.add(criteria);
- }
- } else {
-
- // otherwise add a new column to the projected XPath list (don't
- // worry,
- // it will be removed later and not really projected.
- // match not found, add to project list
- if (!matchedField) {
- criteria.setColumnNumber(totalColumnCount);
- xpath = new OutputXPathDesc(criteria
- .getElement());
- xpath.setColumnNumber(totalColumnCount++);
- this.executionInfo.getRequestedColumns().add(xpath);
- }
- if (xpath.isResponseId()) {
- responses.add(criteria);
- }
- else if (xpath.isLocation()) {
- locations.add(criteria);
- }
- else {
- crits.add(criteria);
- }
- }
- }
-
- private void setProperties() {
- this.executionInfo.setOtherProperties(table.getProperties());
- }
-
- public List<List<CriteriaDesc>> getRequestPerms() {
- return CartesienCriteriaGenerator.generateCartesianCriteria(this.executionInfo.getParameters());
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestGenerator.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestGenerator.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestGenerator.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class RequestGenerator {
-
- // This method is misnamed. It generates cartesian products, not permutations.
- public static List<CriteriaDesc[]> getRequests(List<CriteriaDesc> params)
- {
- List<CriteriaDesc[]> soFar = new ArrayList<CriteriaDesc[]>();
-
- // Start off with a single "row" (with zero parameters)
- soFar.add(new CriteriaDesc[]{});
- for (CriteriaDesc desc: params){
- soFar = RequestGenerator.createCartesionProduct(soFar, desc);
- }
-
- return soFar;
- }
-
- // Create the cartesian product of a list of CriteriaDescs, and single CriteriaDesc
- // with (potentially) multiple values
- static List<CriteriaDesc[]> createCartesionProduct(List<CriteriaDesc[]> permsSoFar, CriteriaDesc desc)
- {
- List<CriteriaDesc[]> retval = new ArrayList<CriteriaDesc[]>();
-
- // Get the 'simple' cartesian product
- List<List> rows = createCartesionProduct(permsSoFar, desc.getValues(), desc.isUnlimited());
-
- // Merge the existing list of CriteriaDescs with the new value turned into a CriteriaDesc)
- for (List row : rows) {
- Object oOperand1 = row.get(0);
- CriteriaDesc[] previousCriteriaDescs = (CriteriaDesc[])oOperand1;
-
- CriteriaDesc[] newRow = new CriteriaDesc[previousCriteriaDescs.length + 1];
- System.arraycopy(previousCriteriaDescs, 0, newRow, 0, previousCriteriaDescs.length);
- CriteriaDesc singleValueCriteriaDesc = desc.cloneWithoutValues();
- for (int i=1; i < row.size(); i++ ){
- Object value = row.get(i);
- singleValueCriteriaDesc.setValue((i - 1), value);
- }
- newRow[newRow.length - 1] = singleValueCriteriaDesc;
- retval.add(newRow);
- }
- return retval;
- }
-
- // Create the cartesian product of any two lists
- private static List<List> createCartesionProduct(List<CriteriaDesc[]> operand1, List operand2, boolean multiElem)
- {
- if (operand1.size() == 0) {
- operand1 = new ArrayList<CriteriaDesc[]>();
- operand1.add(null);
- }
-
- if (operand2.size() == 0) {
- operand2 = new ArrayList();
- operand2.add(null);
- }
-
-
- List<List> cartesianProduct = new ArrayList<List>();
- for (CriteriaDesc[] operand1item : operand1) {
- List newRow = new ArrayList();
- if (! multiElem) {
- for (Object operand2item : operand2 ) {
- newRow.add(operand1item);
- newRow.add(operand2item);
- cartesianProduct.add(newRow);
- }
- } else {
- newRow.add(operand1item);
- for (Object operand2item : operand2 ) {
- newRow.add(operand2item);
- }
- cartesianProduct.add(newRow);
- }
- }
- return cartesianProduct;
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestPreprocessor.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestPreprocessor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/RequestPreprocessor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.translator.xml;
-
-import org.teiid.language.Select;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-
-public interface RequestPreprocessor {
- /**
- *
- * This method is used for altering the query before it enters the XML connector's processing
- *
- * @param query The IQuery passed from the connector
- * @param m_logger the connector logger
- * @param connectorEnv the connector environment
- * @param exeContext the execution context
- * @param m_metadata the runtime metadata
- * @return an IQuery object representing the altered query
- */
- public Select preprocessQuery(Select query, RuntimeMetadata m_metadata, ExecutionContext exeContext);
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/SAXFilterProvider.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/SAXFilterProvider.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/SAXFilterProvider.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.translator.xml;
-
-import org.xml.sax.helpers.XMLFilterImpl;
-
-
-public interface SAXFilterProvider {
- XMLFilterImpl[] getExtendedFilters();
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/StremableDocument.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/StremableDocument.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/StremableDocument.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,25 +0,0 @@
-package org.teiid.translator.xml;
-
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.sql.SQLXML;
-
-public class StremableDocument {
-
- private SQLXML xml;
- private String cacheKey;
-
- public StremableDocument(SQLXML xml, String cacheKey) {
- this.xml = xml;
- this.cacheKey = cacheKey;
- }
-
- public InputStream getStream() throws SQLException{
- return xml.getBinaryStream();
- }
-
- public String getCachekey() {
- return cacheKey;
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLExecutionFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLExecutionFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,230 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.sql.SQLXML;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.resource.ResourceException;
-import javax.resource.cci.Connection;
-import javax.resource.cci.ConnectionFactory;
-import javax.xml.transform.Source;
-import javax.xml.ws.Dispatch;
-
-import org.teiid.language.Call;
-import org.teiid.language.QueryExpression;
-import org.teiid.language.Select;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.logging.MessageLevel;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.ExecutionFactory;
-import org.teiid.translator.FileConnection;
-import org.teiid.translator.ProcedureExecution;
-import org.teiid.translator.ResultSetExecution;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TranslatorProperty;
-import org.teiid.translator.xml.streaming.BaseStreamingExecution;
-
-@Translator(name="xml")
-public class XMLExecutionFactory extends ExecutionFactory {
-
- private String saxFilterProviderClass;
- private String encoding = "ISO-8859-1"; //$NON-NLS-1$
- private Map<String, List<SQLXML>> responses = new ConcurrentHashMap<String, List<SQLXML>>();
- private boolean logRequestResponseDocs = false;
- private String queryPreprocessorClass;
-
- @TranslatorProperty(description="Encoding of the XML documents", display="Encoding Scheme")
- public String getCharacterEncodingScheme() {
- return this.encoding;
- }
-
- public void setCharacterEncodingScheme(String encoding) {
- this.encoding = encoding;
- }
-
- @TranslatorProperty(description="Must be extension of org.teiid.translator.xml.SAXFilterProvider class", display="SAX Filter Provider Class")
- public String getSaxFilterProviderClass() {
- return this.saxFilterProviderClass;
- }
-
- public void setSaxFilterProviderClass(String saxFilterProviderClass) {
- this.saxFilterProviderClass = saxFilterProviderClass;
- }
-
- @TranslatorProperty(display="Request Preprocessor Class", description="Must be extension of org.teiid.translator.xml.RequestPreprocessor")
- public String getRequestPreprocessorClass() {
- return this.queryPreprocessorClass;
- }
-
- public void setRequestPreprocessorClass(String queryPreprocessorClass) {
- this.queryPreprocessorClass = queryPreprocessorClass;
- }
-
- // Can we get rid of this?
- private String inputStreamFilterClass;
-
- public String getInputStreamFilterClass() {
- return this.inputStreamFilterClass;
- }
-
- public void setInputStreamFilterClass(String inputStreamFilterClass) {
- this.inputStreamFilterClass = inputStreamFilterClass;
- }
-
- @TranslatorProperty(description="Log the XML request/response documents", display="Log Request/Response Documents")
- public boolean isLogRequestResponseDocs() {
- return logRequestResponseDocs && LogManager.isMessageToBeRecorded(LogConstants.CTX_CONNECTOR, MessageLevel.DETAIL);
- }
-
- public void setLogRequestResponseDocs(boolean logRequestResponseDocs) {
- this.logRequestResponseDocs = logRequestResponseDocs;
- }
-
- public List<SQLXML> getResponse(String key) {
- return this.responses.get(key);
- }
-
- public void setResponse(String key, SQLXML xml) {
- List<SQLXML> results = this.responses.get(key);
- if (results == null) {
- results = new ArrayList<SQLXML>();
- this.responses.put(key, results);
- }
- results.add(xml);
- }
-
- public List<SQLXML> removeResponse(String key) {
- return this.responses.remove(key);
- }
-
-
- @Override
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws TranslatorException {
- try {
- ConnectionFactory cf = (ConnectionFactory)connectionFactory;
- Connection connection = cf.getConnection();
- if (connection instanceof FileConnection) {
- return new FileProcedureExecution(command, this, (FileConnection)connection);
- }
- else if (connection instanceof Dispatch<?>) {
- return new XMLProcedureExecution(command, metadata, executionContext, this, (Dispatch)connection);
- }
- else {
- return null;
- }
-
- } catch (ResourceException e) {
- throw new TranslatorException(e);
- }
- }
-
- @Override
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws TranslatorException {
- RequestPreprocessor preProcessor = getRequestPreProcessor();
- if (preProcessor != null) {
- command = preProcessor.preprocessQuery((Select)command, metadata, executionContext);
- }
-
- QueryAnalyzer analyzer = new QueryAnalyzer((Select)command);
- ExecutionInfo executionInfo = analyzer.getExecutionInfo();
- List<List<CriteriaDesc>> requestPerms = analyzer.getRequestPerms();
-
- if (requestPerms.size() > 1) {
- CompositeExecution compasiteExecution = new CompositeExecution();
- for (List<CriteriaDesc> cds: requestPerms) {
- compasiteExecution.addExecution(createExecution(cds, executionInfo, executionContext,connectionFactory));
- }
- return compasiteExecution;
- }
- if (requestPerms.size() == 1) {
- return createExecution(requestPerms.get(0), executionInfo, executionContext,connectionFactory);
- }
- return createExecution(Collections.EMPTY_LIST, executionInfo, executionContext,connectionFactory);
- }
-
- private ResultSetExecution createExecution(List<CriteriaDesc> cds, ExecutionInfo executionInfo, ExecutionContext executionContext, Object connectionFactory)
- throws TranslatorException {
- try {
- ConnectionFactory cf = (ConnectionFactory)connectionFactory;
- Connection connection = cf.getConnection();
- if (connection instanceof FileConnection) {
- return new FileResultSetExecution(cds, executionInfo, this, (FileConnection)connection);
- }
- else if (connection instanceof Dispatch<?>) {
- return new BaseStreamingExecution(cds, executionInfo, executionContext, this, (Dispatch)connection);
- }
- } catch (ResourceException e) {
- throw new TranslatorException(e);
- }
- return null;
- }
-
- private RequestPreprocessor getRequestPreProcessor() throws TranslatorException {
- String className = getRequestPreprocessorClass();
- if (className == null) {
- return null;
- }
- return getInstance(RequestPreprocessor.class, className, null, null);
- }
-
- public SAXFilterProvider getSaxFilterProvider() throws TranslatorException {
- if (getSaxFilterProviderClass() == null) {
- return null;
- }
- return getInstance(SAXFilterProvider.class, getSaxFilterProviderClass(), null, null);
- }
-
- public SQLXML convertToXMLType(Source value) {
- return (SQLXML)getTypeFacility().convertToRuntimeType(value);
- }
-
- @Override
- public final int getMaxInCriteriaSize() {
- return Integer.MAX_VALUE;
- }
-
- @Override
- public final List getSupportedFunctions() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public final boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- @Override
- public final boolean supportsInCriteria() {
- return true;
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLPlugin.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLPlugin.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLPlugin.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.teiid.core.BundleUtil;
-
-public class XMLPlugin {
-
- private static final String PLUGIN_ID = XMLPlugin.class.getPackage().getName();
-
- public static final BundleUtil Util = new BundleUtil(PLUGIN_ID, PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-
- public static String getString(String key) {
- try {
- return Util.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
Deleted: trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLProcedureExecution.java
===================================================================
--- trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLProcedureExecution.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/java/org/teiid/translator/xml/XMLProcedureExecution.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.io.StringReader;
-import java.sql.Clob;
-import java.sql.SQLException;
-import java.sql.SQLXML;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.Dispatch;
-
-import org.teiid.language.Argument;
-import org.teiid.language.Call;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.DataNotAvailableException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.ProcedureExecution;
-import org.teiid.translator.TranslatorException;
-
-/**
- * A soap call executor - handles all styles doc/literal, rpc/encoded etc.
- */
-public class XMLProcedureExecution implements ProcedureExecution {
-
- RuntimeMetadata metadata = null;
- ExecutionContext context;
- private Call procedure;
- private boolean returnedResult;
- private SQLXML returnValue;
- private Dispatch<Source> dispatch;
- private XMLExecutionFactory executionFactory;
-
- /**
- * @param env
- */
- public XMLProcedureExecution(Call procedure, RuntimeMetadata metadata, ExecutionContext context, XMLExecutionFactory executionFactory, Dispatch<Source> dispatch) {
- this.metadata = metadata;
- this.context = context;
- this.procedure = procedure;
- this.dispatch = dispatch;
- this.executionFactory = executionFactory;
- }
-
- /**
- * @see org.teiid.connector.api.ProcedureExecution#execute(org.teiid.connector.language.Call, int)
- */
- public void execute() throws TranslatorException {
-
- AbstractMetadataRecord metaObject = procedure.getMetadataObject();
- String procedureName = metaObject.getNameInSource();
- if (procedureName == null || procedureName.length() == 0) {
- throw new TranslatorException(XMLPlugin.getString("source_name_not_supplied")); //$NON-NLS-1$
- }
-
- // execute the request
- Source result;
- try {
- result = this.dispatch.invoke(buildRequest(procedure.getArguments()));
- } catch (SQLException e1) {
- throw new TranslatorException(e1);
- }
- this.returnValue = this.executionFactory.convertToXMLType(result);
- if (executionFactory.isLogRequestResponseDocs()) {
- try {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, this.returnValue.getString());
- } catch (SQLException e) {
- }
- }
-
- }
-
- Source buildRequest(List<Argument> args) throws SQLException, TranslatorException{
- if (args.size() != 1) {
- throw new TranslatorException("Expected a single argument to the procedure execution"); //$NON-NLS-1$
- }
- Argument arg = args.get(0);
- Object value = arg.getArgumentValue().getValue();
- if (value instanceof SQLXML) {
- return new StreamSource(((SQLXML)value).getCharacterStream());
- } else if (value instanceof Clob) {
- return new StreamSource(((Clob)value).getCharacterStream());
- } else if (value != null) {
- return new StreamSource(new StringReader(value.toString()));
- } else {
- //TODO: work around for JBoss native
- return new StreamSource(new StringReader("<none/>")); //$NON-NLS-1$
- }
- }
-
- @Override
- public List<?> next() throws TranslatorException, DataNotAvailableException {
- if (!returnedResult) {
- returnedResult = true;
- return Arrays.asList(this.returnValue);
- }
- return null;
- }
-
- @Override
- public List<?> getOutputParameterValues() throws TranslatorException {
- throw new TranslatorException(XMLPlugin.getString("No_outputs_allowed")); //$NON-NLS-1$
- }
-
- public void close() {
- // no-op
- }
-
- public void cancel() throws TranslatorException {
- // no-op
- }
-}
Modified: trunk/connectors/translator-xml/src/main/resources/org/teiid/translator/xml/i18n.properties
===================================================================
--- trunk/connectors/translator-xml/src/main/resources/org/teiid/translator/xml/i18n.properties 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/main/resources/org/teiid/translator/xml/i18n.properties 2010-06-08 19:11:59 UTC (rev 2202)
@@ -20,57 +20,3 @@
# 02110-1301 USA.
#
-XMLConnection.update.not.supported=XML update is not supported at this time
-XMLConnection.no.xml.procedures=XML procedures are not supported at this time
-XMLConnection.invalid.execution.mode=Invalid execution mode
-XMLConnector.state.not.set=Cannot create a Connection if the Connector's state is not set
-CriteriaDesc.value.not.found.for.param=Value not found for parameter
-CriteriaDesc.property.not.defaulted=Property value is not properly defaulted. System error.
-CriteriaDesc.allow.empty.not.defaulted=Property value for allowing empty values is not defaulted. System error.
-CriteriaDesc.input.xpath.not.defaulted=Property value for input XPath is not properly defaulted. System error.
-CriteriaDesc.parent.attribute.not.defaulted=Property value for parent attribute flag is not properly defaulted. System error.
-CriteriaDesc.attribute.name.not.defaulted=Property value for attribute name is not properly defaulted. System error.
-Executor.name.in.source.required=Name in source is required for all XMLRequest tables
-Executor.xml.docs.not.found=no XML documents found for processing
-Executor.saxpath.error.on.column=SAXPath error on column-level XPath for column {0}
-Executor.jaxen.error.on.selectsinglenode=Jaxen error on column-level selectSingleNode for column {0}
-Executor.saxpath.error.on.group=SAXPath error on group-level XPath
-Executor.jaxen.error.on.selectnodes=Jaxen error on group-level selectNodes
-Executor.jaxen.error.on.namespace.pairs=Jaxen error on namespace pairs {0} {1}
-Executor.unsupported.compound.xpath=Compound XPaths containing union operators (|) must be delimited by parentheses.
-Executor.default.namespace.not.allowed.in.xpath=Default namespaces not allowed in xpath queries; consider using an explicit prefix (see XPath spec section 2.3)
-Executor.IdTransform.xsl.not.found=Unable to find IdTransform.xsl file for unique ID generation
-Executor.unknown.document.producer=The DocumentProduce is an unknown type. Type is {0}
-OutputXPathDesc.name.in.source.required.on.column=Missing 'name in source' property for output column {0}
-OutputXPathDesc.property.value.not.defaulted=Property value is not properly defaulted. System error.
-XMLConnector.could.not.create.state=could not create state class
-XMLExecution.type.conversion.failure=Data value {0} cannot be converted to {1}. Processing will be terminated.
-XMLExecution.invalid.comparison=The following criteria cannot be executed because values are of different types: {0} = {1}
-DocumentBuilder.could.not.parse.namespaces=could not parse namespaces
-ValueReferenceImpl.ValueChunk.class.not.compatible=Unable to find implementation of ValueChunk for creating a CLOB
-HTTPExecutor.error.building.column=Error building input parameters
-QueryAnalyzer.multiple.responseid.supplied=Multiple different values for Response In field(s) supplied
-QueryAnalyzer.multiple.locations.supplied=Multiple different values for Location field(s) supplied
-document.expired.can.not.recreate=The cached document has expired and the connection factory is set to not recreate it
-HTTPExecutor.root.element.required=All XML requests require a root input element.
-Executor.error.decoding.request.id=Unable to decode request id
-Executor.unable.to.encode.response.id=Unable to encode response id
-HTTPExecutor.unable.to.recreate.request=Unable to recreate the request
-HTTPExecutor.dot.notation.not.allowed=Illegal use of dot notation in input XPaths
-Executor.unable.to.encode.response.id=Unable to serialize request object
-XMLConnector.NoLicense=License not found for XML Connectors
-DocumentBuilder.encoding.type.required=Native types are required when using RPC-encoded or Document-Encoded messages
-document.expired.can.not.recreate=The target document has expired from the cache.
-SecureConnectorState.error.loading.trust.deserializer=An error occured loading the Trust Deserializer class.
-SecureConnectorState.empty.trust.deserializer=The Trust Deserializer field in the connection factory is null or empty.
-SOAPConnectorStateImpl.empty.ENCODING_STYLE_PROPERTY_NAME=The Encoding Style in the connection factory is null or empty.
-SOAPConnectorStateImpl.invalid.ENCODING_STYLE_PROPERTY_NAME=The Encoding Style in the connection factory is not one of the expected values: {0}, {1}, {2}, {3}.
-SOAPConnectorStateImpl.empty.AUTH_USER_PROPERTY_NAME=Authentication is enabled but the Authentication User Name is null or empty.
-SOAPConnectorStateImpl.empty.AUTH_PASSWORD_PROPERTY_NAME=Authentication is enabled but the Authentication Password is null or empty.
-SOAPConnectorStateImpl.empty.CONNECTOR_EXCEPTION_ON_SOAP_FAULT=The Exception On Intra-Query Cache Expiration field in the connection factory is null or empty.
-InputStream_reset_not_supported=Mark/Reset are not supported on the InputStreamFilterClass
-No_outputs_allowed=No output parameter variables are allowed in the xml source connectors.
-source_name_not_supplied=Name In the Source property is not specified for the operation "{0}"; Failed to execute.
-executing_procedure=executing the procedure "{0}"
-file_not_supplied=XML file not found "{0}" for procedure execution "{1}"
-failed_to_generate_xml_request=Failed to generate the XML request input for the execution.
\ No newline at end of file
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/MockQueryPreprocessor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.translator.xml;
-
-import org.teiid.language.Select;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.xml.RequestPreprocessor;
-
-public class MockQueryPreprocessor implements RequestPreprocessor {
-
- public MockQueryPreprocessor() {
- super();
- }
-
- public Select preprocessQuery(Select query, RuntimeMetadata m_metadata, ExecutionContext exeContext) {
- return query;
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/ProxyObjectFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,215 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.io.File;
-import java.io.StringReader;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jdom.Document;
-import org.jdom.input.SAXBuilder;
-import org.mockito.Mockito;
-import org.teiid.language.Select;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-
-import com.metamatrix.cdk.api.TranslationUtility;
-/**
- *
- */
-public class ProxyObjectFactory {
-
- public static final String JMS_DESTINATION = "dynamicQueues/topic1";
- public static final String INITIAL_CONTEXT_FACTORY = "org.apache.activemq.jndi.ActiveMQInitialContextFactory";
- private static String docFolder = null;
-
-
- private ProxyObjectFactory() {
-
- }
-
-
-// public static HTTPManagedConnectionFactory getHTTPTestConnectorEnvironment(Properties props) {
-// if (props == null) {
-// props = getDefaultHTTPProps();
-// }
-// HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
-// PropertiesUtils.setBeanProperties(env, props, null);
-// return env;
-// }
-
- public static ExecutionContext getDefaultSecurityContext() {
- return Mockito.mock(ExecutionContext.class);
- }
-
- public static ExecutionContext getDefaultExecutionContext() {
- ExecutionContext ec = Mockito.mock(ExecutionContext.class);
- Mockito.stub(ec.getRequestIdentifier()).toReturn("request");
- Mockito.stub(ec.getPartIdentifier()).toReturn("testPartId");
-
- return ec;
- }
-
- public static ExecutionContext getExecutionContext(String requestID, String partId) {
- ExecutionContext ec = Mockito.mock(ExecutionContext.class);
- Mockito.stub(ec.getRequestIdentifier()).toReturn(requestID);
- Mockito.stub(ec.getPartIdentifier()).toReturn(partId);
-
- return ec;
- }
-
-
-//
-// public static Properties getDefaultHTTPProps() {
-// Properties testHTTPProps = new Properties();
-// testHTTPProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE.toString());
-// testHTTPProps.setProperty(HTTPConnectorState.URI, "http://localhost:8673"); //$NON-NLS-1$
-// testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60"); //$NON-NLS-1$
-// testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.http.HTTPConnectorState"); //$NON-NLS-1$
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_USER, "");
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_PASSWORD, "");
-// testHTTPProps.setProperty(SecureConnectorState.SECURITY_DESERIALIZER_CLASS, "com.metamatrix.connector.xml.http.DefaultTrustDeserializer");
-// testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_NAME_VALUE);
-// testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD, HTTPConnectorState.GET);
-// return testHTTPProps;
-// }
-
-
-//
-// public static Properties getDefaultNameValueRequestProps() {
-// Properties defaultHTTPProps = getDefaultHttpProps();
-// defaultHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_NAME_VALUE);
-// return defaultHTTPProps;
-// }
-
-// public static Properties getDefaultHttpProps() {
-// Properties testHTTPProps = new Properties();
-// testHTTPProps.put(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE);
-// testHTTPProps.put(XMLConnectorStateImpl.CONNECTOR_CAPABILITES, "com.metamatrix.connector.xml.base.XMLCapabilities");
-// testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.http.HTTPConnectorState");
-// testHTTPProps.setProperty(XMLConnectorStateImpl.QUERY_PREPROCESS_CLASS, "com.metamatrix.connector.xml.base.NoQueryPreprocessing");
-// testHTTPProps.setProperty(XMLConnectorStateImpl.SAX_FILTER_PROVIDER_CLASS, "com.metamatrix.connector.xml.base.NoExtendedFilters");
-// testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD, HTTPConnectorState.GET);
-// testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_XML_REQUEST);
-// testHTTPProps.setProperty(HTTPConnectorState.URI, "http://0.0.0.0:8673");
-// //testHTTPProps.setProperty(HTTPConnectorState.PROXY_URI, "http://0.0.0.0:8673");
-// testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60");
-// testHTTPProps.setProperty(HTTPConnectorState.XML_PARAMETER_NAME, "XMLRequest");
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_USER, "");
-// testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_PASSWORD, "");
-// testHTTPProps.setProperty(SecureConnectorState.SECURITY_DESERIALIZER_CLASS, "com.metamatrix.connector.xml.http.DefaultTrustDeserializer");
-// return testHTTPProps;
-// }
-
-
-
-
-// public static XMLConnector getDefaultXMLConnector() {
-// XMLConnector conn;
-// try {
-// conn = new XMLConnector();
-// conn.initialize(getDefaultTestConnectorEnvironment());
-// } catch (ConnectorException ce) {
-// ce.printStackTrace();
-// conn = null;
-// }
-// return conn;
-// }
-
-// public static XMLConnector getDefaultHTTPConnector(Properties props) {
-// XMLConnector conn;
-// try {
-// conn = new XMLConnector();
-// conn.initialize(getHTTPTestConnectorEnvironment(props));
-// } catch (ConnectorException ce) {
-// ce.printStackTrace();
-// conn = null;
-// }
-// return conn;
-// }
-//
-// public static XMLConnectionImpl getDefaultXMLConnection() {
-// XMLConnectionImpl connection;
-// try {
-// ExecutionContext ctx = getDefaultSecurityContext();
-// connection = (XMLConnectionImpl) getDefaultXMLConnector().getConnection();
-// } catch (ConnectorException ce) {
-// connection = null;
-// } catch (NullPointerException ne) {
-// connection = null;
-// }
-// return connection;
-// }
-//
-// private static XMLConnectionImpl getHTTPXMLConnection(Properties props) {
-// XMLConnectionImpl connection;
-// try {
-// ExecutionContext ctx = getDefaultSecurityContext();
-// connection = (XMLConnectionImpl) getDefaultHTTPConnector(props).getConnection();
-// } catch (ConnectorException ce) {
-// connection = null;
-// } catch (NullPointerException ne) {
-// connection = null;
-// }
-// return connection;
-// }
-
-
- public static Select getDefaultIQuery(String vdbPath, String queryString) {
- TranslationUtility transUtil = new TranslationUtility(vdbPath);
- Select query = (Select) transUtil.parseCommand(queryString);
- return query;
- }
-
- public static RuntimeMetadata getDefaultRuntimeMetadata(String vdbPath) {
- TranslationUtility transUtil = new TranslationUtility(vdbPath);
- RuntimeMetadata meta = transUtil.createRuntimeMetadata();
- return meta;
- }
-
- public static Document getDefaultDocument() throws Exception {
- Document doc = null;
- SAXBuilder builder = new SAXBuilder();
- StringReader reader = new StringReader("<foo><bar>baz</bar></foo>");
- doc = builder.build(reader);
- return doc;
- }
-
- public static String getStateCollegeVDBLocation() {
- return getDocumentsFolder() + "/UnitTests.vdb";
- }
-
- public static String getDocumentsFolder() {
- //is the test running locally or in CruiseControl?
- if (docFolder == null) {
- URL url = ProxyObjectFactory.class.getClassLoader().getResource("documents");
- try {
- docFolder = new File(url.toURI()).toString();
- } catch (URISyntaxException e) {
- }
- }
- return docFolder;
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCartesianCriteriaGenerator.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,119 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.xml;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.Test;
-import org.teiid.metadata.Column;
-
-
-@SuppressWarnings("nls")
-public class TestCartesianCriteriaGenerator {
-
- @Test
- public void testCartesian() throws Exception {
- String[] validValues = {"ACE", "ADE", "BCE", "BDE", "ACF", "ADF", "BCF", "BDF"};
-
- List<CriteriaDesc> list = new ArrayList<CriteriaDesc>();
-
- Column c1 = new Column();
- c1.setName("c1");
-
- Column c2 = new Column();
- c2.setName("c2");
-
- Column c3 = new Column();
- c3.setName("c3");
-
- CriteriaDesc desc1 = new CriteriaDesc(c1, Arrays.asList(new String[] {"A", "B"}));
- CriteriaDesc desc2 = new CriteriaDesc(c2, Arrays.asList(new String[] {"C", "D"}));
- CriteriaDesc desc3 = new CriteriaDesc(c3, Arrays.asList(new String[] {"E", "F"}));
- list.add(desc1);
- list.add(desc2);
- list.add(desc3);
-
- List<List<CriteriaDesc>> catesianProduct = CartesienCriteriaGenerator.generateCartesianCriteria(list);
-
- assertEquals(8, catesianProduct.size());
- for (List<CriteriaDesc> cds:catesianProduct) {
- assertEquals(3, cds.size());
-
- String value = "";
- for (CriteriaDesc cd:cds) {
- List values = cd.getValues();
- for (Object v:values) {
- value = value+v.toString();
- }
- }
- assertTrue(Arrays.asList(validValues).contains(value));
- }
- }
-
-
- @Test
- public void testCartesianWithMultiValue() throws Exception {
- // the brackets represent the grouping, how they come as multi values.
- String[] validValues = {"[A][C][EF]", "[A][D][EF]", "[B][C][EF]", "[B][D][EF]"};
-
- List<CriteriaDesc> list = new ArrayList<CriteriaDesc>();
-
- Column c1 = new Column();
- c1.setName("c1");
-
- Column c2 = new Column();
- c2.setName("c2");
-
- // make this column takes multi values
- Column c3 = new Column();
- c3.setName("c3");
- c3.setProperty(CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME, CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_MULTI_ELEMENT_NAME);
-
- CriteriaDesc desc1 = new CriteriaDesc(c1, Arrays.asList(new String[] {"[A]", "[B]"}));
- CriteriaDesc desc2 = new CriteriaDesc(c2, Arrays.asList(new String[] {"[C]", "[D]"}));
- CriteriaDesc desc3 = new CriteriaDesc(c3, Arrays.asList(new String[] {"[E", "F]"}));
- list.add(desc1);
- list.add(desc2);
- list.add(desc3);
-
- List<List<CriteriaDesc>> catesianProduct = CartesienCriteriaGenerator.generateCartesianCriteria(list);
-
- assertEquals(4, catesianProduct.size());
- for (List<CriteriaDesc> cds:catesianProduct) {
- assertEquals(3, cds.size());
-
- String value = "";
- for (CriteriaDesc cd:cds) {
- List values = cd.getValues();
- for (Object v:values) {
- value = value+v.toString();
- }
- }
- assertTrue(Arrays.asList(validValues).contains(value));
- }
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestCriteriaDesc.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,608 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.BaseInCondition;
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Comparison;
-import org.teiid.language.Condition;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.LanguageUtil;
-import org.teiid.language.Select;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.CriteriaDesc;
-
-
-/**
- *
- */
-public class TestCriteriaDesc extends TestCase {
-
- private static String vdbPath;
- private static final String QUERY = "select RequiredDefaultedParam from CriteriaDescTable " //$NON-NLS-1$
- + "where RequiredDefaultedParam in ('foo') order by RequiredDefaultedParam"; //$NON-NLS-1$
- private static final String VALUE = "value1"; //$NON-NLS-1$
-
-
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
- public void testGetCriteriaDescForColumn() throws Exception {
- //case 1: values provided
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnDefaultedValue() throws Exception {
- //case 2: param, required, defaulted
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnNoCriteria() throws Exception {
- //case 3: param, not required, not defaulted, not allowed empty
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select OptionalNotAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNull("CriteriaDesc is not null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnAllowEmpty() throws Exception {
- //case 4: param, not required, not defaulted, allowed empty
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select OptionalAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- final int colLocation = 0;
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnError() {
- //case 5: param, required, not defaulted
- try {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredUndefaultedParam from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- fail("exception not thrown"); //$NON-NLS-1$
- } catch (TranslatorException ce) {
- }
- }
-
- public void testGetCriteriaDescForColumnNotParam() throws Exception {
- //case 6: not a param
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select OutputColumn from CriteriaDescTable"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNull("CriteriaDesc is not null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnCompare() throws Exception {
- //case 7: compare criteria
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam = 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
-
- public void testGetCriteriaDescForColumnMultiElement() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select MultiElementParam from CriteriaDescTable where MultiElementParam in ('foo','bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnDelimited() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select DelimitedParam from CriteriaDescTable where DelimitedParam in ('foo','bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLikeSearchable() {
- try {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select LikeSearchableParam from CriteriaDescTable where LikeSearchableParam in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- fail("should not be able to handle default value"); //$NON-NLS-1$
- } catch (TranslatorException ce) {
- }
- }
-
- public void testGetCriteriaDescForColumnUnlikeSearchable() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select UnlikeSearchableParam from CriteriaDescTable where UnlikeSearchableParam in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- }
-
- public void testGetCriteriaDescForColumnUnsearchable() {
- try {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select UnsearchableParam from CriteriaDescTable where UnsearchableParam in ('foo','bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- String multiplicityStr = elem.getProperties().get(
- CriteriaDesc.PARM_HAS_MULTIPLE_VALUES_COLUMN_PROPERTY_NAME);
- CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- fail("should not be able to handle default value"); //$NON-NLS-1$
- } catch (TranslatorException ce) {
- }
- }
-
- public void testGetCriteriaDescForColumnLike() throws Exception {
- //case 1: values provided
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam like 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnNotEquals() throws Exception {
- //case 1: values provided
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam != 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where concat(RequiredDefaultedParam, 'bar') in('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnNameMatchFailure() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where AttributeParam in('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
-
- public void testGetCriteriaDescForColumnLeftLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable " //$NON-NLS-1$
- + "where concat('bar', 'foo') = concat('bar', RequiredDefaultedParam)"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnTwoElements() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where OutputColumn = RequiredDefaultedParam"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLeftElementEqualsLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where AttributeParam = 'foo'"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetCriteriaDescForColumnLeftElementEqualsNonLiteral() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select RequiredDefaultedParam from CriteriaDescTable where" //$NON-NLS-1$
- + " RequiredDefaultedParam = concat('foo', OutputColumn)"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertNotNull("CriteriaDesc is null", desc); //$NON-NLS-1$
- }
-
- public void testGetInputXPathNoXpath() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select BadNoInputXpath from CriteriaDescTable where BadNoInputXpath in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals(desc.getColumnName(), desc.getInputXpath());
- }
-
-
- public void testGetInputXPathEmptyXpath() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select BadEmptyInputXPath from CriteriaDescTable where BadEmptyInputXPath in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals(desc.getColumnName(), desc.getInputXpath());
- }
-
- public void testGetDataAttributeNameEmptyName() throws Exception {
- assertNotNull("vdb path is null", vdbPath); //$NON-NLS-1$
- String query = "select BadNoDataAttributeName from CriteriaDescTable where BadNoDataAttributeName in ('foo')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals("", desc.getDataAttributeName()); //$NON-NLS-1$
- }
-
- public void testGetInputXpath() throws TranslatorException {
- String query = "select RequiredDefaultedParam from CriteriaDescTable"; //$NON-NLS-1$
- String inputXPath = "/req/default/value"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- assertNotNull("CriteriaDesc is null", desc.getInputXpath()); //$NON-NLS-1$
- assertEquals(inputXPath, desc.getInputXpath());
- }
-
- public void testIsUnlimited() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("Criteria is flagged as unlimited", desc.isUnlimited()); //$NON-NLS-1$
- }
-
- public void testIsAutoIncrement() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("criterion is flagged as autoIncrement", desc.isAutoIncrement()); //$NON-NLS-1$
- }
-
- public void testIsParentAttribute() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- //before its inited
- assertFalse("criterion is flagged as an attribute", desc.isParentAttribute()); //$NON-NLS-1$
- //and after for code coverage
- assertFalse("criterion is flagged as an attribute", desc.isParentAttribute()); //$NON-NLS-1$
- }
-
- public void testIsEnumeratedAttribute() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("criterion is an enumerated attribute", desc.isEnumeratedAttribute()); //$NON-NLS-1$
- }
-
- public void testAllowEmptyValueFalse() throws TranslatorException {
- String query = "select OptionalNotAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- assertFalse("criterion should not allow for empty values", desc.allowEmptyValue()); //$NON-NLS-1$
- }
-
- public void testAllowEmptyValueTrue() throws TranslatorException {
- String query = "select OptionalAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- //before init
- assertTrue("criterion should allow for empty values", desc.allowEmptyValue()); //$NON-NLS-1$
- //and after for code coverage
- assertTrue("criterion should allow for empty values", desc.allowEmptyValue()); //$NON-NLS-1$
- }
-
- public void testIsDataInAttributeFalse() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertFalse("criterion is flagged as data in attribute", desc.isDataInAttribute()); //$NON-NLS-1$
- }
-
- public void testIsDataInAttributeTrue() throws TranslatorException {
- String query = "select AttributeParam from CriteriaDescTable where AttributeParam in ('foo')"; //$NON-NLS-1$
- CriteriaDesc desc = createCriteriaDesc(query);
- assertTrue("criterion is not flagged as data in attribute", desc.isDataInAttribute()); //$NON-NLS-1$
- }
-
- public void testGetDataAttributeName() throws TranslatorException {
- String query = "select AttributeColumn from TestTable where AttributeColumn in ('foo')"; //$NON-NLS-1$
- Column elem = getElement(query);
- String attributeName = "myAttribute"; //$NON-NLS-1$
- ArrayList list = new ArrayList();
- list.add(VALUE);
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertNotNull("CriteriaDesc is null", desc.getDataAttributeName()); //$NON-NLS-1$
- assertTrue("column name mismatch - expected " + attributeName //$NON-NLS-1$
- + " returned " + desc.getDataAttributeName(), //$NON-NLS-1$
- desc.getDataAttributeName().equals(attributeName));
- }
-
- public void testGetValues() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- List values = desc.getValues();
- assertNotNull("Values list is null", values); //$NON-NLS-1$
- assertEquals(values.get(0), VALUE);
- }
-
- public void testGetNumberOfValues() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertEquals(1, desc.getNumberOfValues());
- }
-
- public void testGetCurrentIndexValue() throws TranslatorException {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- assertEquals(VALUE, desc.getCurrentIndexValue());
- }
-
- public void testGetCurrentIndexValueEnumerated() throws Exception {
- String query = "select DelimitedParam from CriteriaDescTable where DelimitedParam in ('foo', 'bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertEquals("There should be two values" , 2, desc.getNumberOfValues()); //$NON-NLS-1$
- assertEquals("foo", desc.getCurrentIndexValue()); //$NON-NLS-1$
- desc.incrementIndex();
- assertEquals("bar", desc.getCurrentIndexValue()); //$NON-NLS-1$
- }
-
- public void testIncrementIndexEnumerated() throws Exception {
- String query = "select DelimitedParam from CriteriaDescTable where DelimitedParam in ('foo', 'bar')"; //$NON-NLS-1$
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- RuntimeMetadata metadata = ProxyObjectFactory.getDefaultRuntimeMetadata(vdbPath);
- Column elem = ((ColumnReference) expr).getMetadataObject();
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, iquery);
- assertTrue("We should be able to increment this CriteriaDesc", desc.incrementIndex()); //$NON-NLS-1$
- }
-
- public void testGetCurrentIndexValueNoValue() throws Exception {
- final String query = "select OptionalAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertEquals("", desc.getCurrentIndexValue()); //$NON-NLS-1$
- }
-
- public void testGetCurrentIndexValueNoValueNotEmpty() throws Exception {
- final String query = "select OptionalNotAllowedEmptyParam from CriteriaDescTable"; //$NON-NLS-1$
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertNull(desc.getCurrentIndexValue());
- }
-
- public void testIncrementIndex() throws Exception {
- final String value2 = "value2"; //$NON-NLS-1$
- String query = "select MultiCol from MultiTable where MultiCol in ('" + VALUE + "', '" + value2 + "')"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- list.add(VALUE);
- list.add(value2);
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- assertEquals(VALUE, desc.getCurrentIndexValue());
- assertTrue("index increment failed", desc.incrementIndex()); //$NON-NLS-1$
- assertEquals(value2, desc.getCurrentIndexValue());
- assertFalse("index went beyond number of values", desc.incrementIndex()); //$NON-NLS-1$
- }
-
- public void testResetIndex() throws Exception {
- CriteriaDesc desc = createCriteriaDesc(QUERY);
- desc.resetIndex();
- }
-
- public void testNameMatch() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- Condition crit = query.getWhere();
- List criteriaList = LanguageUtil.separateCriteriaByAnd(crit);
- Iterator criteriaIter = criteriaList.iterator();
- Expression expr = null;
- while (criteriaIter.hasNext()) {
- Condition criteriaSeg = (Condition) criteriaIter.next();
- if (criteriaSeg instanceof Comparison) {
- Comparison compCriteria = (Comparison) criteriaSeg;
- expr = compCriteria.getLeftExpression();
- break;
- } else if (criteriaSeg instanceof BaseInCondition) {
- expr = ((BaseInCondition) criteriaSeg).getLeftExpression();
- break;
- }
- }
- final String column = "CriteriaDescTable.RequiredDefaultedParam"; //$NON-NLS-1$
- assertTrue("column name mismatch - expected " + column + " returned " + expr, //$NON-NLS-1$ //$NON-NLS-2$
- CriteriaDesc.nameMatch(expr, column));
- }
-
- public void testStringifyCriteria() {
- String withQuotes = "'foodle doodle'"; //$NON-NLS-1$
- String withoutQuotes = "foodle doodle"; //$NON-NLS-1$
- assertEquals("stringify failed", withoutQuotes, CriteriaDesc.stringifyCriteria(withQuotes)); //$NON-NLS-1$
- }
-
- public void testStringifyCriteriaDoubleQuotes() {
- String control = "foodle doodle"; //$NON-NLS-1$
- String test = "\"foodle doodle\""; //$NON-NLS-1$
- assertEquals("stringify failed", control, CriteriaDesc.stringifyCriteria(test)); //$NON-NLS-1$
- }
-
- public void testStringifyCriteriaSingleQuote() {
- String test = "'ello govnor."; //$NON-NLS-1$
- assertEquals("stringify failed", test, CriteriaDesc.stringifyCriteria(test)); //$NON-NLS-1$
- }
-
- public void testStringifyCriteriaSingleDoubleQuote() {
- String test = "\"ello govnor."; //$NON-NLS-1$
- assertEquals("stringify failed", test, CriteriaDesc.stringifyCriteria(test)); //$NON-NLS-1$
- }
-
-
- public void testBadTableSelect() throws TranslatorException {
- String tempVdbpath = vdbPath;
- vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/UnitTests.vdb"; //$NON-NLS-1$
- try {
- createCriteriaDesc("select BadCol1 from BadTable"); //$NON-NLS-1$
- } finally {
- vdbPath = tempVdbpath;
- }
- }
-
- public void testElementAllowsEmpty() throws TranslatorException {
- String tempVdbpath = vdbPath;
- vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/UnitTests.vdb"; //$NON-NLS-1$
- String strQuery = "Select Balance from Response"; //$NON-NLS-1$
- try {
- Column elem = getElement(strQuery);
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- CriteriaDesc desc = CriteriaDesc.getCriteriaDescForColumn(elem, query);
- } finally {
- vdbPath = tempVdbpath;
- }
- }
-
-
- private CriteriaDesc createCriteriaDesc(String query) throws TranslatorException {
- Column elem = getElement(query);
- ArrayList list = new ArrayList();
- list.add(VALUE);
- CriteriaDesc desc = new CriteriaDesc(elem, list);
- return desc;
- }
-
- private Column getElement(String query) throws TranslatorException {
- return getElement(query, 0);
- }
-
- private Column getElement(String query, int colLocation)
- throws TranslatorException {
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- Column elem = ((ColumnReference) expr).getMetadataObject();
- return elem;
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestElementCollector.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestElementCollector.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestElementCollector.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,82 +0,0 @@
-package org.teiid.translator.xml;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLXML;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.teiid.core.types.InputStreamFactory;
-import org.teiid.core.types.SQLXMLImpl;
-import org.teiid.language.Select;
-import org.teiid.translator.xml.streaming.ElementProcessor;
-import org.teiid.translator.xml.streaming.ReaderFactory;
-import org.teiid.translator.xml.streaming.StreamingRowCollector;
-
-
-@SuppressWarnings("nls")
-public class TestElementCollector extends TestCase {
-
- StreamingRowCollector builder;
- String filename = ProxyObjectFactory.getDocumentsFolder() + "/purchaseOrders.xml";
- String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/File/purchase_orders.vdb";
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Map prefixes = new HashMap<String, String>();
- prefixes.put("po", "http://www.example.com/PO1");
- prefixes.put("xsd", "http://www.w3.org/2001/XMLSchema");
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, "SELECT * FROM po_list.ITEM");
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- ExecutionInfo info = analyzer.getExecutionInfo();
- ElementProcessor processor = new ElementProcessor(info);
- builder = new StreamingRowCollector(prefixes, ReaderFactory.getXMLReader(null), processor);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- builder = null;
- }
-
- public void testGetTables1() {
- String path = "/po:purchaseOrders/order/items/item";
- int itemCount = 5968;
- try {
- StremableDocument doc = new StremableDocument(getSQLXML(new FileInputStream(filename)), "foo");
- List result = builder.getElements(doc, Arrays.asList(path));
- assertEquals(itemCount, result.size());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-
- public void testGetRoot() {
- String path = "/";
- int itemCount = 1;
- try {
- StremableDocument doc = new StremableDocument(getSQLXML(new FileInputStream(filename)), "foo");
- List result = builder.getElements(doc, Arrays.asList(path));
- assertEquals(itemCount, result.size());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-
- SQLXML getSQLXML(final InputStream in) {
- InputStreamFactory isf = new InputStreamFactory("ISO-8859-1") {
- @Override
- public InputStream getInputStream() throws IOException {
- return in;
- }
- };
- return new SQLXMLImpl(isf);
- }
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestExecutionInfo.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,191 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.Select;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.ExecutionInfo;
-import org.teiid.translator.xml.QueryAnalyzer;
-
-/**
- *
- */
-public class TestExecutionInfo extends TestCase {
-
- /**
- * Constructor for ExecutionInfoTest.
- * @param arg0
- */
-
- private static final String QUERY = "select Company_id from Company where Company_id = 'MetaMatrix' order by Company_id";
-
- private ExecutionInfo m_info;
-
- //removing hansel while testing clover
-/*
- public static Test suite() {
- return new CoverageDecorator(ExecutionInfoTest.class, new Class[] {ExecutionInfo.class});
-
- }
-*/
-
- public TestExecutionInfo(String arg0) {
- super(arg0);
- }
-
- @Override
- public void setUp() throws TranslatorException {
- String vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- m_info = analyzer.getExecutionInfo();
-
- }
-
- @Override
- public void tearDown() {
- m_info = null;
- }
-
- public void testExecutionInfo() {
- ExecutionInfo info = new ExecutionInfo();
- assertNotNull("ExecutionInfo is null", info);
- assertEquals(0, info.getColumnCount());
- assertNotNull(info.getCriteria());
- assertNotNull(info.getOtherProperties());
- assertNotNull(info.getParameters());
- assertNotNull(info.getRequestedColumns());
- assertNotNull(info.getTableXPath());
- }
-
- public void testGetTableXPath() {
- assertEquals("/Mydata/company", m_info.getTableXPath());
- }
-
- public void testGetRequestedColumns() {
- List columns = m_info.getRequestedColumns();
- assertNotNull("requestedColumns list is null", columns);
- assertEquals(1, columns.size());
- }
-
- public void testGetColumnCount() {
- assertEquals(1, m_info.getColumnCount());
- }
-
- public void testGetParameters() {
- List params = m_info.getParameters();
- assertNotNull("Param list is null", params);
- assertEquals(0, params.size());
- }
-
- public void testGetCriteria() {
- String vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- //String query = "Select AttributeColumn from TestTable where AttributeColumn in ('foo')";
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(iquery);
- analyzer.analyze();
- ExecutionInfo info = analyzer.getExecutionInfo();
- List crits = info.getCriteria();
- assertNotNull("Criteria list is null", crits);
- assertEquals(1, crits.size());
- } catch (TranslatorException ce) {
- ce.printStackTrace();
- fail(ce.getMessage());
- }
- }
-
- public void testGetOtherProperties() throws TranslatorException {
- String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/UnitTests.vdb";
- String strQuery = "select * from Response";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- ExecutionInfo info = analyzer.getExecutionInfo();
- Map<String, String> props = info.getOtherProperties();
- assertFalse("properties are empty", props.isEmpty());
- info.setOtherProperties(null);
- assertNotNull(info.getOtherProperties());
- }
-
- public void testSetTableXPath() {
- String xpath = "/new/path";
- m_info.setTableXPath(xpath);
- assertEquals(xpath, m_info.getTableXPath());
- m_info.setTableXPath("");
- assertNull(m_info.getTableXPath());
- }
-
- public void testSetRequestedColumns() {
- String reqCol = "Company_id";
- ArrayList reqCols = new ArrayList();
- reqCols.add(reqCol);
- m_info.setRequestedColumns(reqCols);
- assertEquals(reqCol, m_info.getRequestedColumns().get(0));
- }
-
- public void testSetColumnCount() {
- final int count = 3;
- m_info.setColumnCount(count);
- assertEquals(count, m_info.getColumnCount());
-
- }
-
- public void testSetParameters() {
- String param = "[Company_id]";
- ArrayList params = new ArrayList();
- params.add(param);
- m_info.setParameters(params);
- assertEquals(param, m_info.getParameters().get(0));
- }
-
- public void testSetCriteria() {
- String crit = "Company_id";
- ArrayList crits = new ArrayList();
- crits.add(crit);
- m_info.setParameters(crits);
- assertEquals(crit, m_info.getParameters().get(0));
- }
-
- public void testSetOtherProperties() {
- String prop = "myProp";
- String key = "foo";
- Map<String, String> props = new HashMap<String, String>();
- props.put(key, prop);
- m_info.setOtherProperties(props);
- assertEquals(prop, m_info.getOtherProperties().get(key));
-
- m_info.setOtherProperties(null);
- assertNotNull("OtherProerties was set to null", m_info.getOtherProperties());
- assertEquals(0, m_info.getOtherProperties().size());
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestOutputXPathDesc.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,172 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Comparison;
-import org.teiid.language.Condition;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.LanguageUtil;
-import org.teiid.language.Literal;
-import org.teiid.language.Select;
-import org.teiid.metadata.Column;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.OutputXPathDesc;
-
-
-/**
- *
- */
-public class TestOutputXPathDesc extends TestCase {
-
-
- private static String vdbPath;
- private static final String QUERY = "select OutputColumn from CriteriaDescTable where"
- + " OutputColumn in ('foo') order by OutputColumn";
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
-// removing hansel while testing clover
-
-/*
- public static Test suite() {
- return new CoverageDecorator(OutputXPathDescTest.class, new Class[] {OutputXPathDesc.class});
- }
-*/
-
- /**
- * Constructor for OutputXPathDescTest.
- * @param arg0
- */
- public TestOutputXPathDesc(String arg0) {
- super(arg0);
- }
-
- /*
- * Class under test for void OutputXPathDesc(Element)
- */
- public void testOutputXPathDescElement() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- assertNull(desc.getCurrentValue());
- assertNotNull(desc.getDataType());;
- }
-
- public void testOutputXPathDescParam() throws Exception {
- String query = "select RequiredDefaultedParam from CriteriaDescTable where RequiredDefaultedParam in ('foo')";
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- assertNotNull("OutputXPathDesc is null", desc);
- }
-
-
- public void testOutputXPathDescNoXPath() throws Exception {
- try {
- String query = "select OutputColumnNoXPath from CriteriaDescTable";
- Select iquery = ProxyObjectFactory.getDefaultIQuery(vdbPath, query);
- final int colLocation = 0;
- DerivedColumn symbol = (DerivedColumn) iquery.getDerivedColumns().get(colLocation);
- Expression expr = symbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- fail("should not be able to create OuputXPathDesc with no XPath");
- } catch (TranslatorException ce) {
- return;
- }
- }
- /*
- * Class under test for void OutputXPathDesc(ILiteral)
- */
- public void testOutputXPathDescILiteral() throws Exception {
- String strLiteral = "MetaMatrix";
- String strQuery = "Select Company_id from Company where Company_id = '" + strLiteral + "'";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- Condition crits = query.getWhere();
- List criteriaList = LanguageUtil.separateCriteriaByAnd(crits);
- Comparison compCriteria = (Comparison) criteriaList.get(0);
- Literal literal = (Literal) compCriteria.getRightExpression();
- OutputXPathDesc desc = new OutputXPathDesc(literal);
- assertNotNull(desc);
- assertEquals(strLiteral, desc.getCurrentValue().toString());
- assertEquals(strLiteral.getClass(), desc.getDataType());
- }
-
- public void testOutputXPathDescILiteralNullValue() throws Exception {
- String strLiteral = "MetaMatrix";
- String strQuery = "Select Company_id from Company where Company_id = '" + strLiteral + "'";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- Condition crits = query.getWhere();
- List criteriaList = LanguageUtil.separateCriteriaByAnd(crits);
- Comparison compCriteria = (Comparison) criteriaList.get(0);
- Literal literal = (Literal) compCriteria.getRightExpression();
- literal.setValue(null);
- OutputXPathDesc desc = new OutputXPathDesc(literal);
- assertNotNull(desc);
- assertNull(desc.getCurrentValue());
- assertEquals(strLiteral.getClass(), desc.getDataType());
- }
-
- public void testSetAndGetCurrentValue() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- String myVal = "myValue";
- desc.setCurrentValue(myVal);
- assertEquals(myVal, desc.getCurrentValue());
- }
-
- public void testGetDataType() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- OutputXPathDesc desc = new OutputXPathDesc(element);
- assertNotNull(desc.getDataType());
- assertEquals(String.class, desc.getDataType());
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestParameterDescriptor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,200 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.Select;
-import org.teiid.metadata.Column;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.ParameterDescriptor;
-
-
-/**
- *
- */
-public class TestParameterDescriptor extends TestCase {
-
- private static String vdbPath;
- private static final String QUERY = "select OutputColumn from CriteriaDescTable where"
- + " OutputColumn in ('MetaMatrix') order by OutputColumn";
-
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
-
-// removing hansel while testing clover
-/*
- public static Test suite() {
- return new CoverageDecorator(ParameterDescriptorTest.class, new Class[] {ParameterDescriptor.class});
- }
-
-*/
- /**
- * Constructor for ParameterDescriptorTest.
- * @param arg0
- */
- public TestParameterDescriptor(String arg0) {
- super(arg0);
- }
-
- /*
- * Class under test for void ParameterDescriptor(Element)
- */
- public void testParameterDescriptorElement() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- }
-
-
- public void testParameterDescriptorElementParameter() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, "select RequiredDefaultedParam from CriteriaDescTable");
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- }
-
-
-
- public void testParameterDescriptorElementSpaceXPath() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, "select OutputColumnSpaceXPath from CriteriaDescTable");
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- }
-
- /*
- * Class under test for void ParameterDescriptor(ILiteral)
- */
- public void testParameterDescriptor() {
- ParameterDescriptor desc = new ParameterDescriptorImpl();
- assertNotNull(desc);
- assertNull(desc.getXPath());
- assertFalse(desc.isParameter());
- assertNull(desc.getColumnName());
- }
-
- public void testSetGetXPath() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- String xpath = "/foo";
- desc.setXPath(xpath);
- assertEquals(xpath, desc.getXPath());
- }
-
- public void testSetIsParameter() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- boolean is = !desc.isParameter();
- desc.setIsParameter(is);
- assertEquals(is, desc.isParameter());
- }
-
- public void testSetGetColumnName() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- String name = "myColumn";
- desc.setColumnName(name);
- assertEquals(name, desc.getColumnName());
- }
-
- public void testSetGetColumnNumber() throws Exception {
- ParameterDescriptor desc = getParameterDescriptor();
- int number = desc.getColumnNumber() + 1;
- desc.setColumnNumber(number);
- assertEquals(number, desc.getColumnNumber());
- }
-
- public void testGetElement() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertEquals(element, desc.getElement());
- }
-
- public void testTestForParam() throws Exception {
- String trueQuery = "select EmptyCol from EmptyTable where EmptyCol = 'foo'";
- String falseQuery = "select Company_id from Company";
-
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, trueQuery);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- assertTrue(ParameterDescriptor.testForParam(element));
-
- query = ProxyObjectFactory.getDefaultIQuery(vdbPath, falseQuery);
- symbols = query.getDerivedColumns();
- selectSymbol = (DerivedColumn) symbols.get(0);
- expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- element = ((ColumnReference) expr).getMetadataObject();
- assertFalse(ParameterDescriptor.testForParam(element));
- }
-
- private ParameterDescriptor getParameterDescriptor() throws Exception {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- List symbols = query.getDerivedColumns();
- DerivedColumn selectSymbol = (DerivedColumn) symbols.get(0);
- Expression expr = selectSymbol.getExpression();
- assertTrue(expr instanceof ColumnReference);
- Column element = ((ColumnReference) expr).getMetadataObject();
- ParameterDescriptor desc = new ParameterDescriptorImpl(element);
- assertNotNull(desc);
- return desc;
- }
-
- private class ParameterDescriptorImpl extends ParameterDescriptor {
- public ParameterDescriptorImpl() {
- super();
- }
-
- public ParameterDescriptorImpl(Column element) throws TranslatorException {
- super(element);
- }
-
- }
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestQueryAnalyzer.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,165 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-
-
-import junit.framework.TestCase;
-
-import org.teiid.language.Select;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.xml.ExecutionInfo;
-import org.teiid.translator.xml.QueryAnalyzer;
-
-/**
- *
- */
-public class TestQueryAnalyzer extends TestCase {
-
- private static String vdbPath;
- private static final String QUERY = "select SimpleOutput from SimpleTable where SimpleOutput = 'MetaMatrix' order by SimpleOutput";
-
- static {
- vdbPath = ProxyObjectFactory.getStateCollegeVDBLocation();
- }
-
-// removing hansel while testing clover
-/*
- public static Test suite() {
- return new CoverageDecorator(QueryAnalyzerTest.class, new Class[] {QueryAnalyzer.class});
- }
-
-*/
- /**
- * Constructor for QueryAnalyzerTest.
- * @param arg0
- */
- public TestQueryAnalyzer(String arg0) {
- super(arg0);
- }
-
- public void testQueryAnalyzer() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- assertNotNull("analyzer is null", analyzer);
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyze() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeSimpleSelect() {
- String strQuery = "select SimpleOutput from SimpleTable";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeLiteralSelect() {
- String strQuery = "select SimpleOutput, 'foo' from SimpleTable";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeFunctionSelect() {
- String strQuery = "select concat(SimpleOutput, 'foo') from SimpleTable";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeParameterSelect() {
- String strQuery = "select SimpleParam from SimpleInput where SimpleParam in ('foo')";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeComplexQuery() {
- String strQuery = "select SimpleOut from SimpleInput where SimpleParam in ('foo')";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAnalyzeComplexQuery2() {
- String strQuery = "select SimpleOut from SimpleInput where SimpleParam in ('foo') and OtherOut in ('bar')";
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, strQuery);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- analyzer.analyze();
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
- }
-
- public void testGetExecutionInfo() {
- Select query = ProxyObjectFactory.getDefaultIQuery(vdbPath, QUERY);
- try {
- QueryAnalyzer analyzer = new QueryAnalyzer(query);
- assertNotNull("analyzer is null", analyzer);
- ExecutionInfo base = analyzer.getExecutionInfo();
- assertEquals(1, base.getColumnCount());
- analyzer.analyze();
- ExecutionInfo post = analyzer.getExecutionInfo();
- assertTrue(post.getColumnCount() > 0);
- assertEquals(1, post.getCriteria().size());
- assertEquals(1, post.getRequestedColumns().size());
- assertNotNull(post.getTableXPath());
- } catch (TranslatorException e) {
- fail(e.getMessage());
- }
-
- }
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLCapabilities.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,195 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.xml;
-
-import org.teiid.translator.xml.XMLExecutionFactory;
-
-import junit.framework.TestCase;
-
-
-/**
- *
- */
-public class TestXMLCapabilities extends TestCase {
-
-
- private XMLExecutionFactory m_caps = null;
- /**
- * Constructor for XMLCapabilitiesTest.
- * @param arg0
- */
- public TestXMLCapabilities(String arg0) {
- super(arg0);
- }
-
- @Override
- public void setUp() {
- m_caps = new XMLExecutionFactory();
-
- }
-
- public void testGetMaxInCriteriaSize() {
- assertEquals(Integer.MAX_VALUE, m_caps.getMaxInCriteriaSize());
- }
-
- public void testSupportsCompareCriteriaEquals() {
- assertTrue(m_caps.supportsCompareCriteriaEquals());
- }
-
- public void testSupportsInCriteria() {
- assertTrue(m_caps.supportsInCriteria());
- }
-
- public void testXMLCapabilities() {
- XMLExecutionFactory caps = new XMLExecutionFactory();
- assertNotNull(caps);
- }
-
- /*
- * Class under test for List getSupportedFunctions()
- */
- public void testGetSupportedFunctions() {
- assertNotNull(m_caps.getSupportedFunctions());
- }
-
- public void testSupportsSelectDistinct() {
- assertFalse(m_caps.supportsSelectDistinct());
- }
-
- public void testSupportsAliasedGroup() {
- assertFalse(m_caps.supportsAliasedTable());
- }
-
- public void testSupportsJoins() {
- assertFalse(m_caps.supportsInnerJoins());
- }
-
- public void testSupportsSelfJoins() {
- assertFalse(m_caps.supportsSelfJoins());
- }
-
- public void testSupportsOuterJoins() {
- assertFalse(m_caps.supportsOuterJoins());
- }
-
- public void testSupportsFullOuterJoins() {
- assertFalse(m_caps.supportsFullOuterJoins());
- }
-
- public void testSupportsBetweenCriteria() {
- assertFalse(m_caps.supportsBetweenCriteria());
- }
-
- public void testSupportsLikeCriteria() {
- assertFalse(m_caps.supportsLikeCriteria());
- }
-
- public void testSupportsLikeCriteriaEscapeCharacter() {
- assertFalse(m_caps.supportsLikeCriteriaEscapeCharacter());
- }
-
- public void testSupportsInCriteriaSubquery() {
- assertFalse(m_caps.supportsInCriteriaSubquery());
- }
-
- public void testSupportsIsNullCriteria() {
- assertFalse(m_caps.supportsIsNullCriteria());
- }
-
- public void testSupportsOrCriteria() {
- assertFalse(m_caps.supportsOrCriteria());
- }
-
- public void testSupportsNotCriteria() {
- assertFalse(m_caps.supportsNotCriteria());
- }
-
- public void testSupportsExistsCriteria() {
- assertFalse(m_caps.supportsExistsCriteria());
- }
-
- public void testSupportsQuantifiedCompareCriteriaSome() {
- assertFalse(m_caps.supportsQuantifiedCompareCriteriaSome());
- }
-
- public void testSupportsQuantifiedCompareCriteriaAll() {
- assertFalse(m_caps.supportsQuantifiedCompareCriteriaAll());
- }
-
- public void testSupportsOrderBy() {
- assertFalse(m_caps.supportsOrderBy());
- }
-
- public void testSupportsAggregatesSum() {
- assertFalse(m_caps.supportsAggregatesSum());
- }
-
- public void testSupportsAggregatesAvg() {
- assertFalse(m_caps.supportsAggregatesAvg());
- }
-
- public void testSupportsAggregatesMin() {
- assertFalse(m_caps.supportsAggregatesMin());
- }
-
- public void testSupportsAggregatesMax() {
- assertFalse(m_caps.supportsAggregatesMax());
- }
-
- public void testSupportsAggregatesCount() {
- assertFalse(m_caps.supportsAggregatesCount());
- }
-
- public void testSupportsAggregatesCountStar() {
- assertFalse(m_caps.supportsAggregatesCountStar());
- }
-
- public void testSupportsAggregatesDistinct() {
- assertFalse(m_caps.supportsAggregatesDistinct());
- }
-
- public void testSupportsScalarSubqueries() {
- assertFalse(m_caps.supportsScalarSubqueries());
- }
-
- public void testSupportsCorrelatedSubqueries() {
- assertFalse(m_caps.supportsCorrelatedSubqueries());
- }
-
- public void testSupportsCaseExpressions() {
- assertFalse(m_caps.supportsCaseExpressions());
- }
-
- public void testSupportsSearchedCaseExpressions() {
- assertFalse(m_caps.supportsSearchedCaseExpressions());
- }
-
- public void testSupportsInlineViews() {
- assertFalse(m_caps.supportsInlineViews());
- }
-
- public void testSupportsUnions() {
- assertFalse(m_caps.supportsUnions());
- }
-
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXMLReaderFactory.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,19 +0,0 @@
-package org.teiid.translator.xml;
-
-import junit.framework.TestCase;
-
-import org.teiid.translator.xml.streaming.ReaderFactory;
-import org.xml.sax.XMLReader;
-
-
-public class TestXMLReaderFactory extends TestCase {
-
- public void testGetSAXBuilder() {
- try {
- XMLReader reader = ReaderFactory.getXMLReader(null);
- assertNotNull(reader);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-}
Deleted: trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java
===================================================================
--- trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/connectors/translator-xml/src/test/java/org/teiid/translator/xml/TestXPathSplitter.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1,88 +0,0 @@
-package org.teiid.translator.xml;
-
-import java.util.List;
-
-import org.teiid.translator.xml.streaming.InvalidPathException;
-import org.teiid.translator.xml.streaming.XPathSplitter;
-
-import junit.framework.TestCase;
-
-
-public class TestXPathSplitter extends TestCase {
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /**
- * ((((/po:purchaseOrder) | (/po:purchaseOrders/order))/items) | (/po:purchaseOrder/items3) | (/po:purchaseOrders/order/items4))/item
- *
- * becomes
- * /po:purchaseOrder/items/item
- * /po:purchaseOrders/order/items/item
- * /po:purchaseOrder/items/item
- * /po:purchaseOrders/order/items/item
- * becomes
- *
- * /po:purchaseOrder/items/item
- * /po:purchaseOrders/order/items/item
- */
- public void testSplit() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("((((/po:purchaseOrder) | (/po:purchaseOrders/order))/items) | (/po:purchaseOrder/items) | (/po:purchaseOrders/order/items))/item");
- assertEquals(2, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- public void testSplitSimple() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("/po:purchaseOrders/order/items/item");
- assertEquals(1, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- public void testSplitCompund() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("(/po:purchaseOrders/order/items/item)|(/po:purchaseOrders/order/items)");
- assertEquals(2, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- public void testSplitCompund2() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("(/po:purchaseOrders/order/items/item)|((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))");
- assertEquals(3, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-
- /**
- * ((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))|((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))
- *
- * /po:purchaseOrders/order/items
- * /po:purchaseOrders/order/item
- *
- */
- public void testSplitCompund3() {
- XPathSplitter splitter = new XPathSplitter();
- try {
- List paths = splitter.split("((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))|((/po:purchaseOrders/order/items)|(/po:purchaseOrders/order/item))");
- assertEquals(2, paths.size());
- } catch (InvalidPathException e) {
- fail(e.getMessage());
- }
- }
-}
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml 2010-06-08 19:11:59 UTC (rev 2202)
@@ -471,25 +471,31 @@
<tbody>
<row>
<entry>BOOLEAN</entry>
- <entry>{b'true'} or {b'false'}</entry>
+ <entry>{b 'true'} or {b 'false'}</entry>
</row>
<row>
<entry>DATE</entry>
- <entry>{d'yyyy-mm-dd'}</entry>
+ <entry>{d 'yyyy-mm-dd'}</entry>
</row>
<row>
<entry>TIME</entry>
- <entry>{t'hh-mm-ss'}</entry>
+ <entry>{t 'hh-mm-ss'}</entry>
</row>
<row>
<entry>TIMESTAMP</entry>
<entry>
- {ts'yyyy-mm-dd hh:mm:ss.fffffffff'}
+ {ts 'yyyy-mm-dd hh:mm:ss.fffffffff'}
<footnote>
<para>fractional seconds are optional</para>
</footnote>
</entry>
</row>
+ <row>
+ <entry>XML</entry>
+ <entry>
+ {x 'well-formed doc'}
+ </entry>
+ </row>
</tbody>
</tgroup>
</table>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1940,7 +1940,7 @@
meaningful result for non-text nodes.</para>
</entry>
<entry>
- <para>Doc in {string, xml} and xpath. Return value is a string.
+ <para>Doc in {string, clob, xml} and xpath. Return value is a string.
</para>
</entry>
</row>
@@ -1952,20 +1952,42 @@
<para>Applies an xsl stylesheet to the given document. If either argument is null, the result is null.</para>
</entry>
<entry>
- <para>Doc, xsl in {string, xml}. Return value is a clob.
+ <para>Doc, xsl in {string, clob, xml}. Return value is a clob.
</para>
</entry>
</row>
+ <row id="xmlquery">
+ <entry>
+ <para><code>XMLQUERY([<NSP>] xquery [<PASSING>] [(NULL|EMPTY) ON EMPTY]]</code></para>
+ <para>PASSING:=<code>PASSING exp [AS name] [, exp [AS name]]*</code></para>
+ </entry>
+ <entry>
+ <para>Returns the XML result from evaluating the given xquery.</para>
+ <para>See XMLELEMENT for the definition of NSP - <link linkend="xmlnamespaces">XMLNAMESPACES</link>.</para><para>Namespaces may also be directly declared in the xquery prolog.</para>
+ <para id="passing">The optional PASSING clause is used to provide the context item, which does not have a name, and named global variable values.
+ If the xquery uses a context item and none is provided, then an exception will be raised.
+ Only one context item may be specified and should be an XML type. All non-context non-XML passing values will be converted to an appropriate XML type.</para>
+ <para>The ON EMPTY clause is used to specify the result when the evaluted sequence is empty.
+ EMPTY ON EMPTY, the default, returns an empty XML result. NULL ON EMPTY returns a null result.</para>
+ <para>See also <link linkend="xmltable">XMLTABLE</link></para>
+ </entry>
+ <entry>
+ <para>xquery in string. Return value is xml.
+ </para>
+ </entry>
+ </row>
<row>
<entry>
<para><code>XMLELEMENT([NAME] name [, <NSP>] [, <ATTR>][, exp]*)</code></para>
<para>ATTR:=<code>XMLATTRIBUTES(exp [AS name] [, exp [AS name]]*)</code></para>
- <para>NSP:=<code>XMLNAMESPACES((uri AS prefix | DEFAULT uri | NO DEFAULTS))+</code></para>
+ <para>NSP:=<code>XMLNAMESPACES((uri AS prefix | DEFAULT uri | NO DEFAULT))+</code></para>
</entry>
<entry>
<para>Returns an XML element with the given name and content. If the content value is of a type other than xml,
it will be escaped when added to the parent element. Null content values are ignored.
Whitespace in XML or the string values of the content is preserved, but no whitespace is added between content values.</para>
+ <para id="xmlnamespaces">XMLNAMESPACES is used provide namespace information. NO DEFAULT is equivalent to defining the default namespace to the null uri - xmlns="".
+ Only one DEFAULT or NO DEFAULT namespace item may be specified. The namespace prefixes xmlns and xml are reserved.</para>
<para>If a attribute name is not supplied, the expression must be a column reference, in which case the attribute name will be the column name. Null attribute values are ignored.</para>
<para>Example: with an xml_value of <doc/>, <code>xmlelement('elem', 1, '<2/>', xml_value)</code>
Returns: <code><elem>1&lt;2/&gt;<doc/><elem/></code>
@@ -1996,7 +2018,7 @@
<entry>
<para>Returns an concatination of an XML element for each non-null expression exp. If a name is not supplied, the expression must be a column reference, in which case the element name will be the column name.
</para>
- <para>See XMLELEMENT for the definition of NSP - XMLNAMESPACES.</para>
+ <para>See XMLELEMENT for the definition of NSP - <link linkend="xmlnamespaces">XMLNAMESPACES</link>.</para>
</entry>
<entry>
<para>Name is an identifier. Exp can be any type. Return value is xml.
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-06-08 19:11:59 UTC (rev 2202)
@@ -710,6 +710,7 @@
<listitem><para>FROM table1 JOIN table2 MAKENOTDEP ON join-criteria</para></listitem>
<listitem><para>FROM table1 left outer join <link linkend="optional_join">/* optional */</link> table2 ON join-criteria</para></listitem>
<listitem><para>FROM <link linkend="texttable">TEXTTABLE...</link></para></listitem>
+ <listitem><para>FROM <link linkend="xmltable">XMLTABLE...</link></para></listitem>
</itemizedlist>
<note>
<title>DEP Hints</title>
@@ -753,22 +754,10 @@
</para>
<para>
Usage:
- <synopsis label="Usage">TEXTTABLE(expression COLUMNS column, ... [DELIMITER char] [(QUOTE|ESCAPE) char] [HEADER [integer]] [SKIP integer]) AS identifier</synopsis>
- <synopsis label="Usage">column := identifier datatype [WIDTH integer]</synopsis>
+ <synopsis label="Usage">TEXTTABLE(expression COLUMNS <COLUMN>, ... [DELIMITER char] [(QUOTE|ESCAPE) char] [HEADER [integer]] [SKIP integer]) AS name</synopsis>
+ <synopsis label="Usage">COLUMN := name datatype [WIDTH integer]</synopsis>
</para>
<itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>If width is specified for one column it must be specified for all columns.
- </para>
- </listitem>
- <listitem>
- <para>If width is specified, then fixed width parsing is used and ESCAPE, QUOTE, and HEADER should not be specified.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
<para>Parameters</para>
<listitem>
<para>expression - the text content to process, which should be convertable to CLOB.
@@ -800,6 +789,22 @@
</listitem>
</itemizedlist>
<itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>If width is specified for one column it must be specified for all columns.
+ </para>
+ </listitem>
+ <listitem>
+ <para>If width is specified, then fixed width parsing is used and ESCAPE, QUOTE, and HEADER should not be specified.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The columns names must be not contain duplicates.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
<para>Examples</para>
<listitem>
<para>Use of the HEADER parameter, returns 1 row ['b']: <programlisting>select * from texttable('col1,col2,col3\na,b,c' COLUMNS col2 string HEADER) x</programlisting>
@@ -817,9 +822,61 @@
<para>As a nested table: <programlisting>select x.* from t, texttable(t.clobcolumn COLUMNS first string, second date SKIP 1) x</programlisting>
</para>
</listitem>
-
</itemizedlist>
</sect3>
+ <sect3 id="xmltable">
+ <title>XMLTABLE</title>
+ <para>The XMLTABLE funciton uses XQuery to produce tabular ouptut.
+ The XMLTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">XMLTABLE([<NSP>,] xquery-expression [<PASSING>] [COLUMNS <COLUMN>, ... )] AS name</synopsis>
+ <synopsis label="Usage">COLUMN := name (FOR ORDINALITY | (datatype [PATH string] [DEFAULT expression]))</synopsis>
+ </para>
+ <para>See XMLELEMENT for the definition of NSP - <link linkend="xmlnamespaces">XMLNAMESPACES</link>.</para>
+ <para>See XMLQUERY for the definition of <link linkend="passing">PASSING</link>.</para>
+ <para>See also <link linkend="xmlquery">XMLQUERY</link></para>
+ <itemizedlist>
+ <para>Parameters</para>
+ <listitem>
+ <para>The optional XMLNAMESPACES clause specifies the namepaces for use in the XQuery and COLUMN path expressions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The xquery-expression should be a valid XQuery. Each sequence item returned by the xquery will be used to create a row of values as defined by the COLUMNS clause.
+ </para>
+ </listitem>
+ <listitem>
+ <para>If COLUMNS is not specified, then that is the same as having the COLUMNS clause: "COLUMNS OBJECT_VALUE XML PATH '.'", which returns the entire item as an XML value. Each non-ordinality column specifies a type and optionally a PATH and a DEFAULT expression.
+ If PATH is not specified, then the path will be the same as the column name. A FOR ORDINALITY column is typed as integer and will return the 1-based item number as its value.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>Only 1 FOR ORDINALITY column may be specified.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The columns names must be not contain duplicates.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Examples</para>
+ <listitem>
+ <para>Use of passing, returns 1 row [1]: <programlisting>select * from xmltable('/a' PASSING {x '<a id="1"/>'} COLUMNS id integer PATH '@id') x</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>As a nested table: <programlisting>select x.* from t, xmltable('/x/y' PASSING t.doc COLUMNS first string, second FOR ORDINALITY) x</programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect3>
</sect2>
<sect2 id="where_clause">
<title>WHERE Clause</title>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/pom.xml 2010-06-08 19:11:59 UTC (rev 2202)
@@ -93,15 +93,6 @@
<artifactId>saxon</artifactId>
</dependency>
- <dependency>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- </dependency>
- <dependency>
- <groupId>nux</groupId>
- <artifactId>nux</artifactId>
- </dependency>
-
</dependencies>
</project>
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -58,7 +58,6 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
-import org.teiid.translator.MetadataProvider;
import org.teiid.translator.TranslatorException;
@@ -133,8 +132,12 @@
public MetadataStore getMetadata(String modelName, Map<String, Datatype> datatypes, Properties importProperties) throws TranslatorException {
MetadataFactory factory = new MetadataFactory(modelName, datatypes, importProperties);
ExecutionFactory executionFactory = getExecutionFactory();
- if (executionFactory instanceof MetadataProvider) {
- ((MetadataProvider)executionFactory).getConnectorMetadata(factory, getConnectionFactory());
+ Object connectionFactory = getConnectionFactory();
+ Object connection = executionFactory.getConnection(executionFactory);
+ try {
+ executionFactory.getMetadata(factory, connection);
+ } finally {
+ executionFactory.closeConnection(connection, connectionFactory);
}
return factory.getMetadataStore();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -79,6 +79,7 @@
/* Created on new request */
private Object connection;
+ private Object connectionFactory;
private ExecutionContextImpl securityContext;
private volatile ResultSetExecution execution;
private ProcedureBatchHandler procedureBatchHandler;
@@ -181,6 +182,7 @@
} catch (Throwable e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e, e.getMessage());
} finally {
+ this.connector.closeConnection(connection, connectionFactory);
manager.removeState(this.id);
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Closed connection"}); //$NON-NLS-1$
}
@@ -226,8 +228,8 @@
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.requestMsg.getAtomicRequestID(), "Processing NEW request:", this.requestMsg.getCommand()}); //$NON-NLS-1$
try {
- this.connection = this.manager.getConnectionFactory();
-
+ this.connectionFactory = this.manager.getConnectionFactory();
+ this.connection = this.connector.getConnection(this.connectionFactory);
// Translate the command
Command command = this.requestMsg.getCommand();
List<SingleElementSymbol> symbols = this.requestMsg.getCommand().getProjectedSymbols();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -29,8 +29,6 @@
import java.util.Map;
import java.util.Set;
-import nux.xom.xquery.XQuery;
-
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryParserException;
import org.teiid.api.exception.query.QueryResolverException;
@@ -230,15 +228,6 @@
return xmlMetadata;
}
- private Map createXQueryColumnMetadata(XQuery xqueryCommand) {
- Map xqueryMetadata = getDefaultColumn(null, ResultsMetadataDefaults.XML_COLUMN_NAME, XMLType.class);
-
- // Override size as XML may be big
- xqueryMetadata.put(ResultsMetadataConstants.DISPLAY_SIZE, ResultsMetadataDefaults.XML_COLUMN_LENGTH);
-
- return xqueryMetadata;
- }
-
private Map createColumnMetadata(String shortColumnName, SingleElementSymbol symbol) throws QueryMetadataException, TeiidComponentException {
if(symbol instanceof ElementSymbol) {
return createElementMetadata(shortColumnName, (ElementSymbol) symbol);
Modified: trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -22,8 +22,6 @@
package org.teiid.query.eval;
-import java.io.IOException;
-import java.io.Writer;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
@@ -31,20 +29,12 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.TransformerException;
-
-import net.sf.saxon.expr.PathMap.PathMapRoot;
-import net.sf.saxon.om.Item;
-import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.SequenceIterator;
-import net.sf.saxon.query.QueryResult;
import net.sf.saxon.trans.XPathException;
import org.teiid.api.exception.query.CriteriaEvaluationException;
@@ -55,10 +45,8 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
-import org.teiid.core.types.SQLXMLImpl;
import org.teiid.core.types.Sequencable;
import org.teiid.core.types.TransformationException;
-import org.teiid.core.types.XMLTranslator;
import org.teiid.core.types.XMLType;
import org.teiid.core.types.XMLType.Type;
import org.teiid.core.types.basic.StringToSQLXMLTransform;
@@ -71,7 +59,6 @@
import org.teiid.query.function.source.XMLSystemFunctions;
import org.teiid.query.function.source.XMLSystemFunctions.NameValuePair;
import org.teiid.query.processor.ProcessorDataManager;
-import org.teiid.query.processor.xml.XMLUtil;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.AbstractSetCriteria;
import org.teiid.query.sql.lang.CollectionValueIterator;
@@ -632,7 +619,7 @@
Type type = StringToSQLXMLTransform.isXml(value.getCharacterStream());
value.setType(type);
}
- if (value.getType() == Type.DOCUMENT || value.getType() == Type.FRAGMENT) {
+ if (value.getType() == Type.DOCUMENT || value.getType() == Type.ELEMENT) {
return DataTypeManager.transformValue(value, xs.getType());
}
} catch (SQLException e) {
@@ -643,17 +630,13 @@
throw new FunctionExecutionException(QueryPlugin.Util.getString("Evaluator.xmlserialize")); //$NON-NLS-1$
} else if (expression instanceof XMLQuery) {
XMLQuery xmlQuery = (XMLQuery)expression;
- boolean contentOnly = true;
boolean emptyOnEmpty = true;
- if (xmlQuery.getReturningContent() != null) {
- contentOnly = xmlQuery.getReturningContent();
- }
if (xmlQuery.getEmptyOnEmpty() != null) {
emptyOnEmpty = xmlQuery.getEmptyOnEmpty();
}
try {
- SequenceIterator iter = evaluateXQuery(xmlQuery.getXQueryExpression(), xmlQuery.getContextRoot(), xmlQuery.getPassing(), tuple);
- return createXMLType(iter, xmlQuery.getXQueryExpression(), contentOnly, emptyOnEmpty);
+ SequenceIterator iter = evaluateXQuery(xmlQuery.getXQueryExpression(), xmlQuery.getPassing(), tuple);
+ return xmlQuery.getXQueryExpression().createXMLType(iter, emptyOnEmpty);
} catch (TeiidProcessingException e) {
throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
} catch (XPathException e) {
@@ -664,56 +647,7 @@
}
}
- public XMLType createXMLType(final SequenceIterator iter, final SaxonXQueryExpression expr, boolean contentOnly, boolean emptyOnEmpty) throws XPathException, TeiidComponentException, TeiidProcessingException {
- Item item = iter.next();
- if (item == null) {
- if (contentOnly) {
- throw new FunctionExecutionException(QueryPlugin.Util.getString("Evaluator.xmlquery_content_empty")); //$NON-NLS-1$
- }
- if (!emptyOnEmpty) {
- return null;
- }
- }
- XMLType.Type type = Type.SEQUENCE;
- if (item instanceof NodeInfo) {
- NodeInfo info = (NodeInfo)item;
- switch (info.getNodeKind()) {
- case net.sf.saxon.type.Type.DOCUMENT:
- type = Type.DOCUMENT;
- break;
- case net.sf.saxon.type.Type.ELEMENT:
- type = Type.FRAGMENT;
- break;
- case net.sf.saxon.type.Type.TEXT:
- type = Type.TEXT;
- break;
- }
- }
- Item next = iter.next();
- if (next != null) {
- type = Type.SEQUENCE;
- }
- if (contentOnly && type != Type.DOCUMENT && type != Type.FRAGMENT) {
- throw new FunctionExecutionException(QueryPlugin.Util.getString("Evaluator.xmlquery_content")); //$NON-NLS-1$
- }
- SQLXMLImpl xml = XMLUtil.saveToBufferManager(new XMLTranslator() {
-
- @Override
- public void translate(Writer writer) throws TransformerException,
- IOException {
- Properties props = new Properties();
- props.setProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- //props.setProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
- QueryResult.serializeSequence(iter.getAnother(), expr.getConfig(), writer, props);
- }
- });
- XMLType value = new XMLType(xml);
- value.setType(type);
- return value;
- }
-
- public SequenceIterator evaluateXQuery(SaxonXQueryExpression xquery, PathMapRoot contextRoot, List<DerivedColumn> cols, List<?> tuple)
+ public SequenceIterator evaluateXQuery(SaxonXQueryExpression xquery, List<DerivedColumn> cols, List<?> tuple)
throws BlockedException, TeiidComponentException, TeiidProcessingException {
HashMap<String, Object> parameters = new HashMap<String, Object>();
Object contextItem = null;
@@ -725,7 +659,7 @@
parameters.put(passing.getAlias(), value);
}
}
- return xquery.evaluateXQuery(contextItem, contextRoot, parameters);
+ return xquery.evaluateXQuery(contextItem, parameters);
}
private NameValuePair<Object>[] getNameValuePairs(List tuple, List<DerivedColumn> args)
Modified: trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -23,6 +23,7 @@
package org.teiid.query.function.source;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -888,6 +889,12 @@
new FunctionParameter("result", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xpathvalue_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
functions.add(new FunctionMethod(SourceSystemFunctions.XPATHVALUE, QueryPlugin.Util.getString("SystemSource.xpathvalue_description"), XML, XML_FUNCTION_CLASS, "xpathValue", //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter[] {
+ new FunctionParameter("document", DataTypeManager.DefaultDataTypes.CLOB, QueryPlugin.Util.getString("SystemSource.xpath_param1")), //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter("xpath", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xpath_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter("result", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xpathvalue_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
+
+ functions.add(new FunctionMethod(SourceSystemFunctions.XPATHVALUE, QueryPlugin.Util.getString("SystemSource.xpathvalue_description"), XML, XML_FUNCTION_CLASS, "xpathValue", //$NON-NLS-1$ //$NON-NLS-2$
new FunctionParameter[] {
new FunctionParameter("document", DataTypeManager.DefaultDataTypes.XML, QueryPlugin.Util.getString("SystemSource.xpath_param1")), //$NON-NLS-1$ //$NON-NLS-2$
new FunctionParameter("xpath", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xpath_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
@@ -895,28 +902,15 @@
}
private void addXslTransformFunction() {
- functions.add(new FunctionMethod(SourceSystemFunctions.XSLTRANSFORM, QueryPlugin.Util.getString("SystemSource.xsltransform_description"), XML, XML_FUNCTION_CLASS, "xslTransform", //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter[] {
- new FunctionParameter("document", DataTypeManager.DefaultDataTypes.XML, QueryPlugin.Util.getString("SystemSource.xsltransform_param1")), //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("xsl", DataTypeManager.DefaultDataTypes.XML, QueryPlugin.Util.getString("SystemSource.xsltransform_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("result", DataTypeManager.DefaultDataTypes.CLOB, QueryPlugin.Util.getString("SystemSource.xsltransform_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
- functions.add(new FunctionMethod(SourceSystemFunctions.XSLTRANSFORM, QueryPlugin.Util.getString("SystemSource.xsltransform_description"), XML, XML_FUNCTION_CLASS, "xslTransform", //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter[] {
- new FunctionParameter("document", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xsltransform_param1")), //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("xsl", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xsltransform_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("result", DataTypeManager.DefaultDataTypes.CLOB, QueryPlugin.Util.getString("SystemSource.xsltransform_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
-
- functions.add(new FunctionMethod(SourceSystemFunctions.XSLTRANSFORM, QueryPlugin.Util.getString("SystemSource.xsltransform_description"), XML, XML_FUNCTION_CLASS, "xslTransform", //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter[] {
- new FunctionParameter("document", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xsltransform_param1")), //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("xsl", DataTypeManager.DefaultDataTypes.XML, QueryPlugin.Util.getString("SystemSource.xsltransform_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("result", DataTypeManager.DefaultDataTypes.CLOB, QueryPlugin.Util.getString("SystemSource.xsltransform_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
-
- functions.add(new FunctionMethod(SourceSystemFunctions.XSLTRANSFORM, QueryPlugin.Util.getString("SystemSource.xsltransform_description"), XML, XML_FUNCTION_CLASS, "xslTransform", //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter[] {
- new FunctionParameter("document", DataTypeManager.DefaultDataTypes.XML, QueryPlugin.Util.getString("SystemSource.xsltransform_param1")), //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("xsl", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.xsltransform_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
- new FunctionParameter("result", DataTypeManager.DefaultDataTypes.CLOB, QueryPlugin.Util.getString("SystemSource.xsltransform_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ for (String type1 : Arrays.asList(DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.XML, DataTypeManager.DefaultDataTypes.CLOB)) {
+ for (String type2 : Arrays.asList(DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.XML, DataTypeManager.DefaultDataTypes.CLOB)) {
+ functions.add(new FunctionMethod(SourceSystemFunctions.XSLTRANSFORM, QueryPlugin.Util.getString("SystemSource.xsltransform_description"), XML, XML_FUNCTION_CLASS, "xslTransform", //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter[] {
+ new FunctionParameter("document", type1, QueryPlugin.Util.getString("SystemSource.xsltransform_param1")), //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter("xsl", type2, QueryPlugin.Util.getString("SystemSource.xsltransform_param2"))}, //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter("result", DataTypeManager.DefaultDataTypes.CLOB, QueryPlugin.Util.getString("SystemSource.xsltransform_result")) ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
}
private void addXmlComment() {
Modified: trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -28,6 +28,7 @@
import java.io.StringReader;
import java.io.Writer;
import java.nio.CharBuffer;
+import java.sql.Blob;
import java.sql.Clob;
import java.sql.SQLException;
import java.sql.SQLXML;
@@ -108,48 +109,52 @@
YEAR_ZERO = cal.getTimeInMillis();
}
- public static ClobType xslTransform(CommandContext context, String xmlResults, String styleSheet) throws Exception {
- return xslTransform(context, DataTypeManager.transformValue(xmlResults, DataTypeManager.DefaultDataClasses.XML), DataTypeManager.transformValue(styleSheet, DataTypeManager.DefaultDataClasses.XML));
- }
-
- public static ClobType xslTransform(CommandContext context, String xmlResults, XMLType styleSheet) throws Exception {
- return xslTransform(context, DataTypeManager.transformValue(xmlResults, DataTypeManager.DefaultDataClasses.XML), styleSheet);
- }
-
- public static ClobType xslTransform(CommandContext context, XMLType xmlResults, String styleSheet) throws Exception {
- return xslTransform(context, xmlResults, DataTypeManager.transformValue(styleSheet, DataTypeManager.DefaultDataClasses.XML));
- }
-
- public static ClobType xslTransform(CommandContext context, XMLType xmlResults, XMLType styleSheet) throws Exception {
- Reader styleSheetReader = styleSheet.getCharacterStream();
- final Source styleSource = new StreamSource(styleSheetReader);
- Reader reader = xmlResults.getCharacterStream();
- final Source xmlSource = new StreamSource(reader);
+ public static ClobType xslTransform(CommandContext context, Object xml, Object styleSheet) throws Exception {
+ Source styleSource = null;
+ Source xmlSource = null;
try {
+ styleSource = convertToSource(styleSheet);
+ xmlSource = convertToSource(xml);
+ final Source xmlParam = xmlSource;
+ TransformerFactory factory = TransformerFactory.newInstance();
+ final Transformer transformer = factory.newTransformer(styleSource);
+
//this creates a non-validated sqlxml - it may not be valid xml/root-less xml
SQLXML result = XMLUtil.saveToBufferManager(context.getBufferManager(), new XMLTranslator() {
@Override
public void translate(Writer writer) throws TransformerException {
- TransformerFactory factory = TransformerFactory.newInstance();
- Transformer transformer = factory.newTransformer(styleSource);
//transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
// Feed the resultant I/O stream into the XSLT processor
- transformer.transform(xmlSource, new StreamResult(writer));
+ transformer.transform(xmlParam, new StreamResult(writer));
}
}, Streamable.STREAMING_BATCH_SIZE_IN_BYTES);
return DataTypeManager.transformValue(new XMLType(result), DataTypeManager.DefaultDataClasses.CLOB);
} finally {
- try {
- reader.close();
- } catch (IOException e) {
+ closeSource(styleSource);
+ closeSource(xmlSource);
+ }
+ }
+
+ private static void closeSource(final Source source) {
+ if (!(source instanceof StreamSource)) {
+ return;
+ }
+
+ StreamSource stream = (StreamSource)source;
+ try {
+ if (stream.getInputStream() != null) {
+ stream.getInputStream().close();
}
- try {
- styleSheetReader.close();
- } catch (IOException e) {
+ } catch (IOException e) {
+ }
+ try {
+ if (stream.getReader() != null) {
+ stream.getReader().close();
}
+ } catch (IOException e) {
}
- }
+ }
public static XMLType xmlForest(final CommandContext context, final NameValuePair[] namespaces, final NameValuePair[] values) throws TeiidComponentException, TeiidProcessingException {
boolean valueExists = false;
@@ -183,7 +188,7 @@
}
}
}, context.getStreamingBatchSize()));
- result.setType(Type.SEQUENCE);
+ result.setType(Type.CONTENT);
return result;
}
@@ -214,7 +219,7 @@
}
}, context.getStreamingBatchSize()));
- result.setType(Type.FRAGMENT);
+ result.setType(Type.ELEMENT);
return result;
}
@@ -268,7 +273,7 @@
}
}
}, context.getStreamingBatchSize()));
- result.setType(Type.SEQUENCE);
+ result.setType(Type.CONTENT);
return result;
}
@@ -340,8 +345,8 @@
r = new BufferedReader(r);
}
switch(type) {
- case FRAGMENT:
- case SEQUENCE:
+ case CONTENT:
+ case ELEMENT:
case PI:
case COMMENT: //write the value directly to the writer
eventWriter.flush();
@@ -414,18 +419,34 @@
return resultBuffer.toString();
}
-
- public static String xpathValue(String document, String xpathStr) throws IOException, XPathException {
- return xpathValue(new StringReader(document), xpathStr);
+
+ public static Source convertToSource(Object value) throws TeiidProcessingException {
+ if (value == null) {
+ return null;
+ }
+ try {
+ if (value instanceof SQLXML) {
+ return ((SQLXML)value).getSource(null);
+ }
+ if (value instanceof Clob) {
+ return new StreamSource(((Clob)value).getCharacterStream());
+ }
+ if (value instanceof Blob) {
+ return new StreamSource(((Blob)value).getBinaryStream());
+ }
+ if (value instanceof String) {
+ return new StreamSource(new StringReader((String)value));
+ }
+ } catch (SQLException e) {
+ throw new TeiidProcessingException(e);
+ }
+ throw new AssertionError("Unknown type"); //$NON-NLS-1$
}
-
- public static String xpathValue(XMLType document, String xpathStr) throws IOException, SQLException, XPathException {
- return xpathValue(document.getCharacterStream(), xpathStr);
- }
- public static String xpathValue(Reader documentReader, String xpath) throws IOException, XPathException {
+ public static String xpathValue(Object doc, String xpath) throws XPathException, TeiidProcessingException {
+ Source s = null;
try {
- Source s = new StreamSource(documentReader);
+ s = convertToSource(doc);
XPathEvaluator eval = new XPathEvaluator();
// Wrap the string() function to force a string return
XPathExpression expr = eval.createExpression(xpath);
@@ -443,8 +464,7 @@
// Return string representation of non-node value
return o.toString();
} finally {
- // Always close the reader
- documentReader.close();
+ closeSource(s);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -386,7 +386,7 @@
for (int col : projectionIndexes) {
filteredColumns.add(xt.getColumns().get(col));
}
- PathMapRoot root = xt.getXQueryExpression().useDocumentProjection(filteredColumns, analysisRecord);
+ xt.getXQueryExpression().useDocumentProjection(filteredColumns, analysisRecord);
xtn.setProjectedColumns(filteredColumns);
xtn.setTable(xt);
processNode = xtn;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -26,7 +26,6 @@
import java.util.Collections;
import java.util.List;
-import net.sf.saxon.expr.PathMap.PathMapRoot;
import net.sf.saxon.om.Item;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.sxpath.XPathDynamicContext;
@@ -52,10 +51,10 @@
private XMLTable table;
private List<XMLColumn> projectedColumns;
- private PathMapRoot contextRoot;
private SequenceIterator result;
private int rowCount = 0;
+ private Item item;
public XMLTableNode(int nodeID) {
super(nodeID);
@@ -74,6 +73,7 @@
result.close();
result = null;
}
+ item = null;
rowCount = 0;
}
@@ -85,10 +85,6 @@
this.projectedColumns = projectedColumns;
}
- public void setContextRoot(PathMapRoot contextRoot) {
- this.contextRoot = contextRoot;
- }
-
@Override
public XMLTableNode clone() {
XMLTableNode clone = new XMLTableNode(getID());
@@ -104,7 +100,7 @@
if (result == null) {
setReferenceValues(this.table);
- result = getEvaluator(Collections.emptyMap()).evaluateXQuery(this.table.getXQueryExpression(), this.contextRoot, this.table.getPassing(), null);
+ result = getEvaluator(Collections.emptyMap()).evaluateXQuery(this.table.getXQueryExpression(), this.table.getPassing(), null);
}
while (!isBatchFull() && !isLastBatch()) {
@@ -115,16 +111,17 @@
private void processRow() throws ExpressionEvaluationException, BlockedException,
TeiidComponentException, TeiidProcessingException {
- Item item;
- try {
- item = result.next();
- } catch (XPathException e) {
- throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("XMLTableNode.error", e.getMessage())); //$NON-NLS-1$
- }
- rowCount++;
if (item == null) {
- terminateBatches();
- return;
+ try {
+ item = result.next();
+ } catch (XPathException e) {
+ throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("XMLTableNode.error", e.getMessage())); //$NON-NLS-1$
+ }
+ rowCount++;
+ if (item == null) {
+ terminateBatches();
+ return;
+ }
}
List<Object> tuple = new ArrayList<Object>(projectedColumns.size());
for (XMLColumn proColumn : projectedColumns) {
@@ -145,7 +142,7 @@
continue;
}
if (proColumn.getSymbol().getType() == DataTypeManager.DefaultDataClasses.XML) {
- XMLType value = getEvaluator(Collections.emptyMap()).createXMLType(pathIter.getAnother(), table.getXQueryExpression(), false, false);
+ XMLType value = table.getXQueryExpression().createXMLType(pathIter.getAnother(), false);
tuple.add(value);
continue;
}
@@ -164,6 +161,7 @@
}
}
}
+ item = null;
addBatchRow(tuple);
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/XMLTable.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -187,7 +187,9 @@
}
}
clone.xquery = this.xquery;
- clone.xqueryExpression = this.xqueryExpression;
+ if (this.xqueryExpression != null) {
+ clone.xqueryExpression = this.xqueryExpression.clone();
+ }
return clone;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLQuery.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLQuery.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/XMLQuery.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -3,8 +3,6 @@
import java.util.ArrayList;
import java.util.List;
-import net.sf.saxon.expr.PathMap.PathMapRoot;
-
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.EquivalenceUtil;
@@ -19,10 +17,8 @@
private String xquery;
private List<DerivedColumn> passing = new ArrayList<DerivedColumn>();
private Boolean emptyOnEmpty;
- private Boolean returningContent;
private SaxonXQueryExpression xqueryExpression;
- private PathMapRoot contextRoot;
@Override
public Class<?> getType() {
@@ -37,14 +33,6 @@
this.emptyOnEmpty = emptyOnEmpty;
}
- public Boolean getReturningContent() {
- return returningContent;
- }
-
- public void setReturningContent(Boolean returningContent) {
- this.returningContent = returningContent;
- }
-
@Override
public boolean isResolved() {
return xqueryExpression != null;
@@ -57,17 +45,13 @@
//TODO: display the analysis record info
public void compileXqueryExpression() throws QueryResolverException {
this.xqueryExpression = new SaxonXQueryExpression(xquery, namespaces, passing, null);
- this.contextRoot = this.xqueryExpression.useDocumentProjection(null, new AnalysisRecord(false, false));
+ this.xqueryExpression.useDocumentProjection(null, new AnalysisRecord(false, false));
}
public SaxonXQueryExpression getXQueryExpression() {
return xqueryExpression;
}
- public PathMapRoot getContextRoot() {
- return contextRoot;
- }
-
public void setPassing(List<DerivedColumn> passing) {
this.passing = passing;
}
@@ -105,9 +89,10 @@
}
}
clone.xquery = this.xquery;
- clone.xqueryExpression = this.xqueryExpression;
+ if (this.xqueryExpression != null) {
+ clone.xqueryExpression = this.xqueryExpression.clone();
+ }
clone.emptyOnEmpty = this.emptyOnEmpty;
- clone.returningContent = this.returningContent;
return clone;
}
@@ -123,8 +108,7 @@
return EquivalenceUtil.areEqual(this.namespaces, other.namespaces)
&& this.passing.equals(other.passing)
&& this.xquery.equals(other.xquery)
- && EquivalenceUtil.areEqual(this.emptyOnEmpty, other.emptyOnEmpty)
- && EquivalenceUtil.areEqual(this.returningContent, other.returningContent);
+ && EquivalenceUtil.areEqual(this.emptyOnEmpty, other.emptyOnEmpty);
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1762,27 +1762,17 @@
parts.add(SPACE);
registerNodes(obj.getPassing(), 0);
}
- if (obj.getReturningContent() != null) {
+ if (obj.getEmptyOnEmpty() != null) {
parts.add(SPACE);
- parts.add(NonReserved.RETURNING);
- parts.add(SPACE);
- if (obj.getReturningContent()) {
- parts.add(NonReserved.CONTENT);
+ if (obj.getEmptyOnEmpty()) {
+ parts.add(NonReserved.EMPTY);
} else {
- parts.add(NonReserved.SEQUENCE);
- if (obj.getEmptyOnEmpty() != null) {
- parts.add(SPACE);
- if (obj.getEmptyOnEmpty()) {
- parts.add(NonReserved.EMPTY);
- } else {
- parts.add(NULL);
- }
- parts.add(SPACE);
- parts.add(ON);
- parts.add(SPACE);
- parts.add(NonReserved.EMPTY);
- }
+ parts.add(NULL);
}
+ parts.add(SPACE);
+ parts.add(ON);
+ parts.add(SPACE);
+ parts.add(NonReserved.EMPTY);
}
parts.add(")");//$NON-NLS-1$
}
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -1188,8 +1188,7 @@
for (DerivedColumn dc : passing) {
if (dc.getAlias() == null) {
Class<?> type = dc.getExpression().getType();
- if (type != DataTypeManager.DefaultDataClasses.XML &&
- type != DataTypeManager.DefaultDataClasses.CLOB) {
+ if (type != DataTypeManager.DefaultDataClasses.XML) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.context_item_type"), obj); //$NON-NLS-1$
}
if (context && !hadError) {
Modified: trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -22,19 +22,20 @@
package org.teiid.query.xquery.saxon;
-import java.sql.Clob;
-import java.sql.SQLException;
+import java.io.IOException;
+import java.io.Writer;
import java.sql.SQLXML;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import javax.xml.transform.ErrorListener;
+import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamSource;
import net.sf.saxon.AugmentedSource;
import net.sf.saxon.Configuration;
@@ -50,11 +51,14 @@
import net.sf.saxon.expr.PathMap.PathMapRoot;
import net.sf.saxon.om.Axis;
import net.sf.saxon.om.DocumentInfo;
+import net.sf.saxon.om.Item;
+import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.pattern.AnyNodeTest;
import net.sf.saxon.pattern.NodeKindTest;
import net.sf.saxon.query.DynamicQueryContext;
+import net.sf.saxon.query.QueryResult;
import net.sf.saxon.query.StaticQueryContext;
import net.sf.saxon.sxpath.IndependentContext;
import net.sf.saxon.sxpath.XPathEvaluator;
@@ -66,13 +70,18 @@
import net.sf.saxon.value.SequenceType;
import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.core.types.ClobType;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.SQLXMLImpl;
+import org.teiid.core.types.XMLTranslator;
import org.teiid.core.types.XMLType;
+import org.teiid.core.types.XMLType.Type;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
+import org.teiid.query.function.source.XMLSystemFunctions;
+import org.teiid.query.processor.xml.XMLUtil;
import org.teiid.query.sql.lang.XMLTable;
import org.teiid.query.sql.lang.XMLTable.XMLColumn;
import org.teiid.query.sql.symbol.DerivedColumn;
@@ -122,6 +131,7 @@
private net.sf.saxon.query.XQueryExpression xQuery;
private Configuration config = new Configuration();
+ private PathMapRoot contextRoot;
public SaxonXQueryExpression(String xQueryString, XMLNamespaces namespaces, List<DerivedColumn> passing, List<XMLTable.XMLColumn> columns)
throws QueryResolverException {
@@ -166,11 +176,24 @@
}
}
+ private SaxonXQueryExpression() {
+
+ }
+
+ public SaxonXQueryExpression clone() {
+ SaxonXQueryExpression clone = new SaxonXQueryExpression();
+ clone.xQuery = xQuery;
+ clone.config = config;
+ clone.contextRoot = contextRoot;
+ return clone;
+ }
+
public boolean usesContextItem() {
return this.xQuery.usesContextItem();
}
- public PathMapRoot useDocumentProjection(List<XMLTable.XMLColumn> columns, AnalysisRecord record) {
+ public void useDocumentProjection(List<XMLTable.XMLColumn> columns, AnalysisRecord record) {
+ this.contextRoot = null;
PathMap map = this.xQuery.getPathMap();
PathMapRoot parentRoot;
try {
@@ -179,7 +202,7 @@
if (record.recordDebug()) {
record.println("Document projection will not be used, since multiple context item exist."); //$NON-NLS-1$
}
- return null;
+ return;
}
if (parentRoot == null) {
//TODO: this seems like we could omit the context item altogether
@@ -187,7 +210,7 @@
if (record.recordDebug()) {
record.println("Document projection will not be used, since no context item reference was found in the XQuery"); //$NON-NLS-1$
}
- return null;
+ return;
}
HashSet<PathMapNode> finalNodes = new HashSet<PathMapNode>();
getReturnableNodes(parentRoot, finalNodes);
@@ -198,11 +221,11 @@
if (record.recordDebug()) {
record.println("Document projection will not be used, since multiple return items exist"); //$NON-NLS-1$
}
- return null;
+ return;
}
parentRoot = projectColumns(parentRoot, columns, finalNodes.iterator().next(), record);
if (parentRoot == null) {
- return null;
+ return;
}
} else {
for (Iterator iter = finalNodes.iterator(); iter.hasNext(); ) {
@@ -215,14 +238,14 @@
if (record.recordDebug()) {
record.println("Document projection will not be used since there are unknown dependencies (most likely a user defined function)."); //$NON-NLS-1$
}
- return null;
+ return;
}
if (record.recordDebug()) {
StringBuilder sb = new StringBuilder();
showArcs(sb, parentRoot, 0);
record.println("Using path filtering for XQuery context item: \n" + sb.toString()); //$NON-NLS-1$
}
- return parentRoot;
+ this.contextRoot = parentRoot;
}
private PathMapRoot projectColumns(PathMapRoot parentRoot, List<XMLTable.XMLColumn> columns, PathMapNode finalNode, AnalysisRecord record) {
@@ -331,36 +354,19 @@
}
}
- public static Source convertToSource(Object value) throws TeiidProcessingException {
- if (value == null) {
- return null;
- }
- try {
- if (value instanceof XMLType) {
- return ((SQLXML)value).getSource(null);
- }
- if (value instanceof ClobType) {
- return new StreamSource(((Clob)value).getCharacterStream());
- }
- } catch (SQLException e) {
- throw new TeiidProcessingException(e);
- }
- throw new AssertionError("Unknown type"); //$NON-NLS-1$
- }
-
- public SequenceIterator evaluateXQuery(Object context, PathMapRoot contextRoot, Map<String, Object> parameterValues) throws TeiidProcessingException {
+ public SequenceIterator evaluateXQuery(Object context, Map<String, Object> parameterValues) throws TeiidProcessingException {
DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
for (Map.Entry<String, Object> entry : parameterValues.entrySet()) {
Object value = entry.getValue();
- if(value instanceof SQLXML || value instanceof Clob) {
- value = convertToSource(value);
+ if(value instanceof SQLXML) {
+ value = XMLSystemFunctions.convertToSource(value);
}
dynamicContext.setParameter(entry.getKey(), value);
}
if (context != null) {
- Source source = convertToSource(context);
+ Source source = XMLSystemFunctions.convertToSource(context);
if (contextRoot != null) {
//create our own filter as this logic is not provided in the free saxon
ProxyReceiver filter = new PathMapFilter(contextRoot);
@@ -383,6 +389,47 @@
}
}
+ public XMLType createXMLType(final SequenceIterator iter, boolean emptyOnEmpty) throws XPathException, TeiidComponentException, TeiidProcessingException {
+ Item item = iter.next();
+ if (item == null && !emptyOnEmpty) {
+ return null;
+ }
+ XMLType.Type type = Type.CONTENT;
+ if (item instanceof NodeInfo) {
+ NodeInfo info = (NodeInfo)item;
+ switch (info.getNodeKind()) {
+ case net.sf.saxon.type.Type.DOCUMENT:
+ type = Type.DOCUMENT;
+ break;
+ case net.sf.saxon.type.Type.ELEMENT:
+ type = Type.ELEMENT;
+ break;
+ case net.sf.saxon.type.Type.TEXT:
+ type = Type.TEXT;
+ break;
+ }
+ }
+ Item next = iter.next();
+ if (next != null) {
+ type = Type.CONTENT;
+ }
+ SQLXMLImpl xml = XMLUtil.saveToBufferManager(new XMLTranslator() {
+
+ @Override
+ public void translate(Writer writer) throws TransformerException,
+ IOException {
+ Properties props = new Properties();
+ props.setProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+ //props.setProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
+ QueryResult.serializeSequence(iter.getAnother(), config, writer, props);
+ }
+ });
+ XMLType value = new XMLType(xml);
+ value.setType(type);
+ return value;
+ }
+
public Configuration getConfig() {
return config;
}
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-06-08 19:11:59 UTC (rev 2202)
@@ -321,15 +321,22 @@
<XMLAGG: "xmlagg">
| <XMLATTRIBUTES: "xmlattributes">
| <XMLBINARY: "xmlbinary">
+| <XMLCAST: "xmlcast">
| <XMLCONCAT: "xmlconcat">
| <XMLCOMMENT: "xmlcomment">
+| <XMLDOCUMENT: "xmldocument">
| <XMLELEMENT: "xmlelement">
+| <XMLEXISTS: "xmlexists">
| <XMLFOREST: "xmlforest">
+| <XMLITERATE: "xmliterate">
| <XMLNAMESPACES: "xmlnamespaces">
| <XMLPARSE: "xmlparse">
| <XMLPI: "xmlpi">
-| <XMLROOT: "xmlroot">
+| <XMLQUERY: "xmlquery">
| <XMLSERIALIZE: "xmlserialize">
+| <XMLTABLE: "xmltable">
+| <XMLTEXT: "xmltext">
+| <XMLVALIDATE: "xmlvalidate">
}
TOKEN : /* SQL/MED Reserved words */
@@ -1883,7 +1890,7 @@
{
( LOOKAHEAD(<ID> <LPAREN>, { "texttable".equalsIgnoreCase(getToken(1).image) }) clause = textTable(info)
|
- LOOKAHEAD(<ID> <LPAREN>, { "xmltable".equalsIgnoreCase(getToken(1).image) }) clause = xmlTable(info)
+ clause = xmlTable(info)
|
clause = unaryFromClause(info)
|
@@ -2038,7 +2045,7 @@
Boolean empty = null;
}
{
- <ID> <LPAREN>
+ <XMLQUERY> <LPAREN>
[ xmlNamespaces = xmlNamespaces(info) <COMMA> ]
xquery = stringVal()
[
@@ -2056,20 +2063,20 @@
}
)*
]
- [
+/* [
LOOKAHEAD(<ID>, { "returning".equalsIgnoreCase(getToken(1).image) }) <ID>
(
LOOKAHEAD(<ID>, { "content".equalsIgnoreCase(getToken(1).image) }) <ID> { content = true; }
|
LOOKAHEAD(<ID>, { "sequence".equalsIgnoreCase(getToken(1).image) }) (<ID> { content = false; }
- [
- (<NULL> { empty = false; }
- |
- nonReserved("EMPTY") { empty = true; }
- )
- <ON> nonReserved("EMPTY")
- ])
)
+ ]*/
+ [
+ (<NULL> { empty = false; }
+ |
+ nonReserved("EMPTY") { empty = true; }
+ )
+ <ON> nonReserved("EMPTY")
]
<RPAREN>
{
@@ -2078,7 +2085,6 @@
result.setNamespaces(xmlNamespaces);
result.setPassing(passingValues);
result.setEmptyOnEmpty(empty);
- result.setReturningContent(content);
return result;
}
}
@@ -2094,7 +2100,7 @@
String aliasID = null;
}
{
- <ID> <LPAREN>
+ <XMLTABLE> <LPAREN>
[ xmlNamespaces = xmlNamespaces(info) <COMMA> ]
xquery = stringVal()
[
@@ -3339,7 +3345,7 @@
{
return expression;
}
- | LOOKAHEAD(<ID>, { "xmlQuery".equalsIgnoreCase(getToken(1).image) }) expression = xmlQuery(info)
+ | expression = xmlQuery(info)
{
return expression;
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-08 19:11:59 UTC (rev 2202)
@@ -819,7 +819,6 @@
Evaluator.xmlserialize=XMLSerialize: data exception - not an xml document
Evaluator.xmlquery=Error evaluating XMLQuery: {0}
Evaluator.xmlquery_content=XQuery evaluation was expected to return content, but it returned a sequence.
-Evaluator.xmlquery_content_empty=XQuery evaluation was expected to return content, but was empty.
FunctionDefinitionsReader.Read_error=Error reading FunctionDefinitions.xmi: {0}
FunctionDefinitionsSource.Read_error=Error reading {0}
ExecResolver.Param_convert_fail=Unable to convert procedural parameter of type {0} to expected type {1}
@@ -895,7 +894,7 @@
ValidationVisitor.text_table_newline=Text table DELIMITER, QUOTE, and ESCAPE characters cannot be the new line character.
ValidationVisitor.xml_namespaces=At most only one NO DEFAULT or DEFAULT namespace may be specified.
ValidationVisitor.xml_namespaces_reserved=At most only one NO DEFAULT or DEFAULT namespace may be specified.
-ValidationVisitor.context_item_type=XMLTABLE or XMLQUERY PASSING context item must be an XML or CLOB value.
+ValidationVisitor.context_item_type=XMLTABLE or XMLQUERY PASSING context item must be an XML value.
ValidationVisitor.passing_requires_name=XMLTABLE or XMLQUERY PASSING clause can only contain at most 1 unnamed item.
ValidationVisitor.duplicate_passing=XMLTABLE or XMLQUERY PASSING clause duplicate item name "{0}".
ValidationVisitor.one_ordinal=Only one FOR ORDINALITY column is allowed for an XMLTABLE.
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -68,6 +68,15 @@
public Object getConnection() {
return new FakeConnection();
}
+
+ @Override
+ public Object getConnection(Object factory) throws TranslatorException {
+ return factory;
+ }
+
+ @Override
+ public void closeConnection(Object connection, Object factory) {
+ }
private class FakeConnection {
public FakeConnection() {
Modified: trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/test/java/org/teiid/query/function/source/TestXMLSystemFunctions.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -25,7 +25,6 @@
import static org.junit.Assert.*;
import java.io.File;
-import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.sql.Timestamp;
@@ -38,12 +37,12 @@
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.SQLXMLImpl;
import org.teiid.core.types.XMLType;
import org.teiid.core.util.FileUtil;
import org.teiid.core.util.UnitTestUtil;
-
@SuppressWarnings("nls")
public class TestXMLSystemFunctions {
@@ -53,16 +52,15 @@
return util.read();
}
- public String helpTestXpathValue(final String xmlFilePath, final String xpath, final String expected) throws IOException, XPathException {
+ public String helpTestXpathValue(final String xmlFilePath, final String xpath, final String expected) throws XPathException, TeiidProcessingException {
final String actual = helpGetNode(xmlFilePath,xpath);
assertEquals(expected,actual);
return actual;
}
- public String helpGetNode(final String xmlFilePath, final String xpath ) throws IOException, XPathException {
+ public String helpGetNode(final String xmlFilePath, final String xpath ) throws XPathException, TeiidProcessingException {
final String xmlContent = getContentOfTestFile(xmlFilePath);
- final Reader docReader = new StringReader(xmlContent);
- return XMLSystemFunctions.xpathValue(docReader,xpath);
+ return XMLSystemFunctions.xpathValue(xmlContent,xpath);
}
public void helpCheckElement(final Object jdomNode, final String name, final String prefix, final String namespaceUri,
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -6819,9 +6819,8 @@
XMLQuery f = new XMLQuery();
f.setXquery("/x");
f.setEmptyOnEmpty(false);
- f.setReturningContent(false);
f.setPassing(Arrays.asList(new DerivedColumn(null, new ElementSymbol("foo"))));
- helpTestExpression("xmlquery('/x' passing foo returning sequence null on empty)", "XMLQUERY('/x' PASSING foo RETURNING SEQUENCE NULL ON EMPTY)", f);
+ helpTestExpression("xmlquery('/x' passing foo null on empty)", "XMLQUERY('/x' PASSING foo NULL ON EMPTY)", f);
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -328,7 +328,7 @@
}
@Test public void testXmlQuery() {
- String sql = "select xmlquery('for $i in (1 to 5) return $i' returning sequence)"; //$NON-NLS-1$
+ String sql = "select xmlquery('for $i in (1 to 5) return $i')"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList("1 2 3 4 5"),
@@ -342,36 +342,8 @@
helpProcess(plan, dataManager, expected);
}
- @Test(expected=TeiidProcessingException.class) public void testXmlQueryContentError() throws Exception {
- String sql = "select xmlquery('for $i in $e1 return $i' passing e1 as e1) from pm1.g1 order by e1 limit 1"; //$NON-NLS-1$
-
- List<?>[] expected = new List<?>[] {
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, createCommandContext(), dataManager, expected);
- }
-
- @Test(expected=TeiidProcessingException.class) public void testXmlQueryEmpty() throws Exception {
- String sql = "select xmlquery('/a' passing xmlelement(x, e1)) from pm1.g1 order by e1 limit 1"; //$NON-NLS-1$
-
- List<?>[] expected = new List<?>[] {
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, createCommandContext(), dataManager, expected);
- }
-
@Test public void testXmlQueryEmptyNull() throws Exception {
- String sql = "select xmlquery('/a' passing {x '<x/>'} returning sequence null on empty)"; //$NON-NLS-1$
+ String sql = "select xmlquery('/a' passing {x '<x/>'} null on empty)"; //$NON-NLS-1$
List<?>[] expected = new List<?>[] {
Arrays.asList((String)null)
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/pom.xml 2010-06-08 19:11:59 UTC (rev 2202)
@@ -473,17 +473,6 @@
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
- <dependency>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>nux</groupId>
- <artifactId>nux</artifactId>
- <version>1.6</version>
- </dependency>
-
</dependencies>
</dependencyManagement>
<modules>
Modified: trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorUtil.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorUtil.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorUtil.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -43,7 +43,7 @@
assertEquals("correctly-assigned", my.getMyProperty());
}
- public static class MyTranslator extends ExecutionFactory {
+ public static class MyTranslator extends ExecutionFactory<Object, Object> {
String mine;
@TranslatorProperty(display="my-property")
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-06-08 18:36:09 UTC (rev 2201)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-06-08 19:11:59 UTC (rev 2202)
@@ -22,7 +22,7 @@
import org.teiid.translator.ResultSetExecution;
-public class MockConnector extends ExecutionFactory {
+public class MockConnector extends ExecutionFactory<Object, Object> {
@Override
14 years, 6 months
teiid SVN: r2201 - in trunk/client/src: test/java/org/teiid/adminapi/impl and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-06-08 14:36:09 -0400 (Tue, 08 Jun 2010)
New Revision: 2201
Modified:
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
Log:
Misc: Adding override translator info to the unit test
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-06-08 18:08:42 UTC (rev 2200)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-06-08 18:36:09 UTC (rev 2201)
@@ -174,7 +174,7 @@
return new ArrayList<Translator>(this.translators.getMap().values());
}
- public void setTranslators(List<Translator> translators) {
+ public void setOverrideTranslators(List<Translator> translators) {
for (Translator t: translators) {
this.translators.getMap().put(t.getName(), (VDBTranslatorMetaData)t);
}
Modified: trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-06-08 18:08:42 UTC (rev 2200)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-06-08 18:36:09 UTC (rev 2201)
@@ -21,10 +21,15 @@
*/
package org.teiid.adminapi.impl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.io.StringReader;
import java.io.StringWriter;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -38,9 +43,10 @@
import org.junit.Test;
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Model;
+import org.teiid.adminapi.Translator;
import org.teiid.adminapi.impl.DataPolicyMetadata.PermissionMetaData;
-
+@SuppressWarnings("nls")
public class TestVDBMetaData {
@Test
@@ -73,6 +79,14 @@
vdb.addModel(modelTwo);
+ TranslatorMetaData t1 = new TranslatorMetaData();
+ t1.setName("oracleOverride");
+ t1.setType("oracle");
+ t1.addProperty("my-property", "my-value");
+ List<Translator> list = new ArrayList<Translator>();
+ list.add(t1);
+ vdb.setOverrideTranslators(list);
+
DataPolicyMetadata roleOne = new DataPolicyMetadata();
roleOne.setName("roleOne"); //$NON-NLS-1$
roleOne.setDescription("roleOne described"); //$NON-NLS-1$
@@ -92,7 +106,6 @@
vdb.addDataPolicy(roleOne);
-
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd")); //$NON-NLS-1$
JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {VDBMetaData.class});
@@ -137,6 +150,14 @@
assertTrue(vdb.getValidityErrors().contains("There is an error in VDB")); //$NON-NLS-1$
+ List<Translator> translators = vdb.getOverrideTranslators();
+ assertTrue(translators.size() == 1);
+
+ Translator translator = translators.get(0);
+ assertEquals("oracleOverride", translator.getName());
+ assertEquals("oracle", translator.getType());
+ assertEquals("my-value", translator.getPropertyValue("my-property"));
+
List<DataPolicy> roles = vdb.getDataPolicies();
assertTrue(roles.size() == 1);
14 years, 6 months
teiid SVN: r2200 - trunk/console/src/main/resources/META-INF.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-06-08 14:08:42 -0400 (Tue, 08 Jun 2010)
New Revision: 2200
Modified:
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-1116: Changed ssl enabled property name
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-06-08 17:58:27 UTC (rev 2199)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-06-08 18:08:42 UTC (rev 2200)
@@ -333,7 +333,7 @@
displayName="Jdbc Socket Configuration Properties" hiddenByDefault="false">
<c:simple-property name="portNumber" displayName="Port Number"
description="Port Number" required="false" readOnly="false" />
- <c:simple-property name="enabled" displayName=" SSL Enabled"
+ <c:simple-property name="sslEnabled" displayName="SSL Enabled"
description="SSL enabled" required="false" readOnly="false" type="boolean"
default="true" />
<c:simple-property name="hostName" displayName="Host Name"
14 years, 6 months