├── data
└── elasticsearch
│ ├── backup.json
│ ├── dashboard.json
│ ├── entry.json
│ ├── mapping.json
│ └── query.json
├── gen_content.sh
├── gen_html.yaml
├── images
├── apiman-add-authorizationpolicy.png
├── apiman-add-oauth2-plugin.png
├── apiman-add-oauth2-plugin1.png
├── apiman-add-oauth2-plugin2.png
├── apiman-authorization-policy.png
├── apiman-authorization-policy1.png
├── apiman-blogservice-api.png
├── apiman-blogservice-newservice-addpolicy.png
├── apiman-blogservice-newservice-addpolicy1.png
├── apiman-blogservice-newservice-addpolicy2.png
├── apiman-blogservice-newservice-addpolicy3.png
├── apiman-blogservice-newservice-addpolicy4.png
├── apiman-blogservice-newservice-addpolicy5.png
├── apiman-blogservice-newservice-basic.png
├── apiman-blogservice-newservice-basic1.png
├── apiman-blogservice-newservice-oauth2-1.png
├── apiman-blogservice-newservice-oauth2-2.png
├── apiman-blogservice-newservice-oauth2-3.png
├── apiman-blogservice-newservice-oauth2-4.png
├── apiman-blogservice-newservice-oauth2-5.png
├── apiman-blogservice-newservice-oauth2-6.png
├── apiman-blogservice-newservice-oauth2.png
├── apiman-blogservice-newservice-published.png
├── apiman-blogservice-oauth2-metrics.png
├── apiman-blogservice-plans.png
├── apiman-blogservice-publish.png
├── apiman-blogservice-unsecure-endpoint.png
├── apiman-blogservice.png
├── apiman-fuse-organisation-addservice.png
├── apiman-fuse-organisation-service.png
├── apiman-fuse-organisation.png
├── apiman-login.png
├── apiman-management.png
├── apiman-organization.png
├── camel.png
├── dashboard1.png
├── dashboard2.png
├── dashboard3.png
├── dashboard4.png
├── fuse-lab1.png
├── jwt1.png
├── keycloak-addclient.png
├── keycloak-addrealm.png
├── keycloak-addrealm1.png
├── keycloak-addrole-reader-to-user.png
├── keycloak-addrole-reader.png
├── keycloak-addrole-writer.png
├── keycloak-addrole-writerreader-to-admin.png
├── keycloak-addroles.png
├── keycloak-adduser-password.png
├── keycloak-adduser.png
├── keycloak-certificate.png
├── keycloak-switchtopublicanddirectgrant.png
├── keycloak-usedirectgrantapi.png
├── swagger1.png
├── swagger1a.png
├── swagger1b.png
├── swagger2.png
├── swagger3.png
└── swagger4.png
├── kibana
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── jboss
│ │ └── fuse
│ │ └── SimpleServer.java
│ └── resources
│ ├── WEB-INF
│ └── web.xml
│ ├── app.js
│ ├── app
│ ├── app.js
│ ├── components
│ │ └── require.config.js
│ ├── dashboards
│ │ ├── blank.json
│ │ ├── camel.json
│ │ ├── default.json
│ │ ├── fuse-lab.json
│ │ ├── guided.json
│ │ ├── logstash.js
│ │ ├── logstash.json
│ │ └── noted.json
│ ├── factories
│ │ └── store.js
│ ├── panels
│ │ ├── bettermap
│ │ │ ├── editor.html
│ │ │ ├── leaflet
│ │ │ │ ├── images
│ │ │ │ │ ├── layers-2x.png
│ │ │ │ │ ├── layers.png
│ │ │ │ │ ├── marker-icon-2x.png
│ │ │ │ │ ├── marker-icon.png
│ │ │ │ │ └── marker-shadow.png
│ │ │ │ ├── leaflet.css
│ │ │ │ ├── leaflet.ie.css
│ │ │ │ ├── leaflet.js
│ │ │ │ ├── plugins.css
│ │ │ │ └── plugins.js
│ │ │ ├── module.css
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── column
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ ├── module.js
│ │ │ └── panelgeneral.html
│ │ ├── dashcontrol
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── derivequeries
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── fields
│ │ │ ├── editor.html
│ │ │ ├── micropanel.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── filtering
│ │ │ ├── editor.html
│ │ │ ├── meta.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── goal
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── histogram
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ ├── module.js
│ │ │ ├── queriesEditor.html
│ │ │ └── styleEditor.html
│ │ ├── hits
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── map
│ │ │ ├── editor.html
│ │ │ ├── lib
│ │ │ │ ├── map.europe.js
│ │ │ │ ├── map.usa.js
│ │ │ │ └── map.world.js
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── query
│ │ │ ├── editor.html
│ │ │ ├── editors
│ │ │ │ ├── lucene.html
│ │ │ │ ├── regex.html
│ │ │ │ └── topN.html
│ │ │ ├── help
│ │ │ │ ├── lucene.html
│ │ │ │ ├── regex.html
│ │ │ │ └── topN.html
│ │ │ ├── helpModal.html
│ │ │ ├── meta.html
│ │ │ ├── module.html
│ │ │ ├── module.js
│ │ │ └── query.css
│ │ ├── sparklines
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── stats
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── table
│ │ │ ├── editor.html
│ │ │ ├── micropanel.html
│ │ │ ├── modal.html
│ │ │ ├── module.html
│ │ │ ├── module.js
│ │ │ └── pagination.html
│ │ ├── terms
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── text
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ │ ├── timepicker
│ │ │ ├── custom.html
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ ├── module.js
│ │ │ └── refreshctrl.html
│ │ └── trends
│ │ │ ├── editor.html
│ │ │ ├── module.html
│ │ │ └── module.js
│ └── partials
│ │ ├── connectionFailed.html
│ │ ├── dashLoader.html
│ │ ├── dashLoaderShare.html
│ │ ├── dashboard.html
│ │ ├── dasheditor.html
│ │ ├── inspector.html
│ │ ├── load.html
│ │ ├── modal.html
│ │ ├── paneladd.html
│ │ ├── paneleditor.html
│ │ ├── panelgeneral.html
│ │ ├── querySelect.html
│ │ └── roweditor.html
│ ├── config.js
│ ├── css
│ ├── animate.min.css
│ ├── bootstrap-responsive.min.css
│ ├── bootstrap.dark.less
│ ├── bootstrap.dark.min.css
│ ├── bootstrap.light.less
│ ├── bootstrap.light.min.css
│ ├── font-awesome.min.css
│ ├── normalize.min.css
│ └── timepicker.css
│ ├── favicon.ico
│ ├── font
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ └── fontawesome-webfont.woff
│ ├── img
│ ├── annotation-icon.png
│ ├── cubes.png
│ ├── glyphicons-halflings-white.png
│ ├── glyphicons-halflings.png
│ ├── kibana.png
│ ├── light.png
│ ├── load.gif
│ ├── load_big.gif
│ └── small.png
│ ├── index.html
│ ├── log4j.properties
│ ├── package.json
│ └── vendor
│ ├── LICENSE.json
│ ├── bootstrap
│ └── less
│ │ └── tests
│ │ ├── buttons.html
│ │ ├── css-tests.css
│ │ ├── css-tests.html
│ │ ├── forms-responsive.html
│ │ ├── forms.html
│ │ ├── navbar-fixed-top.html
│ │ ├── navbar-static-top.html
│ │ └── navbar.html
│ ├── require
│ ├── css-build.js
│ ├── require.js
│ └── tmpl.js
│ └── timezone.js
├── pom.xml
├── readme.adoc
├── routing
├── pom.xml
└── src
│ ├── data
│ └── articles
│ │ └── records.csv
│ └── main
│ ├── fabric8
│ ├── Readme.md
│ ├── fuse-lab1.png
│ └── org.jboss.fuse.demo.properties
│ ├── java
│ └── org
│ │ └── jboss
│ │ └── fuse
│ │ ├── model
│ │ └── Blog.java
│ │ ├── route
│ │ ├── AddArticleToElasticRoute.java
│ │ ├── DeleteArticleToElasticRoute.java
│ │ ├── FileToAddServiceRoute.java
│ │ ├── OnExceptionElasticSearch.java
│ │ ├── RestToServicesRoute.java
│ │ └── SearchArticleToElasticRoute.java
│ │ └── service
│ │ └── ElasticSearchService.java
│ └── resources
│ ├── OSGI-INF
│ └── blueprint
│ │ └── camel-context.xml
│ └── log4j.properties
├── script
├── pom.xml
└── src
│ └── main
│ └── resources
│ ├── demo-install.script
│ └── io.fabric8.elasticsearch-insight.cfg
├── swagger
├── pom.xml
├── run_jetty.sh
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── jboss
│ │ └── fuse
│ │ └── CORSFilter.java
│ ├── resources
│ ├── log4j.properties
│ └── services.json
│ └── webapp
│ ├── WEB-INF
│ └── web.xml
│ ├── css
│ ├── print.css
│ ├── reset.css
│ ├── screen.css
│ ├── style.css
│ └── typography.css
│ ├── fonts
│ ├── droid-sans-v6-latin-700.eot
│ ├── droid-sans-v6-latin-700.svg
│ ├── droid-sans-v6-latin-700.ttf
│ ├── droid-sans-v6-latin-700.woff
│ ├── droid-sans-v6-latin-700.woff2
│ ├── droid-sans-v6-latin-regular.eot
│ ├── droid-sans-v6-latin-regular.svg
│ ├── droid-sans-v6-latin-regular.ttf
│ ├── droid-sans-v6-latin-regular.woff
│ └── droid-sans-v6-latin-regular.woff2
│ ├── images
│ ├── explorer_icons.png
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── favicon.ico
│ ├── logo_small.png
│ ├── pet_store_api.png
│ ├── throbber.gif
│ └── wordnik_api.png
│ ├── index.html
│ ├── lang
│ ├── en.js
│ ├── es.js
│ ├── pt.js
│ ├── ru.js
│ └── translator.js
│ ├── lib
│ ├── backbone-min.js
│ ├── handlebars-2.0.0.js
│ ├── highlight.7.3.pack.js
│ ├── jquery-1.8.0.min.js
│ ├── jquery.ba-bbq.min.js
│ ├── jquery.slideto.min.js
│ ├── jquery.wiggle.min.js
│ ├── marked.js
│ ├── swagger-oauth.js
│ ├── underscore-min.js
│ └── underscore-min.map
│ ├── log4j.properties
│ ├── o2c.html
│ ├── services.json
│ ├── swagger-ui.js
│ └── swagger-ui.min.js
└── useful_cmds.txt
/data/elasticsearch/backup.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "fs",
3 | "settings": {
4 | "location": "/Users/chmoulli/RedHat/GPE/GPE-Courses/fuse-lab/chm_backup",
5 | "compress": true
6 | }
7 | }
--------------------------------------------------------------------------------
/data/elasticsearch/entry.json:
--------------------------------------------------------------------------------
1 | { "id":"0", "user": "cmoulliard", "postDate": "2015-08-10T10:10", "body": "Integration is hard. Integration should be easy.", "title": "On distributed search" }
--------------------------------------------------------------------------------
/data/elasticsearch/mapping.json:
--------------------------------------------------------------------------------
1 | {
2 | "article": {
3 | "properties": {
4 | "user": {
5 | "type": "string"
6 | },
7 | "title": {
8 | "type": "string"
9 | },
10 | "postDate": {
11 | "type": "date",
12 | "format": "yyyy-MM-dd'T'HH:mm"
13 | },
14 | "body": {
15 | "type": "string"
16 | },
17 | "id": {
18 | "type": "integer"
19 | }
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/data/elasticsearch/query.json:
--------------------------------------------------------------------------------
1 | {
2 | "aggs" : {
3 | "articles_over_time" : {
4 | "date_histogram" : {
5 | "field" : "postDate",
6 | "interval" : "month"
7 | }
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/gen_content.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | hyla generate -c gen_html.yaml
--------------------------------------------------------------------------------
/gen_html.yaml:
--------------------------------------------------------------------------------
1 | source: .
2 | destination: generated_html_content
3 |
4 | mode: 'development'
5 | tracer: 'false'
6 | level: 'INFO'
7 | dirname: /Users/chmoulli/log
8 | logname: hyla.log
9 |
10 | #
11 | # Styles
12 | # Supported : liberation, asciidoctor, colony, foundation, foundation-lime, foundation-potion, github, golo, iconic, maker, readthedocs, riak, rocket-panda, rubygems
13 | #
14 | style: asciidoctor
15 |
16 | #
17 | # Asciidoctor and attributes options
18 | #
19 | backend: html5
20 | doctype: book
21 | attributes:
22 | source-highlighter: coderay # prettify, pygments, coderay, highlightjs
23 | #highlightjs-theme: sunburst
24 | linkcss!: true
25 | data-uri: true
26 | allow-uri-read: true
27 | last-update-label!:
28 | stylesdir: /Users/chmoulli/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/hyla-1.0.8/lib/resources/assets/styles
29 | safe: unsafe
30 |
31 | :toc: macro
32 |
33 | rendering: adoc2html
34 |
--------------------------------------------------------------------------------
/images/apiman-add-authorizationpolicy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-add-authorizationpolicy.png
--------------------------------------------------------------------------------
/images/apiman-add-oauth2-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-add-oauth2-plugin.png
--------------------------------------------------------------------------------
/images/apiman-add-oauth2-plugin1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-add-oauth2-plugin1.png
--------------------------------------------------------------------------------
/images/apiman-add-oauth2-plugin2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-add-oauth2-plugin2.png
--------------------------------------------------------------------------------
/images/apiman-authorization-policy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-authorization-policy.png
--------------------------------------------------------------------------------
/images/apiman-authorization-policy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-authorization-policy1.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-api.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-addpolicy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-addpolicy.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-addpolicy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-addpolicy1.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-addpolicy2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-addpolicy2.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-addpolicy3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-addpolicy3.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-addpolicy4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-addpolicy4.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-addpolicy5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-addpolicy5.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-basic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-basic.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-basic1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-basic1.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2-1.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2-2.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2-3.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2-4.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2-5.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2-6.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-oauth2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-oauth2.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-newservice-published.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-newservice-published.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-oauth2-metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-oauth2-metrics.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-plans.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-plans.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-publish.png
--------------------------------------------------------------------------------
/images/apiman-blogservice-unsecure-endpoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice-unsecure-endpoint.png
--------------------------------------------------------------------------------
/images/apiman-blogservice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-blogservice.png
--------------------------------------------------------------------------------
/images/apiman-fuse-organisation-addservice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-fuse-organisation-addservice.png
--------------------------------------------------------------------------------
/images/apiman-fuse-organisation-service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-fuse-organisation-service.png
--------------------------------------------------------------------------------
/images/apiman-fuse-organisation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-fuse-organisation.png
--------------------------------------------------------------------------------
/images/apiman-login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-login.png
--------------------------------------------------------------------------------
/images/apiman-management.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-management.png
--------------------------------------------------------------------------------
/images/apiman-organization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/apiman-organization.png
--------------------------------------------------------------------------------
/images/camel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/camel.png
--------------------------------------------------------------------------------
/images/dashboard1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/dashboard1.png
--------------------------------------------------------------------------------
/images/dashboard2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/dashboard2.png
--------------------------------------------------------------------------------
/images/dashboard3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/dashboard3.png
--------------------------------------------------------------------------------
/images/dashboard4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/dashboard4.png
--------------------------------------------------------------------------------
/images/fuse-lab1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/fuse-lab1.png
--------------------------------------------------------------------------------
/images/jwt1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/jwt1.png
--------------------------------------------------------------------------------
/images/keycloak-addclient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addclient.png
--------------------------------------------------------------------------------
/images/keycloak-addrealm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addrealm.png
--------------------------------------------------------------------------------
/images/keycloak-addrealm1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addrealm1.png
--------------------------------------------------------------------------------
/images/keycloak-addrole-reader-to-user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addrole-reader-to-user.png
--------------------------------------------------------------------------------
/images/keycloak-addrole-reader.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addrole-reader.png
--------------------------------------------------------------------------------
/images/keycloak-addrole-writer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addrole-writer.png
--------------------------------------------------------------------------------
/images/keycloak-addrole-writerreader-to-admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addrole-writerreader-to-admin.png
--------------------------------------------------------------------------------
/images/keycloak-addroles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-addroles.png
--------------------------------------------------------------------------------
/images/keycloak-adduser-password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-adduser-password.png
--------------------------------------------------------------------------------
/images/keycloak-adduser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-adduser.png
--------------------------------------------------------------------------------
/images/keycloak-certificate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-certificate.png
--------------------------------------------------------------------------------
/images/keycloak-switchtopublicanddirectgrant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-switchtopublicanddirectgrant.png
--------------------------------------------------------------------------------
/images/keycloak-usedirectgrantapi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/keycloak-usedirectgrantapi.png
--------------------------------------------------------------------------------
/images/swagger1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/swagger1.png
--------------------------------------------------------------------------------
/images/swagger1a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/swagger1a.png
--------------------------------------------------------------------------------
/images/swagger1b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/swagger1b.png
--------------------------------------------------------------------------------
/images/swagger2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/swagger2.png
--------------------------------------------------------------------------------
/images/swagger3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/swagger3.png
--------------------------------------------------------------------------------
/images/swagger4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/images/swagger4.png
--------------------------------------------------------------------------------
/kibana/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 | org.jboss.fuse
8 | camel-rest-dsl-demo
9 | 1.0
10 |
11 |
12 | kibana
13 | 1.0
14 |
15 | FuseByExample :: REST DSL Demo :: Kibana 3
16 |
17 |
18 | 9090
19 | 9.3.0.M1
20 |
21 | jar
22 |
23 |
24 |
25 | org.eclipse.jetty
26 | jetty-server
27 | ${jetty.version}
28 |
29 |
30 | org.eclipse.jetty
31 | jetty-http
32 | ${jetty.version}
33 |
34 |
35 | org.eclipse.jetty
36 | jetty-io
37 | ${jetty.version}
38 |
39 |
40 | org.eclipse.jetty
41 | jetty-util
42 | ${jetty.version}
43 |
44 |
45 | org.slf4j
46 | slf4j-log4j12
47 |
48 |
49 | log4j
50 | log4j
51 |
52 |
53 |
54 |
55 |
56 |
57 | src/main/resources
58 |
59 |
60 |
61 |
62 |
63 |
64 | org.codehaus.mojo
65 | exec-maven-plugin
66 | 1.4.0
67 |
68 | org.jboss.fuse.SimpleServer
69 |
70 |
71 | webPort
72 | ${jetty.port}
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/kibana/src/main/java/org/jboss/fuse/SimpleServer.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse;
2 |
3 | import org.eclipse.jetty.server.Handler;
4 | import org.eclipse.jetty.server.Server;
5 | import org.eclipse.jetty.server.handler.DefaultHandler;
6 | import org.eclipse.jetty.server.handler.HandlerList;
7 | import org.eclipse.jetty.server.handler.ResourceHandler;
8 | import org.slf4j.Logger;
9 |
10 | import java.util.Enumeration;
11 | import java.util.Properties;
12 |
13 | public class SimpleServer {
14 |
15 | protected final static Logger LOG = org.slf4j.LoggerFactory.getLogger(SimpleServer.class);
16 |
17 | public static void main(String[] args) throws Exception {
18 |
19 | int port = Integer.parseInt(System.getProperty("webPort"));
20 | LOG.info("[Port : " + port + "]");
21 |
22 | Server server = new Server(port);
23 |
24 | ResourceHandler handler = new ResourceHandler();
25 | handler.setDirectoriesListed(true);
26 | handler.setWelcomeFiles(new String[]{ "index.html" });
27 | LOG.info("[index.html page registered as welcome page]");
28 |
29 | handler.setResourceBase("src/main/resources");
30 | LOG.info("[Resource Base point to the resources directory]");
31 |
32 | HandlerList handlers = new HandlerList();
33 | handlers.setHandlers(new Handler[] { handler, new DefaultHandler() });
34 | server.setHandler(handlers);
35 |
36 | LOG.info(("[HTTP Simple Server started at the address : http://localhost:9090]"));
37 |
38 | server.start();
39 | server.join();
40 | }
41 | }
--------------------------------------------------------------------------------
/kibana/src/main/resources/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Kibana3 Web App
8 |
9 |
10 | index.html
11 |
12 |
13 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var cors = require('cors');
3 |
4 | var app = express();
5 |
6 | // Enable CORS for all requests
7 | app.use(cors());
8 |
9 | // allow serving of static files from the public directory
10 | app.use(express.static(__dirname));
11 |
12 | var port = 9090;
13 | var host = '0.0.0.0';
14 | var server = app.listen(port, host, function() {
15 | console.log("App started at: " + new Date() + " on port: " + port);
16 | });
17 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/components/require.config.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | require.config({baseUrl:"app",paths:{config:"../config",settings:"components/settings",kbn:"components/kbn",vendor:"../vendor",css:"../vendor/require/css",text:"../vendor/require/text",moment:"../vendor/moment",blob:"../vendor/blob",filesaver:"../vendor/filesaver",chromath:"../vendor/chromath",angular:"../vendor/angular/angular","angular-cookies":"../vendor/angular/angular-cookies","angular-dragdrop":"../vendor/angular/angular-dragdrop","angular-strap":"../vendor/angular/angular-strap","angular-sanitize":"../vendor/angular/angular-sanitize",timepicker:"../vendor/angular/timepicker",datepicker:"../vendor/angular/datepicker",bindonce:"../vendor/angular/bindonce",lodash:"components/lodash.extended","lodash-src":"../vendor/lodash",bootstrap:"../vendor/bootstrap/bootstrap",jquery:"../vendor/jquery/jquery-1.8.0","jquery-ui":"../vendor/jquery/jquery-ui-1.10.3","extend-jquery":"components/extend-jquery","jquery.flot":"../vendor/jquery/jquery.flot","jquery.flot.pie":"../vendor/jquery/jquery.flot.pie","jquery.flot.events":"../vendor/jquery/jquery.flot.events","jquery.flot.selection":"../vendor/jquery/jquery.flot.selection","jquery.flot.stack":"../vendor/jquery/jquery.flot.stack","jquery.flot.stackpercent":"../vendor/jquery/jquery.flot.stackpercent","jquery.flot.time":"../vendor/jquery/jquery.flot.time","jquery.flot.byte":"../vendor/jquery/jquery.flot.byte",modernizr:"../vendor/modernizr-2.6.1",numeral:"../vendor/numeral",jsonpath:"../vendor/jsonpath",elasticjs:"../vendor/elasticjs/elastic-angular-client"},shim:{angular:{deps:["jquery","config"],exports:"angular"},bootstrap:{deps:["jquery"]},modernizr:{exports:"Modernizr"},jsonpath:{exports:"jsonPath"},jquery:{exports:"jQuery"},"jquery-ui":["jquery"],"jquery.flot":["jquery"],"jquery.flot.byte":["jquery","jquery.flot"],"jquery.flot.pie":["jquery","jquery.flot"],"jquery.flot.events":["jquery","jquery.flot"],"jquery.flot.selection":["jquery","jquery.flot"],"jquery.flot.stack":["jquery","jquery.flot"],"jquery.flot.stackpercent":["jquery","jquery.flot"],"jquery.flot.time":["jquery","jquery.flot"],"angular-sanitize":["angular"],"angular-cookies":["angular"],"angular-dragdrop":["jquery","jquery-ui","angular"],"angular-loader":["angular"],"angular-mocks":["angular"],"angular-resource":["angular"],"angular-route":["angular"],"angular-touch":["angular"],bindonce:["angular"],"angular-strap":["angular","bootstrap","timepicker","datepicker"],timepicker:["jquery","bootstrap"],datepicker:["jquery","bootstrap"],elasticjs:["angular","../vendor/elasticjs/elastic"]},waitSeconds:60});
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/dashboards/blank.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "New Dashboard",
3 | "services": {
4 | "query": {
5 | "list": {
6 | "0": {
7 | "query": "*",
8 | "alias": "",
9 | "color": "#7EB26D",
10 | "id": 0
11 | }
12 | },
13 | "ids": [
14 | 0
15 | ]
16 | },
17 | "filter": {
18 | "list": {},
19 | "ids": []
20 | }
21 | },
22 | "rows": [
23 | ],
24 | "editable": true,
25 | "failover": false,
26 | "index": {
27 | "interval": "none",
28 | "pattern": "[logstash-]YYYY.MM.DD",
29 | "default": "_all",
30 | "warm_fields": false
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/factories/store.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define(["angular","lodash"],function(a,b){var c=a.module("kibana.factories");c.factory("storeFactory",function(){return function(a,c,d){if(!b.isFunction(a.$watch))throw new TypeError("Invalid scope.");if(!b.isString(c))throw new TypeError("Invalid name, expected a string that the is unique to this store.");if(d&&!b.isPlainObject(d))throw new TypeError("Invalid defaults, expected a simple object or nothing");d=d||{};var e=localStorage.getItem(c);if(null!=e)try{e=JSON.parse(e)}catch(f){e=null}if(null==e)e=b.clone(d);else{if(!b.isPlainObject(e))throw new TypeError("Invalid store value"+e);b.defaults(e,d)}return a[c]=e,a.$watch(c,function(e){void 0===e?(localStorage.removeItem(c),a[c]=b.clone(d)):localStorage.setItem(c,JSON.stringify(e))},!0),e}})});
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/bettermap/editor.html:
--------------------------------------------------------------------------------
1 |
This panel has been removed. Please use the dashboard controls in the top right and remove this panel from your dashboard
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/dashcontrol/module.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define("panels/dashcontrol/module",["angular","app","lodash"],function(a,b,c){var d=a.module("kibana.panels.dashcontrol",[]);b.useModule(d),d.controller("dashcontrol",["$scope","$http","timer","dashboard","alertSrv",function(a,b,d,e,f){a.panelMeta={status:"Deprecated",description:"This panel has been moved to the navigation bar. See the dashboard setting editor to configure it."},a.panel=a.panel||{};var g={save:{gist:!1,elasticsearch:!0,local:!0,"default":!0},load:{gist:!0,elasticsearch:!0,local:!0},hide_control:!1,elasticsearch_size:20,temp:!0,ttl_enable:!0,temp_ttl:"30d"};c.defaults(a.panel,g),a.init=function(){a.gist_pattern=/(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/,a.gist={},a.elasticsearch={}},a.set_default=function(){e.set_default()?f.set("Local Default Set",e.current.title+" has been set as your local default","success",5e3):f.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},a.purge_default=function(){e.purge_default()?f.set("Local Default Clear","Your local default dashboard has been cleared","success",5e3):f.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},a.elasticsearch_save=function(b,d){e.elasticsearch_save(b,a.elasticsearch.title||e.current.title,a.panel.ttl_enable?d:!1).then(function(d){c.isUndefined(d._id)?f.set("Save failed","Dashboard could not be saved to Elasticsearch","error",5e3):(f.set("Dashboard Saved",'This dashboard has been saved to Elasticsearch as "'+d._id+'"',"success",5e3),"temp"===b&&(a.share=e.share_link(e.current.title,"temp",d._id)))})},a.elasticsearch_delete=function(b){e.elasticsearch_delete(b).then(function(d){if(c.isUndefined(d))f.set("Dashboard Not Deleted","An error occurred deleting the dashboard","error",5e3);else if(d.found){f.set("Dashboard Deleted",b+" has been deleted","success",5e3);var e=c.where(a.elasticsearch.dashboards,{_id:b})[0];a.elasticsearch.dashboards=c.without(a.elasticsearch.dashboards,e)}else f.set("Dashboard Not Found","Could not find "+b+" in Elasticsearch","warning",5e3)})},a.elasticsearch_dblist=function(b){e.elasticsearch_list(b,a.panel.elasticsearch_size).then(function(b){c.isUndefined(b.hits)||(a.panel.error=!1,a.hits=b.hits.total,a.elasticsearch.dashboards=b.hits.hits)})},a.save_gist=function(){e.save_gist(a.gist.title).then(function(b){c.isUndefined(b)?f.set("Save failed","Gist could not be saved","error",5e3):(a.gist.last=b,f.set("Gist saved",'You will be able to access your exported dashboard file at ");f.bind("plothover",function(a,b,c){c?h.html([e.query_color_dot(c.series.color,15),c.series.label||"",parseFloat(c.series.percent).toFixed(1)+"%"].join(" ")).place_tt(b.pageX,b.pageY,{offset:10}):h.remove()})}}}])});
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/histogram/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/histogram/module.html:
--------------------------------------------------------------------------------
1 |
View |  Zoom Out |  {{series.query.alias || series.query.query}} {{series.query.alias}} ({{series.hits}}) change in {{panel.value_field}} {{panel.mode}} per {{panel.interval}} 1s | ({{hits}} hits)
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/histogram/queriesEditor.html:
--------------------------------------------------------------------------------
1 |
Charted
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/histogram/styleEditor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/hits/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/hits/module.html:
--------------------------------------------------------------------------------
1 |
{{query.info.alias}} {{query.data[0][1]}}
{{query.info.alias}} ({{query.data[0][1]}})
{{query.info.alias}} {{query.data[0][1]}}
{{query.info.alias}} ({{query.data[0][1]}})
{{query.info.alias}} ({{query.hits}})
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/hits/module.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define("panels/hits/module",["angular","app","lodash","jquery","kbn","jquery.flot","jquery.flot.pie"],function(a,b,c,d,e){var f=a.module("kibana.panels.hits",[]);b.useModule(f),f.controller("hits",["$scope","querySrv","dashboard","filterSrv",function(b,d,e,f){b.panelMeta={modals:[{description:"Inspect",icon:"icon-info-sign",partial:"app/partials/inspector.html",show:b.panel.spyable}],editorTabs:[{title:"Queries",src:"app/partials/querySelect.html"}],status:"Stable",description:"The total hits for a query or set of queries. Can be a pie chart, bar chart, list, or absolute total of all queries combined"};var g={style:{"font-size":"10pt"},arrangement:"horizontal",chart:"bar",counter_pos:"above",donut:!1,tilt:!1,labels:!0,spyable:!0,queries:{mode:"all",ids:[]}};c.defaults(b.panel,g),b.init=function(){b.hits=0,b.$on("refresh",function(){b.get_data()}),b.get_data()},b.get_data=function(g,h){if(delete b.panel.error,b.panelMeta.loading=!0,0!==e.indices.length){var i=c.isUndefined(g)?0:g,j=b.ejs.Request().indices(e.indices[i]);b.panel.queries.ids=d.idsByMode(b.panel.queries);var k=d.getQueryObjs(b.panel.queries.ids);c.each(k,function(a){var c=b.ejs.FilteredQuery(d.toEjsObj(a),f.getBoolFilter(f.ids()));j=j.facet(b.ejs.QueryFacet(a.id).query(c)).size(0)}),b.inspector=a.toJson(JSON.parse(j.toString()),!0);var l=j.doSearch();l.then(function(a){if(b.panelMeta.loading=!1,0===i&&(b.hits=0,b.data=[],h=b.query_id=(new Date).getTime()),!c.isUndefined(a.error))return void(b.panel.error=b.parse_error(a.error));if(b.query_id===h){var d=0;c.each(k,function(e){var f=a.facets[e.id],g=c.isUndefined(b.data[d])||0===i?f.count:b.data[d].hits+f.count;b.hits+=f.count,b.data[d]={info:e,id:e.id,hits:g,data:[[d,g]]},d++}),b.$emit("render"),i
'+a+" "+Math.round(b.percent)+"% "},threshold:.1}}},grid:{hoverable:!0,clickable:!0},colors:a.colors}))}catch(e){f.text(e)}}b.$on("render",function(){g()});var h=d("");f.bind("plothover",function(a,c,d){if(d){var f="bar"===b.panel.chart?d.datapoint[1]:d.datapoint[1][0][1];h.html(e.query_color_dot(d.series.color,20)+" "+d.series.label+" ("+f.toFixed(0)+")").place_tt(c.pageX,c.pageY)}else h.remove()})}}}])});
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/map/editor.html:
--------------------------------------------------------------------------------
1 |
MaxMaximum countries to plot
Map
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/map/module.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/editors/lucene.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/app/panels/query/editors/lucene.html
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/editors/regex.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/app/panels/query/editors/regex.html
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/editors/topN.html:
--------------------------------------------------------------------------------
1 |
Field Count
Union {{mode}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/help/lucene.html:
--------------------------------------------------------------------------------
1 | The lucene query type uses
LUCENE query string syntax to find matching documents or events within Elasticsearch.
Examples status
field contains active
status:active title
field contains quick
or brown
title:(quick brown) author
field contains the exact phrase "john smith"
author:"John Smith" Wildcard searches can be run on individual terms, using ?
to replace a single character, and *
to replace zero or more characters:
qu?ck bro*
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/help/regex.html:
--------------------------------------------------------------------------------
1 | The regex query allows you to use regular expressions to match terms in the
_all field. A detailed overview of lucene's regex engine is available here:
Regular expressions in Elasticsearch A note on anchoring Lucene’s patterns are always anchored. The pattern provided must match the entire string. For string "abcde":
ab.*
will matchabcd
will not match
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/help/topN.html:
--------------------------------------------------------------------------------
1 | The topN query uses an
Elasticsearch terms facet to find the most common terms in a field and build queries from the result. The topN query uses
LUCENE query string syntax Parameters Field / The field to facet on. Fields with a large number of unique terms will use more memory to calculate.Count / How many queries to generate. The resulting queries will use brightness variations on the original query's color for their own.Union / The relation the generated queries have to the original. For example, if your field was set to 'extension', your original query was "user:B.Awesome" and your union was AND. Kibana might generate the following example query: extension:"html" AND (user:B.Awesome)
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/helpModal.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/meta.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/module.html:
--------------------------------------------------------------------------------
1 |
Pinned {{dashboard.current.services.query.list[id].alias || dashboard.current.services.query.list[id].query}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/module.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define("css-embed",function(){function a(a){var b=document.getElementsByTagName("head")[0],c=document.createElement("style"),d=document.createTextNode(a);c.type="text/css",c.styleSheet?c.styleSheet.cssText=d.nodeValue:c.appendChild(d),b.appendChild(c)}return a}),define("css!panels/query/query.css",["css-embed"],function(a){return a(".short-query{display:inline-block;margin-right:10px}.short-query input.search-query{width:280px}.begin-query{position:absolute;left:10px;top:5px}.end-query{position:absolute;right:10px;top:5px}.end-query i,.begin-query i{margin:0}.panel-query{padding-left:25px!important;height:31px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.query-disabled{opacity:.3}.form-search:hover .has-remove{padding-left:40px!important}.remove-query{opacity:0}.last-query{padding-right:45px!important}.form-search:hover .remove-query{opacity:1}.query-panel .pinned{margin-right:5px}"),!0}),define("panels/query/module",["angular","app","lodash","css!./query.css"],function(a,b,c){var d=a.module("kibana.panels.query",[]);b.useModule(d),d.controller("query",["$scope","querySrv","$rootScope","dashboard","$q","$modal",function(a,b,d,e,f,g){a.panelMeta={status:"Stable",description:"Manage all of the queries on the dashboard. You almost certainly need one of these somewhere. This panel allows you to add, remove, label, pin and color queries"};var h={query:"*",pinned:!0,history:[],remember:10};c.defaults(a.panel,h),a.querySrv=b,a.dashboard=e,a.queryTypes=b.types;var i=g({template:"./app/panels/query/helpModal.html",persist:!0,show:!1,scope:a});a.init=function(){},a.refresh=function(){j(c.pluck(a.dashboard.current.services.query.list,"query")),e.refresh()},a.render=function(){d.$broadcast("render")},a.toggle_pin=function(a){e.current.services.query.list[a].pin=e.current.services.query.list[a].pin?!1:!0},a.queryIcon=function(a){return b.queryTypes[a].icon},a.queryConfig=function(a){return"./app/panels/query/editors/"+(a||"lucene")+".html"},a.queryHelpPath=function(a){return"./app/panels/query/help/"+(a||"lucene")+".html"},a.queryHelp=function(b){a.help={type:b},f.when(i).then(function(a){a.modal("show")})},a.typeChange=function(a){var c={id:a.id,type:a.type,query:a.query,alias:a.alias,color:a.color};e.current.services.query.list[c.id]=b.defaults(c)};var j=function(b){if(a.panel.remember>0){a.panel.history=c.union(b.reverse(),a.panel.history);var d=a.panel.history.length;d>a.panel.remember&&(a.panel.history=a.panel.history.slice(0,a.panel.remember))}};a.init()}])});
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/query/query.css:
--------------------------------------------------------------------------------
1 | .short-query{display:inline-block;margin-right:10px}.short-query input.search-query{width:280px}.begin-query{position:absolute;left:10px;top:5px}.end-query{position:absolute;right:10px;top:5px}.end-query i,.begin-query i{margin:0}.panel-query{padding-left:25px!important;height:31px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.query-disabled{opacity:.3}.form-search:hover .has-remove{padding-left:40px!important}.remove-query{opacity:0}.last-query{padding-right:45px!important}.form-search:hover .remove-query{opacity:1}.query-panel .pinned{margin-right:5px}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/sparklines/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/sparklines/module.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/stats/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/stats/module.html:
--------------------------------------------------------------------------------
1 |
{{data.value|formatstats:panel.format}} {{panel.unit}} ({{panel.mode}})
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/table/editor.html:
--------------------------------------------------------------------------------
1 |
Columns {{field}} Highlighted Fields {{field}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/table/micropanel.html:
--------------------------------------------------------------------------------
1 |
× Micro Analysis of {{micropanel.field}} ({{micropanel.type}}) as Groups / Singles Value Action Count / {{micropanel.count}} events {{$index+1}}. {{{true: "__blank__", false:field[0] }[(field[0] == '' || field[0] == undefined) && field[0] != 0]|tableTruncate:panel.trimFactor:3}}
{{field[1]}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/table/modal.html:
--------------------------------------------------------------------------------
1 |
Top 10 terms in field {{modalField}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/table/pagination.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/terms/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/terms/module.html:
--------------------------------------------------------------------------------
1 |
{{term.label}} {{term.data[0][1]}}
{{term.label}} ({{term.data[0][1]}})   | {{ panel.tstat }} of {{ panel.valuefield }}
{{term.label}} {{term.data[0][1]}}
{{term.label}} ({{term.data[0][1]}})   | {{ panel.tstat }} of {{ panel.valuefield }}
Term {{ panel.tmode == 'terms_stats' ? panel.tstat : 'Count' }} Action {{term.label}} {{term.data[0][1]}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/text/editor.html:
--------------------------------------------------------------------------------
1 |
Content (This area uses HTML sanitized via AngularJS's $sanitize service) (This area uses Markdown . HTML is not supported)
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/text/module.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/timepicker/custom.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/timepicker/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/timepicker/module.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/timepicker/module.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define("panels/timepicker/module",["angular","app","lodash","moment","kbn"],function(a,b,c,d,e){var f=a.module("kibana.panels.timepicker",[]);b.useModule(f),f.controller("timepicker",["$scope","$modal","$q","filterSrv",function(a,b,f,g){a.panelMeta={status:"Stable",description:"A panel for controlling the time range filters. If you have time based data, or if you're using time stamped indices, you need one of these"};var h={status:"Stable",time_options:["5m","15m","1h","6h","12h","24h","2d","7d","30d"],refresh_intervals:["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],timefield:"@timestamp"};c.defaults(a.panel,h);var i=b({template:"./app/panels/timepicker/custom.html",persist:!0,show:!1,scope:a,keyboard:!1});a.filterSrv=g,a.patterns={date:/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/,hour:/^([01]?[0-9]|2[0-3])$/,minute:/^[0-5][0-9]$/,second:/^[0-5][0-9]$/,millisecond:/^[0-9]*$/},a.$on("refresh",function(){a.init()}),a.init=function(){var b=g.timeRange("last");b&&(a.panel.now="now"===g.timeRange(!1).to?!0:!1,a.time=l(b.from,b.to))},a.customTime=function(){a.input.$setValidity("dummy",!0),a.temptime=k(a.time),a.temptime.from.date.setHours(0,0,0,0),a.temptime.to.date.setHours(0,0,0,0),(new Date).getTimezoneOffset()<0&&(a.temptime.from.date=d(a.temptime.from.date).add("days",1).toDate(),a.temptime.to.date=d(a.temptime.to.date).add("days",1).toDate()),f.when(i).then(function(a){a.modal("show")})},a.validate=function(b){a.input.$setValidity("dummy",!0);var c=n(b.from.date),d=n(b.to.date),e=b;return a.input.$valid?(c.setHours(e.from.hour,e.from.minute,e.from.second,e.from.millisecond),d.setHours(e.to.hour,e.to.minute,e.to.second,e.to.millisecond),isNaN(c.getTime())||isNaN(d.getTime())||c.getTime()>=d.getTime()?(a.input.$setValidity("dummy",!1),!1):{from:c,to:d}):!1},a.setNow=function(){a.time.to=m(new Date)},a.setAbsoluteTimeFilter=function(b){var d=c.clone(b);return d.type="time",d.field=a.panel.timefield,a.panel.now&&(d.to="now"),g.removeByType("time",!0),a.panel.filter_id=g.set(d),a.time=l(b.from,b.to),a.panel.filter_id},a.setRelativeFilter=function(b){a.panel.now=!0;var c={type:"time",field:a.panel.timefield,from:"now-"+b,to:"now"};return g.removeByType("time",!0),a.panel.filter_id=g.set(c),a.time=l(e.parseDate(c.from),new Date),a.panel.filter_id};var j=function(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a},k=function(a){var b={from:c.clone(a.from),to:c.clone(a.to)};return b.from.date=new Date(b.from.date),b.to.date=new Date(b.to.date),b},l=function(a,b){return{from:m(a),to:m(b)}},m=function(a){return{date:new Date(a),hour:j(a.getHours(),2),minute:j(a.getMinutes(),2),second:j(a.getSeconds(),2),millisecond:j(a.getMilliseconds(),3)}},n=function(a){return a=d(a).clone().toDate(),d(new Date(a.getTime()+6e4*a.getTimezoneOffset())).toDate()}}])});
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/timepicker/refreshctrl.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/trends/editor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/trends/module.html:
--------------------------------------------------------------------------------
1 |
{{query.percent}}% ({{query.info.alias}})
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/panels/trends/module.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define("panels/trends/module",["angular","app","lodash","kbn"],function(a,b,c,d){var e=a.module("kibana.panels.trends",[]);b.useModule(e),e.controller("trends",["$scope","kbnIndex","querySrv","dashboard","filterSrv",function(b,e,f,g,h){function i(a,b){return 0===a?null:100*(b-a)/a}b.panelMeta={modals:[{description:"Inspect",icon:"icon-info-sign",partial:"app/partials/inspector.html",show:b.panel.spyable}],editorTabs:[{title:"Queries",src:"app/partials/querySelect.html"}],status:"Beta",description:'A stock-ticker style representation of how queries are moving over time. For example, if the time is 1:10pm, your time picker was set to "Last 10m", and the "Time Ago" parameter was set to \'1h\', the panel would show how much the query results have changed since 12:00-12:10pm'};var j={ago:"1d",arrangement:"vertical",reverse:!1,spyable:!0,queries:{mode:"all",ids:[]},style:{"font-size":"14pt"}};c.defaults(b.panel,j),b.init=function(){b.hits=0,b.$on("refresh",function(){b.get_data()}),b.get_data()},b.get_data=function(i,j){if(delete b.panel.error,b.panelMeta.loading=!0,0!==g.indices.length){b.index=i>0?b.index:g.indices;var l=c.uniq(c.pluck(h.getByType("time"),"field"));if(l.length>1)return void(b.panel.error="Time field must be consistent amongst time filters");if(0===l.length)return void(b.panel.error="A time filter must exist for this panel to function");l=l[0],b.time=h.timeRange("last"),b.old_time={from:new Date(b.time.from.getTime()-d.interval_to_ms(b.panel.ago)).valueOf(),to:new Date(b.time.to.getTime()-d.interval_to_ms(b.panel.ago)).valueOf()};var m=c.isUndefined(i)?0:i,n=b.ejs.Request(),o=c.difference(h.ids,h.idsByType("time"));b.panel.queries.ids=f.idsByMode(b.panel.queries);var p=f.getQueryObjs(b.panel.queries.ids);c.each(p,function(a){var c=b.ejs.FilteredQuery(f.toEjsObj(a),h.getBoolFilter(h.ids()));n=n.facet(b.ejs.QueryFacet(a.id).query(c)).size(0)}),c.each(p,function(a){var c=b.ejs.FilteredQuery(f.toEjsObj(a),h.getBoolFilter(o).must(b.ejs.RangeFilter(l).from(b.old_time.from).to(b.old_time.to)));n=n.facet(b.ejs.QueryFacet("old_"+a.id).query(c)).size(0)}),b.inspector=a.toJson(JSON.parse(n.toString()),!0),0===m?e.indices(b.old_time.from,b.old_time.to,g.current.index.pattern,g.current.index.interval).then(function(a){b.index=c.union(a,b.index),n=n.indices(b.index[m]),k(n.doSearch(),m,j)}):k(n.indices(b.index[m]).doSearch(),m,j)}};var k=function(a,d,e){a.then(function(a){if(b.panelMeta.loading=!1,0===d&&(b.hits={},b.data=[],e=b.query_id=(new Date).getTime()),!c.isUndefined(a.error))return void(b.panel.error=b.parse_error(a.error));if(b.query_id===e){var g=0,h=f.getQueryObjs(b.panel.queries.ids);c.each(h,function(e){var f=a.facets[e.id].count,h=a.facets["old_"+e.id].count,j={"new":c.isUndefined(b.data[g])||0===d?f:b.data[g].hits.new+f,old:c.isUndefined(b.data[g])||0===d?h:b.data[g].hits.old+h};b.hits.new+=f,b.hits.old+=h;var k=null==i(j.old,j.new)?"?":Math.round(100*i(j.old,j.new))/100;b.data[g]={info:e,hits:{"new":j.new,old:j.old},percent:k},g++}),b.$emit("render"),d
Connection Failed Possibility #1: Your elasticsearch server is down or unreachable This can be caused by a network outage, or a failure of the Elasticsearch process. If you have recently run a query that required a
terms facet to be executed it is possible the process has run out of memory and stopped. Be sure to check your Elasticsearch logs for any sign of memory pressure.
Possibility #2: You are running Elasticsearch 1.4 or higher Elasticsearch 1.4 ships with a security setting that prevents Kibana from connecting. You will need to set the following in your elasticsearch.yml:
http.cors.enabled: true http.cors.allow-origin to the correct protocol, hostname, and port (if not 80) that your access Kibana from. Note that if you are running Kibana in a sub-url, you should exclude the sub-url path and only include the protocol, hostname and port. For example, http://mycompany.com:8080 , not http://mycompany.com:8080/kibana .Click back, or the home button, when you have resolved the connection issue
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/dashLoaderShare.html:
--------------------------------------------------------------------------------
1 | Share this dashboard with this URL
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/dashboard.html:
--------------------------------------------------------------------------------
1 | {{pulldown.type}}
{{row.title || 'Row '+$index}}
Drop here to add to this row Or drop on top of any other panel to insert in that rowAdd panel to empty row
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/inspector.html:
--------------------------------------------------------------------------------
1 | curl -XGET '{{config.elasticsearch}}/{{dashboard.indices|stringify}}/_search?pretty' -d '{{inspector}}'
2 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/load.html:
--------------------------------------------------------------------------------
1 | type: {{type}}id: {{id}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/modal.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/paneladd.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/paneleditor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/panelgeneral.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/querySelect.html:
--------------------------------------------------------------------------------
1 | Queries
Selected Queries {{querySrv.list()[id].alias || querySrv.list()[id].query}}
--------------------------------------------------------------------------------
/kibana/src/main/resources/app/partials/roweditor.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/config.js:
--------------------------------------------------------------------------------
1 | /** @scratch /configuration/config.js/1
2 | *
3 | * == Configuration
4 | * config.js is where you will find the core Kibana configuration. This file contains parameter that
5 | * must be set before kibana is run for the first time.
6 | */
7 | define(['settings'],
8 | function (Settings) {
9 |
10 |
11 | /** @scratch /configuration/config.js/2
12 | *
13 | * === Parameters
14 | */
15 | return new Settings({
16 |
17 | /** @scratch /configuration/config.js/5
18 | *
19 | * ==== elasticsearch
20 | *
21 | * The URL to your elasticsearch server. You almost certainly don't
22 | * want +http://localhost:9200+ here. Even if Kibana and Elasticsearch are on
23 | * the same host. By default this will attempt to reach ES at the same host you have
24 | * kibana installed on. You probably want to set it to the FQDN of your
25 | * elasticsearch host
26 | *
27 | * Note: this can also be an object if you want to pass options to the http client. For example:
28 | *
29 | * +elasticsearch: {server: "http://localhost:9200", withCredentials: true}+
30 | *
31 | */
32 | elasticsearch: "http://localhost:9200",
33 |
34 | /** @scratch /configuration/config.js/5
35 | *
36 | * ==== default_route
37 | *
38 | * This is the default landing page when you don't specify a dashboard to load. You can specify
39 | * files, scripts or saved dashboards here. For example, if you had saved a dashboard called
40 | * `WebLogs' to elasticsearch you might use:
41 | *
42 | * default_route: '/dashboard/elasticsearch/WebLogs',
43 | */
44 | default_route : '/dashboard/file/default.json',
45 |
46 | /** @scratch /configuration/config.js/5
47 | *
48 | * ==== kibana-int
49 | *
50 | * The default ES index to use for storing Kibana specific object
51 | * such as stored dashboards
52 | */
53 | kibana_index: "kibana-int",
54 |
55 | /** @scratch /configuration/config.js/5
56 | *
57 | * ==== panel_name
58 | *
59 | * An array of panel modules available. Panels will only be loaded when they are defined in the
60 | * dashboard, but this list is used in the "add panel" interface.
61 | */
62 | panel_names: [
63 | 'histogram',
64 | 'map',
65 | 'goal',
66 | 'table',
67 | 'filtering',
68 | 'timepicker',
69 | 'text',
70 | 'hits',
71 | 'column',
72 | 'trends',
73 | 'bettermap',
74 | 'query',
75 | 'terms',
76 | 'stats',
77 | 'sparklines'
78 | ]
79 | });
80 | });
81 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/css/normalize.min.css:
--------------------------------------------------------------------------------
1 | /*! normalize.css v1.0.1 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.75em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:1em 40px}dfn{font-style:italic}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}
--------------------------------------------------------------------------------
/kibana/src/main/resources/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/favicon.ico
--------------------------------------------------------------------------------
/kibana/src/main/resources/font/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/font/FontAwesome.otf
--------------------------------------------------------------------------------
/kibana/src/main/resources/font/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/font/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/kibana/src/main/resources/font/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/font/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/kibana/src/main/resources/font/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/font/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/annotation-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/annotation-icon.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/cubes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/cubes.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/kibana.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/kibana.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/light.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/load.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/load.gif
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/load_big.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/load_big.gif
--------------------------------------------------------------------------------
/kibana/src/main/resources/img/small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/kibana/src/main/resources/img/small.png
--------------------------------------------------------------------------------
/kibana/src/main/resources/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Kibana 3{{dashboard.current.title ? " - "+dashboard.current.title : ""}}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | You must enable javascript to use Kibana
31 |
32 |
33 |
34 |
35 |
36 |
37 |
× {{alert.title}}
38 |
{{$index + 1}} alert(s)
39 |
40 |
41 |
42 |
{{dashboard.current.title}}
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The logging properties used for testing
3 | #
4 | log4j.rootLogger=INFO, out
5 |
6 | # CONSOLE appender not used by default
7 | log4j.appender.out=org.apache.log4j.ConsoleAppender
8 | log4j.appender.out.layout=org.apache.log4j.PatternLayout
9 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
10 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
11 |
12 | # File appender
13 | log4j.appender.file=org.apache.log4j.FileAppender
14 | log4j.appender.file.layout=org.apache.log4j.PatternLayout
15 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n
16 | log4j.appender.file.file=target/camel.log
--------------------------------------------------------------------------------
/kibana/src/main/resources/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kibana-node",
3 | "private": true,
4 | "version": "0.1.0",
5 | "dependencies": {
6 | "express": "4.0.0",
7 | "body-parser": "1.14.1",
8 | "cors": "2.2.0"
9 | },
10 | "engines": {
11 | "node": ">=0.8.0"
12 | },
13 | "scripts": {},
14 | "license": "Apache-2.0"
15 | }
16 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/vendor/LICENSE.json:
--------------------------------------------------------------------------------
1 | {
2 | "angular": {
3 | "version":"1.1.5",
4 | "license":"MIT"
5 | },
6 | "angular-dragdrop": {
7 | "version":"1.0.4",
8 | "license":"MIT"
9 | },
10 | "angular-strap": {
11 | "version":"0.7.5",
12 | "license":"MIT"
13 | },
14 | "bindonce": {
15 | "version":"0.2.1",
16 | "license":"MIT"
17 | },
18 | "datepicker": {
19 | "version":"12/3/2013",
20 | "license":"Apache 2.0"
21 | },
22 | "timepicker": {
23 | "version":"0.2.6",
24 | "license":"MIT"
25 | },
26 | "bootstrap": {
27 | "version":"2.3.2",
28 | "license":"Apache 2.0"
29 | },
30 | "elasticjs": {
31 | "version":"1.1.1",
32 | "license":"MIT"
33 | },
34 | "jquery": {
35 | "version":"1.8.0",
36 | "license":"MIT"
37 | },
38 | "jquery-ui": {
39 | "version":"1.10.3",
40 | "license":"MIT"
41 | },
42 | "jsonpath": {
43 | "version":"0.8.0",
44 | "license":"MIT"
45 | },
46 | "flot": {
47 | "version":"0.8.1",
48 | "license":"MIT"
49 | },
50 | "require": {
51 | "version":"2.1.8",
52 | "license":"MIT"
53 | },
54 | "chromath": {
55 | "version":"0.0.5",
56 | "license":"MIT"
57 | },
58 | "blob": {
59 | "version":"2013-06-20",
60 | "license":"MIT"
61 | },
62 | "filesaver": {
63 | "version":"2013-01-23",
64 | "license":"MIT"
65 | },
66 | "modernizr": {
67 | "version":"2.6.1",
68 | "license":"MIT"
69 | },
70 | "moment": {
71 | "version":"2.1.0",
72 | "license":"MIT"
73 | },
74 | "numeral": {
75 | "version":"1.5.2",
76 | "license":"MIT"
77 | },
78 | "timezone": {
79 | "version":"2010",
80 | "license":"Apache 2"
81 | },
82 | "lodash": {
83 | "version":"2.4.1",
84 | "license":"https://github.com/lodash/lodash/blob/2.4.1/LICENSE.txt"
85 | },
86 | "leaflet": {
87 | "version":"0.6",
88 | "license":"https://github.com/Leaflet/Leaflet/blob/v0.6/LICENSE"
89 | },
90 | "jvectormap": {
91 | "version":"1.2.2",
92 | "license":"MIT"
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/vendor/bootstrap/less/tests/forms-responsive.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Bootstrap, from Twitter
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/kibana/src/main/resources/vendor/require/css-build.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define([],function(){function a(a,b){var d=c.readFileSync(a,"utf8");0===d.indexOf("")&&(d=d.substring(1)),b(d)}function b(a){return a.replace(/[\r\n]+/g," ").replace(/[\t]/g," ")}var c=require.nodeRequire("fs"),d={},e=!1,f={load:function(c,e,f,g){f(!0),a(g.baseUrl+c,function(a){d[c]=b(a)})},write:function(a,b,c){e||(e=!0,c("define('"+a+"-embed', function()\n{\n function embed_css(content)\n {\n var head = document.getElementsByTagName('head')[0],\n style = document.createElement('style'),\n rules = document.createTextNode(content);\n style.type = 'text/css';\n if(style.styleSheet)\n style.styleSheet.cssText = rules.nodeValue;\n else style.appendChild(rules);\n head.appendChild(style);\n }\n return embed_css;\n});\n")),c("define('"+a+"!"+b+"', ['"+a+"-embed'], \nfunction(embed)\n{\n embed(\n '"+d[b].replace(/'/g,"\\'")+"'\n );\n return true;\n});\n")},writeFile:function(){},onLayerEnd:function(){}};return f});
--------------------------------------------------------------------------------
/kibana/src/main/resources/vendor/require/tmpl.js:
--------------------------------------------------------------------------------
1 | /*! kibana - v3.1.2 - 2014-11-07
2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */
3 |
4 | define(["module"],function(a){var b=a.config&&a.config()||{};return{load:function(a,c,d){var e=c.toUrl(a);c(["text!"+a],function(a){b.registerTemplate&&b.registerTemplate(e,a),d(a)})}}});
--------------------------------------------------------------------------------
/routing/src/data/articles/records.csv:
--------------------------------------------------------------------------------
1 | "ID","User","Date","Body","Title"
2 | "1","cmoulliard","2015-09-29T07:15","Integration is hard 1.","On distributed search"
3 | "2","cmoulliard","2015-09-20T09:05","Integration is hard 2.","On distributed search"
4 | "3","jbride","2015-07-10T05:12","Integration is hard 3.","On distributed search"
5 | "4","cmoulliard","2015-04-02T09:45","Integration is hard 4.","On distributed search"
6 | "5","cdarby","2015-02-17T20:29","Integration is hard 5.","On distributed search"
7 | "6","kpeeples","2015-09-29T07:10","Integration is hard 6.","On distributed search"
8 | "7","jbritton","2015-09-20T09:12","Integration is hard 7.","On distributed search"
9 | "8","cposta","2015-07-10T05:37","Integration is hard 8.","On distributed search"
10 | "9","cposta","2015-04-02T09:48","Integration is hard 9.","On distributed search"
11 | "10","cposta","2015-02-17T20:32","Integration is hard 10.","On distributed search"
12 | "11","jbride","2015-09-29T07:15","Integration is hard 11.","On distributed search"
13 | "12","cibsen","2015-09-20T09:05","Integration is hard 12.","On distributed search"
14 | "13","jbride","2015-07-10T05:12","Integration is hard 13.","On distributed search"
15 | "14","jstrachan","2015-04-02T09:45","Integration is hard 14.","On distributed search"
16 | "15","jstrachan","2015-02-17T20:29","Integration is hard 15.","On distributed search"
17 | "16","rdavies","2015-09-29T07:10","Integration is hard 16.","On distributed search"
18 | "17","jstrachan","2015-09-20T09:12","Integration is hard 17.","On distributed search"
19 | "18","rdavies","2014-07-10T05:37","Integration is hard 17.","On distributed search"
20 | "19","cibsen","2013-04-02T09:48","Integration is hard 18.","On distributed search"
21 | "20","cibsen","2012-02-17T20:32","Integration is hard 19.","On distributed search"
--------------------------------------------------------------------------------
/routing/src/main/fabric8/Readme.md:
--------------------------------------------------------------------------------
1 | # GPE JBoss Fuse Lab
2 |
3 | This JBoss Fuse lab will demonstrate how the new Apache Camel REST DSL syntax can be used to expose REST Services that we will use to add, search or delete
4 | articles for a blog into a nosql Elasticsearch database. The use case has been enriched to expose a file endpoint, as you can see within the following picture, which
5 | is responsible to poll a folder, to consumes csv files and insert all the articles into the database. The Apache Camel Elasticsearch component is called from different routes
6 | and will communicate with the ElasticSearch Database to perform the CRUD operations.
7 |
8 | [](fuse-lab1.png)
9 |
10 | The Elasticsearch database and the Apache Camel projects will be deployed into different Fuse Managed Containers operated by a JBoss Fuse Fabric Server.
11 |
12 | The CRUD services can be accessed using the new Camel REST component and the file component. To do a bulk import of articles, you will create a CSV file containing this
13 | record structure `id,user,blog description,title`. All the records will be uploaded by the file endpoint, transformed using the `Apache Camel Bindy` Dataformat to a collection of Blog objects.
14 | Next, each Blog object will be used as input to issue a request to insert a new record within the Elasticsearch database.
15 |
16 | For the REST Service, a JSON article `{ "user": "cmoulliard" "postDate": "2015-12-12", "body": "Integration is hard.", "title": "On distributed search" }` message is expected by the Jetty REST endpoint `/blog/article/id`
17 | The body content will be used as input to also issue a request to the same Service used by the file endpoint to consume CSV records.
--------------------------------------------------------------------------------
/routing/src/main/fabric8/fuse-lab1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/routing/src/main/fabric8/fuse-lab1.png
--------------------------------------------------------------------------------
/routing/src/main/fabric8/org.jboss.fuse.demo.properties:
--------------------------------------------------------------------------------
1 | clustername=insight
2 | address=localhost
3 | port=9200
4 | swaggerBasePath=http://localhost:8183/camel-rest
5 | indexname=blog
6 | indextype=post
7 | fileUri=file://articles?noop=true
--------------------------------------------------------------------------------
/routing/src/main/java/org/jboss/fuse/model/Blog.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.fasterxml.jackson.annotation.JsonProperty;
5 | import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
6 | import org.apache.camel.dataformat.bindy.annotation.DataField;
7 |
8 | import java.text.Format;
9 | import java.text.SimpleDateFormat;
10 | import java.util.Date;
11 |
12 | @CsvRecord(skipFirstLine = true, separator = ",", quote = "\"")
13 | public class Blog {
14 |
15 | @DataField(pos = 2) String user;
16 | @DataField(pos = 3, pattern = "yyyy-MM-dd'T'HH:mm") @JsonFormat(pattern="yyyy-MM-dd'T'HH:mm") Date postDate; // yyyy-MM-dd'T'HH:mm:ss
17 | @DataField(pos = 4) String body;
18 | @DataField(pos = 5) String title;
19 |
20 | @DataField(pos = 1) @JsonProperty(required = false)
21 | String id;
22 |
23 | public String getUser() {
24 | return user;
25 | }
26 |
27 | public void setUser(String user) {
28 | this.user = user;
29 | }
30 |
31 | public Date getPostDate() {
32 | return postDate;
33 | }
34 |
35 | public void setPostDate(Date postDate) {
36 | this.postDate = postDate;
37 | }
38 |
39 | public String getBody() {
40 | return body;
41 | }
42 |
43 | public void setBody(String body) {
44 | this.body = body;
45 | }
46 |
47 | public String getTitle() {
48 | return title;
49 | }
50 |
51 | public void setTitle(String title) {
52 | this.title = title;
53 | }
54 |
55 | public String getId() {
56 | return id;
57 | }
58 |
59 | public void setId(String id) {
60 | this.id = id;
61 | }
62 |
63 | public String convertTime(long time){
64 | Date date = new Date(time);
65 | Format format = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss aa");
66 | return format.format(date);
67 | }
68 |
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/routing/src/main/java/org/jboss/fuse/route/AddArticleToElasticRoute.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse.route;
2 |
3 | import org.apache.camel.Exchange;
4 | import org.jboss.fuse.model.Blog;
5 | import org.jboss.fuse.service.ElasticSearchService;
6 | import org.apache.camel.LoggingLevel;
7 | import org.apache.camel.component.elasticsearch.ElasticsearchConfiguration;
8 | import org.apache.camel.component.jackson.JacksonDataFormat;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 |
12 | public class AddArticleToElasticRoute extends OnExceptionElasticSearch {
13 |
14 | final static Logger LOG = LoggerFactory.getLogger(ElasticSearchService.class);
15 |
16 | @Override
17 | public void configure() throws Exception {
18 |
19 | JacksonDataFormat jacksondf = new JacksonDataFormat(Blog.class);
20 | final String ID = "id";
21 |
22 | from("direct:add").id("add-direct-route")
23 | .log(LoggingLevel.INFO,"Add new Blog entry service called !")
24 |
25 | .setHeader(ElasticsearchConfiguration.PARAM_INDEX_NAME).simple("{{indexname}}")
26 | .setHeader(ElasticsearchConfiguration.PARAM_INDEX_TYPE).simple("{{indextype}}")
27 | .setHeader(ElasticsearchConfiguration.PARAM_OPERATION).constant(ElasticsearchConfiguration.OPERATION_INDEX)
28 | // Transform Java Blog Object to JSON String. IT will be used as Source Body content to insert the record in ElasticSearch
29 | .setHeader(ID).simple("${body.id}")
30 | .marshal(jacksondf)
31 |
32 | // Call the add service of the elasticsearchService POJO to generate the IndexRequest object
33 | .beanRef("elasticSearchService", "add")
34 |
35 | // Call the elasticsearch Service to add/insert an entry within the index
36 | .to("elasticsearch://{{clustername}}?ip={{address}}")
37 | .log("Response received : ${body}");
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/routing/src/main/java/org/jboss/fuse/route/DeleteArticleToElasticRoute.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse.route;
2 |
3 | import org.jboss.fuse.service.ElasticSearchService;
4 | import org.apache.camel.Exchange;
5 | import org.apache.camel.component.elasticsearch.ElasticsearchConfiguration;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | public class DeleteArticleToElasticRoute extends OnExceptionElasticSearch {
10 |
11 | final static Logger LOG = LoggerFactory.getLogger(ElasticSearchService.class);
12 |
13 | @Override
14 | public void configure() throws Exception {
15 |
16 | from("direct:remove").id("remove-direct-route")
17 | .log("Remove a Blog entry service called !")
18 | .setHeader(ElasticsearchConfiguration.PARAM_INDEX_NAME).simple("{{indexname}}")
19 | .setHeader(ElasticsearchConfiguration.PARAM_INDEX_TYPE).simple("{{indextype}}")
20 |
21 | // We will search for the ID of the Blog Article
22 | .setHeader(ElasticsearchConfiguration.PARAM_OPERATION).constant(ElasticsearchConfiguration.OPERATION_GET_BY_ID)
23 |
24 | // Set the id of the article to search for
25 | .setBody().simple("${header.id}")
26 |
27 | .to("elasticsearch://{{clustername}}?ip={{address}}")
28 | .beanRef("elasticSearchService", "getBlog")
29 |
30 | .choice()
31 | .when()
32 | // If No article has been retrieved, we generate a message for the HTTP Client
33 | .simple("${body} == null")
34 | .setBody().simple("No article has been retrieved from the ES DB for this id ${header.id}.")
35 | .setHeader(Exchange.CONTENT_TYPE).constant("text/plain")
36 | .setHeader(Exchange.HTTP_RESPONSE_CODE).constant(200)
37 | .endChoice()
38 | .otherwise()
39 | // We will delete now the article if a result has been retrieved
40 | .setHeader(ElasticsearchConfiguration.PARAM_OPERATION).constant(ElasticsearchConfiguration.OPERATION_DELETE)
41 | .beanRef("elasticSearchService", "remove")
42 | .to("elasticsearch://{{clustername}}?ip={{address}}");
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/routing/src/main/java/org/jboss/fuse/route/FileToAddServiceRoute.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse.route;
2 |
3 | import org.jboss.fuse.model.Blog;
4 | import org.apache.camel.LoggingLevel;
5 | import org.apache.camel.builder.RouteBuilder;
6 | import org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat;
7 | import org.elasticsearch.client.transport.NoNodeAvailableException;
8 |
9 | public class FileToAddServiceRoute extends RouteBuilder {
10 | @Override
11 | public void configure() throws Exception {
12 |
13 | BindyCsvDataFormat csv = new BindyCsvDataFormat(Blog.class);
14 |
15 | from("{{fileUri}}").id(("file-marshal-split-service"))
16 | .onException(NoNodeAvailableException.class).maximumRedeliveries(2).to("direct://error").handled(true).end()
17 | .log(LoggingLevel.DEBUG, "Records received : ${body}")
18 | .unmarshal(csv)
19 | .split(body())
20 | .setHeader("id").simple("${body.id}")
21 | .to("direct:add");
22 |
23 | from("direct://error")
24 | .log("No node Elasticsearch server is available");
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/routing/src/main/java/org/jboss/fuse/route/OnExceptionElasticSearch.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse.route;
2 |
3 | import org.jboss.fuse.service.ElasticSearchService;
4 | import org.apache.camel.Exchange;
5 | import org.apache.camel.builder.RouteBuilder;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | public abstract class OnExceptionElasticSearch extends RouteBuilder {
10 |
11 | final static Logger LOG = LoggerFactory.getLogger(ElasticSearchService.class);
12 |
13 | @Override
14 | public void configure() throws Exception {
15 |
16 | onException(org.elasticsearch.client.transport.NoNodeAvailableException.class)
17 | .handled(true)
18 | .setBody().constant("ElasticSearch server is not available, not started, network issue , ... ")
19 | .setHeader(Exchange.CONTENT_TYPE).constant("text/plain")
20 | .setHeader(Exchange.HTTP_RESPONSE_CODE).constant(400)
21 | .log(">> Exception message : ${exception.message}")
22 | .log(">> Stack trace : ${exception.stacktrace}");
23 |
24 | onException(org.elasticsearch.indices.IndexMissingException.class)
25 | .handled(true)
26 | .setBody().constant("The [blog] index is missing into the Elasticsearch Database")
27 | .setHeader(Exchange.CONTENT_TYPE).constant("text/plain")
28 | .setHeader(Exchange.HTTP_RESPONSE_CODE).constant(400)
29 | .log(">> Exception message : ${exception.message}")
30 | .log(">> Stack trace : ${exception.stacktrace}");
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/routing/src/main/java/org/jboss/fuse/route/RestToServicesRoute.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse.route;
2 |
3 | import org.apache.camel.Exchange;
4 | import org.apache.camel.Message;
5 | import org.apache.camel.Processor;
6 | import org.jboss.fuse.model.Blog;
7 | import org.apache.camel.builder.RouteBuilder;
8 | import org.apache.camel.model.rest.RestBindingMode;
9 |
10 | public class RestToServicesRoute extends RouteBuilder {
11 |
12 | @Override
13 | public void configure() throws Exception {
14 |
15 | restConfiguration().component("servlet")
16 | .enableCORS(true)
17 | .bindingMode(RestBindingMode.json)
18 | .dataFormatProperty("prettyPrint", "true");
19 |
20 | rest("/blog/article/").id("rest-blog-service").description("Blog Article REST Endpoint").produces("application/json").consumes("application/json")
21 |
22 | .get("search/id/{id}").description("Search for a blog article / id").id("rest-searchbyid")
23 | .to("direct:searchById")
24 |
25 | .get("search/user/{user}").description("Search for a blog article / user").id("rest-searchbyuser").outTypeList(Blog.class)
26 | .to("direct:searchByUser")
27 |
28 | .put().id("rest-put-article").description("Put a blog article").type(Blog.class)
29 | .to("direct:add")
30 |
31 | .delete("{id}").id("rest-deletearticle").description("Delete a blog article").type(Blog.class)
32 | .to("direct:remove");
33 |
34 | /*
35 | * Workaround to support HTTP OPTIONS request required for Swagger API when CORS is enabled
36 | * The Allow Header reports the operations supported.
37 | * A new verb has been added - https://issues.apache.org/jira/browse/CAMEL-9129 but it will be available for 2.16 or 2.15.x
38 | * */
39 | rest("/blog/article").id("rest-options")
40 | .verb("options").route()
41 | .setHeader("Access-Control-Allow-Origin", constant("*"))
42 | .setHeader("Access-Control-Allow-Methods", constant("GET, HEAD, POST, PUT, DELETE, OPTIONS"))
43 | .setHeader("Access-Control-Allow-Headers", constant("Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"))
44 | .setHeader("Allow", constant("GET, HEAD, POST, PUT, DELETE, OPTIONS"));
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/routing/src/main/resources/OSGI-INF/blueprint/camel-context.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | org.jboss.fuse.route
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/routing/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The logging properties used for testing
3 | #
4 | log4j.rootLogger=INFO, out
5 |
6 | log4j.logger.org.apache.camel=INFO
7 | # log4j.org.apache.camel.component.elasticsearch=INFO
8 | # log4j.logger.org.apache.camel.impl.DefaultCamelContext=DEBUG
9 |
10 | # CONSOLE appender not used by default
11 | log4j.appender.out=org.apache.log4j.ConsoleAppender
12 | log4j.appender.out.layout=org.apache.log4j.PatternLayout
13 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
14 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
15 |
16 | # File appender
17 | log4j.appender.file=org.apache.log4j.FileAppender
18 | log4j.appender.file.layout=org.apache.log4j.PatternLayout
19 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n
20 | log4j.appender.file.file=target/camel.log
--------------------------------------------------------------------------------
/script/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 | org.jboss.fuse
8 | camel-rest-dsl-demo
9 | 1.0
10 |
11 |
12 | deployment
13 | 1.0
14 |
15 | FuseByExample :: REST DSL Demo :: Deployment scripts
16 |
17 |
18 | install
19 |
20 |
21 |
22 | org.apache.maven.plugins
23 | maven-resources-plugin
24 |
25 | UTF-8
26 |
27 |
28 |
29 |
30 | org.codehaus.mojo
31 | build-helper-maven-plugin
32 |
33 |
34 | attach-artifacts
35 |
36 | attach-artifact
37 |
38 | package
39 |
40 |
41 |
42 | target/classes/demo-install.script
43 | script
44 | install
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/script/src/main/resources/demo-install.script:
--------------------------------------------------------------------------------
1 | fabric:create --clean -m 127.0.0.1 -r manualip --wait-for-provisioning
2 |
3 | fabric:profile-edit --pid io.fabric8.elasticsearch-insight/network.host=127.0.0.1 insight-elasticsearch.datastore
4 |
5 | fabric:container-create-child --profile insight-elasticsearch.datastore root elasticsearch-node
6 | fabric:container-create-child --profile feature-camel root demo
--------------------------------------------------------------------------------
/script/src/main/resources/io.fabric8.elasticsearch-insight.cfg:
--------------------------------------------------------------------------------
1 | network.host=127.0.0.1
--------------------------------------------------------------------------------
/swagger/run_jetty.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | mvn clean jetty:run
4 |
5 |
--------------------------------------------------------------------------------
/swagger/src/main/java/org/jboss/fuse/CORSFilter.java:
--------------------------------------------------------------------------------
1 | package org.jboss.fuse;
2 |
3 | import org.slf4j.LoggerFactory;
4 | import org.slf4j.Logger;
5 |
6 | import java.io.*;
7 | import javax.servlet.*;
8 | import javax.servlet.http.*;
9 |
10 | public class CORSFilter implements Filter {
11 |
12 | static final Logger LOG = LoggerFactory.getLogger(CORSFilter.class);
13 |
14 | public static final String ACCESS_CONTROL_ALLOW_ORIGIN_HEADER = "Access-Control-Allow-Origin";
15 | public static final String ACCESS_CONTROL_ALLOW_METHODS_HEADER = "Access-Control-Allow-Methods";
16 | public static final String ACCESS_CONTROL_ALLOW_HEADERS_HEADER = "Access-Control-Allow-Headers";
17 |
18 | public CORSFilter() {}
19 |
20 | public void init(FilterConfig fConfig) throws ServletException {
21 | LOG.info("CORSFilter initialized");
22 | }
23 |
24 | public void destroy() {}
25 |
26 | public void doFilter(
27 | ServletRequest request, ServletResponse response,
28 | FilterChain chain) throws IOException, ServletException {
29 |
30 | HttpServletRequest req = (HttpServletRequest)request;
31 | StringBuffer urlBuffer = req.getRequestURL();
32 |
33 | HttpServletResponse reply = (HttpServletResponse) response;
34 | reply.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "*");
35 | reply.addHeader(ACCESS_CONTROL_ALLOW_METHODS_HEADER, "GET, POST, DELETE, PUT, PATCH, OPTIONS");
36 | reply.addHeader(ACCESS_CONTROL_ALLOW_HEADERS_HEADER, "X-Requested-With,api_key,Content-Type,Accept,Origin");
37 |
38 | if (LOG.isDebugEnabled()) {
39 | LOG.debug("HTTP URL : " + urlBuffer.toString());
40 | LOG.debug("Added : " + ACCESS_CONTROL_ALLOW_ORIGIN_HEADER + ": " + "*");
41 | LOG.debug("Added : " + ACCESS_CONTROL_ALLOW_METHODS_HEADER + ": " + "GET, POST, DELETE, PUT, PATCH, OPTIONS");
42 | LOG.debug("Added : " + ACCESS_CONTROL_ALLOW_HEADERS_HEADER + ": " + "X-Requested-With,Content-Type,api_key,Accept,Origin");
43 | }
44 | chain.doFilter(request, reply);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/swagger/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The logging properties used for testing
3 | #
4 | log4j.rootLogger=INFO, out
5 |
6 | log4j.logger.org.eclipse.jetty.servlets=DEBUG
7 | # log4j.org.apache.camel.component.elasticsearch=INFO
8 | # log4j.logger.org.apache.camel.impl.DefaultCamelContext=DEBUG
9 |
10 | # CONSOLE appender not used by default
11 | log4j.appender.out=org.apache.log4j.ConsoleAppender
12 | log4j.appender.out.layout=org.apache.log4j.PatternLayout
13 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
14 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
15 |
16 | # File appender
17 | log4j.appender.file=org.apache.log4j.FileAppender
18 | log4j.appender.file.layout=org.apache.log4j.PatternLayout
19 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n
20 | log4j.appender.file.file=target/camel.log
--------------------------------------------------------------------------------
/swagger/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | CORSFilter
7 | org.jboss.fuse.CORSFilter
8 |
9 |
10 |
11 | CORSFilter
12 | /*
13 |
14 |
15 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/css/reset.css:
--------------------------------------------------------------------------------
1 | /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
2 | html,
3 | body,
4 | div,
5 | span,
6 | applet,
7 | object,
8 | iframe,
9 | h1,
10 | h2,
11 | h3,
12 | h4,
13 | h5,
14 | h6,
15 | p,
16 | blockquote,
17 | pre,
18 | a,
19 | abbr,
20 | acronym,
21 | address,
22 | big,
23 | cite,
24 | code,
25 | del,
26 | dfn,
27 | em,
28 | img,
29 | ins,
30 | kbd,
31 | q,
32 | s,
33 | samp,
34 | small,
35 | strike,
36 | strong,
37 | sub,
38 | sup,
39 | tt,
40 | var,
41 | b,
42 | u,
43 | i,
44 | center,
45 | dl,
46 | dt,
47 | dd,
48 | ol,
49 | ul,
50 | li,
51 | fieldset,
52 | form,
53 | label,
54 | legend,
55 | table,
56 | caption,
57 | tbody,
58 | tfoot,
59 | thead,
60 | tr,
61 | th,
62 | td,
63 | article,
64 | aside,
65 | canvas,
66 | details,
67 | embed,
68 | figure,
69 | figcaption,
70 | footer,
71 | header,
72 | hgroup,
73 | menu,
74 | nav,
75 | output,
76 | ruby,
77 | section,
78 | summary,
79 | time,
80 | mark,
81 | audio,
82 | video {
83 | margin: 0;
84 | padding: 0;
85 | border: 0;
86 | font-size: 100%;
87 | font: inherit;
88 | vertical-align: baseline;
89 | }
90 | /* HTML5 display-role reset for older browsers */
91 | article,
92 | aside,
93 | details,
94 | figcaption,
95 | figure,
96 | footer,
97 | header,
98 | hgroup,
99 | menu,
100 | nav,
101 | section {
102 | display: block;
103 | }
104 | body {
105 | line-height: 1;
106 | }
107 | ol,
108 | ul {
109 | list-style: none;
110 | }
111 | blockquote,
112 | q {
113 | quotes: none;
114 | }
115 | blockquote:before,
116 | blockquote:after,
117 | q:before,
118 | q:after {
119 | content: '';
120 | content: none;
121 | }
122 | table {
123 | border-collapse: collapse;
124 | border-spacing: 0;
125 | }
126 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/css/typography.css:
--------------------------------------------------------------------------------
1 | /* droid-sans-regular - latin */
2 | @font-face {
3 | font-family: 'Droid Sans';
4 | font-style: normal;
5 | font-weight: 400;
6 | src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */
7 | src: local('Droid Sans'), local('DroidSans'),
8 | url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
9 | url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
10 | url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */
11 | url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
12 | url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */
13 | }
14 | /* droid-sans-700 - latin */
15 | @font-face {
16 | font-family: 'Droid Sans';
17 | font-style: normal;
18 | font-weight: 700;
19 | src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */
20 | src: local('Droid Sans Bold'), local('DroidSans-Bold'),
21 | url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
22 | url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
23 | url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */
24 | url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
25 | url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */
26 | }
27 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.eot
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.ttf
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff2
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.eot
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.ttf
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff
--------------------------------------------------------------------------------
/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff2
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/explorer_icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/explorer_icons.png
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/favicon-16x16.png
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/favicon-32x32.png
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/favicon.ico
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/logo_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/logo_small.png
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/pet_store_api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/pet_store_api.png
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/throbber.gif
--------------------------------------------------------------------------------
/swagger/src/main/webapp/images/wordnik_api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FuseByExample/rest-dsl-in-action/609ca5ca0eca935e04a317afe4aee415615f04f8/swagger/src/main/webapp/images/wordnik_api.png
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lang/en.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Warning: Deprecated",
6 | "Implementation Notes":"Implementation Notes",
7 | "Response Class":"Response Class",
8 | "Status":"Status",
9 | "Parameters":"Parameters",
10 | "Parameter":"Parameter",
11 | "Value":"Value",
12 | "Description":"Description",
13 | "Parameter Type":"Parameter Type",
14 | "Data Type":"Data Type",
15 | "Response Messages":"Response Messages",
16 | "HTTP Status Code":"HTTP Status Code",
17 | "Reason":"Reason",
18 | "Response Model":"Response Model",
19 | "Request URL":"Request URL",
20 | "Response Body":"Response Body",
21 | "Response Code":"Response Code",
22 | "Response Headers":"Response Headers",
23 | "Hide Response":"Hide Response",
24 | "Headers":"Headers",
25 | "Try it out!":"Try it out!",
26 | "Show/Hide":"Show/Hide",
27 | "List Operations":"List Operations",
28 | "Expand Operations":"Expand Operations",
29 | "Raw":"Raw",
30 | "can't parse JSON. Raw result":"can't parse JSON. Raw result",
31 | "Model Schema":"Model Schema",
32 | "Model":"Model",
33 | "apply":"apply",
34 | "Username":"Username",
35 | "Password":"Password",
36 | "Terms of service":"Terms of service",
37 | "Created by":"Created by",
38 | "See more at":"See more at",
39 | "Contact the developer":"Contact the developer",
40 | "api version":"api version",
41 | "Response Content Type":"Response Content Type",
42 | "fetching resource":"fetching resource",
43 | "fetching resource list":"fetching resource list",
44 | "Explore":"Explore",
45 | "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
47 | "Please specify the protocol for":"Please specify the protocol for",
48 | "Can't read swagger JSON from":"Can't read swagger JSON from",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
50 | "Unable to read api":"Unable to read api",
51 | "from path":"from path",
52 | "server returned":"server returned"
53 | });
54 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lang/es.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Advertencia: Obsoleto",
6 | "Implementation Notes":"Notas de implementación",
7 | "Response Class":"Clase de la Respuesta",
8 | "Status":"Status",
9 | "Parameters":"Parámetros",
10 | "Parameter":"Parámetro",
11 | "Value":"Valor",
12 | "Description":"Descripción",
13 | "Parameter Type":"Tipo del Parámetro",
14 | "Data Type":"Tipo del Dato",
15 | "Response Messages":"Mensajes de la Respuesta",
16 | "HTTP Status Code":"Código de Status HTTP",
17 | "Reason":"Razón",
18 | "Response Model":"Modelo de la Respuesta",
19 | "Request URL":"URL de la Solicitud",
20 | "Response Body":"Cuerpo de la Respuesta",
21 | "Response Code":"Código de la Respuesta",
22 | "Response Headers":"Encabezados de la Respuesta",
23 | "Hide Response":"Ocultar Respuesta",
24 | "Try it out!":"Pruébalo!",
25 | "Show/Hide":"Mostrar/Ocultar",
26 | "List Operations":"Listar Operaciones",
27 | "Expand Operations":"Expandir Operaciones",
28 | "Raw":"Crudo",
29 | "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
30 | "Model Schema":"Esquema del Modelo",
31 | "Model":"Modelo",
32 | "apply":"aplicar",
33 | "Username":"Nombre de usuario",
34 | "Password":"Contraseña",
35 | "Terms of service":"Términos de Servicio",
36 | "Created by":"Creado por",
37 | "See more at":"Ver más en",
38 | "Contact the developer":"Contactar al desarrollador",
39 | "api version":"versión de la api",
40 | "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
41 | "fetching resource":"buscando recurso",
42 | "fetching resource list":"buscando lista del recurso",
43 | "Explore":"Explorar",
44 | "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
45 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
46 | "Please specify the protocol for":"Por favor, especificar el protocola para",
47 | "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
48 | "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
49 | "Unable to read api":"No se puede leer la api",
50 | "from path":"desde ruta",
51 | "server returned":"el servidor retornó"
52 | });
53 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lang/pt.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Aviso: Depreciado",
6 | "Implementation Notes":"Notas de Implementação",
7 | "Response Class":"Classe de resposta",
8 | "Status":"Status",
9 | "Parameters":"Parâmetros",
10 | "Parameter":"Parâmetro",
11 | "Value":"Valor",
12 | "Description":"Descrição",
13 | "Parameter Type":"Tipo de parâmetro",
14 | "Data Type":"Tipo de dados",
15 | "Response Messages":"Mensagens de resposta",
16 | "HTTP Status Code":"Código de status HTTP",
17 | "Reason":"Razão",
18 | "Response Model":"Modelo resposta",
19 | "Request URL":"URL requisição",
20 | "Response Body":"Corpo da resposta",
21 | "Response Code":"Código da resposta",
22 | "Response Headers":"Cabeçalho da resposta",
23 | "Headers":"Cabeçalhos",
24 | "Hide Response":"Esconder resposta",
25 | "Try it out!":"Tente agora!",
26 | "Show/Hide":"Mostrar/Esconder",
27 | "List Operations":"Listar operações",
28 | "Expand Operations":"Expandir operações",
29 | "Raw":"Cru",
30 | "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
31 | "Model Schema":"Modelo esquema",
32 | "Model":"Modelo",
33 | "apply":"Aplicar",
34 | "Username":"Usuário",
35 | "Password":"Senha",
36 | "Terms of service":"Termos do serviço",
37 | "Created by":"Criado por",
38 | "See more at":"Veja mais em",
39 | "Contact the developer":"Contate o desenvolvedor",
40 | "api version":"Versão api",
41 | "Response Content Type":"Tipo de conteúdo da resposta",
42 | "fetching resource":"busca recurso",
43 | "fetching resource list":"buscando lista de recursos",
44 | "Explore":"Explorar",
45 | "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
47 | "Please specify the protocol for":"Por favor especifique o protocolo",
48 | "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
50 | "Unable to read api":"Não foi possível ler api",
51 | "from path":"do caminho",
52 | "server returned":"servidor retornou"
53 | });
54 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lang/ru.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Ворнинг: Депрекейтед",
6 | "Implementation Notes":"Заметки",
7 | "Response Class":"Пример ответа",
8 | "Status":"Статус",
9 | "Parameters":"Параметры",
10 | "Parameter":"Параметр",
11 | "Value":"Значение",
12 | "Description":"Описание",
13 | "Parameter Type":"Тип параметра",
14 | "Data Type":"Тип данных",
15 | "HTTP Status Code":"HTTP код",
16 | "Reason":"Причина",
17 | "Response Model":"Структура ответа",
18 | "Request URL":"URL запроса",
19 | "Response Body":"Тело ответа",
20 | "Response Code":"HTTP код ответа",
21 | "Response Headers":"Заголовки ответа",
22 | "Hide Response":"Спрятать ответ",
23 | "Response Messages":"Что может прийти в ответ",
24 | "Try it out!":"Попробовать!",
25 | "Show/Hide":"Показать/Скрыть",
26 | "List Operations":"Операции кратко",
27 | "Expand Operations":"Операции подробно",
28 | "Raw":"В сыром виде",
29 | "can't parse JSON. Raw result":"Не удается распарсить ответ:",
30 | "Model Schema":"Структура",
31 | "Model":"Описание",
32 | "apply":"применить",
33 | "Username":"Имя пользователя",
34 | "Password":"Пароль",
35 | "Terms of service":"Условия использования",
36 | "Created by":"Разработано",
37 | "See more at":"Еще тут",
38 | "Contact the developer":"Связаться с разработчиком",
39 | "api version":"Версия API",
40 | "Response Content Type":"Content Type ответа",
41 | "fetching resource":"Получение ресурса",
42 | "fetching resource list":"Получение ресурсов",
43 | "Explore":"Поехали",
44 | "Show Swagger Petstore Example Apis":"Показать примеры АПИ",
45 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, какая-то лажа с настройками доступа",
46 | "Please specify the protocol for":"Пожалуйста, укажите протогол для",
47 | "Can't read swagger JSON from":"Не получается прочитать swagger json из",
48 | "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
49 | "Unable to read api":"Не удалось прочитать api",
50 | "from path":"по адресу",
51 | "server returned":"сервер сказал"
52 | });
53 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lang/translator.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /**
4 | * Translator for documentation pages.
5 | *
6 | * To enable translation you should include one of language-files in your index.html
7 | * after .
8 | * For example -
9 | *
10 | * If you wish to translate some new texsts you should do two things:
11 | * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
12 | * 2. Mark that text it templates this way New Phrase or .
13 | * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
14 | *
15 | */
16 | window.SwaggerTranslator = {
17 |
18 | _words:[],
19 |
20 | translate: function(sel) {
21 | var $this = this;
22 | sel = sel || '[data-sw-translate]';
23 |
24 | $(sel).each(function() {
25 | $(this).html($this._tryTranslate($(this).html()));
26 |
27 | $(this).val($this._tryTranslate($(this).val()));
28 | $(this).attr('title', $this._tryTranslate($(this).attr('title')));
29 | });
30 | },
31 |
32 | _tryTranslate: function(word) {
33 | return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
34 | },
35 |
36 | learn: function(wordsMap) {
37 | this._words = wordsMap;
38 | }
39 | };
40 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lib/jquery.ba-bbq.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
3 | * http://benalman.com/projects/jquery-bbq-plugin/
4 | *
5 | * Copyright (c) 2010 "Cowboy" Ben Alman
6 | * Dual licensed under the MIT and GPL licenses.
7 | * http://benalman.com/about/license/
8 | */
9 | (function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M ').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lib/jquery.slideto.min.js:
--------------------------------------------------------------------------------
1 | (function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
2 |
--------------------------------------------------------------------------------
/swagger/src/main/webapp/lib/jquery.wiggle.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | jQuery Wiggle
3 | Author: WonderGroup, Jordan Thomas
4 | URL: http://labs.wondergroup.com/demos/mini-ui/index.html
5 | License: MIT (http://en.wikipedia.org/wiki/MIT_License)
6 | */
7 | jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('
').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
8 | if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
--------------------------------------------------------------------------------
/swagger/src/main/webapp/log4j.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The logging properties used for testing
3 | #
4 | log4j.rootLogger=INFO, out
5 |
6 | log4j.logger.org.eclipse.jetty.servlets=DEBUG
7 | # log4j.org.apache.camel.component.elasticsearch=INFO
8 | # log4j.logger.org.apache.camel.impl.DefaultCamelContext=DEBUG
9 |
10 | # CONSOLE appender not used by default
11 | log4j.appender.out=org.apache.log4j.ConsoleAppender
12 | log4j.appender.out.layout=org.apache.log4j.PatternLayout
13 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
14 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
15 |
16 | # File appender
17 | log4j.appender.file=org.apache.log4j.FileAppender
18 | log4j.appender.file.layout=org.apache.log4j.PatternLayout
19 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n
20 | log4j.appender.file.file=target/camel.log
--------------------------------------------------------------------------------
/swagger/src/main/webapp/o2c.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/useful_cmds.txt:
--------------------------------------------------------------------------------
1 | # JBoss Fuse
2 | shell:source mvn:org.jboss.fuse/deployment/1.0/script/install
3 | fabric:container-list
4 | fabric:container-remove-profile demo gpe-fuse
5 | fabric:container-add-profile demo gpe-fuse
6 |
7 | # Deploy profile
8 | cd routing
9 | mvn fabric8:deploy
10 |
11 | # Create ES index and Data Model
12 | http PUT http://localhost:9200/blog
13 | http PUT http://localhost:9200/blog/_mapping/article < data/elasticsearch/mapping.json
14 | http http://localhost:9200/blog/_mapping/article
15 |
16 | # Create Kibana Dashboard
17 | http PUT http://localhost:9200/kibana-int/dashboard/fusedemo < data/elasticsearch/dashboard.json
18 | cd kibana
19 | mvn exec:java
20 |
21 | # Queries
22 | http DELETE http://localhost:8183/camel-rest/blog/article/0
23 | http PUT http://localhost:8183/camel-rest/blog/article < data/elasticsearch/entry.json
24 |
25 | http http://localhost:8183/camel-rest/blog/article/search/id/0
26 |
27 | http http://localhost:8183/camel-rest/blog/article/search/user/cmoulliard
28 | http http://localhost:8183/camel-rest/blog/article/search/user/cmoullia
29 |
30 | http DELETE http://localhost:8183/camel-rest/blog/article/0
31 | http http://localhost:8183/camel-rest/blog/article/search/id/0
32 |
33 |
34 |
--------------------------------------------------------------------------------