From 906a4ce648cbcef097f7da2888f88e082a0b8d5c Mon Sep 17 00:00:00 2001 From: huangjian Date: Wed, 14 Sep 2016 23:59:44 +0800 Subject: Add wso2bpel-ext code Change-Id: I774e0ede1668ee8b4ef03bb48a2fb2971fbd3757 Signed-off-by: huangjian --- wso2bpel-ext/wso2bpel-core/distribution/pom.xml | 33 + .../wso2bpel-core/distribution/standalone/pom.xml | 153 + .../standalone/src/main/assembly/conf/wso2bpel.yml | 76 + .../src/main/assembly/find_kill_process.bat | 25 + .../standalone/src/main/assembly/run.bat | 41 + .../standalone/src/main/assembly/run.sh | 35 + .../standalone/src/main/assembly/stop.bat | 35 + .../standalone/src/main/assembly/stop.sh | 45 + wso2bpel-ext/wso2bpel-core/pom.xml | 34 + .../wso2bpel-mgr/lib/XmlSchema_1.4.7.wso2v3.jar | Bin 0 -> 141813 bytes .../wso2bpel-mgr/lib/axiom_1.2.11.wso2v10.jar | Bin 0 -> 2320023 bytes .../wso2bpel-mgr/lib/axion_1.0.0.M3-dev-wso2v1.jar | Bin 0 -> 30891 bytes .../lib/axis2-jaxbri_1.6.1.wso2v17.jar | Bin 0 -> 24589 bytes .../wso2bpel-mgr/lib/axis2-json_1.6.1.wso2v17.jar | Bin 0 -> 64684 bytes .../lib/axis2-transport-jms_1.1.1.wso2v2.jar | Bin 0 -> 92732 bytes .../lib/axis2-transport-mail_1.1.0.wso2v13.jar | Bin 0 -> 42996 bytes .../lib/axis2-transport-sms_1.1.0.wso2v13.jar | Bin 0 -> 48094 bytes .../wso2bpel-mgr/lib/axis2_1.6.1.wso2v17.jar | Bin 0 -> 7899077 bytes .../wso2bpel-mgr/lib/commons-beanutils-1.9.2.jar | Bin 0 -> 233859 bytes .../lib/commons-codec_1.4.0.wso2v1.jar | Bin 0 -> 52434 bytes .../wso2bpel-mgr/lib/commons-collections-3.2.1.jar | Bin 0 -> 575389 bytes .../lib/commons-fileupload_1.2.2.wso2v1.jar | Bin 0 -> 54790 bytes .../lib/commons-httpclient_3.1.0.wso2v2.jar | Bin 0 -> 568561 bytes .../wso2bpel-mgr/lib/commons-io_2.4.0.wso2v1.jar | Bin 0 -> 181260 bytes .../wso2bpel-mgr/lib/commons-lang-2.5.jar | Bin 0 -> 279193 bytes .../wso2bpel-mgr/lib/commons-lang3-3.2.jar | Bin 0 -> 384767 bytes .../wso2bpel-mgr/lib/commons-logging-1.0.4.jar | Bin 0 -> 38015 bytes .../wso2bpel-mgr/lib/ezmorph-1.0.6.jar | Bin 0 -> 86487 bytes .../wso2bpel-mgr/lib/httpclient_4.3.1.wso2v2.jar | Bin 0 -> 589296 bytes .../wso2bpel-mgr/lib/httpcore_4.3.3.wso2v1.jar | Bin 0 -> 278948 bytes .../wso2bpel-mgr/lib/httpmime_4.3.1.wso2v2.jar | Bin 0 -> 32770 bytes .../wso2bpel-mgr/lib/jackson-annotations-2.5.0.jar | Bin 0 -> 39815 bytes .../wso2bpel-mgr/lib/javassist-3.3.ga.jar | Bin 0 -> 459663 bytes .../wso2bpel-mgr/lib/javax.annotation-api-1.2.jar | Bin 0 -> 26366 bytes .../wso2bpel-mgr/lib/javax.ws.rs-api-2.0.1.jar | Bin 0 -> 115534 bytes .../wso2bpel-core/wso2bpel-mgr/lib/jdom.jar | Bin 0 -> 127118 bytes .../wso2bpel-mgr/lib/jersey-media-jaxb.jar | Bin 0 -> 72733 bytes .../lib/jersey-media-multipart-2.22.2.jar | Bin 0 -> 67855 bytes .../wso2bpel-mgr/lib/jersey-server.jar | Bin 0 -> 951701 bytes .../wso2bpel-mgr/lib/json-lib-2.4-jdk15.jar | Bin 0 -> 159123 bytes .../wso2bpel-mgr/lib/log4j-1.2.16-patch.jar | Bin 0 -> 486336 bytes .../wso2bpel-core/wso2bpel-mgr/lib/looks-2.2.1.jar | Bin 0 -> 425495 bytes .../wso2bpel-mgr/lib/mimepull-1.9.3.jar | Bin 0 -> 62135 bytes .../wso2bpel-mgr/lib/neethi_2.0.4.wso2v5.jar | Bin 0 -> 28643 bytes .../lib/org.wso2.carbon.bpel.stub_4.4.7.jar | Bin 0 -> 1032436 bytes .../lib/org.wso2.securevault_1.0.0.wso2v2.jar | Bin 0 -> 80183 bytes .../wso2bpel-mgr/lib/soapui-1.7.1.jar | Bin 0 -> 2031098 bytes .../wso2bpel-mgr/lib/soapui-xmlbeans-1.7.jar | Bin 0 -> 299196 bytes .../wso2bpel-mgr/lib/wsdl4j_1.6.2.wso2v4.jar | Bin 0 -> 193193 bytes .../wso2bpel-mgr/lib/xmlbeans-2.4.0.jar | Bin 0 -> 2694049 bytes wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/pom.xml | 219 ++ .../org/openo/carbon/bpel/Wso2BpelApplication.java | 106 + .../openo/carbon/bpel/Wso2BpelConfiguration.java | 71 + .../java/org/openo/carbon/bpel/common/Config.java | 30 + .../openo/carbon/bpel/common/ServiceRegistrer.java | 66 + .../carbon/bpel/config/AbstractBpsProperties.java | 57 + .../carbon/bpel/config/BpsCommonProperties.java | 33 + .../carbon/bpel/config/BpsExtraProperties.java | 37 + .../openo/carbon/bpel/config/ConfigManager.java | 46 + .../bpel/externalservice/entity/ServiceNode.java | 33 + .../entity/ServiceRegisterEntity.java | 53 + .../msb/MicroserviceBusConsumer.java | 48 + .../externalservice/msb/MicroserviceBusRest.java | 39 + .../openo/carbon/bpel/resources/BpsPackage.java | 503 +++ .../openo/carbon/bpel/resources/BpsProcess.java | 536 ++++ .../openo/carbon/bpel/resources/RestAppConfig.java | 37 + .../openo/carbon/bpel/util/ClientWsdlLoader.java | 82 + .../java/org/openo/carbon/bpel/util/JsonUtil.java | 61 + .../openo/carbon/bpel/util/LRULinkedHashMap.java | 106 + .../java/org/openo/carbon/bpel/util/SoapUtil.java | 156 + .../org/openo/carbon/bpel/util/Xml2JsonUtil.java | 141 + .../main/resources/api-doc/META-INF/MANIFEST.MF | 3 + .../src/main/resources/api-doc/WEB-INF/web.xml | 40 + .../src/main/resources/api-doc/css/reset.css | 125 + .../src/main/resources/api-doc/css/screen.css | 1256 ++++++++ .../src/main/resources/api-doc/css/typography.css | 26 + .../api-doc/fonts/droid-sans-v6-latin-700.eot | Bin 0 -> 22924 bytes .../api-doc/fonts/droid-sans-v6-latin-700.svg | 411 +++ .../api-doc/fonts/droid-sans-v6-latin-700.ttf | Bin 0 -> 40516 bytes .../api-doc/fonts/droid-sans-v6-latin-700.woff | Bin 0 -> 25992 bytes .../api-doc/fonts/droid-sans-v6-latin-700.woff2 | Bin 0 -> 11480 bytes .../api-doc/fonts/droid-sans-v6-latin-regular.eot | Bin 0 -> 22008 bytes .../api-doc/fonts/droid-sans-v6-latin-regular.svg | 403 +++ .../api-doc/fonts/droid-sans-v6-latin-regular.ttf | Bin 0 -> 39072 bytes .../api-doc/fonts/droid-sans-v6-latin-regular.woff | Bin 0 -> 24868 bytes .../fonts/droid-sans-v6-latin-regular.woff2 | Bin 0 -> 11304 bytes .../resources/api-doc/images/explorer_icons.png | Bin 0 -> 5763 bytes .../main/resources/api-doc/images/logo_small.png | Bin 0 -> 770 bytes .../resources/api-doc/images/pet_store_api.png | Bin 0 -> 824 bytes .../src/main/resources/api-doc/images/throbber.gif | Bin 0 -> 9257 bytes .../main/resources/api-doc/images/wordnik_api.png | Bin 0 -> 980 bytes .../src/main/resources/api-doc/index.html | 99 + .../src/main/resources/api-doc/lib/backbone-min.js | 15 + .../main/resources/api-doc/lib/handlebars-2.0.0.js | 28 + .../resources/api-doc/lib/highlight.7.3.pack.js | 1 + .../main/resources/api-doc/lib/jquery-1.8.0.min.js | 2 + .../resources/api-doc/lib/jquery.ba-bbq.min.js | 18 + .../resources/api-doc/lib/jquery.slideto.min.js | 1 + .../resources/api-doc/lib/jquery.wiggle.min.js | 8 + .../src/main/resources/api-doc/lib/marked.js | 1272 ++++++++ .../src/main/resources/api-doc/lib/shred.bundle.js | 2765 ++++++++++++++++ .../main/resources/api-doc/lib/shred/content.js | 193 ++ .../main/resources/api-doc/lib/swagger-client.js | 3294 ++++++++++++++++++++ .../main/resources/api-doc/lib/swagger-oauth.js | 279 ++ .../main/resources/api-doc/lib/underscore-min.js | 6 + .../src/main/resources/api-doc/o2c.html | 20 + .../src/main/resources/api-doc/swagger-ui.js | 2240 +++++++++++++ .../src/main/resources/api-doc/swagger-ui.min.js | 2 + .../wso2bpel-mgr/src/main/resources/banner.txt | 9 + .../src/main/resources/config.properties | 16 + .../wso2bpel-mgr/src/main/resources/migrations.xml | 21 + .../src/main/resources/wso2-config.properties | 24 + 112 files changed, 15514 insertions(+) create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/pom.xml create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat create mode 100644 wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh create mode 100644 wso2bpel-ext/wso2bpel-core/pom.xml create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/XmlSchema_1.4.7.wso2v3.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axiom_1.2.11.wso2v10.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axion_1.0.0.M3-dev-wso2v1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-jaxbri_1.6.1.wso2v17.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-json_1.6.1.wso2v17.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-jms_1.1.1.wso2v2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-mail_1.1.0.wso2v13.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-sms_1.1.0.wso2v13.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2_1.6.1.wso2v17.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-beanutils-1.9.2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-codec_1.4.0.wso2v1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-collections-3.2.1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-fileupload_1.2.2.wso2v1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-httpclient_3.1.0.wso2v2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-io_2.4.0.wso2v1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang-2.5.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang3-3.2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-logging-1.0.4.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/ezmorph-1.0.6.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpclient_4.3.1.wso2v2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpcore_4.3.3.wso2v1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpmime_4.3.1.wso2v2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jackson-annotations-2.5.0.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javassist-3.3.ga.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.annotation-api-1.2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.ws.rs-api-2.0.1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jdom.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-jaxb.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-multipart-2.22.2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-server.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/json-lib-2.4-jdk15.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/log4j-1.2.16-patch.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/looks-2.2.1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/mimepull-1.9.3.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/neethi_2.0.4.wso2v5.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.carbon.bpel.stub_4.4.7.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.securevault_1.0.0.wso2v2.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-1.7.1.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-xmlbeans-1.7.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/wsdl4j_1.6.2.wso2v4.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/xmlbeans-2.4.0.jar create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/pom.xml create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelApplication.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/Config.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/ServiceRegistrer.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceNode.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceRegisterEntity.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusConsumer.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusRest.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/RestAppConfig.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/ClientWsdlLoader.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/JsonUtil.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/LRULinkedHashMap.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/SoapUtil.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/Xml2JsonUtil.java create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/WEB-INF/web.xml create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/reset.css create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/screen.css create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/typography.css create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/explorer_icons.png create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/logo_small.png create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/pet_store_api.png create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/throbber.gif create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/wordnik_api.png create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/index.html create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/backbone-min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/jquery.slideto.min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/jquery.wiggle.min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/marked.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/shred.bundle.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/shred/content.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/swagger-client.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/swagger-oauth.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/underscore-min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/o2c.html create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/swagger-ui.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/swagger-ui.min.js create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/banner.txt create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/config.properties create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/migrations.xml create mode 100644 wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/wso2-config.properties (limited to 'wso2bpel-ext/wso2bpel-core') diff --git a/wso2bpel-ext/wso2bpel-core/distribution/pom.xml b/wso2bpel-ext/wso2bpel-core/distribution/pom.xml new file mode 100644 index 0000000..1c0a794 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/pom.xml @@ -0,0 +1,33 @@ + + + + org.openo.common-services.common-utilities + wso2bpel-core-parent + 1.0.0-SNAPSHOT + + + 4.0.0 + distribution + + pom + + + standalone + + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml new file mode 100644 index 0000000..af35250 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml @@ -0,0 +1,153 @@ + + + + org.openo.common-services.common-utilities + distribution + 1.0.0-SNAPSHOT + + + 4.0.0 + standalone + + pom + + + openo-commonservice-commonutilities + + + + + + maven-resources-plugin + + + copy-resources + process-resources + + copy-resources + + + ${basedir}/target/assembly/ + + + src/main/assembly/ + false + + **/* + + + + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-jar + + copy + + prepare-package + + + + org.openo.common-services.common-utilities + wso2bpel-mgr + jar + true + target/assembly/ + wso2bpel-service.jar + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + zip + package + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + + attach-artifact + + + + + target/${packagename}-${project.version}.zip + zip + + + + + + + + + + + + org.openo.common-services.common-utilities + wso2bpel-mgr + ${project.version} + + + + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml new file mode 100644 index 0000000..530a2b8 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml @@ -0,0 +1,76 @@ +# +# Copyright 2016 [ZTE] and others. +# +# 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. +# + +template: Hello, %s! + +#defaultName: ${DW_DEFAULT_NAME:-Stranger} + +msbServerAddr: http://127.0.0.1:80 +#database +#database: + +# # the name of your JDBC driver +# driverClass: com.mysql.jdbc.Driver + +# # the username +# user: wso2bpel + +# # the password +# password: wso2bpel + +# # the JDBC URL +# url: jdbc:mysql://127.0.0.1:3306/wso2bpel + +# use the simple server factory if you only want to run on a single port +#server: +# type: simple +# connector: +# type: http +# port: 8080 +server: + type: simple + rootPath: '/*' + applicationContextPath: / + adminContextPath: /admin + connector: + type: http + port: 8101 + +# Logging settings. +logging: + + # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL. + level: ALL + + # Logger-specific levels. + loggers: + + # Sets the level for 'com.example.app' to DEBUG. + org.openo.carbon.bpel.Wso2BpelApplication: INFO + + appenders: + - type: console + threshold: INFO + timeZone: UTC + logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n" + - type: file + threshold: INFO + logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n" + currentLogFilename: ./logs/wso2bpel-ext.log + archivedLogFilenamePattern: ./logs/zip/wso2bpel-ext-%d{yyyy-MM-dd}.log.gz + archivedFileCount: 7 + timeZone: UTC + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat new file mode 100644 index 0000000..3e4e981 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat @@ -0,0 +1,25 @@ +@REM +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +echo %1 | findstr %2 >NUL +echo ERRORLEVEL=%ERRORLEVEL% +IF ERRORLEVEL 1 goto findend +for /f "tokens=1" %%a in (%1) do ( + echo kill %1 + taskkill /F /pid %%a +) +:findend \ No newline at end of file diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat new file mode 100644 index 0000000..5f6d093 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat @@ -0,0 +1,41 @@ +@REM +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +@echo off +title wso2bpel-service + +set RUNHOME=%~dp0 +echo ### RUNHOME: %RUNHOME% +echo ### Starting wso2bpel-service + +set JAVA="%JAVA_HOME%\bin\java.exe" +set port=8312 +set jvm_opts=-Xms50m -Xmx128m +rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n +set class_path=%RUNHOME%;lib\*;%RUNHOME%wso2bpel-service.jar +echo ### jvm_opts: %jvm_opts% +echo ### class_path: %class_path% + +%JAVA% -classpath %class_path% %jvm_opts% org.openo.carbon.bpel.Wso2BpelApplication server %RUNHOME%conf/wso2bpel.yml + +IF ERRORLEVEL 1 goto showerror +exit +:showerror +echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check! +echo After checking, press any key to close +pause +exit \ No newline at end of file diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh new file mode 100644 index 0000000..6046356 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh @@ -0,0 +1,35 @@ +# +# +# Copyright 2016 [ZTE] and others. +# +# 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. +# + +DIRNAME=`dirname $0` +RUNHOME=`cd $DIRNAME/; pwd` +echo @RUNHOME@ $RUNHOME + +echo @JAVA_HOME@ $JAVA_HOME +JAVA="$JAVA_HOME/bin/java" +echo @JAVA@ $JAVA + +JAVA_OPTS="-Xms50m -Xmx128m" +port=8312 +#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" +echo @JAVA_OPTS@ $JAVA_OPTS + +class_path="$RUNHOME/:dependency\*:$RUNHOME/wso2bpel-service.jar" +echo @class_path@ $class_path + +"$JAVA" $JAVA_OPTS -classpath "$class_path" org.openo.carbon.bpel.Wso2BpelApplication server "$RUNHOME/conf/wso2bpel.yml" + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat new file mode 100644 index 0000000..3d3e42a --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat @@ -0,0 +1,35 @@ +@REM +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +@echo off +title stopping wso2bpel-service + +set HOME=%~dp0 +set Main_Class="org.openo.carbon.bpel.Wso2BpelApplication" + +echo ================== wso2bpel-service info ============================================= +echo HOME=$HOME +echo Main_Class=%Main_Class% +echo =============================================================================== + +echo ### Stopping wso2bpel-service +cd /d %HOME% + +for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do ( + call find_kill_process "%%i" %Main_Class% +) +exit \ No newline at end of file diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh new file mode 100644 index 0000000..0b03b41 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# +# Copyright 2016 [ZTE] and others. +# +# 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. +# + +DIRNAME=`dirname $0` +HOME=`cd $DIRNAME/; pwd` +Main_Class="org.openo.carbon.bpel.Wso2BpelApplication" + +echo ================== wso2bpel-service info ============================================= +echo HOME=$HOME +echo Main_Class=$Main_Class +echo =============================================================================== +cd $HOME; pwd + +echo @WORK_DIR@ $HOME + +function save_service_pid(){ + service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'` + echo @service_pid@ $service_pid +} + +function kill_service_process(){ + ps -p $service_pid + if [ $? == 0 ]; then + kill -9 $service_pid + fi +} + +save_service_pid; +echo @C_CMD@ kill -9 $service_pid +kill_service_process; diff --git a/wso2bpel-ext/wso2bpel-core/pom.xml b/wso2bpel-ext/wso2bpel-core/pom.xml new file mode 100644 index 0000000..44b92c3 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/pom.xml @@ -0,0 +1,34 @@ + + + + org.openo.common-services.common-utilities + wso2bpel-root + 1.0.0-SNAPSHOT + + + 4.0.0 + wso2bpel-core-parent + + pom + + + wso2bpel-mgr + distribution + + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/XmlSchema_1.4.7.wso2v3.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/XmlSchema_1.4.7.wso2v3.jar new file mode 100644 index 0000000..d6a9797 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/XmlSchema_1.4.7.wso2v3.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axiom_1.2.11.wso2v10.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axiom_1.2.11.wso2v10.jar new file mode 100644 index 0000000..d7dc3c4 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axiom_1.2.11.wso2v10.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axion_1.0.0.M3-dev-wso2v1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axion_1.0.0.M3-dev-wso2v1.jar new file mode 100644 index 0000000..a57f03f Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axion_1.0.0.M3-dev-wso2v1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-jaxbri_1.6.1.wso2v17.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-jaxbri_1.6.1.wso2v17.jar new file mode 100644 index 0000000..ccf726e Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-jaxbri_1.6.1.wso2v17.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-json_1.6.1.wso2v17.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-json_1.6.1.wso2v17.jar new file mode 100644 index 0000000..2ed751d Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-json_1.6.1.wso2v17.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-jms_1.1.1.wso2v2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-jms_1.1.1.wso2v2.jar new file mode 100644 index 0000000..6a97e2d Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-jms_1.1.1.wso2v2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-mail_1.1.0.wso2v13.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-mail_1.1.0.wso2v13.jar new file mode 100644 index 0000000..76b0e87 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-mail_1.1.0.wso2v13.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-sms_1.1.0.wso2v13.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-sms_1.1.0.wso2v13.jar new file mode 100644 index 0000000..3fdfa27 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2-transport-sms_1.1.0.wso2v13.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2_1.6.1.wso2v17.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2_1.6.1.wso2v17.jar new file mode 100644 index 0000000..fe1752e Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/axis2_1.6.1.wso2v17.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-beanutils-1.9.2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-beanutils-1.9.2.jar new file mode 100644 index 0000000..7d075ed Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-beanutils-1.9.2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-codec_1.4.0.wso2v1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-codec_1.4.0.wso2v1.jar new file mode 100644 index 0000000..578d94b Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-codec_1.4.0.wso2v1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-collections-3.2.1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-collections-3.2.1.jar new file mode 100644 index 0000000..c35fa1f Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-collections-3.2.1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-fileupload_1.2.2.wso2v1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-fileupload_1.2.2.wso2v1.jar new file mode 100644 index 0000000..f0422b9 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-fileupload_1.2.2.wso2v1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-httpclient_3.1.0.wso2v2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-httpclient_3.1.0.wso2v2.jar new file mode 100644 index 0000000..a2262bf Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-httpclient_3.1.0.wso2v2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-io_2.4.0.wso2v1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-io_2.4.0.wso2v1.jar new file mode 100644 index 0000000..909853b Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-io_2.4.0.wso2v1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang-2.5.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang-2.5.jar new file mode 100644 index 0000000..ae491da Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang-2.5.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang3-3.2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang3-3.2.jar new file mode 100644 index 0000000..a30d272 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-lang3-3.2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-logging-1.0.4.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-logging-1.0.4.jar new file mode 100644 index 0000000..b73a80f Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/commons-logging-1.0.4.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/ezmorph-1.0.6.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/ezmorph-1.0.6.jar new file mode 100644 index 0000000..30fad12 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/ezmorph-1.0.6.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpclient_4.3.1.wso2v2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpclient_4.3.1.wso2v2.jar new file mode 100644 index 0000000..41fca19 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpclient_4.3.1.wso2v2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpcore_4.3.3.wso2v1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpcore_4.3.3.wso2v1.jar new file mode 100644 index 0000000..fcdd948 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpcore_4.3.3.wso2v1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpmime_4.3.1.wso2v2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpmime_4.3.1.wso2v2.jar new file mode 100644 index 0000000..bebb5e1 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/httpmime_4.3.1.wso2v2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jackson-annotations-2.5.0.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jackson-annotations-2.5.0.jar new file mode 100644 index 0000000..6252131 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jackson-annotations-2.5.0.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javassist-3.3.ga.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javassist-3.3.ga.jar new file mode 100644 index 0000000..d834b3a Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javassist-3.3.ga.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.annotation-api-1.2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.annotation-api-1.2.jar new file mode 100644 index 0000000..9ab39ff Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.annotation-api-1.2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.ws.rs-api-2.0.1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.ws.rs-api-2.0.1.jar new file mode 100644 index 0000000..7eb68b4 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/javax.ws.rs-api-2.0.1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jdom.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jdom.jar new file mode 100644 index 0000000..7ccb9fd Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jdom.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-jaxb.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-jaxb.jar new file mode 100644 index 0000000..9ea2cc1 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-jaxb.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-multipart-2.22.2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-multipart-2.22.2.jar new file mode 100644 index 0000000..f9ef216 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-media-multipart-2.22.2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-server.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-server.jar new file mode 100644 index 0000000..893e2dc Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/jersey-server.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/json-lib-2.4-jdk15.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/json-lib-2.4-jdk15.jar new file mode 100644 index 0000000..68d4f3b Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/json-lib-2.4-jdk15.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/log4j-1.2.16-patch.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/log4j-1.2.16-patch.jar new file mode 100644 index 0000000..f7f4c6d Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/log4j-1.2.16-patch.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/looks-2.2.1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/looks-2.2.1.jar new file mode 100644 index 0000000..78b367c Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/looks-2.2.1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/mimepull-1.9.3.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/mimepull-1.9.3.jar new file mode 100644 index 0000000..c323455 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/mimepull-1.9.3.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/neethi_2.0.4.wso2v5.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/neethi_2.0.4.wso2v5.jar new file mode 100644 index 0000000..4bb49f2 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/neethi_2.0.4.wso2v5.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.carbon.bpel.stub_4.4.7.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.carbon.bpel.stub_4.4.7.jar new file mode 100644 index 0000000..6d0cb58 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.carbon.bpel.stub_4.4.7.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.securevault_1.0.0.wso2v2.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.securevault_1.0.0.wso2v2.jar new file mode 100644 index 0000000..3ab7704 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/org.wso2.securevault_1.0.0.wso2v2.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-1.7.1.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-1.7.1.jar new file mode 100644 index 0000000..cd394a6 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-1.7.1.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-xmlbeans-1.7.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-xmlbeans-1.7.jar new file mode 100644 index 0000000..79fad6f Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/soapui-xmlbeans-1.7.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/wsdl4j_1.6.2.wso2v4.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/wsdl4j_1.6.2.wso2v4.jar new file mode 100644 index 0000000..57a67dd Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/wsdl4j_1.6.2.wso2v4.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/xmlbeans-2.4.0.jar b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/xmlbeans-2.4.0.jar new file mode 100644 index 0000000..5f1016c Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/lib/xmlbeans-2.4.0.jar differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/pom.xml b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/pom.xml new file mode 100644 index 0000000..d4b6e9f --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/pom.xml @@ -0,0 +1,219 @@ + + + + + org.openo.common-services.common-utilities + wso2bpel-core-parent + 1.0.0-SNAPSHOT + + + 4.0.0 + wso2bpel-mgr + + jar + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + UTF-8 + + -verbose + -Xlint:unchecked + -Xlint:deprecation + -bootclasspath + ${env.JAVA_HOME}/jre/lib/rt.jar + -extdirs + ${project.basedir}/lib + + + + + org.eclipse.m2e + lifecycle-mapping + + + + + + org.apache.maven.plugins + maven-dependency-plugin + [2.0,) + + copy-dependencies + + + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + + + + org.apache.maven.plugins + maven-shade-plugin + + true + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + package + + shade + + + + + + org.openo.carbon.bpel.Wso2BpelApplication + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + + io.dropwizard + dropwizard-core + ${dropwizard.version} + true + + + + + + + + + + + + io.dropwizard + dropwizard-core + + + io.dropwizard + dropwizard-assets + + + io.dropwizard + dropwizard-hibernate + + + + org.projectlombok + lombok + + + io.swagger + swagger-jersey2-jaxrs + + + + org.glassfish.jersey.core + jersey-server + + + org.glassfish.jersey.media + jersey-media-multipart + + + org.glassfish.jersey.containers + jersey-container-servlet-core + + + + com.eclipsesource.jaxrs + consumer + + + com.eclipsesource.jaxrs + jersey-all + + + + + + com.google.code.gson + gson + + + + junit + junit + test + + + org.powermock + powermock-module-junit4 + test + + + org.powermock + powermock-api-mockito + test + + + org.apache.ant + ant + test + + + + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelApplication.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelApplication.java new file mode 100644 index 0000000..97e793a --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelApplication.java @@ -0,0 +1,106 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel; + +import io.dropwizard.Application; +import io.dropwizard.assets.AssetsBundle; +import io.dropwizard.configuration.EnvironmentVariableSubstitutor; +import io.dropwizard.configuration.SubstitutingSourceProvider; +import io.dropwizard.server.SimpleServerFactory; +import io.dropwizard.setup.Bootstrap; +import io.dropwizard.setup.Environment; +import io.swagger.jaxrs.config.BeanConfig; +import io.swagger.jaxrs.listing.ApiListingResource; + +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.openo.carbon.bpel.common.Config; +import org.openo.carbon.bpel.common.ServiceRegistrer; +import org.openo.carbon.bpel.resources.BpsPackage; +import org.openo.carbon.bpel.resources.BpsProcess; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonInclude; + + + +public class Wso2BpelApplication extends Application { + private static final Logger LOGGER = LoggerFactory.getLogger(Wso2BpelApplication.class); + private static final String API_RESOURCE = "org.openo.carbon.bpel.resources"; + + public static void main(String[] args) throws Exception { + new Wso2BpelApplication().run(args); + } + + + @Override + public String getName() { + return "hello-wso2bpel"; + } + + @Override + public void initialize(Bootstrap bootstrap) { + bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider( + bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false))); + // binding jar static resource + bootstrap.addBundle(new AssetsBundle("/api-doc", "/api-doc", "index.html", "api-doc")); + } + + private void initService() { + Thread registerWso2bpelService = new Thread(new ServiceRegistrer()); + registerWso2bpelService.setName("register wso2bpel service to Microservice Bus"); + registerWso2bpelService.start(); + } + + + + @Override + public void run(Wso2BpelConfiguration configuration, Environment environment) { + environment.jersey().register(MultiPartFeature.class); + environment.jersey().register(new BpsPackage()); + environment.jersey().register(new BpsProcess()); + // init Swagger conf + initSwaggerConfig(environment, configuration); + Config.setConfigration(configuration); + initService(); + } + + private void initSwaggerConfig(Environment environment, Wso2BpelConfiguration configuration) { + // register swagger scan class + environment.jersey().register(new ApiListingResource()); + environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); + + BeanConfig config = new BeanConfig(); + config.setTitle(configuration.getApiDescription()); + config.setVersion("1.0"); + config.setResourcePackage(API_RESOURCE); + + // read rootPath config from yml + SimpleServerFactory simpleServerFactory = + (SimpleServerFactory) configuration.getServerFactory(); + String basePath = simpleServerFactory.getApplicationContextPath(); + String rootPath = simpleServerFactory.getJerseyRootPath(); + + // set basepath for rest api + rootPath = rootPath.substring(0, rootPath.indexOf("/*")); + basePath = basePath.equals("/") ? rootPath + : (new StringBuilder()).append(basePath).append(rootPath).toString(); + + LOGGER.info("getApplicationContextPath:" + basePath); + config.setBasePath(basePath); + config.setScan(true); + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java new file mode 100644 index 0000000..8494b54 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java @@ -0,0 +1,71 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel; + +import io.dropwizard.Configuration; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.dropwizard.db.DataSourceFactory; +import org.hibernate.validator.constraints.NotEmpty; + +import javax.validation.constraints.NotNull; + +public class Wso2BpelConfiguration extends Configuration { + @NotEmpty + private String template; + @NotEmpty + private String apiDescription = "Wso2bps REST API"; + @NotNull + private DataSourceFactory database = new DataSourceFactory(); + + @JsonProperty + public String getTemplate() { + return template; + } + + @JsonProperty + public String getApiDescription() { + return apiDescription; + } + + @NotEmpty + private String msbServerAddr; + + @JsonProperty("database") + public DataSourceFactory getDataSourceFactory() { + return database; + } + + @JsonProperty + public DataSourceFactory getDatabase() { + return database; + } + + @JsonProperty + public void setDatabase(DataSourceFactory database) { + this.database = database; + } + + @JsonProperty + public String getMsbServerAddr() { + return msbServerAddr; + } + + @JsonProperty + public void setMsbServerAddr(String msbServerAddr) { + this.msbServerAddr = msbServerAddr; + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/Config.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/Config.java new file mode 100644 index 0000000..3d3daec --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/Config.java @@ -0,0 +1,30 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.common; + +import org.openo.carbon.bpel.Wso2BpelConfiguration; + +public class Config { + private static Wso2BpelConfiguration configration; + + public static Wso2BpelConfiguration getConfigration() { + return configration; + } + + public static void setConfigration(Wso2BpelConfiguration config) { + configration = config; + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/ServiceRegistrer.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/ServiceRegistrer.java new file mode 100644 index 0000000..2fe3817 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/common/ServiceRegistrer.java @@ -0,0 +1,66 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.common; + +import org.openo.carbon.bpel.externalservice.entity.ServiceRegisterEntity; +import org.openo.carbon.bpel.externalservice.msb.MicroserviceBusConsumer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ServiceRegistrer implements Runnable { + private static final Logger LOG = LoggerFactory.getLogger(ServiceRegistrer.class); + private final ServiceRegisterEntity wso2bpelEntity = new ServiceRegisterEntity(); + + @Override + public void run() { + LOG.info("start wso2bpelEntity microservice register"); + boolean flag = false; + int retry = 0; + while (!flag && retry < 1000) { + LOG.info("wso2bpel microservice register.retry:" + retry); + retry++; + flag = MicroserviceBusConsumer.registerService(wso2bpelEntity); + if (flag == false) { + LOG.warn("microservice register failed, sleep 30S and try again."); + threadSleep(30000); + } else { + LOG.info("microservice register success!"); + break; + } + } + LOG.info("wso2bpel microservice register end."); + } + + private void threadSleep(int second) { + LOG.info("start sleep ...."); + try { + Thread.sleep(second); + } catch (InterruptedException error) { + LOG.error("thread sleep error.errorMsg:" + error.getMessage()); + } + LOG.info("sleep end ."); + } + + private void initServiceEntity() { + wso2bpelEntity.setServiceName("wso2bpel"); + wso2bpelEntity.setProtocol("REST"); + wso2bpelEntity.setVersion("v1"); + wso2bpelEntity.setUrl("/openoapi/wso2bpel/v1"); + wso2bpelEntity.setSingleNode(null, "8101", 0); + wso2bpelEntity.setVisualRange("1"); + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java new file mode 100644 index 0000000..dc2411f --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java @@ -0,0 +1,57 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.config; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Properties; + +import org.apache.commons.lang3.StringUtils; +import org.apache.log4j.Logger; + +public abstract class AbstractBpsProperties { + private static final Logger dmsg = Logger.getLogger(AbstractBpsProperties.class.getName()); + private Properties properties; + + protected AbstractBpsProperties() { + properties = new Properties(); + /* + * URL commonConfigURL = AbstractBpsProperties.class.getResource(getConfigName()); if + * (commonConfigURL != null) { try { properties.load(new FileInputStream(new + * File(commonConfigURL.getFile()))); } catch (IOException e) { dmsg.error(e.getMessage(), e); } + * } + */ + + File propertyFile = new File(getConfigName()); + try { + if (propertyFile != null) { + properties.load(this.getClass().getResourceAsStream("/" + propertyFile.getName())); + } + } catch (FileNotFoundException e) { + dmsg.error(e.getMessage(), e); + } catch (Exception e) { + dmsg.error(e.getMessage(), e); + } + + } + + protected abstract String getConfigName(); + + public String getProperty(String propertyName) { + String value = properties.getProperty(propertyName); + return StringUtils.trimToEmpty(value); + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java new file mode 100644 index 0000000..7a9c706 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java @@ -0,0 +1,33 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.config; + +public class BpsCommonProperties extends AbstractBpsProperties { + private static BpsCommonProperties instance; + + public static BpsCommonProperties getInstance() { + if (instance == null) { + instance = new BpsCommonProperties(); + } + return instance; + } + + @Override + protected String getConfigName() { + return "config.properties"; + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java new file mode 100644 index 0000000..bcfe1dc --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java @@ -0,0 +1,37 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.config; + +public class BpsExtraProperties extends AbstractBpsProperties { + private static BpsExtraProperties instance = null; + + public static synchronized BpsExtraProperties getInstance() { + if (instance == null) { + instance = new BpsExtraProperties(); + } + return instance; + } + + @Override + protected String getConfigName() { + /* + * String[] paths = null; URL url = BpsExtraProperties.class.getResource(""); if (url != null) { + * paths = url.getPath().split("jar!"); } if (paths == null || paths.length <= 1) { return null; + * } + */ + return "wso2-config.properties"; + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java new file mode 100644 index 0000000..79b30ec --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java @@ -0,0 +1,46 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.config; + +import org.apache.commons.lang3.StringUtils; + +public class ConfigManager { + private static BpsExtraProperties extraProperties; + private static BpsCommonProperties commonProperties; + private static ConfigManager instance = null; + + private ConfigManager() { + commonProperties = BpsCommonProperties.getInstance(); + extraProperties = BpsExtraProperties.getInstance(); + } + + public static synchronized ConfigManager getInstance() { + if (instance == null) { + instance = new ConfigManager(); + } + return instance; + } + + public String getProperty(String key) { + String value = extraProperties.getProperty(key); + value = StringUtils.trimToEmpty(value); + if (StringUtils.isBlank(value)) { + return commonProperties.getProperty(key); + } + return value; + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceNode.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceNode.java new file mode 100644 index 0000000..fbea87a --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceNode.java @@ -0,0 +1,33 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.externalservice.entity; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class ServiceNode { + private String ip; + private String port; + private int ttl; +} + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceRegisterEntity.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceRegisterEntity.java new file mode 100644 index 0000000..3c4585d --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/entity/ServiceRegisterEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.externalservice.entity; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class ServiceRegisterEntity { + private String serviceName; + private String version; + private String url; + private String protocol; + private String visualRange; + private ArrayList nodes = new ArrayList(); + + /** + * set service entity. + * + * @param ip node ip. can be null + * @param port service port + * @param ttl service survival time + */ + public void setSingleNode(String ip, String port, int ttl) { + ServiceNode node = new ServiceNode(); + node.setIp(ip); + node.setPort(port); + node.setTtl(ttl); + nodes.add(node); + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusConsumer.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusConsumer.java new file mode 100644 index 0000000..dcf765a --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusConsumer.java @@ -0,0 +1,48 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.externalservice.msb; + +import com.eclipsesource.jaxrs.consumer.ConsumerFactory; + +import org.glassfish.jersey.client.ClientConfig; +import org.openo.carbon.bpel.common.Config; +import org.openo.carbon.bpel.externalservice.entity.ServiceRegisterEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + + + +public class MicroserviceBusConsumer { + private static final Logger LOG = LoggerFactory.getLogger(MicroserviceBusConsumer.class); + + /** + * @param entity service entity + * @return register service to msb success return true, else return false. + */ + public static boolean registerService(ServiceRegisterEntity entity) { + ClientConfig config = new ClientConfig(); + try { + MicroserviceBusRest resourceserviceproxy = ConsumerFactory.createConsumer( + Config.getConfigration().getMsbServerAddr(), config, MicroserviceBusRest.class); + resourceserviceproxy.registerServce("false", entity); + } catch (Exception error) { + LOG.error("microservice register failed!" + error.getMessage()); + return false; + } + return true; + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusRest.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusRest.java new file mode 100644 index 0000000..82a43ea --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/externalservice/msb/MicroserviceBusRest.java @@ -0,0 +1,39 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.externalservice.msb; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +import org.openo.carbon.bpel.externalservice.entity.ServiceRegisterEntity; + + + + +@Path("/openoapi/microservices/v1/services") +// @Path("/api/microservices/v1/services") +public interface MicroserviceBusRest { + @Path("") + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public ServiceRegisterEntity registerServce(@QueryParam("createOrUpdate") String createOrUpdate, + ServiceRegisterEntity entity)throws Exception; +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java new file mode 100644 index 0000000..c197e86 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java @@ -0,0 +1,503 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.resources; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; + +import javax.activation.DataHandler; +import javax.activation.DataSource; +import javax.activation.FileDataSource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.xml.namespace.QName; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMNamespace; +import org.apache.axis2.AxisFault; +import org.apache.axis2.addressing.EndpointReference; +import org.apache.axis2.client.Options; +import org.apache.axis2.rpc.client.RPCServiceClient; +import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.axis2.transport.http.HttpTransportProperties; +import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator; +import org.apache.commons.io.FileUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataMultiPart; +import org.glassfish.jersey.media.multipart.FormDataParam; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; +import org.wso2.carbon.bpel.stub.upload.types.UploadedFileItem; +import org.openo.carbon.bpel.config.ConfigManager; +import org.openo.carbon.bpel.util.JsonUtil; +import org.openo.carbon.bpel.util.Xml2JsonUtil; + +import com.codahale.metrics.annotation.Timed; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +@Path("/openoapi/wso2bpel/v1") +@Api(tags = {"wso2 bpel api"}) +public class BpsPackage { + + private static final Log log = LogFactory.getLog(BpsPackage.class); + + public static final int STATUS_SUCCESS = 1; + public static final int STATUS_FAIL = 0; + + public static Set packageNameSet = new HashSet(); + + private Map configMap = null; + + @SuppressWarnings("unused") + private final AtomicLong counter; + + public BpsPackage() { + this.counter = new AtomicLong(); + } + + private synchronized String getConfig(String key) { + if (configMap == null) { + configMap = new HashMap(); + String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path"); + String jksFile = ConfigManager.getInstance().getProperty("wso2.ssl.jks.file"); + String trustStorePassword = + ConfigManager.getInstance().getProperty("wso2.ssl.trustStorePassword"); + String httpUsername = + ConfigManager.getInstance().getProperty("wso2.http.authenticator.username"); + String httpPassword = + ConfigManager.getInstance().getProperty("wso2.http.authenticator.password"); + String host = ConfigManager.getInstance().getProperty("wso2.host"); + String port = ConfigManager.getInstance().getProperty("wso2.http.port"); + configMap.put("uploadFilePath", uploadFilePath); + configMap.put("jksFile", jksFile); + configMap.put("trustStorePassword", trustStorePassword); + configMap.put("httpUsername", httpUsername); + configMap.put("httpPassword", httpPassword); + configMap.put("host", host); + configMap.put("port", port); + } + if (configMap.containsKey(key)) { + return configMap.get(key); + } else { + return ConfigManager.getInstance().getProperty(key); + } + } + + public static boolean lockPackageName(String packageName) { + boolean succeed = false; + synchronized (packageNameSet) { + if (!packageNameSet.contains(packageName)) { + packageNameSet.add(packageName); + succeed = true; + } + } + return succeed; + } + + public static boolean unlockPackageName(String packageName) { + boolean succeed = false; + synchronized (packageNameSet) { + if (packageNameSet.contains(packageName)) { + packageNameSet.remove(packageName); + succeed = true; + } + } + return succeed; + } + + @POST + @Path(value = "package") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(value = MediaType.APPLICATION_JSON) + @ApiOperation(value = "package process", response = Map.class) + @Timed + public Map uploadFile(@FormDataParam("filename") String filename, + @FormDataParam("file") InputStream fileInputStream, + @FormDataParam("file") FormDataContentDisposition fileDetail, + @Context HttpServletRequest request, @Context HttpServletResponse response) + throws IOException { + Map map = new LinkedHashMap(); + String errorMessage = "unkown"; + + String fileName = fileDetail.getFileName(); + String fullName = getConfig("uploadFilePath") + "/" + fileName; + File file = new File(fullName); + String packageName = null; + try { + if (fileName.endsWith(".zip")) { + packageName = fileName.substring(0, fileName.length() - 4); + } else { + throw new Exception("Only support *.zip file."); + } + if (!lockPackageName(packageName)) { + throw new Exception("Package " + packageName + " is operating."); + } + FileUtils.copyInputStreamToFile(fileInputStream, file); + System.setProperty("javax.net.ssl.trustStore", "*.keystore"); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", getConfig("jksFile")); + System.setProperty("javax.net.ssl.trustStorePassword", getConfig("trustStorePassword")); + + HttpTransportProperties.Authenticator authenticator = + new HttpTransportProperties.Authenticator(); + List auth = new ArrayList(); + auth.add(Authenticator.BASIC); + authenticator.setAuthSchemes(auth); + authenticator.setUsername(getConfig("httpUsername")); + authenticator.setPassword(getConfig("httpPassword")); + authenticator.setPreemptiveAuthentication(true); + + map.putAll(bpsDeployPackage(fileName, fullName, packageName, authenticator)); + + map.put("status", STATUS_SUCCESS); + map.put("message", "success"); + return map; + } catch (AxisFault e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (IOException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (Throwable e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } finally { + if (packageName != null) { + unlockPackageName(packageName); + } + } + map.put("status", STATUS_FAIL); + map.put("message", errorMessage); + return map; + } + + @SuppressWarnings("rawtypes") + private Map bpsDeployPackage(String fileName, String fullName, String packageName, + HttpTransportProperties.Authenticator authenticator) + throws JsonParseException, JsonMappingException, IOException, AxisFault, Exception { + Map map = new HashMap(); + Map deployedPackageInfoMap = getDeployedPackageInfo(authenticator, packageName); + if (deployedPackageInfoMap.get("packageName") != null) { + throw new Exception("Package " + deployedPackageInfoMap.get("packageName") + + " exist, please undeploy it first."); + } + OMElement element = deployPackage(fileName, fullName, authenticator); + System.out.println(Xml2JsonUtil.xml2JSON(element.toString())); + + long timeout = 60 * 1000L; + long timeStart = System.currentTimeMillis(); + while (System.currentTimeMillis() - timeStart < timeout) { + deployedPackageInfoMap = getDeployedPackageInfo(authenticator, packageName); + if (deployedPackageInfoMap.get("packageName") == null) { + Thread.sleep(2000); + } else { + break; + } + } + if (deployedPackageInfoMap.get("packageName") == null) { + throw new Exception( + "Package " + packageName + " deploy failed or deploy information is lost."); + } + map.put("packageName", deployedPackageInfoMap.get("packageName")); + map.put("processId", deployedPackageInfoMap.get("pid")); + return map; + } + + private OMElement deployPackage(String fileName, String fullName, + HttpTransportProperties.Authenticator authenticator) throws AxisFault { + String url = + "https://" + getConfig("host") + ":" + getConfig("port") + "/services/BPELUploader?wsdl"; + RPCServiceClient serviceClient = new RPCServiceClient(); + EndpointReference targetEPR = new EndpointReference(url); + Options options = serviceClient.getOptions(); + options.setTo(targetEPR); + options.setAction("urn:uploadService"); + options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(300000)); + options.setProperty(HTTPConstants.AUTHENTICATE, authenticator); + serviceClient.setOptions(options); + + QName qname = new QName("http://services.deployer.bpel.carbon.wso2.org", "uploadService"); + UploadedFileItem fileItem = new UploadedFileItem(); + fileItem.setFileName(fileName); + fileItem.setFileType("zip"); + + DataSource dataSource = new FileDataSource(fullName); + fileItem.setDataHandler(new DataHandler(dataSource)); + UploadedFileItem[] parameters = new UploadedFileItem[] {fileItem}; + OMElement element = serviceClient.invokeBlocking(qname, parameters); + return element; + } + + @Path(value = "package/{packageName}") + @DELETE + @Produces(value = MediaType.APPLICATION_JSON) + @ApiOperation(value = "delete", response = Map.class) + @Timed + public Map delete(@PathParam("packageName") String packageName, + @PathParam("param") String param, @Context HttpServletRequest request) { + Map map = new LinkedHashMap(); + String errorMessage = "unkown"; + try { + if (!lockPackageName(packageName)) { + throw new Exception("Package " + packageName + " is operating."); + } + System.setProperty("javax.net.ssl.trustStore", "*.keystore"); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", getConfig("jksFile")); + System.setProperty("javax.net.ssl.trustStorePassword", getConfig("trustStorePassword")); + + HttpTransportProperties.Authenticator authenticator = + new HttpTransportProperties.Authenticator(); + List auth = new ArrayList(); + auth.add(Authenticator.BASIC); + authenticator.setAuthSchemes(auth); + authenticator.setUsername("admin"); + authenticator.setPassword("admin"); + authenticator.setPreemptiveAuthentication(true); + + map.putAll(bpsUndeployPackage(packageName, authenticator)); + + return map; + } catch (AxisFault e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (Throwable e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } finally { + if (packageName != null) { + unlockPackageName(packageName); + } + } + map.put("status", STATUS_FAIL); + map.put("message", errorMessage); + return map; + } + + @SuppressWarnings({"rawtypes", "unused"}) + private Map bpsUndeployPackage(String packageName, + HttpTransportProperties.Authenticator authenticator) + throws JsonParseException, JsonMappingException, IOException, AxisFault, Exception { + Map map = new HashMap(); + Map deployedPackageInfoMap = getDeployedPackageInfo(authenticator, packageName); + if (deployedPackageInfoMap.get("packageName") == null) { + throw new Exception("Package " + deployedPackageInfoMap.get("packageName") + + " does not exist, please deploy it first."); + } + OMElement element = undeployPackage(authenticator, packageName); + deployedPackageInfoMap = getDeployedPackageInfo(authenticator, packageName); + if (deployedPackageInfoMap.get("packageName") != null) { + throw new Exception( + "Package " + deployedPackageInfoMap.get("packageName") + " undeploy failed."); + } + map.put("status", STATUS_SUCCESS); + map.put("message", "success"); + + return map; + } + + private OMElement undeployPackage(HttpTransportProperties.Authenticator authenticator, + String packageName) throws AxisFault { + String url = "https://" + getConfig("host") + ":" + getConfig("port") + + "/services/BPELPackageManagementService?wsdl"; + RPCServiceClient serviceClient = new RPCServiceClient(); + EndpointReference targetEPR = new EndpointReference(url); + Options options = serviceClient.getOptions(); + options.setTo(targetEPR); + options.setAction("sch:undeployBPELPackage"); + options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(300000)); + options.setProperty(HTTPConstants.AUTHENTICATE, authenticator); + serviceClient.setOptions(options); + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMNamespace omNs = fac.createOMNamespace("http://wso2.org/bps/management/schema", "sch"); + OMElement method = fac.createOMElement("undeployBPELPackage", omNs); + OMElement content = fac.createOMElement("package", omNs); + content.addChild(fac.createOMText(content, packageName)); + method.addChild(content); + method.build(); + OMElement res = serviceClient.sendReceive(method); + return res; + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private Map getDeployedPackageInfo(HttpTransportProperties.Authenticator authenticator, + String packageName) throws Exception { + Map resultMap = new HashMap(); + + String result; + String jsonTemplate = + "{'listDeployedPackagesPaginated':{'page':'','packageSearchString':'${searchString}'}}"; + Map jsonParamMap = new HashMap(); + jsonParamMap.put("searchString", packageName); + Object params = getParams(jsonTemplate, jsonParamMap); + result = BpsProcess.invokeWsdl("https://" + getConfig("host") + ":" + getConfig("port") + + "/services/BPELPackageManagementService?wsdl", params, authenticator); + System.out.println(result); + Map processMap = JsonUtil.json2Bean(result, Map.class); + Object packages = ((Map) processMap.get("deployedPackagesPaginated")).get("package"); + Map deployedPackage = null; + if (packages instanceof List) { + for (Iterator iter = ((List) packages).iterator(); iter.hasNext();) { + Map packageMap = (Map) iter.next(); + String deployedPackageName = (String) packageMap.get("name"); + if (deployedPackageName.equals(packageName)) { + deployedPackage = packageMap; + break; + } + } + } else if (packages instanceof Map) { + String deployedPackageName = (String) ((Map) packages).get("name"); + if (deployedPackageName.equals(packageName)) { + deployedPackage = (Map) packages; + } + } + if (deployedPackage != null) { + String fullPackageName = null; + String pid = null; + Object versions = ((Map) deployedPackage.get("versions")).get("version"); + Map lastestVersion = null; + if (versions instanceof List) { + for (Iterator iter = ((List) versions).iterator(); iter.hasNext();) { + Map version = (Map) iter.next(); + if (version.get("isLatest").equals("true")) { + lastestVersion = version; + } + } + } else if (versions instanceof Map) { + lastestVersion = (Map) versions; + } + fullPackageName = (String) ((Map) ((Map) lastestVersion.get("processes")).get("process")) + .get("packageName"); + pid = (String) ((Map) ((Map) lastestVersion.get("processes")).get("process")).get("pid"); + resultMap.put("packageName", fullPackageName); + resultMap.put("pid", pid); + } + return resultMap; + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + public static Map getParams(String jsonTemplate, Map paramMap) + throws JsonParseException, JsonMappingException, IOException { + String json = jsonTemplate.replaceAll("'", "\""); + for (Iterator iter = paramMap.keySet().iterator(); iter.hasNext();) { + String key = (String) iter.next(); + String value = paramMap.get(key).toString().replaceAll("\"", "\\\\\""); + json = json.replaceAll("\\$\\{" + key + "\\}", value); + } + return JsonUtil.json2Bean(json, Map.class); + } + + @SuppressWarnings("rawtypes") + public static void main(String[] args) { + try { + + boolean remoteDebug = true; + boolean localDebug = false; + if (remoteDebug) { + Client client = ClientBuilder.newBuilder().register(MultiPartFeature.class).build(); + WebTarget target = client.target("http://localhost:8101/openoapi/wso2bpel/v1/package"); + FileDataBodyPart bodyPart = new FileDataBodyPart("file", + new File("F:\\wso2bps-3.5.1\\wso2bps-3.5.1\\repository\\samples\\bpel\\Alarm.zip")); + FormDataMultiPart formDataMultiPart = new FormDataMultiPart(); + formDataMultiPart.field("fileName", "Alarm.zip").bodyPart(bodyPart); + String result = target.request(MediaType.APPLICATION_JSON) + .post(Entity.entity(formDataMultiPart, formDataMultiPart.getMediaType()), String.class); + System.out.println(result); + } + // + // System.out.println("************************************************************************"); + // + // bodyPart = new FileDataBodyPart("file", new + // File("D:\\temp\\bpel-sample\\AssignDate\\AssignDate.zip")); + // formDataMultiPart = new FormDataMultiPart(); + // formDataMultiPart.field("fileName", + // "AssignDate.zip").bodyPart(bodyPart); + // result = target.request(MediaType.APPLICATION_JSON) + // .post(Entity.entity(formDataMultiPart, + // formDataMultiPart.getMediaType()), String.class); + // System.out.println(result); + // + if (localDebug) { + System.setProperty("javax.net.ssl.trustStore", "*.keystore"); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", + "D:\\software\\WSO2\\wso2bps-3.5.1\\repository\\resources\\security\\wso2carbon.jks"); + System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon"); + HttpTransportProperties.Authenticator authenticator = + new HttpTransportProperties.Authenticator(); + List auth = new ArrayList(); + auth.add(Authenticator.BASIC); + authenticator.setAuthSchemes(auth); + authenticator.setUsername("admin"); + authenticator.setPassword("admin"); + authenticator.setPreemptiveAuthentication(true); + // + // String packageName = "RESTProcess"; + // Map deployedPackageInfoMap = + // getDeployedPackageInfo(authenticator, packageName); + + BpsPackage packageTest = new BpsPackage(); + Map map; + // map = packageTest.bpsUndeployPackage("AssignDate", + // authenticator); + // System.out.println(JsonUtil.bean2Json(map)); + map = packageTest.bpsDeployPackage("AssignDate.zip", + "D:\\temp\\bpel-sample\\AssignDate\\AssignDate.zip", "AssignDate", authenticator); + System.out.println(JsonUtil.bean2Json(map)); + map = packageTest.bpsUndeployPackage("AssignDate", authenticator); + System.out.println(JsonUtil.bean2Json(map)); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java new file mode 100644 index 0000000..6185f8b --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java @@ -0,0 +1,536 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.resources; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.xml.namespace.QName; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMAttribute; +import org.apache.axiom.om.OMDocument; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMNamespace; +import org.apache.axiom.om.OMText; +import org.apache.axiom.om.OMXMLBuilderFactory; +import org.apache.axiom.om.OMXMLParserWrapper; +import org.apache.axiom.om.util.StAXParserConfiguration; +import org.apache.axis2.AxisFault; +import org.apache.axis2.addressing.EndpointReference; +import org.apache.axis2.client.Options; +import org.apache.axis2.client.ServiceClient; +import org.apache.axis2.rpc.client.RPCServiceClient; +import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.axis2.transport.http.HttpTransportProperties; +import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.openo.carbon.bpel.config.ConfigManager; +import org.openo.carbon.bpel.util.JsonUtil; +import org.openo.carbon.bpel.util.SoapUtil; +import org.openo.carbon.bpel.util.Xml2JsonUtil; + +import com.codahale.metrics.annotation.Timed; +import com.eviware.soapui.model.iface.MessagePart; +import com.eviware.soapui.model.iface.Request; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +@Path("/openoapi/wso2bpel/v1") +@Api(tags = {"wso2 bpel api"}) +public class BpsProcess { + + private static final Log log = LogFactory.getLog(BpsProcess.class); + + public static final int STATUS_SUCCESS = 1; + public static final int STATUS_FAIL = 0; + + private Map configMap = null; + + @SuppressWarnings("unused") + private final AtomicLong counter; + + public BpsProcess() { + this.counter = new AtomicLong(); + } + + private synchronized String getConfig(String key) { + if (configMap == null) { + configMap = new HashMap(); + String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path"); + String jksFile = ConfigManager.getInstance().getProperty("wso2.ssl.jks.file"); + String trustStorePassword = + ConfigManager.getInstance().getProperty("wso2.ssl.trustStorePassword"); + String httpUsername = + ConfigManager.getInstance().getProperty("wso2.http.authenticator.username"); + String httpPassword = + ConfigManager.getInstance().getProperty("wso2.http.authenticator.password"); + String host = ConfigManager.getInstance().getProperty("wso2.host"); + String port = ConfigManager.getInstance().getProperty("wso2.http.port"); + configMap.put("uploadFilePath", uploadFilePath); + configMap.put("jksFile", jksFile); + configMap.put("trustStorePassword", trustStorePassword); + configMap.put("httpUsername", httpUsername); + configMap.put("httpPassword", httpPassword); + configMap.put("host", host); + configMap.put("port", port); + } + if (configMap.containsKey(key)) { + return configMap.get(key); + } else { + return ConfigManager.getInstance().getProperty(key); + } + } + + @SuppressWarnings("unchecked") + @POST + @Path("process/instance") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(value = MediaType.APPLICATION_JSON) + @ApiOperation(value = "startProcess", response = Map.class) + @Timed + public Map startProcess(JsonNode jsonObj, @Context HttpServletRequest request) { + Map map = new LinkedHashMap(); + String errorMessage = "unkown"; + + Map paramMap = new HashMap(); + try { + paramMap = JsonUtil.json2Bean(jsonObj.toString(), Map.class); + String processId = (String) paramMap.get("processId"); + + Object params = paramMap.get("params"); + + String wsdlUrl = getWsdlUrl(processId); + String response = invokeWsdl(wsdlUrl, params); + + map.put("status", STATUS_SUCCESS); + map.put("message", "success"); + // map.put("wsdl", wsdlUrl); + map.put("response", response); + return map; + } catch (JsonParseException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (JsonMappingException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (IOException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (Exception e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } + + map.put("status", STATUS_FAIL); + map.put("message", errorMessage); + return map; + } + + public static String invokeWsdl(String wsdlUrl, Object params) throws Exception { + return invokeWsdl(wsdlUrl, params, null); + } + + @SuppressWarnings({"unused", "rawtypes"}) + public static String invokeWsdl(String wsdlUrl, Object params, + HttpTransportProperties.Authenticator authenticator) throws Exception { + SoapUtil soapUtil = new SoapUtil(); + Request[] requestTemplates = soapUtil.getRequestTemplate(wsdlUrl); + String requestTemplate = null; + Request invokeRequest = null; + for (Request requestXML : requestTemplates) { + + InputStream is = new ByteArrayInputStream(requestXML.getRequestContent().getBytes()); + OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder( + OMAbstractFactory.getOMFactory(), StAXParserConfiguration.STANDALONE, is); + OMElement root = builder.getDocumentElement(); + OMDocument omDocument = builder.getDocument(); + Iterator iter = omDocument.getChildren(); + OMElement bodyElement = null; + while (iter.hasNext()) { + OMElement node = (OMElement) iter.next(); + String nodeName = node.getLocalName(); + if (nodeName.equals("Envelope")) { + Iterator envChildren = node.getChildElements(); + while (envChildren.hasNext()) { + Object childNode = envChildren.next(); + if (childNode instanceof OMElement) { + if (((OMElement) childNode).getLocalName().equals("Body")) { + bodyElement = (OMElement) childNode; + } + } + } + } + } + Set paramSet = new HashSet(); + Iterator bodyIter = bodyElement.getChildElements(); + while (bodyIter.hasNext()) { + Object obj = bodyIter.next(); + OMElement requestBody = (OMElement) obj; + paramSet.add(requestBody.getLocalName()); + } + if (params instanceof Map) { + Set paramKeySet = ((Map) params).keySet(); + boolean matched = true; + for (Object key : paramKeySet) { + if (!paramSet.contains(key)) { + matched = false; + continue; + } + } + if (matched) { + invokeRequest = requestXML; + requestTemplate = requestXML.getRequestContent(); + break; + } + } + } + if (requestTemplate == null) { + throw new Exception("Invalid param."); + } + + InputStream is = new ByteArrayInputStream(requestTemplate.getBytes()); + OMXMLParserWrapper builder = OMXMLBuilderFactory + .createOMBuilder(OMAbstractFactory.getOMFactory(), StAXParserConfiguration.STANDALONE, is); + OMElement root = builder.getDocumentElement(); + OMDocument omDocument = builder.getDocument(); + Iterator iter = omDocument.getChildren(); + OMElement bodyElement = null; + while (iter.hasNext()) { + OMElement node = (OMElement) iter.next(); + String nodeName = node.getLocalName(); + if (nodeName.equals("Envelope")) { + Iterator envChildren = node.getChildElements(); + while (envChildren.hasNext()) { + Object childNode = envChildren.next(); + if (childNode instanceof OMElement) { + if (((OMElement) childNode).getLocalName().equals("Body")) { + bodyElement = (OMElement) childNode; + } + } + } + } + } + + Options options = new Options(); + EndpointReference targetEPR = new EndpointReference(wsdlUrl); + options.setTo(targetEPR); + if (authenticator != null) { + options.setProperty(HTTPConstants.AUTHENTICATE, authenticator); + } + ServiceClient sender = new ServiceClient(); + sender.setOptions(options); + OMFactory factory = OMAbstractFactory.getOMFactory(); + OMElement requestBody = null; + Iterator bodyIter = bodyElement.getChildElements(); + while (bodyIter.hasNext()) { + Object obj = bodyIter.next(); + requestBody = (OMElement) obj; + } + + // Iterator requestBodyIter = requestBody.getChildElements(); + setParams(requestBody, params); + + requestBody.build(); + OMElement result = null; + boolean needResponse = false; + try { + MessagePart[] parts = invokeRequest.getResponseParts(); + if (parts != null && parts.length > 0) { + needResponse = true; + } + } catch (RuntimeException e) { + e.printStackTrace(); + } catch (Throwable e) { + e.printStackTrace(); + } + if (needResponse) { + result = sender.sendReceive(requestBody); + return Xml2JsonUtil.xml2JSON(result.toString()); + } else { + sender.sendRobust(requestBody); + return ""; + } + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private static void setParams(OMElement requestBody, Object params) { + Object currentParams = null; + if (params instanceof Map) { + currentParams = ((Map) params).get((requestBody).getLocalName()); + Object obj = requestBody.getFirstElement(); + if (obj == null) { + if (currentParams instanceof String) { + requestBody.setText((String) currentParams); + } + } else { + Iterator iter = requestBody.getChildElements(); + while (iter.hasNext()) { + OMElement child = iter.next(); + setParams((OMElement) child, currentParams); + } + } + } + } + + @SuppressWarnings("unchecked") + public String getWsdlUrl(String pid) { + log.warn("rest begin..."); + String wsdlUrl = null; + try { + System.setProperty("javax.net.ssl.trustStore", "*.keystore"); + + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + + System.setProperty("javax.net.ssl.trustStore", getConfig("jksFile")); + System.setProperty("javax.net.ssl.trustStorePassword", getConfig("trustStorePassword")); + + String url = "https://" + getConfig("host") + ":" + getConfig("port") + + "/services/ProcessManagementService?wsdl"; + RPCServiceClient serviceClient = new RPCServiceClient(); + EndpointReference targetEPR = new EndpointReference(url); + Options options = serviceClient.getOptions(); + options.setTo(targetEPR); + // options.setAction("sch:undeployBPELPackage"); + + options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(300000)); + HttpTransportProperties.Authenticator authenticator = + new HttpTransportProperties.Authenticator(); + List auth = new ArrayList(); + auth.add(Authenticator.BASIC); + authenticator.setAuthSchemes(auth); + authenticator.setUsername(getConfig("httpUsername")); + authenticator.setPassword(getConfig("httpPassword")); + authenticator.setPreemptiveAuthentication(true); + options.setProperty(HTTPConstants.AUTHENTICATE, authenticator); + + serviceClient.setOptions(options); + + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMNamespace omNs = fac.createOMNamespace("http://wso2.org/bps/management/schema", "sch"); + + OMElement method = fac.createOMElement("getProcessInfoIn", omNs); + QName pidQName = QName.valueOf(pid); + OMElement pidElement = fac.createOMElement("pid", omNs); + + pidElement.addChild(fac.createOMText(pidElement, pidQName)); + method.addChild(pidElement); + + method.build(); + + OMElement res = serviceClient.sendReceive(method); + res.getFirstElement().getText(); + + // System.out.println(JsonUtil.bean2Json(parse(res))); + + Iterator iter = res.getChildrenWithLocalName("endpoints"); + if (iter.hasNext()) { + OMElement endPoints = (OMElement) iter.next(); + Iterator endPointIter = endPoints.getChildrenWithLocalName("endpointRef"); + if (endPointIter.hasNext()) { + OMElement endpointRef = (OMElement) endPointIter.next(); + Iterator endpointRefIter = + endpointRef.getChildrenWithLocalName("serviceLocations"); + if (endpointRefIter.hasNext()) { + OMElement serviceLocations = (OMElement) endpointRefIter.next(); + Iterator serviceLocationsIter = + serviceLocations.getChildrenWithLocalName("serviceLocation"); + while (serviceLocationsIter.hasNext()) { + OMElement serviceLocation = (OMElement) serviceLocationsIter.next(); + String sUrl = serviceLocation.getText(); + if (sUrl.endsWith("wsdl")) { + wsdlUrl = sUrl; + break; + } + } + } + } + } + + } catch (AxisFault e) { + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (Throwable e) { + log.error(e.getMessage(), e); + e.printStackTrace(); + } finally { + log.warn("invoke finally..."); + } + return wsdlUrl; + } + + @SuppressWarnings({"unused", "rawtypes", "unchecked"}) + private Map parse(OMElement node) { + Map resultMap = new HashMap(); + Iterator attrIter = node.getAllAttributes(); + while (attrIter.hasNext()) { + OMAttribute attr = (OMAttribute) attrIter.next(); + resultMap.put(attr.getLocalName(), attr.getAttributeValue()); + } + boolean hasChild = false; + List childList = new ArrayList(); + Iterator childIter = node.getChildren();// getChildElements(); + while (childIter.hasNext()) { + hasChild = true; + Object child = childIter.next(); + if (child instanceof OMText) { + resultMap.put(node.getLocalName(), ((OMText) child).getText()); + } else if (child instanceof OMElement) { + childList.add(parse((OMElement) child)); + resultMap.put(node.getLocalName(), childList); + } + } + return resultMap; + } + + public static void main1(String[] args) { + Client client = ClientBuilder.newBuilder().register(MultiPartFeature.class).build(); + WebTarget target = client.target("http://127.0.0.1:8080/wso2bpel/v1/process/instance"); + String jsonObj = + "{\"processId\":\"{http://ode/bpel/unit-test}HelloWorld2-18\",\"params\": {\"hello\":{\"TestPart\":\"AAA\"}}}"; + Response response = target.request(MediaType.APPLICATION_JSON) + .post(Entity.entity(jsonObj, MediaType.APPLICATION_JSON)); + int responseCode = response.getStatus(); + if (responseCode == 200) { + String excuteRespJson = response.readEntity(String.class); + // context.setExcuteRespJson(excuteRespJson); + // System.out.println("excute responseJson=====" + + // context.getExcuteRespJson()); + System.out.println(excuteRespJson); + } + + System.out.println("************************************************************************"); + jsonObj = + "{\"processId\":\"{http://ode/bpel/unit-test}HelloWorld2-18\",\"params\": {\"hello\":{\"TestPart\":\"AAA\"}}}"; + BpsProcess process = new BpsProcess(); + try { + Map resultMap = process.startProcess(JsonUtil.getJsonNode(jsonObj), null); + System.out.println(JsonUtil.bean2Json(resultMap)); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println("************************************************************************"); + jsonObj = + "{\"processId\":\"{http://ode/bpel/unit-test}HelloXslWorld-3\",\"params\": {\"helloXsl\":{\"TestPart\":{\"content\":\"AAA\"}}}}"; + process = new BpsProcess(); + try { + Map resultMap = process.startProcess(JsonUtil.getJsonNode(jsonObj), null); + System.out.println(JsonUtil.bean2Json(resultMap)); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println("************************************************************************"); + jsonObj = + "{\"processId\":\"{http://wso2.org/bps/samples/While}While-5\",\"params\": {\"WhileRequest\":{\"input\":\"365\"}}}"; + process = new BpsProcess(); + try { + Map resultMap = process.startProcess(JsonUtil.getJsonNode(jsonObj), null); + System.out.println(JsonUtil.bean2Json(resultMap)); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } catch (IOException e) { + } + + } + + @SuppressWarnings("unchecked") + public static void main(String[] args) { + + Map map = new LinkedHashMap(); + String errorMessage = "unkown"; + + Map paramMap = new HashMap(); + try { + String param = + "{\"planInput\":{\"sfc_count\":\"2\",\"nsInstanceId\":\"223\",\"vnfmId\":\"112\",\"instanceId\":\"334\",\"object_context\":\"{\\\"e\\\":{\\\"f\\\":\\\"4\\\"}}\",\"vnf_count\":\"2\",\"serviceTemplateId\":\"?\",\"vl_count\":\"2\",\"containerapiUrl\":\"?\",\"object_additionalParamForVnf\":\"[{\\\"b\\\":1},{\\\"c\\\":{\\\"d\\\":\\\"2\\\"}}}]\",\"object_additionalParamForNs\":\"[{\\\"a\\\":3},{\\\"e\\\":{\\\"f\\\":\\\"4\\\"}}}]\"}}"; + String jsonObj = + "{\"processId\":\"{http://wso2.org/bps/samples/While}While-5\",\"params\":" + param + "}"; + paramMap = JsonUtil.json2Bean(jsonObj.toString(), Map.class); + Object params = paramMap.get("params"); + String wsdlUrl = "http://10.74.151.36:9763/services/initService?wsdl"; + String response = invokeWsdl(wsdlUrl, params); + map.put("status", STATUS_SUCCESS); + map.put("message", "success"); + map.put("response", response); + System.out.println(JsonUtil.bean2Json(map)); + } catch (JsonParseException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (JsonMappingException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (IOException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } catch (Exception e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } + + map.put("status", STATUS_FAIL); + map.put("message", errorMessage); + try { + System.out.println(JsonUtil.bean2Json(map)); + } catch (IOException e) { + errorMessage = e.getLocalizedMessage(); + log.error(e.getMessage(), e); + e.printStackTrace(); + } + + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/RestAppConfig.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/RestAppConfig.java new file mode 100644 index 0000000..9533397 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/RestAppConfig.java @@ -0,0 +1,37 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.resources; + +import javax.ws.rs.ApplicationPath; + +import org.glassfish.jersey.filter.LoggingFilter; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.server.ResourceConfig; + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +@ApplicationPath("/v1") +public class RestAppConfig extends ResourceConfig { + + public RestAppConfig() { + packages("org.wso2.carbon.bpel.rest.ext.v1"); + register(JacksonJsonProvider.class); + register(MultiPartFeature.class); + // register(MultiPartResource.class); + register(LoggingFilter.class); + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/ClientWsdlLoader.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/ClientWsdlLoader.java new file mode 100644 index 0000000..219d04d --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/ClientWsdlLoader.java @@ -0,0 +1,82 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.util; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URL; +import org.apache.log4j.Logger; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpException; +import org.apache.commons.httpclient.HttpStatus; +import org.apache.commons.httpclient.methods.GetMethod; + +import com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader; + +public class ClientWsdlLoader extends WsdlLoader { + private static Logger logger = Logger.getLogger(ClientWsdlLoader.class); + + private boolean isAborted = false; + private HttpClient httpClient; + + public ClientWsdlLoader(String url, HttpClient httpClient) { + super(url); + this.httpClient = httpClient; + } + + public InputStream load(String url) throws Exception { + GetMethod httpGetMethod; + + if (url.startsWith("file")) { + return new URL(url).openStream(); + } + + // Authentication is not being overridden on the method. It needs + // to be present on the supplied HttpClient instance! + httpGetMethod = new GetMethod(url); + httpGetMethod.setDoAuthentication(true); + + try { + int result = httpClient.executeMethod(httpGetMethod); + + if (result != HttpStatus.SC_OK) { + if (result < 200 || result > 299) { + throw new HttpException( + "Received status code '" + result + "' on WSDL HTTP (GET) request: '" + url + "'."); + } else { + logger.warn( + "Received status code '" + result + "' on WSDL HTTP (GET) request: '" + url + "'."); + } + } + + return new ByteArrayInputStream(httpGetMethod.getResponseBody()); + } finally { + httpGetMethod.releaseConnection(); + } + } + + public boolean abort() { + isAborted = true; + return true; + } + + public boolean isAborted() { + return isAborted; + } + + public void close() {} +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/JsonUtil.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/JsonUtil.java new file mode 100644 index 0000000..b1319fd --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/JsonUtil.java @@ -0,0 +1,61 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.util; + +import java.io.IOException; +import java.io.StringWriter; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class JsonUtil { + + @SuppressWarnings("deprecation") + public static String bean2Json(Object obj) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + StringWriter sw = new StringWriter(); + JsonGenerator gen = new JsonFactory().createJsonGenerator(sw); + mapper.writeValue(gen, obj); + gen.close(); + return sw.toString(); + } + + public static T json2Bean(String jsonStr, Class objClass) + throws JsonParseException, JsonMappingException, IOException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(jsonStr, objClass); + } + + @SuppressWarnings("deprecation") + public static T readJson(String jsonStr, Class collectionClass, Class... elementClasses) + throws Exception { + ObjectMapper mapper = new ObjectMapper(); + JavaType javaType = + mapper.getTypeFactory().constructParametricType(collectionClass, elementClasses); + return mapper.readValue(jsonStr, javaType); + } + + public static JsonNode getJsonNode(String json) throws JsonProcessingException, IOException { + return new ObjectMapper().readTree(json); + } + +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/LRULinkedHashMap.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/LRULinkedHashMap.java new file mode 100644 index 0000000..6315feb --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/LRULinkedHashMap.java @@ -0,0 +1,106 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.util; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +/** + * + * @author bsli + * + * @param + * @param + */ +@SuppressWarnings("serial") +public class LRULinkedHashMap extends LinkedHashMap { + private final int maxCapacity; + + private static final float DEFAULT_LOAD_FACTOR = 0.75f; + + private final Lock lock = new ReentrantLock(); + + public LRULinkedHashMap(int maxCapacity) { + super(maxCapacity, DEFAULT_LOAD_FACTOR, true); + this.maxCapacity = maxCapacity; + } + + @Override + protected boolean removeEldestEntry(java.util.Map.Entry eldest) { + return size() > maxCapacity; + } + + @Override + public boolean containsKey(Object key) { + try { + lock.lock(); + return super.containsKey(key); + } finally { + lock.unlock(); + } + } + + @Override + public V get(Object key) { + try { + lock.lock(); + return super.get(key); + } finally { + lock.unlock(); + } + } + + @Override + public V put(K key, V value) { + try { + lock.lock(); + return super.put(key, value); + } finally { + lock.unlock(); + } + } + + public int size() { + try { + lock.lock(); + return super.size(); + } finally { + lock.unlock(); + } + } + + public void clear() { + try { + lock.lock(); + super.clear(); + } finally { + lock.unlock(); + } + } + + public Collection> getAll() { + try { + lock.lock(); + return new ArrayList>(super.entrySet()); + } finally { + lock.unlock(); + } + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/SoapUtil.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/SoapUtil.java new file mode 100644 index 0000000..47913ae --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/SoapUtil.java @@ -0,0 +1,156 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.util; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.naming.ConfigurationException; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.log4j.Logger; + +import com.eviware.soapui.impl.wsdl.WsdlInterface; +import com.eviware.soapui.impl.wsdl.WsdlProject; +import com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader; +import com.eviware.soapui.model.iface.Operation; +import com.eviware.soapui.model.iface.Request; + +public class SoapUtil { + private static final Logger log = Logger.getLogger(SoapUtil.class); + + private DocumentBuilderFactory docBuilderFactory; + private Map wsdls = new LRULinkedHashMap(256); + + public SoapUtil() { + docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setNamespaceAware(true); + } + + public Request[] getRequestTemplate(String wsdlUrl) + throws UnsupportedOperationException, IOException { + Request[] requests = new Request[0]; + List requestList = new ArrayList(); + Operation operationInst = null; + WsdlInterface[] wsdlInterfaces = getWsdlInterfaces(wsdlUrl, null); + for (WsdlInterface wsdlInterface : wsdlInterfaces) { + Operation opr = wsdlInterface.getOperationAt(0); + if (opr != null) { + operationInst = opr; + String requestTemplate = operationInst.getRequestAt(0).getRequestContent(); + requestList.add(operationInst.getRequestAt(0)); + } + } + requests = requestList.toArray(new Request[0]); + return requests; + } + + /** + * + * @param wsdl + * @param operation + * @param httpClientProps + * @return + * @throws IOException + * @throws UnsupportedOperationException + */ + private Operation getOperation(String wsdl, String operation, Properties httpClientProps) + throws IOException, UnsupportedOperationException { + WsdlInterface[] wsdlInterfaces = getWsdlInterfaces(wsdl, httpClientProps); + for (WsdlInterface wsdlInterface : wsdlInterfaces) { + Operation operationInst = wsdlInterface.getOperationByName(operation); + + if (operationInst != null) { + return operationInst; + } + } + wsdls.remove(wsdl); + wsdlInterfaces = getWsdlInterfaces(wsdl, httpClientProps); + for (WsdlInterface wsdlInterface : wsdlInterfaces) { + Operation operationInst = wsdlInterface.getOperationByName(operation); + if (operationInst != null) { + return operationInst; + } + } + + throw new UnsupportedOperationException( + "Operation '" + operation + "' not supported by WSDL '" + wsdl + "'."); + } + + /** + * + * @param wsdl + * @param httpClientProps + * @return + * @throws IOException + */ + private WsdlInterface[] getWsdlInterfaces(String wsdl, Properties httpClientProps) + throws IOException { + try { + WsdlInterface[] wsdlInterfaces = wsdls.get(wsdl); + if (wsdlInterfaces == null) { + WsdlProject wsdlProject = new WsdlProject(); + WsdlLoader wsdlLoader = createWsdlLoader(wsdl, httpClientProps); + + wsdlInterfaces = wsdlProject.importWsdl(wsdl, true, wsdlLoader); + + wsdls.put(wsdl, wsdlInterfaces); + } + return wsdlInterfaces; + } catch (Exception e) { + e.printStackTrace(); + log.error(e.getMessage()); + throw new RuntimeException("Failed to import WSDL '" + wsdl + "'."); + } + } + + /** + * + * @param wsdl + * @param httpClientProps + * @return + * @throws ConfigurationException + */ + private WsdlLoader createWsdlLoader(String wsdl, Properties httpClientProps) + throws ConfigurationException { + HttpClient httpClient = new HttpClient(); + return new ClientWsdlLoader(wsdl, httpClient); + } + + public static void main(String[] args) { + SoapUtil soapUtil = new SoapUtil(); + + try { + String url = "http://10.74.151.36:9763/services/initService?wsdl"; + Request[] requestXMLs = soapUtil.getRequestTemplate(url); + + for (Request requestXML : requestXMLs) { + String requestJson = Xml2JsonUtil.xml2JSON(requestXML.getRequestContent()); + System.out.println("===================================="); + System.out.println(requestJson); + } + + } catch (UnsupportedOperationException e1) { + e1.printStackTrace(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/Xml2JsonUtil.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/Xml2JsonUtil.java new file mode 100644 index 0000000..fcc55c2 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/util/Xml2JsonUtil.java @@ -0,0 +1,141 @@ +/** + * Copyright 2016 [ZTE] and others. + * + * 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. + */ +package org.openo.carbon.bpel.util; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.InputStream; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import net.sf.json.JSONObject; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.input.SAXBuilder; + +public class Xml2JsonUtil { + /** + * transform xml to json + * + * @param xml xml format string + * @return return json string when success; otherwise return null + */ + public static String xml2JSON(String xml) { + JSONObject obj = new JSONObject(); + try { + InputStream is = new ByteArrayInputStream(xml.getBytes("utf-8")); + SAXBuilder sb = new SAXBuilder(); + Document doc = sb.build(is); + Element root = doc.getRootElement(); + obj.put(root.getName(), iterateElement(root)); + return obj.toString(); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * transform xml file to json string + * + * @param file java.io.File is an effective xml file + * @return return json string when success; otherwise return null + */ + public static String xml2JSON(File file) { + JSONObject obj = new JSONObject(); + try { + SAXBuilder sb = new SAXBuilder(); + Document doc = sb.build(file); + Element root = doc.getRootElement(); + obj.put(root.getName(), iterateElement(root)); + return obj.toString(); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * an iteration function + * + * @param parentElement : org.jdom.Element + * @return java.util.Map + */ + @SuppressWarnings({"unchecked", "rawtypes"}) + private static Map iterateElement(Element parentElement) { + List node = parentElement.getChildren(); + Element element = null; + Map map = new HashMap(); + List list = null; + for (int i = 0; i < node.size(); i++) { + element = (Element) node.get(i); + if (element.getTextTrim().equals("")) { + if (element.getChildren().size() == 0) + continue; + if (map.containsKey(element.getName())) { + Object obj = map.get(element.getName()); + if (obj instanceof Map) { + list = new LinkedList(); + list.add(obj); + list.add(iterateElement(element)); + map.remove(element.getName()); + map.put(element.getName(), list); + } else if (obj instanceof List) { + list = (List) obj; + list.add(iterateElement(element)); + } + } else { + map.put(element.getName(), iterateElement(element)); + } + } else { + map.put(element.getName(), element.getTextTrim()); + } + } + return map; + } + + public static void main(String[] args) { + System.out.println(Xml2JsonUtil.xml2JSON("" + "" + "" + + "MapGuideddddddd" + "true" + "" + + "ddd" + "" + "" + "" + "ccc" + + "ggg" + "" + "aaa" + + "" + "" + "" + "" + "" + "33333333" + + "" + "" + "444" + "" + "")); + + String xml = + " fdsafasdfasdf "; + + System.out.println(Xml2JsonUtil.xml2JSON(xml)); + + xml = + " ? "; + + System.out.println(Xml2JsonUtil.xml2JSON(xml)); + + xml = + ""; + + System.out.println(Xml2JsonUtil.xml2JSON(xml)); + + xml = + " 2 112 {\"e\":{\"f\":\"4\"}} ? 2 ? 223 334 2 [{\"b\":1},{\"c\":{\"d\":\"2\"}}}] [{\"a\":3},{\"e\":{\"f\":\"4\"}}}] "; + + System.out.println(Xml2JsonUtil.xml2JSON(xml)); + } +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF new file mode 100644 index 0000000..eaf90a9 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Created-By: 1.7.0_72 (Oracle Corporation) + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/WEB-INF/web.xml b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/WEB-INF/web.xml new file mode 100644 index 0000000..7d51568 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/WEB-INF/web.xml @@ -0,0 +1,40 @@ + + + + + + ZENAP API-DOC. + + ZENAP API-DOC + + + + + index.html + index.xhtml + index.htm + index.jsp + + + + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/reset.css b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/reset.css new file mode 100644 index 0000000..b2b0789 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/reset.css @@ -0,0 +1,125 @@ +/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/screen.css b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/screen.css new file mode 100644 index 0000000..32b199b --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/screen.css @@ -0,0 +1,1256 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +.swagger-section .access { + float: right; +} +.swagger-section .auth { + float: right; +} +.swagger-section #api_information_panel { + position: absolute; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section #api_information_panel p .api-msg-enabled { + color: green; +} +.swagger-section #api_information_panel p .api-msg-disabled { + color: red; +} +.swagger-section .api-ic { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .ic-info { + background-position: 0 0; + width: 18px; + margin-top: -7px; + margin-left: 4px; +} +.swagger-section .ic-warning { + background-position: -60px 0; + width: 18px; + margin-top: -7px; + margin-left: 4px; +} +.swagger-section .ic-error { + background-position: -30px 0; + width: 18px; + margin-top: -7px; + margin-left: 4px; +} +.swagger-section .ic-off { + background-position: -90px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section .ic-on { + background-position: -160px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section #header { + background-color: #89bf04; + padding: 14px; +} +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo_small.png) no-repeat left center; + padding: 20px 0 20px 40px; + color: white; +} +.swagger-section #header form#api_selector { + display: block; + clear: none; + float: right; +} +.swagger-section #header form#api_selector .input { + display: block; + clear: none; + float: left; + margin: 0 10px 0 0; +} +.swagger-section #header form#api_selector .input input#input_apiKey { + width: 200px; +} +.swagger-section #header form#api_selector .input input#input_baseUrl { + width: 400px; +} +.swagger-section #header form#api_selector .input a#explore { + display: block; + text-decoration: none; + font-weight: bold; + padding: 6px 8px; + font-size: 0.9em; + color: white; + background-color: #547f00; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} +.swagger-section #header form#api_selector .input a#explore:hover { + background-color: #547f00; +} +.swagger-section #header form#api_selector .input input { + font-size: 0.9em; + padding: 3px; + margin: 0; +} +.swagger-section #content_message { + margin: 10px 15px; + font-style: italic; + color: #999999; +} +.swagger-section #message-bar { + min-height: 30px; + text-align: center; + padding-top: 10px; +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/typography.css b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/typography.css new file mode 100644 index 0000000..27c3751 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/css/typography.css @@ -0,0 +1,26 @@ +/* droid-sans-regular - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans'), local('DroidSans'), + url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ +} +/* droid-sans-700 - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 700; + src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans Bold'), local('DroidSans-Bold'), + url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ +} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot new file mode 100644 index 0000000..2250b71 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg new file mode 100644 index 0000000..a54bbbb --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf new file mode 100644 index 0000000..523cb92 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff new file mode 100644 index 0000000..67e3e25 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 new file mode 100644 index 0000000..1e726a7 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot new file mode 100644 index 0000000..ac2698e Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg new file mode 100644 index 0000000..d9f2a21 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf new file mode 100644 index 0000000..76aede2 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff new file mode 100644 index 0000000..abf1989 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 new file mode 100644 index 0000000..9f93f74 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/explorer_icons.png b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/explorer_icons.png new file mode 100644 index 0000000..ed9d2ff Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/explorer_icons.png differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/logo_small.png b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/logo_small.png new file mode 100644 index 0000000..5496a65 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/logo_small.png differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/pet_store_api.png b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/pet_store_api.png new file mode 100644 index 0000000..f9f9cd4 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/pet_store_api.png differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/throbber.gif b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/throbber.gif new file mode 100644 index 0000000..0639388 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/throbber.gif differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/wordnik_api.png b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/wordnik_api.png new file mode 100644 index 0000000..dca4f14 Binary files /dev/null and b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/images/wordnik_api.png differ diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/index.html b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/index.html new file mode 100644 index 0000000..6c9fff0 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/index.html @@ -0,0 +1,99 @@ + + + + Swagger UI + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+
+ + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/backbone-min.js b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/backbone-min.js new file mode 100644 index 0000000..a3f544b --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/resources/api-doc/lib/backbone-min.js @@ -0,0 +1,15 @@ +// Backbone.js 1.1.2 + +(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('