This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push: new fd31028 Clean up poms and minor example fixes. fd31028 is described below commit fd31028f6205282ed1a90e5a03ed70837100f5df Author: JamesBognar <jamesbog...@apache.org> AuthorDate: Mon Nov 19 12:00:16 2018 -0500 Clean up poms and minor example fixes. --- .../org/apache/juneau/internal/SystemUtils.java | 24 ++ .../build-overlay/pom.xml | 13 +- .../files/htdocs/images/asf.png | Bin 0 -> 8875 bytes .../files/htdocs/images/juneau.png | Bin 0 -> 6274 bytes .../files/htdocs/styles/SwaggerUI.css | 342 +++++++++++++++++++++ .../files/htdocs/themes/dark.css | 285 +++++++++++++++++ .../files/htdocs/themes/devops.css | 276 +++++++++++++++++ .../files/htdocs/themes/light.css | 273 ++++++++++++++++ .../files/htdocs/themes/original.css | 237 ++++++++++++++ .../juneau-examples-rest-springboot/pom.xml | 18 -- .../src/assembly/bin.xml | 2 +- .../juneau/examples/rest/springboot/App.java | 6 +- .../juneau-examples-rest/build-overlay/pom.xml | 16 +- juneau-examples/juneau-examples-rest/pom.xml | 12 +- .../examples/rest/petstore/PetStoreService.java | 4 +- .../juneau/microservice/RestMicroservice.java | 6 +- pom.xml | 10 +- 17 files changed, 1481 insertions(+), 43 deletions(-) diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SystemUtils.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SystemUtils.java index 5f7a6b9..7964f7c 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SystemUtils.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/SystemUtils.java @@ -68,4 +68,28 @@ public class SystemUtils { String s = getFirstString(null, keys); return s == null ? def : Integer.parseInt(s); } + + /** + * Convenience method for setting a system property value. + * + * @param key The system property key. + * @param value The system property value. + * @param overwrite Overwrite the previous value if it exists. + */ + public static void setProperty(String key, Object value, boolean overwrite) { + if (value != null) { + if (System.getProperty(key) == null || overwrite) + System.setProperty(key, StringUtils.asString(value)); + } + } + + /** + * Convenience method for setting a system property value. + * + * @param key The system property key. + * @param value The system property value. + */ + public static void setProperty(String key, Object value) { + setProperty(key, value, true); + } } diff --git a/juneau-examples/juneau-examples-rest-springboot/build-overlay/pom.xml b/juneau-examples/juneau-examples-rest-springboot/build-overlay/pom.xml index e6c1d70..67e2885 100644 --- a/juneau-examples/juneau-examples-rest-springboot/build-overlay/pom.xml +++ b/juneau-examples/juneau-examples-rest-springboot/build-overlay/pom.xml @@ -39,12 +39,13 @@ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.javadoc.skip>true</maven.javadoc.skip> - <derby.version>10.10.2.0</derby.version> - <springframework.version>2.0.1.RELEASE</springframework.version> - <javax.inject.version>1</javax.inject.version> + <derby.version>${derby.version}</derby.version> + <springframework.version>${springframework.version}</springframework.version> + <javax.inject.version>${javax.inject.version}</javax.inject.version> <juneau.version>${version}</juneau.version> - <jena.version>2.7.1</jena.version> - <hibernate.version>5.0.9.Final</hibernate.version> + <jena.version>${jena.version}</jena.version> + <hibernate.version>${hibernate.version}</hibernate.version> + <xml.apis.version>${xml.apis.version}</xml.apis.version> </properties> <dependencies> @@ -110,7 +111,7 @@ <dependency> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> - <version>1.4.01</version> + <version>\${xml.apis.version}</version> </dependency> <!-- Optional RDF support --> diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/images/asf.png b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/images/asf.png new file mode 100644 index 0000000..ce28113 Binary files /dev/null and b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/images/asf.png differ diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/images/juneau.png b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/images/juneau.png new file mode 100644 index 0000000..42a1656 Binary files /dev/null and b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/images/juneau.png differ diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/styles/SwaggerUI.css b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/styles/SwaggerUI.css new file mode 100644 index 0000000..b55ffc6 --- /dev/null +++ b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/styles/SwaggerUI.css @@ -0,0 +1,342 @@ +/* + *************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + *************************************************************************************************************************** +*/ + +.swagger-ui { +} + +/*----------------------------------------------------------------------------------------------------------- + - Header key-value pairs + ----------------------------------------------------------------------------------------------------------*/ + +.swagger-ui table.header { + margin-bottom: 15px; + width: 95%; + border: none; +} + +.swagger-ui table.header * { + vertical-align: middle; +} + +.swagger-ui table.header th { + font-weight: bold; + padding: 5px 10px; + text-align: left; + white-space: nowrap; + border: none; + border-radius: 3px; +} + +.swagger-ui table.header td { + padding: 5px 10px; + text-align: left; + vertical-align: middle; + border: none; +} + +/*----------------------------------------------------------------------------------------------------------- + - Method buttons (e.g GET/PUT/... buttons) + ----------------------------------------------------------------------------------------------------------*/ +.method-button { + display: inline-block; + font-weight: bold; + min-width: 60px; + padding: 6px 15px; + text-align: center; + border-radius: 3px; + text-shadow: 0 1px 0 rgba(0,0,0,.1); + color: #fff; +} +.get .method-button { background: rgb(97,175,254); } +.put .method-button { background: rgb(252,161,48); } +.post .method-button { background: rgb(73,204,144); } +.delete .method-button { background: rgb(249,62,62); } +.options .method-button { background: rgb(153,102,255); } +.deprecated .method-button { background: rgb(170,170,170); } +.model .method-button { background: rgb(150,150,150); min-width: 120px;} +.other .method-button { background: rgb(230,230,0); } + + +/*----------------------------------------------------------------------------------------------------------- + - Tag block - + - Encapsulates one or more op-blocks. + ----------------------------------------------------------------------------------------------------------*/ + +.tag-block { + min-width: 800px; +} + +.tag-block-summary { + margin: 10px 0px; + padding: 5px 0px; + align-items: center; + cursor: pointer; + border-bottom: 1px solid rgba(59,65,81,.2); + user-select: none; + transition: all .2s; +} +.tag-block-summary:hover { + background-color: rgba(59,65,81,.1); +} + +.tag-block-summary .name { + font-size: 18px; + padding: 0px 20px; +} +.tag-block-summary .description { + font-size: 14px; + padding: 0px 20px; +} +.tag-block-summary .extdocs { + float: right; + font-size: 14px; + padding: 0px 20px; +} + +.tag-block-open .tag-block-contents { display: block; } +.tag-block-closed .tag-block-contents { display: none; } + +/*----------------------------------------------------------------------------------------------------------- + - Op block + - Encapsulates a single http-method + http-path + ----------------------------------------------------------------------------------------------------------*/ + +.op-block { + margin-bottom: 10px; + align-items: center; + border-radius: 4px; +} + +.op-block.get { background: rgba(97,175,254,.1); border: 1px solid rgb(97,175,254); } +.op-block.put { background: rgba(252,161,48,.1); border: 1px solid rgb(252,161,48); } +.op-block.post { background: rgba(73,204,144,.1); border: 1px solid rgb(73,204,144); } +.op-block.options { background: rgba(153,102,255,.1); border: 1px solid rgb(153,102,255); } +.op-block.delete { background: rgba(249,62,62,.1); border: 1px solid rgb(249,62,62); } +.op-block.deprecated { background: rgba(170,170,170,.1); border: 1px solid rgb(170,170,170); } +.op-block.model { background: rgba(0,0,0,.05); border: 1px solid rgb(170,170,170); } +.op-block.other { background: rgba(230,230,0,0.1); border: 1px solid rgb(230,230,0); } + +.op-block-summary { + padding: 5px; + cursor: pointer; + user-select: none; +} + +.op-block-summary .path { + font-size: 14px; + word-break: break-all; + font-family: monospace; + font-weight: bold; + padding:10px; +} + +.op-block.deprecated .op-block-summary .path { color: #8f9199; text-decoration: line-through;} +.op-block.deprecated .op-block-summary .description { color: #8f9199 } + +.op-block-summary .summary { + font-size: 14px; + padding: 10px; +} + +.op-block-description { + font-size: 14px; + padding: 10px; +} + + +.op-block-open .op-block-contents { display: block; } +.op-block-closed .op-block-contents { display: none; } + +/*----------------------------------------------------------------------------------------------------------- + - Op block section header - + - 'Parameters' and 'Responses' subsections in an op-block + ----------------------------------------------------------------------------------------------------------*/ + +.op-block-section-header { + padding: 8px 15px; + background: hsla(0,0%,100%,.3); + box-shadow: 1px 2px 3px rgba(0,0,0,.3); + margin: 10px; + border-radius: 4px; +} + +.op-block-section-header .title { + font-size: 14px; + margin: 0px; +} + +/*----------------------------------------------------------------------------------------------------------- + - Parameters and Responses sections + ----------------------------------------------------------------------------------------------------------*/ + +table.parameters, table.responses { + border-collapse: collapse; + margin: 20px; + width: 95%; + border-bottom: 1px solid rgba(59,65,81,.2); +} + +th.parameter-key, th.response-key { + font-size: 12px; + font-weight: bold; + text-align: left; + border: none; + border-bottom: 1px solid rgba(59,65,81,.2); + background-color: inherit; +} + +td.parameter-key, td.response-key { + font-size: 12px; + padding: 10px; + text-align: left; + border: none; + border-bottom: 1px solid rgba(59,65,81,.2); + background-color: inherit; +} + +td.parameter-value, td.response-value { + padding: 10px; + text-align: left; + border-bottom: 1px solid rgba(59,65,81,.2); +} + +/*----------------------------------------------------------------------------------------------------------- + - Parameter name + ----------------------------------------------------------------------------------------------------------*/ + +.parameter-key .in { + font-size: 12px; + font-family: monospace; + font-weight: bold; + font-style: italic; + color: gray; +} + +.parameter-key .name { + font-size: 14px; +} + +.parameter-key .name.required { + font-weight: bold; +} + +.parameter-key .requiredlabel { + font-size: 10px; + color: rgba(255,0,0,.6); + font-weight: bold; +} + +.parameter-key .type { + font-size: 12px; + padding: 5px 0; + font-family: monospace; + font-weight: bold; +} + +/*----------------------------------------------------------------------------------------------------------- + - Examples + ----------------------------------------------------------------------------------------------------------*/ + +.op-block-contents .example-select { + margin: 10px 0 5px 0; + border-width: 1px; + font-weight:bold; + padding: 5px 40px 5px 10px; + border: 1px solid #41444e; + border-radius: 4px; + box-shadow: 0 1px 2px 0 rgba(0,0,0,.25); + background: hsla(0,0%,100%,.3); +} + +.op-block-contents .example-select:disabled { + color: rgba(0,0,0,.50); + border: 1px solid rgba(0,0,0,.50); +} + +.op-block-contents .example { + margin: 0; + padding: 5px 20px; + white-space: pre-wrap; + word-wrap: break-word; + hyphens: auto; + border-radius: 4px; + background: #41444e; + overflow-wrap: break-word; + font-family: monospace; + font-weight: 400; + color: limegreen; + display: none; + max-width: 800px; + max-height: 800px; + text-overflow: auto; + overflow: auto; +} + +.op-block-contents .example.active { + display:block; +} + +.op-block-contents .model { + display: none; +} + +.op-block-contents .model.active { + display:block; +} + +/*----------------------------------------------------------------------------------------------------------- + - Headers + ----------------------------------------------------------------------------------------------------------*/ + +.section { + font-weight: bold; + padding: 5px 0; + text-align: left; +} + +.headers .name { + padding: 5px 0; + font-family: monospace; + font-weight: bold; +} + +div.headers { + margin: 20px 0px; +} + +.headers .type { + padding: 5px 0; + font-family: monospace; + font-weight: bold; +} + +.section-name { + display: inline-block; + vertical-align: top; + margin-right: 20px; + font-weight: bold; + padding: 5px 0; + text-align: left; +} + +.section-table { +/* display: inline-block;*/ +} + +.responses .section-table td { + padding: 5px 20px 5px 0px; + text-align: left; + border-bottom: 1px solid rgba(59,65,81,.2); +} diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/dark.css b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/dark.css new file mode 100644 index 0000000..c81702d --- /dev/null +++ b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/dark.css @@ -0,0 +1,285 @@ +/*************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + ***************************************************************************************************************************/ + +/** Dark look-and-feel */ + +/**********************************************************************************************************************/ +/** Body **/ +/**********************************************************************************************************************/ + +body { + background-color: #212121 ; + margin: 0px; + font-family: HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + color: #EEE; + height: 100%; +} + +body { + font-size: 14px; +} + +body textarea, body pre { + -moz-tab-size: 3; + -o-tab-size: 3; + -webkit-tab-size: 3; + tab-size: 3; +} + +/**********************************************************************************************************************/ +/** Header **/ +/**********************************************************************************************************************/ + +header { + background-color: #373a3c; +} + +header * { + font-size: 14px; + color: #B3B3B3; + margin: 0px; + text-decoration: none; + font-weight: normal; +} + +header h1 { + padding: 10px 20px; + font-size: 16px; + border-bottom: 2px solid #000000; + color: white; +} + +header h2 { + padding: 10px 20px; + font-size: 14px; + border-bottom: 2px solid #000000; +} + +/**********************************************************************************************************************/ +/** Nav **/ +/**********************************************************************************************************************/ + +nav { + margin: 10px 20px 10px 20px; + color: #94A3AB; +} + +nav>ol { + list-style-type: none; + margin: 0px 10px; + padding: 0px; +} + +nav>ol>li { + display: inline; +} + +nav li:not(:first-child):before { + content: " - "; +} + +nav a { + font-size: 10pt; + color: #94A3AB; + text-decoration: none; + margin: 0px 15px; + text-transform: uppercase; + cursor: pointer; +} + +nav a:active, nav a:hover { + color: white; + text-decoration: underline; +} + +/**********************************************************************************************************************/ +/** Content **/ +/**********************************************************************************************************************/ + +section { + display: table; + width: 100%; + margin-bottom: 50px; +} + +article { + display: table-cell; +} + +article * { + font-size: 9pt; + color: #EEE; +} + +article textarea, article input, article button { + color: #111; +} + +article textarea, article input { + background-color: #EEE; +} + +article div.data { + padding: 10px; + background-color: #373a3c; + border-radius: 4px; + margin: 20px; + display: inline-block; + box-shadow: 2px 3px 3px 0px rgba(0, 0, 0, 0.5); + font-family: sans-serif; +} + +article table { + border: none; + width: 100%; +} + +article th { + padding: 4px 8px; + font-weight: normal; + text-align: center; + background-color: #0275d8; +} + +article td { + vertical-align: top; + border-bottom: 1px solid #000000; + border-right: 1px solid #000000; + padding: 2px 5px; +} + +article td:last-child { + width: 100%; +} + +article ul { + margin: 0px; + padding-left: 20px; +} + +article a { + color: #3d8bb5; + text-decoration: none; +} + +article a:hover { + text-decoration: underline; +} + +article iframe { + background-color: #F6F7F9; + border: 1px solid gray; + padding: 0px; + overflow: hidden; + width: 100%; + min-height: 400px; +} + +aside { + display: table-cell; + vertical-align: top; + padding: 20px 20px; +} + +/**********************************************************************************************************************/ +/** Footer **/ +/**********************************************************************************************************************/ + +footer { + padding: 10px; + width: 100%; + bottom: 0; + position: fixed; + background-color: #373a3c; +} + +/**********************************************************************************************************************/ +/** Popup windows **/ +/**********************************************************************************************************************/ + +.popup-content { + display: none; + position: absolute; + background-color: #DDD; + white-space: nowrap; + padding: 5px; + box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5); + z-index: 1; + margin-top: 10px; + border-radius: 4px; +} + +.popup-content * { + color: black; + font-size: 11px; +} + +.popup-content a:hover { + color: #94A3AB; +} + +.popup-show { + display:block; +} + +/**********************************************************************************************************************/ +/** Tooltips **/ +/**********************************************************************************************************************/ + +.tooltip { + position: relative; + display: inline-block; +} + +.tooltip .tooltiptext { + visibility: hidden; + background-color: #FEF9E7; + color: black; + padding: 5px; + border-radius: 6px; + position: absolute; + z-index: 1; + top: 0; + left: 0; + margin-left: 30px; + box-shadow: 2px 3px 3px 0px rgba(0, 0, 0, 0.5); + opacity: 0; + transition: opacity 0.5s; + font-weight: normal; +} + +.tooltip .tooltiptext * { + color: black; +} + +.tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; +} + +.tooltiptext { + white-space: nowrap; + float: left; + border: 1px solid black; +} + +/**********************************************************************************************************************/ +/** Other classes **/ +/**********************************************************************************************************************/ + +.table {display:table;} +.row {display:table-row;} +.cell {display:table-cell;} +.monospace {font-family:monospace;} +.link { color: #94A3AB; text-decoration: none; cursor: pointer;} +.link:hover { text-decoration: underline; } diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/devops.css b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/devops.css new file mode 100644 index 0000000..ad7188a --- /dev/null +++ b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/devops.css @@ -0,0 +1,276 @@ +/*************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + ***************************************************************************************************************************/ + +/** DevOps look-and-feel */ + +/**********************************************************************************************************************/ +/** Body **/ +/**********************************************************************************************************************/ + +body { + background-color: #3B4B54; + margin: 0px; + font-family: HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + color: #B3B3B3; + height: 100%; +} + +body { + font-size: 14px; +} + +body textarea, body pre { + -moz-tab-size: 3; + -o-tab-size: 3; + -webkit-tab-size: 3; + tab-size: 3; +} + +/**********************************************************************************************************************/ +/** Header **/ +/**********************************************************************************************************************/ + +header { + background-color: #26343F; +} + +header * { + font-size: 14px; + color: #B3B3B3; + margin: 0px; + text-decoration: none; + font-weight: normal; +} + +header h1 { + padding: 10px 20px; + font-size: 16px; + border-bottom: 2px solid #34534B; + color: white; +} + +header h2 { + padding: 10px 20px; + font-size: 14px; + border-bottom: 2px solid #34534B; +} + +/**********************************************************************************************************************/ +/** Nav **/ +/**********************************************************************************************************************/ + +nav { + margin: 10px 20px 10px 20px; + color: #94A3AB; +} + +nav>ol { + list-style-type: none; + margin: 0px 10px; + padding: 0px; +} + +nav>ol>li { + display: inline; +} + +nav li:not(:first-child):before { + content: " - "; +} + +nav a { + font-size: 10pt; + color: #94A3AB; + text-decoration: none; + margin: 0px 15px; + text-transform: uppercase; + cursor: pointer; +} + +nav a:active, nav a:hover { + color: white; + text-decoration: underline; +} + +/**********************************************************************************************************************/ +/** Content **/ +/**********************************************************************************************************************/ + +section { + display: table; + width: 100%; + margin-bottom: 50px; +} + +article { + display: table-cell; +} + +article * { + font-size: 9pt; + color: #26343F; +} + +article div.data { + padding: 10px; + background-color: white; + border-radius: 4px; + margin: 20px; + display: inline-block; + box-shadow: 2px 3px 3px 0px rgba(0, 0, 0, 0.5); + font-family: sans-serif; + color: #26343F; +} + +article table { + border: none; + width: 100%; +} + +article th { + border-top: 1px solid #D9DCDE; + padding: 4px 8px; + font-weight: bold; + text-align: center; + background-color: #F4F6F9; +} + +article td { + vertical-align: top; + border-bottom: 1px solid #d9dcde; + border-right: 1px solid #d9dcde; + padding: 2px 5px; +} + +article td:last-child { + width: 100%; +} + +article ul { + margin: 0px; + padding-left: 20px; +} + +article a { + color: #116998; + text-decoration: none; +} + +article a:hover { + text-decoration: underline; +} + +article iframe { + background-color: #F6F7F9; + border: 1px solid gray; + padding: 0px; + overflow: hidden; + width: 100%; + min-height: 400px; +} + +aside { + display: table-cell; + vertical-align: top; + padding: 20px 20px; +} + +/**********************************************************************************************************************/ +/** Footer **/ +/**********************************************************************************************************************/ + +footer { + padding: 10px; + width: 100%; + bottom: 0; + position: fixed; + background-color: #26343F; +} + +/**********************************************************************************************************************/ +/** Popup windows **/ +/**********************************************************************************************************************/ + +.popup-content { + display: none; + position: absolute; + background-color: #f4f6f9; + white-space: nowrap; + padding: 5px; + box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5); + z-index: 1; + margin-top: 10px; + border-radius: 4px; +} + +.popup-content * { + color: black; + font-size: 11px; +} + +.popup-content a:hover { + color: #94A3AB; +} + +.popup-show { + display:block; +} + +/**********************************************************************************************************************/ +/** Tooltips **/ +/**********************************************************************************************************************/ + +.tooltip { + position: relative; + display: inline-block; +} + +.tooltip .tooltiptext { + visibility: hidden; + background-color: #FEF9E7; + color: black; + padding: 5px; + border-radius: 6px; + position: absolute; + z-index: 1; + top: 0; + left: 0; + margin-left: 30px; + box-shadow: 2px 3px 3px 0px rgba(0, 0, 0, 0.5); + opacity: 0; + transition: opacity 0.5s; + font-weight: normal; +} + +.tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; +} + +.tooltiptext { + white-space: nowrap; + float: left; + border: 1px solid black; +} + +/**********************************************************************************************************************/ +/** Other classes **/ +/**********************************************************************************************************************/ + +.table {display:table;} +.row {display:table-row;} +.cell {display:table-cell;} +.monospace {font-family:monospace;} +.link { color: #94A3AB; text-decoration: none; cursor: pointer;} +.link:hover { text-decoration: underline; } + diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/light.css b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/light.css new file mode 100644 index 0000000..aa91f98 --- /dev/null +++ b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/light.css @@ -0,0 +1,273 @@ +/*************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + ***************************************************************************************************************************/ + +/** Light look-and-feel */ + +/**********************************************************************************************************************/ +/** Body **/ +/**********************************************************************************************************************/ + +body { + margin: 0px; + font-size: 10px; + font-family: HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + color: #2c4557; + height: 100%; +} + +body * { + font-size: 14px; +} + +body textarea, body pre { + -moz-tab-size: 3; + -o-tab-size: 3; + -webkit-tab-size: 3; + tab-size: 3; +} + +/**********************************************************************************************************************/ +/** Header **/ +/**********************************************************************************************************************/ + +header { + background-color: #e8ebef; + padding: 10px 20px; + box-shadow: 5px 5px 2px #999999; + text-shadow: rgba(1,1,1,.2) 2px 4px 5px, rgba(125,32,191,.05) 0 -10px 30px; + white-space: nowrap; +} + +header * { + color: #af2222;; + font-weight: lighter; +} + +header h1 { + font-size: 18px; + margin: 0px; + padding: 2px; +} + +header h2 { + font-size: 14px; + margin: 0px; + padding: 2px; +} + +/**********************************************************************************************************************/ +/** Nav **/ +/**********************************************************************************************************************/ + +nav { + margin: 10px; + padding: 5px; + box-shadow: 5px 5px 2px #999999; + background-color: #eef3f7; +} + +nav * { + font-size: 12px; + font-weight: lighter; +} + +nav>ol { + list-style-type: none; + margin: 0px 10px; + padding: 0px; +} + +nav>ol>li { + display: inline; +} + +nav li:not(:first-child):before { + content: " - "; +} + +nav a { + font-size: 10pt; + color: #2c4557; + text-decoration: none; + margin: 0px 10px; + text-transform: uppercase; + cursor: pointer; +} + +nav a:active, nav a:hover { + text-decoration: none; + color: #94a3ab; +} + +/**********************************************************************************************************************/ +/** Content **/ +/**********************************************************************************************************************/ + +section { + display: table; + width: 100%; + margin: 0px 0px 50px 0px; +} + +article { + display: table-cell; + padding: 20px 40px; +} + +article * { + font-size: 9pt; +} + +article div.data { + padding: 0px; + margin: 0px; + display: inline-block; + font-family: sans-serif; +} + +article table { + border: none; + width: 100%; +} + +article td { + vertical-align: top; + border-bottom: 1px solid #d9dcde; + border-right: 1px solid #d9dcde; + padding: 2px 5px; +} + +article td:last-child { + width: 100%; +} + +article th { + padding: 4px 8px; + text-align: center; + background-color: #eef3f7; + box-shadow: 1px 1px 2px #999999; +} + +article ul { + margin: 0px; + padding-left: 20px; +} + +article a { + color: #416e8e; + text-decoration: none; +} + +article iframe { + background-color: #F6F7F9; + border: 1px solid gray; + padding: 0px; + overflow: hidden; + width: 100%; + min-height: 400px; +} + +aside { + display: table-cell; + vertical-align: top; + padding: 20px 20px; +} + +/**********************************************************************************************************************/ +/** Footer **/ +/**********************************************************************************************************************/ + +footer { + padding: 10px; + width: 100%; + bottom: 0; + position: fixed; + background-color: #e8ebef; +} + +/**********************************************************************************************************************/ +/** Popup windows **/ +/**********************************************************************************************************************/ + +.popup-content { + display: none; + position: absolute; + background-color: #eef3f7; + white-space: nowrap; + padding: 5px; + box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5); + z-index: 1; + margin-top: 10px; + border-radius: 4px; +} + +.popup-content * { + color: #2c4557; + font-size: 10pt; +} + +.popup-content a:hover { + color: #94A3AB; +} + +.popup-show { + display: block; +} + +/**********************************************************************************************************************/ +/** Tooltips **/ +/**********************************************************************************************************************/ + +.tooltip { + position: relative; + display: inline-block; +} + +.tooltip .tooltiptext { + visibility: hidden; + background-color: #FEF9E7; + color: black; + padding: 5px; + border-radius: 6px; + position: absolute; + z-index: 1; + top: 0; + left: 0; + margin-left: 30px; + box-shadow: 2px 3px 3px 0px rgba(0, 0, 0, 0.5); + opacity: 0; + transition: opacity 0.5s; + font-weight: normal; +} + +.tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; +} + +.tooltiptext { + white-space: nowrap; + float: left; + border: 1px solid black; +} + +/**********************************************************************************************************************/ +/** Other classes **/ +/**********************************************************************************************************************/ + +.table {display:table;} +.row {display:table-row;} +.cell {display:table-cell;} +.monospace {font-family:monospace;} +.link { color: #94A3AB; text-decoration: none; cursor: pointer;} +.link:hover { text-decoration: underline; } diff --git a/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/original.css b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/original.css new file mode 100644 index 0000000..2052281 --- /dev/null +++ b/juneau-examples/juneau-examples-rest-springboot/files/htdocs/themes/original.css @@ -0,0 +1,237 @@ +/*************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + ***************************************************************************************************************************/ + +/** Original look-and-feel */ + +/**********************************************************************************************************************/ +/** Body **/ +/**********************************************************************************************************************/ + +body { + background-image: linear-gradient(top, #CDDDDF 0, #EAEDED 20px, #FFFFFF 70px); + background-image: -webkit-linear-gradient(top, #CDDDDF 0, #EAEDED 20px, #FFFFFF 70px); + background-attachment: fixed; + font-family: Sans-Serif; + color: #2c4557; + height: 100%; + margin: 0px; +} + +body * { + font-size: 12px; +} + +body textarea, body pre { + -moz-tab-size: 3; + -o-tab-size: 3; + -webkit-tab-size: 3; + tab-size: 3; +} + +/**********************************************************************************************************************/ +/** Header **/ +/**********************************************************************************************************************/ + +header { + padding: 10px 20px; +} + +header h1 { + font-size: 16px; + margin-bottom: 10px; + margin-right: 40px; + padding: 5px 30px; + border-radius: 15px; + text-decoration: none; + font-weight: normal; + background: linear-gradient(to bottom, #F5F5F5, #DEE3E9) repeat scroll 0% 0% transparent; + background: -webkit-gradient(linear, left top, left bottom, from(#F5F5F5), to(#DEE3E9)); +} + +header h2 { + font-weight: normal; + margin-left: 20px; +} + +/**********************************************************************************************************************/ +/** Nav **/ +/**********************************************************************************************************************/ + +nav { + margin: 0px 25px; +} + +nav>ol { + list-style-type: none; + margin: 0px 10px; + padding: 0px; +} + +nav>ol>li { + display: inline; +} + +nav li:not(:first-child):before { + content: " - "; +} + +nav a { + text-decoration: underline; + cursor: pointer; + color: -webkit-link; +} + +/**********************************************************************************************************************/ +/** Content **/ +/**********************************************************************************************************************/ + +section { + display: table; + width: 100%; + margin: 0px 0px 50px 0px; +} + +article { + display: table-cell; + padding: 20px 40px; +} + +aside { + display: table-cell; + vertical-align: top; + padding: 20px 20px; +} + +article div.data { + padding: 0px; + margin: 0px; + display: inline-block; + font-family: sans-serif; +} + +article table { + border:1px solid #CCCC99; + border-collapse: collapse; + margin: 5px 0px; + width: 100%; +} + +article th { + border-top: 1px solid #CCCC99; + padding: 3px 5px; + color: #666666; + text-align: center; + background-image: linear-gradient(top, #FBF9E4 0%, #F3F2C2 100%); + background-image: -webkit-linear-gradient(top, #FBF9E4 0%, #F3F2C2 100%); +} + +article td { + border: 1px solid #E9EACB; + padding: 2px 5px; + color: #005C87; + vertical-align: top; +} + +article td:last-child { + width: 100%; +} + +article ul { + margin: 0px; + padding-left: 20px; +} + +/**********************************************************************************************************************/ +/** Footer **/ +/**********************************************************************************************************************/ + +footer { + display: none; +} + +/**********************************************************************************************************************/ +/** Popup windows **/ +/**********************************************************************************************************************/ + +.popup-content { + display: none; + position: absolute; + background-color: #eef3f7; + white-space: nowrap; + padding: 5px; + box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5); + z-index: 1; + margin-top: 10px; + border-radius: 4px; +} + +.popup-content * { + font-size: 9pt; +} + +.popup-content a:hover { + color: #94A3AB; +} + +.popup-show { + display: block; +} + +/**********************************************************************************************************************/ +/** Tooltips **/ +/**********************************************************************************************************************/ + +.tooltip { + position: relative; + display: inline-block; +} + +.tooltip .tooltiptext { + visibility: hidden; + background-color: #FEF9E7; + color: black; + padding: 5px; + border-radius: 6px; + position: absolute; + z-index: 1; + top: 0; + left: 0; + margin-left: 30px; + box-shadow: 2px 3px 3px 0px rgba(0, 0, 0, 0.5); + opacity: 0; + transition: opacity 0.5s; + font-weight: normal; +} + +.tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; +} + +.tooltiptext { + white-space: nowrap; + float: left; + border: 1px solid black; +} + +/**********************************************************************************************************************/ +/** Other classes **/ +/**********************************************************************************************************************/ + +.table {display:table;} +.row {display:table-row;} +.cell {display:table-cell;} +.monospace {font-family:monospace;} +.link { color: #94A3AB; text-decoration: none; cursor: pointer;} +.link:hover { text-decoration: underline; } + diff --git a/juneau-examples/juneau-examples-rest-springboot/pom.xml b/juneau-examples/juneau-examples-rest-springboot/pom.xml index 8beccbd..d28ccf5 100644 --- a/juneau-examples/juneau-examples-rest-springboot/pom.xml +++ b/juneau-examples/juneau-examples-rest-springboot/pom.xml @@ -29,15 +29,10 @@ <properties> <encoding>UTF-8</encoding> - <maven.javadoc.skip>true</maven.javadoc.skip> <!-- Skip javadoc generation since we generate them in the aggregate pom --> <maven.javadoc.skip>true</maven.javadoc.skip> - <!-- Java 8 required because Jetty requires it. --> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> - <springframework.version>2.0.1.RELEASE</springframework.version> </properties> @@ -102,17 +97,4 @@ </plugin> </plugins> </build> - - <distributionManagement> - <repository> - <id>apache.releases.https</id> - <name>Apache Release Distribution Repository</name> - <url>https://repository.apache.org/service/local/staging/deploy/maven2</url> - </repository> - <snapshotRepository> - <id>apache.snapshots.https</id> - <name>Apache Development Snapshot Repository</name> - <url>https://repository.apache.org/content/repositories/snapshots</url> - </snapshotRepository> - </distributionManagement> </project> diff --git a/juneau-examples/juneau-examples-rest-springboot/src/assembly/bin.xml b/juneau-examples/juneau-examples-rest-springboot/src/assembly/bin.xml index 98fc607..1d1c88f 100644 --- a/juneau-examples/juneau-examples-rest-springboot/src/assembly/bin.xml +++ b/juneau-examples/juneau-examples-rest-springboot/src/assembly/bin.xml @@ -34,7 +34,6 @@ <outputDirectory>/</outputDirectory> <includes> <include>src/main/**</include> - <include>files/**</include> </includes> </fileSet> <fileSet> @@ -42,6 +41,7 @@ <outputDirectory>/</outputDirectory> <includes> <include>src/main/**</include> + <include>files/**</include> <include>.settings/**</include> <include>.project</include> <include>*.launch</include> diff --git a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java index 458563d..69c31ff 100644 --- a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java +++ b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java @@ -12,6 +12,8 @@ // *************************************************************************************************************************** package org.apache.juneau.examples.rest.springboot; +import static org.apache.juneau.internal.SystemUtils.*; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.*; import org.springframework.context.*; @@ -30,13 +32,13 @@ public class App { private static volatile ConfigurableApplicationContext context; public static void main(String[] args) { - if (System.getProperty("juneau.configFile") == null) - System.setProperty("juneau.configFile", "examples.cfg"); try { + setProperty("juneau.configFile", "examples.cfg", false); context = SpringApplication.run(App.class, args); if (context == null) System.exit(2); // Probably port in use? AppConfiguration.setAppContext(context); + setProperty("juneau.serverPort", context.getEnvironment().getProperty("server.port"), false); } catch (Exception e) { e.printStackTrace(); } diff --git a/juneau-examples/juneau-examples-rest/build-overlay/pom.xml b/juneau-examples/juneau-examples-rest/build-overlay/pom.xml index 0eb8483..588b837 100644 --- a/juneau-examples/juneau-examples-rest/build-overlay/pom.xml +++ b/juneau-examples/juneau-examples-rest/build-overlay/pom.xml @@ -39,13 +39,14 @@ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.javadoc.skip>true</maven.javadoc.skip> - <derby.version>10.10.2.0</derby.version> - <springframework.version>2.0.1.RELEASE</springframework.version> + <derby.version>${derby.version}</derby.version> + <springframework.version>${springframework.version}</springframework.version> <javax.inject.version>1</javax.inject.version> <juneau.version>${version}</juneau.version> - <jena.version>2.7.1</jena.version> - <junit.version>4.11</junit.version> - <hibernate.version>5.0.9.Final</hibernate.version> + <jena.version>${jena.version}</jena.version> + <junit.version>${junit.version}</junit.version> + <hibernate.version>${hibernate.version}</hibernate.version> + <xml.apis.version>${xml.apis.version}</xml.apis.version> </properties> <dependencies> @@ -96,6 +97,11 @@ <artifactId>hibernate-entitymanager</artifactId> <version>\${hibernate.version}</version> </dependency> + <dependency> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + <version>\${xml.apis.version}</version> + </dependency> <!-- Optional RDF support --> <dependency> diff --git a/juneau-examples/juneau-examples-rest/pom.xml b/juneau-examples/juneau-examples-rest/pom.xml index a85fa40..a87c1b8 100644 --- a/juneau-examples/juneau-examples-rest/pom.xml +++ b/juneau-examples/juneau-examples-rest/pom.xml @@ -29,17 +29,10 @@ <properties> <encoding>UTF-8</encoding> - <maven.javadoc.skip>true</maven.javadoc.skip> - <derby.version>10.10.2.0</derby.version> - <hibernate.version>5.0.9.Final</hibernate.version> <!-- Skip javadoc generation since we generate them in the aggregate pom --> <maven.javadoc.skip>true</maven.javadoc.skip> - <!-- Java 8 required because Jetty requires it. --> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> - <javax.inject.version>1</javax.inject.version> </properties> @@ -78,6 +71,11 @@ <artifactId>hibernate-entitymanager</artifactId> <version>${hibernate.version}</version> </dependency> + <dependency> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + <version>${xml.apis.version}</version> + </dependency> <dependency> <groupId>javax.inject</groupId> diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java index cac18a4..b0e5854 100644 --- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java +++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java @@ -96,7 +96,9 @@ public class PetStoreService extends AbstractPersistenceService { public PetStoreService initViaRest(PrintWriter w) throws Exception { JsonParser parser = JsonParser.create().ignoreUnknownBeanProperties().build(); - try (RestClient rc = RestClient.create().json().rootUrl("http://localhost:10000").build()) { + String port = System.getProperty("juneau.serverPort", "8000"); + + try (RestClient rc = RestClient.create().json().rootUrl("http://localhost:" + port).build()) { PetStore ps = rc.getRemoteResource(PetStore.class); for (Pet x : ps.getPets()) { diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/RestMicroservice.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/RestMicroservice.java index b9ae826..773fe97 100755 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/RestMicroservice.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/RestMicroservice.java @@ -12,6 +12,8 @@ // *************************************************************************************************************************** package org.apache.juneau.microservice; +import static org.apache.juneau.internal.SystemUtils.*; + import java.io.*; import java.net.*; import java.util.*; @@ -296,7 +298,7 @@ public class RestMicroservice extends Microservice { int[] ports = cf.getObjectWithDefault("Jetty/port", mf.getWithDefault("Jetty-Port", new int[]{8000}, int[].class), int[].class); int availablePort = findOpenPort(ports); - System.setProperty("availablePort", String.valueOf(availablePort)); + setProperty("availablePort", availablePort, false); if (jettyXml == null) jettyXml = cf.getString("Jetty/config", mf.getString("Jetty-Config", null)); @@ -327,6 +329,8 @@ public class RestMicroservice extends Microservice { XmlConfiguration config = new XmlConfiguration(new ByteArrayInputStream(xmlConfig.getBytes())); server = (Server)config.configure(); + setProperty("juneau.serverPort", availablePort, false); + return server; } diff --git a/pom.xml b/pom.xml index a827c84..50cb30b 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,9 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + <jena.version>2.7.1</jena.version> <junit.version>4.11</junit.version> <jaxrs.version>1.1.1</jaxrs.version> @@ -42,8 +45,11 @@ <javadoc.juneau.version>8.0.0</javadoc.juneau.version> <juneauVersion>8.0.0</juneauVersion> <juneauVersionNext>8.0.1</juneauVersionNext> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> + <derby.version>10.10.2.0</derby.version> + <hibernate.version>5.0.9.Final</hibernate.version> + <javax.inject.version>1</javax.inject.version> + <springframework.version>2.0.1.RELEASE</springframework.version> + <xml.apis.version>1.4.01</xml.apis.version> </properties> <dependencyManagement>