You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/01/02 07:51:20 UTC
[05/13] isis git commit: ISIS-1243: recreating simpleapp archetype
http://git-wip-us.apache.org/repos/asf/isis/blob/52456594/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
index 98b2e62..518c6cd 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
@@ -76,7 +76,7 @@ ${symbol_pound}wrapper {
<b><a href="wicket/">wicket/</a></b>
</p>
<p>
- provides accesses to a generic UI for end-users,
+ provides access to a generic UI for end-users,
Isis' <a href="http://isis.apache.org/components/viewers/wicket/about.html" target="_blank">Wicket Viewer</a>.
As its name suggests, this viewer is built on top of <a href="http://wicket.apache.org" target="_blank">Apache Wicket</a>™.
</p>
@@ -84,13 +84,21 @@ ${symbol_pound}wrapper {
<li>
<p>
<b>
- <a href="restful/">restful/</a>
+ <a href="swagger-ui/index.html">swagger-ui/</a>
</b>
</p>
<p>
- provides access to a RESTful API conformant with the
- <a href="http://restfulobjects.org">Restful Objects</a> spec</td>. This is part of Apache Isis Core. The
- implementation technology is JBoss RestEasy.
+ provides access to a Swagger UI which uses a subset of the framework's automatically
+ generated <a href="restful/">RESTful API</a>. There are three versions of the Swagger
+ spec files (that drive the UI): <a href="restful/swagger/public">public</a> (for use by
+ "third-party" apps), <a href="restful/swagger/private">private</a> (for use by internal apps),
+ and <a href="restful/swagger/prototyping">prototyping</a> (an extended version of the private
+ API). The Swagger spec files are themselves dynamically generated and can be used to generate
+ client-side stubs.
+ </p>
+ <p>The RESTful API can return both simple representations and also richer hypermedia representations
+ that are conformant with the <a href="http://restfulobjects.org">Restful Objects</a> spec.
+ The HTTP <code>Accept</code> header is used to select which representation should be generated.
</p>
</li>
</ul>
http://git-wip-us.apache.org/repos/asf/isis/blob/52456594/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/swagger-ui/index.html
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/swagger-ui/index.html b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/swagger-ui/index.html
new file mode 100644
index 0000000..a504c37
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/swagger-ui/index.html
@@ -0,0 +1,164 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+<head>
+ <meta charset="UTF-8">
+ <base href="../webjars/swagger-ui/2.1.3/"/>
+ <title>Swagger UI</title>
+ <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
+ <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
+ <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
+ <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
+ <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+ <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
+ <script src='lib/underscore-min.js' type='text/javascript'></script>
+ <script src='lib/backbone-min.js' type='text/javascript'></script>
+ <script src='swagger-ui.js' type='text/javascript'></script>
+ <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
+ <script src='lib/marked.js' type='text/javascript'></script>
+ <script src='lib/swagger-oauth.js' type='text/javascript'></script>
+
+ <!-- Some basic translations -->
+ <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/en.js' type='text/javascript'></script> -->
+
+ <script type="text/javascript">
+ ${symbol_dollar}(function () {
+ var url = document.getElementById("input_baseUrl").selectedOptions[0].value;
+
+ // Pre load translate...
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+ window.swaggerUi = new SwaggerUi({
+ url: url,
+ dom_id: "swagger-ui-container",
+ supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
+ onComplete: function(swaggerApi, swaggerUi){
+ if(typeof initOAuth == "function") {
+ initOAuth({
+ clientId: "your-client-id",
+ clientSecret: "your-client-secret-if-required",
+ realm: "your-realms",
+ appName: "your-app-name",
+ scopeSeparator: ","
+ });
+ }
+
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+
+ ${symbol_dollar}('pre code').each(function(i, e) {
+ hljs.highlightBlock(e)
+ });
+
+ addApiKeyAuthorization();
+ },
+ onFailure: function(data) {
+ log("Unable to Load SwaggerUI");
+ },
+ docExpansion: "none",
+ apisSorter: "alpha",
+ defaultModelRendering: 'schema',
+ showRequestHeaders: false
+ });
+
+ function addApiKeyAuthorization(){
+ /*
+ var key = encodeURIComponent(${symbol_dollar}('${symbol_pound}input_apiKey')[0].value);
+ if(key && key.trim() != "") {
+ var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
+ window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
+ log("added key " + key);
+ }
+ */
+ var username = document.getElementById("input_user").value;
+ var password = document.getElementById("input_pass").value;
+ if(username && username.trim() != "" && password && password.trim() != "") {
+ var auth = "Basic " + btoa(username + ":" + password);
+ var swaggerUi = window.swaggerUi;
+ window.swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorization("Authorization", auth, "header"));
+ } else {
+ window.swaggerUi.api.clientAuthorizations.remove("key");
+ }
+ }
+
+ // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
+ /*
+ ${symbol_dollar}('${symbol_pound}input_apiKey').change(addApiKeyAuthorization);
+ */
+
+ /*
+ var apiKey = "myApiKeyXXXX123456789";
+ ${symbol_dollar}('${symbol_pound}input_apiKey').val(apiKey);
+ */
+ ${symbol_dollar}('${symbol_pound}input_user').val("sven");
+ ${symbol_dollar}('${symbol_pound}input_pass').val("pass");
+
+
+
+
+ window.swaggerUi.load();
+
+ function log() {
+ if ('console' in window) {
+ console.log.apply(console, arguments);
+ }
+ }
+ });
+ </script>
+</head>
+
+<body class="swagger-section">
+<div id='header'>
+ <div class="swagger-ui-wrap">
+ <a id="logo" href="http://swagger.io">swagger</a>
+ <form id='api_selector'>
+ <div class='input'>
+ <div class='input'><input placeholder="user" id="input_user" name="user" type="text" size="10"/></div>
+ <div class='input'><input placeholder="pass" id="input_pass" name="pass" type="password" size="10"/></div>
+ <select id="input_baseUrl" name="baseUrl" style="height: 26px;">
+ <option id="private" label="private" value="/restful/swagger/private"/>
+ <option id="public" label="public" value="/restful/swagger/public"/>
+ <option id="prototyping" label="prototyping" value="/restful/swagger/prototyping"/>
+ </select>
+ </div>
+ <div class='input' style="display:none;"><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
+ <div class='input'><a id="explore" href="${symbol_pound}" data-sw-translate>Reload</a></div>
+ </form>
+
+ </div>
+</div>
+
+<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
+<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/52456594/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index 4a8ba5c..e8427d5 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Sat Nov 07 00:29:54 GMT 2015
+#Tue Dec 29 12:36:56 GMT 2015
package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it