@ -1,8 +1,25 @@
@@ -1,8 +1,25 @@
|
||||
*~ |
||||
#* |
||||
*# |
||||
.#* |
||||
*~ |
||||
_site |
||||
.classpath |
||||
.project |
||||
.settings/ |
||||
.springBeans |
||||
target/ |
||||
_site/ |
||||
.idea |
||||
*.iml |
||||
*.swp |
||||
.factorypath |
||||
*.logtjmeter |
||||
.checkstyle |
||||
*.log |
||||
.DS_Store |
||||
/spring-cloud-sleuth-core/nb-configuration.xml |
||||
/spring-cloud-sleuth-core/nbactions.xml |
||||
*.sw[op] |
||||
.project |
||||
sample-pages |
||||
.class |
||||
antrun |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<project name="maven-antrun-" default="main" > |
||||
<target name="main"> |
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/> |
||||
<taskdef classname="ise.antelope.tasks.StringUtilTask" name="stringutil"/> |
||||
<var name="version-type" value="2.0.0.BUILD-SNAPSHOT"/> |
||||
<propertyregex input="${version-type}" regexp=".*\.(.*)" property="version-type" replace="\1" override="true"/> |
||||
<propertyregex input="${version-type}" regexp="(M)\d+" property="version-type" replace="MILESTONE" override="true"/> |
||||
<propertyregex input="${version-type}" regexp="(RC)\d+" property="version-type" replace="MILESTONE" override="true"/> |
||||
<propertyregex input="${version-type}" regexp="BUILD-(.*)" property="version-type" replace="SNAPSHOT" override="true"/> |
||||
<stringutil string="${version-type}" property="spring-cloud-repo"> |
||||
<lowercase/> |
||||
</stringutil> |
||||
<var name="github-tag" value="v2.0.0.BUILD-SNAPSHOT"/> |
||||
<propertyregex input="${github-tag}" regexp=".*SNAPSHOT" property="github-tag" replace="master" override="true"/> |
||||
</target> |
||||
</project> |
@ -1,6 +0,0 @@
@@ -1,6 +0,0 @@
|
||||
Manifest-Version: 1.0 |
||||
Archiver-Version: Plexus Archiver |
||||
Built-By: jenkins |
||||
Created-By: Apache Maven 3.5.0 |
||||
Build-Jdk: 1.8.0_144 |
||||
|
@ -1,86 +0,0 @@
@@ -1,86 +0,0 @@
|
||||
image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"] |
||||
|
||||
Spring Cloud Build is a common utility project for Spring Cloud |
||||
to use for plugin and dependency management. |
||||
|
||||
== Building and Deploying |
||||
|
||||
To install locally: |
||||
|
||||
---- |
||||
|
||||
$ mvn install -s .settings.xml |
||||
---- |
||||
|
||||
and to deploy snapshots to repo.spring.io: |
||||
|
||||
---- |
||||
$ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local |
||||
---- |
||||
|
||||
for a RELEASE build use |
||||
|
||||
---- |
||||
$ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local |
||||
---- |
||||
|
||||
and for jcenter use |
||||
|
||||
---- |
||||
$ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build |
||||
---- |
||||
|
||||
and for Maven Central use |
||||
|
||||
---- |
||||
$ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2 |
||||
---- |
||||
|
||||
(the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent). |
||||
|
||||
== Contributing |
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[] |
||||
|
||||
== Reusing the documentation |
||||
|
||||
Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains |
||||
helpful scripts (e.g. README generation ruby script) and css, xslt and images |
||||
for the Spring Cloud documentation. If you want to follow the same convention |
||||
approach of generating documentation just add these plugins to your `docs` module |
||||
|
||||
[source,xml] |
||||
---- |
||||
<profiles> |
||||
<profile> |
||||
<id>docs</id> |
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-dependency-plugin</artifactId> <1> |
||||
</plugin> |
||||
<plugin> |
||||
<groupId>org.asciidoctor</groupId> |
||||
<artifactId>asciidoctor-maven-plugin</artifactId> <2> |
||||
</plugin> |
||||
<plugin> |
||||
<groupId>com.agilejava.docbkx</groupId> |
||||
<artifactId>docbkx-maven-plugin</artifactId> <3> |
||||
</plugin> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-antrun-plugin</artifactId> <4> |
||||
<inherited>false</inherited> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
</profile> |
||||
</profiles> |
||||
---- |
||||
<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module |
||||
<2> This plugin is required to parse the Asciidoctor documentation |
||||
<3> This plugin converts the Asciidoctor documentation into single and multi page docs |
||||
<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc |
||||
|
||||
IMPORTANT: The order of plugin declaration is important! |
@ -1,86 +0,0 @@
@@ -1,86 +0,0 @@
|
||||
=== Basic Compile and Test |
||||
|
||||
To build the source you will need to install JDK {jdkversion}. |
||||
|
||||
Spring Cloud uses Maven for most build-related activities, and you |
||||
should be able to get off the ground quite quickly by cloning the |
||||
project you are interested in and typing |
||||
|
||||
---- |
||||
$ ./mvnw install |
||||
---- |
||||
|
||||
NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command |
||||
in place of `./mvnw` in the examples below. If you do that you also |
||||
might need to add `-P spring` if your local Maven settings do not |
||||
contain repository declarations for spring pre-release artifacts. |
||||
|
||||
NOTE: Be aware that you might need to increase the amount of memory |
||||
available to Maven by setting a `MAVEN_OPTS` environment variable with |
||||
a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in |
||||
the `.mvn` configuration, so if you find you have to do it to make a |
||||
build succeed, please raise a ticket to get the settings added to |
||||
source control. |
||||
|
||||
For hints on how to build the project look in `.travis.yml` if there |
||||
is one. There should be a "script" and maybe "install" command. Also |
||||
look at the "services" section to see if any services need to be |
||||
running locally (e.g. mongo or rabbit). Ignore the git-related bits |
||||
that you might find in "before_install" since they're related to setting git |
||||
credentials and you already have those. |
||||
|
||||
The projects that require middleware generally include a |
||||
`docker-compose.yml`, so consider using |
||||
http://compose.docker.io/[Docker Compose] to run the middeware servers |
||||
in Docker containers. See the README in the |
||||
https://github.com/spring-cloud-samples/scripts[scripts demo |
||||
repository] for specific instructions about the common cases of mongo, |
||||
rabbit and redis. |
||||
|
||||
NOTE: If all else fails, build with the command from `.travis.yml` (usually |
||||
`./mvnw install`). |
||||
|
||||
=== Documentation |
||||
|
||||
The spring-cloud-build module has a "docs" profile, and if you switch |
||||
that on it will try to build asciidoc sources from |
||||
`src/main/asciidoc`. As part of that process it will look for a |
||||
`README.adoc` and process it by loading all the includes, but not |
||||
parsing or rendering it, just copying it to `${main.basedir}` |
||||
(defaults to `${basedir}`, i.e. the root of the project). If there are |
||||
any changes in the README it will then show up after a Maven build as |
||||
a modified file in the correct place. Just commit it and push the change. |
||||
|
||||
=== Working with the code |
||||
If you don't have an IDE preference we would recommend that you use |
||||
http://www.springsource.com/developer/sts[Spring Tools Suite] or |
||||
http://eclipse.org[Eclipse] when working with the code. We use the |
||||
http://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools |
||||
should also work without issue as long as they use Maven 3.3.3 or better. |
||||
|
||||
==== Importing into eclipse with m2eclipse |
||||
We recommend the http://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with |
||||
eclipse. If you don't already have m2eclipse installed it is available from the "eclipse |
||||
marketplace". |
||||
|
||||
NOTE: Older versions of m2e do not support Maven 3.3, so once the |
||||
projects are imported into Eclipse you will also need to tell |
||||
m2eclipse to use the right profile for the projects. If you |
||||
see many different errors related to the POMs in the projects, check |
||||
that you have an up to date installation. If you can't upgrade m2e, |
||||
add the "spring" profile to your `settings.xml`. Alternatively you can |
||||
copy the repository settings from the "spring" profile of the parent |
||||
pom into your `settings.xml`. |
||||
|
||||
==== Importing into eclipse without m2eclipse |
||||
If you prefer not to use m2eclipse you can generate eclipse project metadata using the |
||||
following command: |
||||
|
||||
[indent=0] |
||||
---- |
||||
$ ./mvnw eclipse:eclipse |
||||
---- |
||||
|
||||
The generated eclipse projects can be imported by selecting `import existing projects` |
||||
from the `file` menu. |
||||
|
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
:jdkversion: 1.8 |
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building-base.adoc[] |
||||
|
@ -1,33 +0,0 @@
@@ -1,33 +0,0 @@
|
||||
==== Adding Project Lombok Agent |
||||
|
||||
Spring Cloud uses http://projectlombok.org/features/index.html[Project Lombok] |
||||
to generate getters and setters etc. Compiling from the command line this |
||||
shouldn't cause any problems, but in an IDE you need to add an agent |
||||
to the JVM. Full instructions can be found in the Lombok website. The |
||||
sign that you need to do this is a lot of compiler errors to do with |
||||
missing methods and fields, e.g. |
||||
|
||||
[indent=0] |
||||
---- |
||||
The method getInitialStatus() is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 120 Java Problem |
||||
The method getInitialStatus() is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 121 Java Problem |
||||
The method setNonSecurePort(int) is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 112 Java Problem |
||||
The type EurekaInstanceConfigBean.IdentifyingDataCenterInfo must implement the inherited abstract method DataCenterInfo.getName() EurekaInstanceConfigBean.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 131 Java Problem |
||||
The method getId() is undefined for the type ProxyRouteLocator.ProxyRouteSpec PreDecorationFilter.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre line 60 Java Problem |
||||
The method getLocation() is undefined for the type ProxyRouteLocator.ProxyRouteSpec PreDecorationFilter.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre line 55 Java Problem |
||||
---- |
||||
|
||||
==== Importing into Intellij |
||||
Spring Cloud projects use annotation processing, particularly Lombok, which requires configuration |
||||
or you will encounter compile problems. It also needs a specific version of maven and a profile |
||||
enabled. Intellij 14.1+ requires some configuration to ensure these are setup properly. |
||||
|
||||
1. Click Preferences, Plugins. *Ensure Lombok is installed* |
||||
2. Click New, Project from Existing Sources, choose your spring-cloud project directory |
||||
3. Choose Maven, and select Environment Settings. *Ensure you are using Maven 3.3.3* |
||||
4. In the next screen, *Select the profile `spring`* click Next until Finish. |
||||
5. Click Preferences, "Build, Execution, Deployment", Compiler, Annotation Processors. *Click Enable Annotation Processing* |
||||
6. Click Build, Rebuild Project, and you are ready to go! |
||||
|
||||
==== Importing into other IDEs |
||||
Maven is well supported by most Java IDEs. Refer to you vendor documentation. |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
:jdkversion: 1.7 |
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building-base.adoc[] |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
|
||||
= Contributor Code of Conduct |
||||
|
||||
As contributors and maintainers of this project, and in the interest of fostering an open |
||||
and welcoming community, we pledge to respect all people who contribute through reporting |
||||
issues, posting feature requests, updating documentation, submitting pull requests or |
||||
patches, and other activities. |
||||
|
||||
We are committed to making participation in this project a harassment-free experience for |
||||
everyone, regardless of level of experience, gender, gender identity and expression, |
||||
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, |
||||
religion, or nationality. |
||||
|
||||
Examples of unacceptable behavior by participants include: |
||||
|
||||
* The use of sexualized language or imagery |
||||
* Personal attacks |
||||
* Trolling or insulting/derogatory comments |
||||
* Public or private harassment |
||||
* Publishing other's private information, such as physical or electronic addresses, |
||||
without explicit permission |
||||
* Other unethical or unprofessional conduct |
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, |
||||
commits, code, wiki edits, issues, and other contributions that are not aligned to this |
||||
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors |
||||
that they deem inappropriate, threatening, offensive, or harmful. |
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to fairly and |
||||
consistently applying these principles to every aspect of managing this project. Project |
||||
maintainers who do not follow or enforce the Code of Conduct may be permanently removed |
||||
from the project team. |
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an |
||||
individual is representing the project or its community. |
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by |
||||
contacting a project maintainer at spring-code-of-conduct@pivotal.io . All complaints will |
||||
be reviewed and investigated and will result in a response that is deemed necessary and |
||||
appropriate to the circumstances. Maintainers are obligated to maintain confidentiality |
||||
with regard to the reporter of an incident. |
||||
|
||||
This Code of Conduct is adapted from the |
||||
http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at |
||||
http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/] |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
NOTE: Spring Cloud is released under the non-restrictive Apache 2.0 license. If you would like to contribute to this section of the documentation or if you find an error, please find the source code and issue trackers in the project at {docslink}[github]. |
@ -1,44 +0,0 @@
@@ -1,44 +0,0 @@
|
||||
Spring Cloud is released under the non-restrictive Apache 2.0 license, |
||||
and follows a very standard Github development process, using Github |
||||
tracker for issues and merging pull requests into master. If you want |
||||
to contribute even something trivial please do not hesitate, but |
||||
follow the guidelines below. |
||||
|
||||
=== Sign the Contributor License Agreement |
||||
Before we accept a non-trivial patch or pull request we will need you to sign the |
||||
https://cla.pivotal.io/sign/spring[Contributor License Agreement]. |
||||
Signing the contributor's agreement does not grant anyone commit rights to the main |
||||
repository, but it does mean that we can accept your contributions, and you will get an |
||||
author credit if we do. Active contributors might be asked to join the core team, and |
||||
given the ability to merge pull requests. |
||||
|
||||
=== Code of Conduct |
||||
This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of |
||||
conduct]. By participating, you are expected to uphold this code. Please report |
||||
unacceptable behavior to spring-code-of-conduct@pivotal.io. |
||||
|
||||
=== Code Conventions and Housekeeping |
||||
None of these is essential for a pull request, but they will all help. They can also be |
||||
added after the original pull request but before a merge. |
||||
|
||||
* Use the Spring Framework code format conventions. If you use Eclipse |
||||
you can import formatter settings using the |
||||
`eclipse-code-formatter.xml` file from the |
||||
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring |
||||
Cloud Build] project. If using IntelliJ, you can use the |
||||
http://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter |
||||
Plugin] to import the same file. |
||||
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an |
||||
`@author` tag identifying you, and preferably at least a paragraph on what the class is |
||||
for. |
||||
* Add the ASF license header comment to all new `.java` files (copy from existing files |
||||
in the project) |
||||
* Add yourself as an `@author` to the .java files that you modify substantially (more |
||||
than cosmetic changes). |
||||
* Add some Javadocs and, if you change the namespace, some XSD doc elements. |
||||
* A few unit tests would help a lot as well -- someone has to do it. |
||||
* If no-one else is using your branch, please rebase it against the current master (or |
||||
other target branch in the main project). |
||||
* When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions], |
||||
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit |
||||
message (where XXXX is the issue number). |
@ -1,360 +0,0 @@
@@ -1,360 +0,0 @@
|
||||
#!/bin/bash -x |
||||
|
||||
# Usage: (cd <project root>; ghpages.sh -v <version> -b -c) |
||||
|
||||
set -e |
||||
|
||||
# Set default props like MAVEN_PATH, ROOT_FOLDER etc. |
||||
function set_default_props() { |
||||
# The script should be executed from the root folder |
||||
ROOT_FOLDER=`pwd` |
||||
echo "Current folder is ${ROOT_FOLDER}" |
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then |
||||
echo "You're not in the root folder of the project!" |
||||
exit 1 |
||||
fi |
||||
|
||||
# Prop that will let commit the changes |
||||
COMMIT_CHANGES="no" |
||||
MAVEN_PATH=${MAVEN_PATH:-} |
||||
if [ -e "${ROOT_FOLDER}/mvnw" ]; then |
||||
MAVEN_EXEC="$ROOT_FOLDER/mvnw" |
||||
else |
||||
MAVEN_EXEC="${MAVEN_PATH}mvn" |
||||
fi |
||||
echo "Path to Maven is [${MAVEN_EXEC}]" |
||||
if [ -z $REPO_NAME ]; then |
||||
REPO_NAME=$(git remote -v | grep origin | head -1 | sed -e 's!.*/!!' -e 's/ .*//' -e 's/\.git.*//') |
||||
fi |
||||
echo "Repo name is [${REPO_NAME}]" |
||||
SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git} |
||||
echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}" |
||||
} |
||||
|
||||
# Check if gh-pages exists and docs have been built |
||||
function check_if_anything_to_sync() { |
||||
git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'` |
||||
|
||||
if ! (git remote set-branches --add origin gh-pages && git fetch -q) && [[ "${RELEASE_TRAIN}" != "yes" ]] ; then |
||||
echo "No gh-pages, so not syncing" |
||||
exit 0 |
||||
fi |
||||
|
||||
if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then |
||||
echo "No gh-pages sources in docs/target/generated-docs, so not syncing" |
||||
exit 0 |
||||
fi |
||||
} |
||||
|
||||
function retrieve_current_branch() { |
||||
# Code getting the name of the current branch. For master we want to publish as we did until now |
||||
# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch |
||||
# If there is a branch already passed will reuse it - otherwise will try to find it |
||||
CURRENT_BRANCH=${BRANCH} |
||||
if [[ -z "${CURRENT_BRANCH}" ]] ; then |
||||
CURRENT_BRANCH=$(git symbolic-ref -q HEAD) |
||||
CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/} |
||||
CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD} |
||||
fi |
||||
echo "Current branch is [${CURRENT_BRANCH}]" |
||||
git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script" |
||||
PREVIOUS_BRANCH=${CURRENT_BRANCH} |
||||
} |
||||
|
||||
# Switches to the provided value of the release version. We always prefix it with `v` |
||||
function switch_to_tag() { |
||||
if [[ "${RELEASE_TRAIN}" != "yes" ]] ; then |
||||
git checkout v${VERSION} |
||||
fi |
||||
} |
||||
|
||||
# Build the docs if switch is on |
||||
function build_docs_if_applicable() { |
||||
if [[ "${BUILD}" == "yes" ]] ; then |
||||
./mvnw clean install -P docs -pl docs -DskipTests |
||||
fi |
||||
} |
||||
|
||||
# Get the name of the `docs.main` property |
||||
# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile |
||||
function retrieve_doc_properties() { |
||||
MAIN_ADOC_VALUE=$("${MAVEN_EXEC}" -q \ |
||||
-Dexec.executable="echo" \ |
||||
-Dexec.args='${docs.main}' \ |
||||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \ |
||||
-P docs \ |
||||
-pl docs | tail -1 ) |
||||
echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]" |
||||
|
||||
|
||||
WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"} |
||||
WHITELISTED_BRANCHES_VALUE=$("${MAVEN_EXEC}" -q \ |
||||
-Dexec.executable="echo" \ |
||||
-Dexec.args="\${${WHITELIST_PROPERTY}}" \ |
||||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \ |
||||
-P docs \ |
||||
-pl docs | tail -1 ) |
||||
echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]" |
||||
} |
||||
|
||||
# Stash any outstanding changes |
||||
function stash_changes() { |
||||
git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1") |
||||
if [ "$dirty" != "0" ]; then git stash; fi |
||||
} |
||||
|
||||
# Switch to gh-pages branch to sync it with current branch |
||||
function add_docs_from_target() { |
||||
local DESTINATION_REPO_FOLDER |
||||
if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then |
||||
DESTINATION_REPO_FOLDER=${ROOT_FOLDER} |
||||
elif [[ "${CLONE}" == "yes" ]]; then |
||||
mkdir -p ${ROOT_FOLDER}/target |
||||
local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static |
||||
if [[ ! -e "${clonedStatic}/.git" ]]; then |
||||
echo "Cloning Spring Cloud Static to target" |
||||
git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && cd ${clonedStatic} && git checkout gh-pages |
||||
else |
||||
echo "Spring Cloud Static already cloned - will pull changes" |
||||
cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages |
||||
fi |
||||
if [[ -z "${RELEASE_TRAIN}" ]] ; then |
||||
DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME} |
||||
else |
||||
DESTINATION_REPO_FOLDER=${clonedStatic} |
||||
fi |
||||
mkdir -p ${DESTINATION_REPO_FOLDER} |
||||
else |
||||
if [[ ! -e "${DESTINATION}/.git" ]]; then |
||||
echo "[${DESTINATION}] is not a git repository" |
||||
exit 1 |
||||
fi |
||||
if [[ -z "${RELEASE_TRAIN}" ]] ; then |
||||
DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME} |
||||
else |
||||
DESTINATION_REPO_FOLDER=${DESTINATION} |
||||
fi |
||||
mkdir -p ${DESTINATION_REPO_FOLDER} |
||||
echo "Destination was provided [${DESTINATION}]" |
||||
fi |
||||
cd ${DESTINATION_REPO_FOLDER} |
||||
git checkout gh-pages |
||||
git pull origin gh-pages |
||||
|
||||
# Add git branches |
||||
################################################################### |
||||
if [[ -z "${VERSION}" && -z "${RELEASE_TRAIN}" ]] ; then |
||||
copy_docs_for_current_version |
||||
else |
||||
copy_docs_for_provided_version |
||||
fi |
||||
commit_changes_if_applicable |
||||
} |
||||
|
||||
|
||||
# Copies the docs by using the retrieved properties from Maven build |
||||
function copy_docs_for_current_version() { |
||||
if [[ "${CURRENT_BRANCH}" == "master" ]] ; then |
||||
echo -e "Current branch is master - will copy the current docs only to the root folder" |
||||
for f in docs/target/generated-docs/*; do |
||||
file=${f#docs/target/generated-docs/*} |
||||
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then |
||||
# Not ignored... |
||||
cp -rf $f ${ROOT_FOLDER}/ |
||||
fi |
||||
done |
||||
git add -A ${ROOT_FOLDER} |
||||
COMMIT_CHANGES="yes" |
||||
else |
||||
echo -e "Current branch is [${CURRENT_BRANCH}]" |
||||
# http://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin |
||||
if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then |
||||
mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH} |
||||
echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder" |
||||
for f in docs/target/generated-docs/*; do |
||||
file=${f#docs/target/generated-docs/*} |
||||
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then |
||||
# Not ignored... |
||||
# We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html |
||||
if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then |
||||
# We don't want to copy the spring-cloud-sleuth.html |
||||
# we want it to be converted to index.html |
||||
cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html |
||||
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html |
||||
else |
||||
cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH} |
||||
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file || echo "Failed to add the file [$file]" |
||||
fi |
||||
fi |
||||
done |
||||
COMMIT_CHANGES="yes" |
||||
else |
||||
echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in |
||||
[docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch." |
||||
fi |
||||
fi |
||||
} |
||||
|
||||
# Copies the docs by using the explicitly provided version |
||||
function copy_docs_for_provided_version() { |
||||
local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION} |
||||
mkdir -p ${FOLDER} |
||||
echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder" |
||||
for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do |
||||
file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*} |
||||
copy_docs_for_branch ${file} ${FOLDER} |
||||
done |
||||
COMMIT_CHANGES="yes" |
||||
CURRENT_BRANCH="v${VERSION}" |
||||
} |
||||
|
||||
# Copies the docs from target to the provided destination |
||||
# Params: |
||||
# $1 - file from target |
||||
# $2 - destination to which copy the files |
||||
function copy_docs_for_branch() { |
||||
local file=$1 |
||||
local destination=$2 |
||||
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then |
||||
# Not ignored... |
||||
# We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html |
||||
if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then |
||||
# We don't want to copy the spring-cloud-sleuth.html |
||||
# we want it to be converted to index.html |
||||
cp -rf $f ${destination}/index.html |
||||
else |
||||
cp -rf $f ${destination} |
||||
fi |
||||
git add -A ${destination} |
||||
fi |
||||
} |
||||
|
||||
function commit_changes_if_applicable() { |
||||
if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then |
||||
COMMIT_SUCCESSFUL="no" |
||||
git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes" |
||||
|
||||
# Uncomment the following push if you want to auto push to |
||||
# the gh-pages branch whenever you commit to master locally. |
||||
# This is a little extreme. Use with care! |
||||
################################################################### |
||||
if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then |
||||
git push origin gh-pages |
||||
fi |
||||
fi |
||||
} |
||||
|
||||
# Switch back to the previous branch and exit block |
||||
function checkout_previous_branch() { |
||||
# If -version was provided we need to come back to root project |
||||
cd ${ROOT_FOLDER} |
||||
git checkout ${PREVIOUS_BRANCH} || echo "Failed to check the branch... continuing with the script" |
||||
if [ "$dirty" != "0" ]; then git stash pop; fi |
||||
exit 0 |
||||
} |
||||
|
||||
# Assert if properties have been properly passed |
||||
function assert_properties() { |
||||
echo "VERSION [${VERSION}], RELEASE_TRAIN [${RELEASE_TRAIN}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]" |
||||
if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi |
||||
if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi |
||||
if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi |
||||
if [[ "${RELEASE_TRAIN}" != "" && -z "${VERSION}" ]] ; then echo "Release train was set but no version was passed!"; exit 1;fi |
||||
} |
||||
|
||||
# Prints the usage |
||||
function print_usage() { |
||||
cat <<EOF |
||||
The idea of this script is to update gh-pages branch with the generated docs. Without any options |
||||
the script will work in the following manner: |
||||
|
||||
- if there's no gh-pages / target for docs module then the script ends |
||||
- for master branch the generated docs are copied to the root of gh-pages branch |
||||
- for any other branch (if that branch is whitelisted) a subfolder with branch name is created |
||||
and docs are copied there |
||||
- if the version switch is passed (-v) then a tag with (v) prefix will be retrieved and a folder |
||||
with that version number will be created in the gh-pages branch. WARNING! No whitelist verification will take place |
||||
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will |
||||
switch to gh-pages of that repo and copy the generated docs to `docs/<project-name>/<version>` |
||||
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will |
||||
switch to gh-pages of that repo and copy the generated docs to `docs/<project-name>/<version>` |
||||
- if the release train switch is passed (-r) then the script will check if the provided dir is a git repo and then will |
||||
switch to gh-pages of that repo and copy the generated docs to `docs/<version>` |
||||
|
||||
USAGE: |
||||
|
||||
You can use the following options: |
||||
|
||||
-v|--version - the script will apply the whole procedure for a particular library version |
||||
-r|--releasetrain - instead of nesting the docs under the project_name/version folder the docs will end up in version |
||||
-d|--destination - the root of destination folder where the docs should be copied. You have to use the full path. |
||||
E.g. point to spring-cloud-static folder. Can't be used with (-c) |
||||
-b|--build - will run the standard build process after checking out the branch |
||||
-c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination. |
||||
Obviously can't be used with (-d) |
||||
|
||||
EOF |
||||
} |
||||
|
||||
|
||||
# ========================================== |
||||
# ____ ____ _____ _____ _____ _______ |
||||
# / ____|/ ____| __ \|_ _| __ \__ __| |
||||
# | (___ | | | |__) | | | | |__) | | | |
||||
# \___ \| | | _ / | | | ___/ | | |
||||
# ____) | |____| | \ \ _| |_| | | | |
||||
# |_____/ \_____|_| \_\_____|_| |_| |
||||
# |
||||
# ========================================== |
||||
|
||||
while [[ $# > 0 ]] |
||||
do |
||||
key="$1" |
||||
case ${key} in |
||||
-v|--version) |
||||
VERSION="$2" |
||||
shift # past argument |
||||
;; |
||||
-r|--releasetrain) |
||||
RELEASE_TRAIN="yes" |
||||
;; |
||||
-d|--destination) |
||||
DESTINATION="$2" |
||||
shift # past argument |
||||
;; |
||||
-b|--build) |
||||
BUILD="yes" |
||||
;; |
||||
-c|--clone) |
||||
CLONE="yes" |
||||
;; |
||||
-h|--help) |
||||
print_usage |
||||
exit 0 |
||||
;; |
||||
*) |
||||
echo "Invalid option: [$1]" |
||||
print_usage |
||||
exit 1 |
||||
;; |
||||
esac |
||||
shift # past argument or value |
||||
done |
||||
|
||||
assert_properties |
||||
set_default_props |
||||
check_if_anything_to_sync |
||||
retrieve_current_branch |
||||
if echo $VERSION | egrep -q 'SNAPSHOT' || [[ -z "${VERSION}" ]]; then |
||||
CLONE="" |
||||
VERSION="" |
||||
echo "You've provided a version variable but it's a snapshot one. Due to this will not clone spring-cloud-static and publish docs over there" |
||||
else |
||||
switch_to_tag |
||||
fi |
||||
build_docs_if_applicable |
||||
retrieve_doc_properties |
||||
stash_changes |
||||
add_docs_from_target |
||||
checkout_previous_branch |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
= Spring Cloud Build |
||||
|
||||
include::README.adoc[] |
@ -1,211 +0,0 @@
@@ -1,211 +0,0 @@
|
||||
#!/bin/bash |
||||
|
||||
set -e |
||||
|
||||
# Either clones or pulls the repo for given project |
||||
# Params: |
||||
# $1 organization e.g. spring-cloud |
||||
# $2 repo name e.g. spring-cloud-sleuth |
||||
function clone_or_pull() { |
||||
if [ "$#" -ne 2 ] |
||||
then |
||||
echo "You haven't provided 2 args... \$1 organization e.g. spring-cloud; \$2 repo name e.g. spring-cloud-sleuth" |
||||
exit 1 |
||||
fi |
||||
if [[ "${JUST_PUSH}" == "yes" ]] ; then |
||||
echo "Skipping cloning since the option to just push was provided" |
||||
exit 0 |
||||
fi |
||||
local ORGANIZATION=$1 |
||||
local REPO_NAME=$2 |
||||
local LOCALREPO_VC_DIR=${REPO_NAME}/.git |
||||
if [ ! -d ${LOCALREPO_VC_DIR} ] |
||||
then |
||||
echo "Repo [${REPO_NAME}] doesn't exist - will clone it!" |
||||
git clone git@github.com:${ORGANIZATION}/${REPO_NAME}.git |
||||
else |
||||
echo "Repo [${REPO_NAME}] exists - will pull the changes" |
||||
cd ${REPO_NAME} && git pull || echo "Not pulling since repo is up to date" |
||||
cd ${ROOT_FOLDER} |
||||
fi |
||||
} |
||||
|
||||
# For the given branch updates the docs/src/main/asciidoc/ghpages.sh |
||||
# with the one from spring-cloud-build. Then commits and pushes the change |
||||
# Params: |
||||
# $1 repo name e.g. spring-cloud-sleuth |
||||
# $2 branch name |
||||
function update_ghpages_script() { |
||||
if [ "$#" -ne 2 ] |
||||
then |
||||
echo "You haven't provided 2 args... \$1 repo name e.g. spring-cloud-sleuth; \$2 branch name e.g. master" |
||||
exit 1 |
||||
fi |
||||
local REPO_NAME=$1 |
||||
local BRANCH_NAME=$2 |
||||
echo "Updating ghpages script for [${REPO_NAME}] and branch [${BRANCH_NAME}]" |
||||
cd ${REPO_NAME} |
||||
echo "Checking out [${BRANCH_NAME}]" |
||||
git checkout ${BRANCH_NAME} |
||||
echo "Resetting the repo and pulling before commiting" |
||||
git reset --hard origin/${BRANCH_NAME} && git pull origin ${BRANCH_NAME} |
||||
# If the user wants to just push we will not copy / add / commit files |
||||
if [[ "${JUST_PUSH}" != "yes" ]] ; then |
||||
echo "Copying [${GHPAGES_DOWNLOAD_PATH}] to [${GHPAGES_IN_REPO_PATH}]" |
||||
cp -rf ${GHPAGES_DOWNLOAD_PATH} ${GHPAGES_IN_REPO_PATH} |
||||
echo "Adding and committing [${GHPAGES_IN_REPO_PATH}] with message [${COMMIT_MESSAGE}]" |
||||
git add ${GHPAGES_IN_REPO_PATH} |
||||
git commit -m "${COMMIT_MESSAGE}" || echo "Proceeding to the next repo" |
||||
fi |
||||
if [[ "${AUTO_PUSH}" == "yes" ]] ; then |
||||
echo "Pushing the branch [${BRANCH_NAME}]" |
||||
wait_if_manual_proceed |
||||
git push origin ${BRANCH_NAME} |
||||
fi |
||||
cd ${ROOT_FOLDER} |
||||
} |
||||
|
||||
# Downloads ghpages.sh |
||||
function download_ghpages() { |
||||
rm -rf ${GHPAGES_DOWNLOAD_PATH} |
||||
echo "Downloading ghpages.sh from [${GHPAGES_URL}] to [${GHPAGES_DOWNLOAD_PATH}]" |
||||
curl ${GHPAGES_URL} -o ${GHPAGES_DOWNLOAD_PATH} |
||||
chmod +x ${GHPAGES_DOWNLOAD_PATH} |
||||
} |
||||
|
||||
# Either clones or pulls the repo for given project and then updates gh-pages for the given project |
||||
# Params: |
||||
# $1 organization e.g. spring-cloud |
||||
# $2 repo name e.g. spring-cloud-sleuth |
||||
# $3 branch name e.g. master |
||||
function clone_and_update_ghpages() { |
||||
if [ "$#" -ne 3 ] |
||||
then |
||||
echo "You haven't provided 3 args... \$1 organization e.g. spring-cloud; \$2 repo name e.g. spring-cloud-sleuth; \$3 branch name e.g. master" |
||||
exit 1 |
||||
fi |
||||
local ORGANIZATION=$1 |
||||
local REPO_NAME=$2 |
||||
local BRANCH_NAME=$3 |
||||
local VAR |
||||
echo -e "\n\nWill clone the repo and update scripts for org [${ORGANIZATION}], repo [${REPO_NAME}] and branch [${BRANCH_NAME}]\n\n" |
||||
clone_or_pull ${ORGANIZATION} ${REPO_NAME} |
||||
update_ghpages_script ${REPO_NAME} ${BRANCH_NAME} |
||||
echo "Proceeding to next project" |
||||
wait_if_manual_proceed |
||||
} |
||||
|
||||
function wait_if_manual_proceed() { |
||||
if [[ "${AUTO_PROCEED}" != "yes" ]] ; then |
||||
echo -n "Press [ENTER] to continue..." |
||||
read VAR |
||||
fi |
||||
} |
||||
|
||||
# Prints the provided parameters |
||||
function print_parameters() { |
||||
cat <<EOF |
||||
Running the script with the following parameters |
||||
GHPAGES_URL=${GHPAGES_URL} |
||||
GHPAGES_DOWNLOAD_PATH=${GHPAGES_DOWNLOAD_PATH} |
||||
COMMIT_MESSAGE=${COMMIT_MESSAGE} |
||||
GHPAGES_IN_REPO_PATH=${GHPAGES_IN_REPO_PATH} |
||||
AUTO_PROCEED=${AUTO_PROCEED} |
||||
AUTO_PUSH=${AUTO_PUSH} |
||||
JUST_PUSH=${JUST_PUSH} |
||||
ROOT_FOLDER=${ROOT_FOLDER} |
||||
EOF |
||||
} |
||||
|
||||
# Prints the usage |
||||
function print_usage() { |
||||
cat <<EOF |
||||
The idea of this script is to batch update all ghpages scripts for all projects that we have in Spring Cloud. |
||||
If you don't provide any options by default the script will copy the latest ghpages.sh, commit it for each repo |
||||
and then push it to the appropriate branch. |
||||
|
||||
USAGE: |
||||
|
||||
You can use the following options: |
||||
|
||||
-p|--nopush - the script will not push the changes |
||||
-m|--manualproceed - if you want to do a manual proceed after every step |
||||
-x|--justpush - if you want to go to every single repo and just push the changes |
||||
-h|--help - present this help message |
||||
|
||||
EOF |
||||
} |
||||
|
||||
# ========================================== |
||||
# ____ ____ _____ _____ _____ _______ |
||||
# / ____|/ ____| __ \|_ _| __ \__ __| |
||||
# | (___ | | | |__) | | | | |__) | | | |
||||
# \___ \| | | _ / | | | ___/ | | |
||||
# ____) | |____| | \ \ _| |_| | | | |
||||
# |_____/ \_____|_| \_\_____|_| |_| |
||||
# |
||||
# ========================================== |
||||
|
||||
while [[ $# > 0 ]] |
||||
do |
||||
key="$1" |
||||
case ${key} in |
||||
-p|--nopush) |
||||
AUTO_PUSH="no" |
||||
;; |
||||
-m|--manualproceed) |
||||
AUTO_PROCEED="no" |
||||
;; |
||||
-x|--justpush) |
||||
JUST_PUSH="yes" |
||||
;; |
||||
-h|--help) |
||||
print_usage |
||||
exit 0 |
||||
;; |
||||
*) |
||||
echo "Invalid option: [$1]" |
||||
print_usage |
||||
exit 1 |
||||
;; |
||||
esac |
||||
shift # past argument or value |
||||
done |
||||
|
||||
export GHPAGES_URL=${GHPAGES_URL:-https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh} |
||||
export GHPAGES_DOWNLOAD_PATH=${GHPAGES_DOWNLOAD_PATH:-/tmp/ghpages.sh} |
||||
export COMMIT_MESSAGE=${COMMIT_MESSAGE:-Updating ghpages for all projects} |
||||
export GHPAGES_IN_REPO_PATH=${GHPAGES_IN_REPO_PATH:-docs/src/main/asciidoc/ghpages.sh} |
||||
export AUTO_PROCEED=${AUTO_PROCEED:-yes} |
||||
export AUTO_PUSH=${AUTO_PUSH:-yes} |
||||
export JUST_PUSH=${JUST_PUSH:-no} |
||||
export ROOT_FOLDER=`pwd` |
||||
|
||||
|
||||
print_parameters |
||||
download_ghpages |
||||
clone_and_update_ghpages spring-cloud spring-cloud-aws master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-aws 1.0.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-aws 1.2.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-bus master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-cli 1.0.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-cli 1.1.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-cli master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-cloudfoundry master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-cluster master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-commons master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-config master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-config 1.1.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-consul 1.0.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-consul master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-contract master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-netflix 1.0.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-netflix 1.1.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-netflix master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-security master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-sleuth 1.0.x |
||||
clone_and_update_ghpages spring-cloud spring-cloud-sleuth master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-starters Brixton |
||||
clone_and_update_ghpages spring-cloud spring-cloud-starters master |
||||
clone_and_update_ghpages spring-cloud-incubator spring-cloud-vault-config master |
||||
clone_and_update_ghpages spring-cloud spring-cloud-zookeeper master |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
/* |
||||
code highlight CSS resemblign the Eclipse IDE default color schema |
||||
@author Costin Leau |
||||
*/ |
||||
|
||||
.hl-keyword { |
||||
color: #7F0055; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hl-comment { |
||||
color: #3F5F5F; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-multiline-comment { |
||||
color: #3F5FBF; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-tag { |
||||
color: #3F7F7F; |
||||
} |
||||
|
||||
.hl-attribute { |
||||
color: #7F007F; |
||||
} |
||||
|
||||
.hl-value { |
||||
color: #2A00FF; |
||||
} |
||||
|
||||
.hl-string { |
||||
color: #2A00FF; |
||||
} |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body.firstpage { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: none; |
||||
} |
@ -1,6 +0,0 @@
@@ -1,6 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
@ -1,344 +0,0 @@
@@ -1,344 +0,0 @@
|
||||
@IMPORT url("highlight.css"); |
||||
|
||||
html { |
||||
padding: 0pt; |
||||
margin: 0pt; |
||||
} |
||||
|
||||
body { |
||||
color: #333333; |
||||
margin: 15px 30px; |
||||
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif; |
||||
line-height: 1.6; |
||||
-webkit-font-smoothing: antialiased; |
||||
} |
||||
|
||||
code { |
||||
font-size: 16px; |
||||
font-family: Consolas, "Liberation Mono", Courier, monospace; |
||||
} |
||||
|
||||
:not(a)>code { |
||||
color: #6D180B; |
||||
} |
||||
|
||||
:not(pre)>code { |
||||
background-color: #F2F2F2; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 4px; |
||||
padding: 1px 3px 0; |
||||
text-shadow: none; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
body>*:first-child { |
||||
margin-top: 0 !important; |
||||
} |
||||
|
||||
div { |
||||
margin: 0pt; |
||||
} |
||||
|
||||
hr { |
||||
border: 1px solid #CCCCCC; |
||||
background: #CCCCCC; |
||||
} |
||||
|
||||
h1,h2,h3,h4,h5,h6 { |
||||
color: #000000; |
||||
cursor: text; |
||||
font-weight: bold; |
||||
margin: 30px 0 10px; |
||||
padding: 0; |
||||
} |
||||
|
||||
h1,h2,h3 { |
||||
margin: 40px 0 10px; |
||||
} |
||||
|
||||
h1 { |
||||
margin: 70px 0 30px; |
||||
padding-top: 20px; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: 1px dotted #CCCCCC; |
||||
} |
||||
|
||||
h1,h1 code { |
||||
font-size: 32px; |
||||
} |
||||
|
||||
h2,h2 code { |
||||
font-size: 24px; |
||||
} |
||||
|
||||
h3,h3 code { |
||||
font-size: 20px; |
||||
} |
||||
|
||||
h4,h1 code,h5,h5 code,h6,h6 code { |
||||
font-size: 18px; |
||||
} |
||||
|
||||
div.book,div.chapter,div.appendix,div.part,div.preface { |
||||
min-width: 300px; |
||||
max-width: 1200px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
p.releaseinfo { |
||||
font-weight: bold; |
||||
margin-bottom: 40px; |
||||
margin-top: 40px; |
||||
} |
||||
|
||||
div.authorgroup { |
||||
line-height: 1; |
||||
} |
||||
|
||||
p.copyright { |
||||
line-height: 1; |
||||
margin-bottom: -5px; |
||||
} |
||||
|
||||
.legalnotice p { |
||||
font-style: italic; |
||||
font-size: 14px; |
||||
line-height: 1; |
||||
} |
||||
|
||||
div.titlepage+p,div.titlepage+p { |
||||
margin-top: 0; |
||||
} |
||||
|
||||
pre { |
||||
line-height: 1.0; |
||||
color: black; |
||||
} |
||||
|
||||
a { |
||||
color: #4183C4; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
p { |
||||
margin: 15px 0; |
||||
text-align: left; |
||||
} |
||||
|
||||
ul,ol { |
||||
padding-left: 30px; |
||||
} |
||||
|
||||
li p { |
||||
margin: 0; |
||||
} |
||||
|
||||
div.table { |
||||
margin: 1em; |
||||
padding: 0.5em; |
||||
text-align: center; |
||||
} |
||||
|
||||
div.table table,div.informaltable table { |
||||
display: table; |
||||
width: 100%; |
||||
} |
||||
|
||||
div.table td { |
||||
padding-left: 7px; |
||||
padding-right: 7px; |
||||
} |
||||
|
||||
.sidebar { |
||||
line-height: 1.4; |
||||
padding: 0 20px; |
||||
background-color: #F8F8F8; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 3px 3px 3px 3px; |
||||
} |
||||
|
||||
.sidebar p.title { |
||||
color: #6D180B; |
||||
} |
||||
|
||||
pre.programlisting,pre.screen { |
||||
font-size: 15px; |
||||
padding: 6px 10px; |
||||
background-color: #F8F8F8; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 3px 3px 3px 3px; |
||||
clear: both; |
||||
overflow: auto; |
||||
line-height: 1.4; |
||||
font-family: Consolas, "Liberation Mono", Courier, monospace; |
||||
} |
||||
|
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
border: 1px solid #DDDDDD !important; |
||||
border-radius: 4px !important; |
||||
border-collapse: separate !important; |
||||
line-height: 1.6; |
||||
} |
||||
|
||||
table thead { |
||||
background: #F5F5F5; |
||||
} |
||||
|
||||
table tr { |
||||
border: none; |
||||
border-bottom: none; |
||||
} |
||||
|
||||
table th { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
table th,table td { |
||||
border: none !important; |
||||
padding: 6px 13px; |
||||
} |
||||
|
||||
table tr:nth-child(2n) { |
||||
background-color: #F8F8F8; |
||||
} |
||||
|
||||
td p { |
||||
margin: 0 0 15px 0; |
||||
} |
||||
|
||||
div.table-contents td p { |
||||
margin: 0; |
||||
} |
||||
|
||||
div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist * |
||||
{ |
||||
border: none !important; |
||||
background: none !important; |
||||
margin: 0; |
||||
} |
||||
|
||||
div.important p,div.note p,div.tip p,div.warning p { |
||||
color: #6F6F6F; |
||||
line-height: 1.6; |
||||
} |
||||
|
||||
div.important code,div.note code,div.tip code,div.warning code { |
||||
background-color: #F2F2F2 !important; |
||||
border: 1px solid #CCCCCC !important; |
||||
border-radius: 4px !important; |
||||
padding: 1px 3px 0 !important; |
||||
text-shadow: none !important; |
||||
white-space: nowrap !important; |
||||
} |
||||
|
||||
.note th,.tip th,.warning th { |
||||
display: none; |
||||
} |
||||
|
||||
.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td |
||||
{ |
||||
border-right: 1px solid #CCCCCC !important; |
||||
padding-top: 10px; |
||||
} |
||||
|
||||
div.calloutlist p,div.calloutlist td { |
||||
padding: 0; |
||||
margin: 0; |
||||
} |
||||
|
||||
div.calloutlist>table>tbody>tr>td:first-child { |
||||
padding-left: 10px; |
||||
width: 30px !important; |
||||
} |
||||
|
||||
div.important,div.note,div.tip,div.warning { |
||||
margin-left: 0px !important; |
||||
margin-right: 20px !important; |
||||
margin-top: 20px; |
||||
margin-bottom: 20px; |
||||
padding-top: 10px; |
||||
padding-bottom: 10px; |
||||
} |
||||
|
||||
div.toc { |
||||
line-height: 1.2; |
||||
} |
||||
|
||||
dl,dt { |
||||
margin-top: 1px; |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
div.toc>dl>dt { |
||||
font-size: 32px; |
||||
font-weight: bold; |
||||
margin: 30px 0 10px 0; |
||||
display: block; |
||||
} |
||||
|
||||
div.toc>dl>dd>dl>dt { |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
margin: 20px 0 10px 0; |
||||
display: block; |
||||
} |
||||
|
||||
div.toc>dl>dd>dl>dd>dl>dt { |
||||
font-weight: bold; |
||||
font-size: 20px; |
||||
margin: 10px 0 0 0; |
||||
} |
||||
|
||||
tbody.footnotes * { |
||||
border: none !important; |
||||
} |
||||
|
||||
div.footnote p { |
||||
margin: 0; |
||||
line-height: 1; |
||||
} |
||||
|
||||
div.footnote p sup { |
||||
margin-right: 6px; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
div.navheader { |
||||
border-bottom: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
div.navfooter { |
||||
border-top: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.title { |
||||
margin-left: -1em; |
||||
padding-left: 1em; |
||||
} |
||||
|
||||
.title>a { |
||||
position: absolute; |
||||
visibility: hidden; |
||||
display: block; |
||||
font-size: 0.85em; |
||||
margin-top: 0.05em; |
||||
margin-left: -1em; |
||||
vertical-align: text-top; |
||||
color: black; |
||||
} |
||||
|
||||
.title>a:before { |
||||
content: "\00A7"; |
||||
} |
||||
|
||||
.title:hover>a,.title>a:hover,.title:hover>a:hover { |
||||
visibility: visible; |
||||
} |
||||
|
||||
.title:focus>a,.title>a:focus,.title:focus>a:focus { |
||||
outline: 0; |
||||
} |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 178 KiB |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you under the Apache License, Version 2.0 (the |
||||
"License"); you may not use this file except in compliance |
||||
with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, |
||||
software distributed under the License is distributed on an |
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations |
||||
under the License. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
xmlns:d="http://docbook.org/ns/docbook" |
||||
exclude-result-prefixes="xslthl d" |
||||
version='1.0'> |
||||
|
||||
<!-- Extensions --> |
||||
<xsl:param name="use.extensions">1</xsl:param> |
||||
<xsl:param name="tablecolumns.extension">0</xsl:param> |
||||
<xsl:param name="callout.extensions">1</xsl:param> |
||||
|
||||
<!-- Graphics --> |
||||
<xsl:param name="admon.graphics" select="1"/> |
||||
<xsl:param name="admon.graphics.path">images/</xsl:param> |
||||
<xsl:param name="admon.graphics.extension">.png</xsl:param> |
||||
|
||||
<!-- Table of Contents --> |
||||
<xsl:param name="generate.toc">book toc,title</xsl:param> |
||||
<xsl:param name="toc.section.depth">3</xsl:param> |
||||
|
||||
<!-- Hide revhistory --> |
||||
<xsl:template match="d:revhistory" mode="titlepage.mode"/> |
||||
|
||||
</xsl:stylesheet> |
@ -1,31 +0,0 @@
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you under the Apache License, Version 2.0 (the |
||||
"License"); you may not use this file except in compliance |
||||
with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, |
||||
software distributed under the License is distributed on an |
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations |
||||
under the License. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
xmlns:d="http://docbook.org/ns/docbook" |
||||
exclude-result-prefixes="xslthl d" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="urn:docbkx:stylesheet"/> |
||||
<xsl:import href="common.xsl"/> |
||||
|
||||
</xsl:stylesheet> |
@ -1,73 +0,0 @@
@@ -1,73 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you under the Apache License, Version 2.0 (the |
||||
"License"); you may not use this file except in compliance |
||||
with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, |
||||
software distributed under the License is distributed on an |
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations |
||||
under the License. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="urn:docbkx:stylesheet"/> |
||||
<xsl:import href="html.xsl"/> |
||||
|
||||
<xsl:param name="html.stylesheet">css/manual-multipage.css</xsl:param> |
||||
|
||||
<xsl:param name="chunk.section.depth">'5'</xsl:param> |
||||
<xsl:param name="use.id.as.filename">'1'</xsl:param> |
||||
|
||||
<!-- Replace chunk-element-content from chunk-common to add firstpage class to body --> |
||||
<xsl:template name="chunk-element-content"> |
||||
<xsl:param name="prev"/> |
||||
<xsl:param name="next"/> |
||||
<xsl:param name="nav.context"/> |
||||
<xsl:param name="content"> |
||||
<xsl:apply-imports/> |
||||
</xsl:param> |
||||
|
||||
<xsl:call-template name="user.preroot"/> |
||||
|
||||
<html> |
||||
<xsl:call-template name="html.head"> |
||||
<xsl:with-param name="prev" select="$prev"/> |
||||
<xsl:with-param name="next" select="$next"/> |
||||
</xsl:call-template> |
||||
<body> |
||||
<xsl:if test="count($prev) = 0"> |
||||
<xsl:attribute name="class">firstpage</xsl:attribute> |
||||
</xsl:if> |
||||
<xsl:call-template name="body.attributes"/> |
||||
<xsl:call-template name="user.header.navigation"/> |
||||
<xsl:call-template name="header.navigation"> |
||||
<xsl:with-param name="prev" select="$prev"/> |
||||
<xsl:with-param name="next" select="$next"/> |
||||
<xsl:with-param name="nav.context" select="$nav.context"/> |
||||
</xsl:call-template> |
||||
<xsl:call-template name="user.header.content"/> |
||||
<xsl:copy-of select="$content"/> |
||||
<xsl:call-template name="user.footer.content"/> |
||||
<xsl:call-template name="footer.navigation"> |
||||
<xsl:with-param name="prev" select="$prev"/> |
||||
<xsl:with-param name="next" select="$next"/> |
||||
<xsl:with-param name="nav.context" select="$nav.context"/> |
||||
</xsl:call-template> |
||||
<xsl:call-template name="user.footer.navigation"/> |
||||
</body> |
||||
</html> |
||||
<xsl:value-of select="$chunk.append"/> |
||||
</xsl:template> |
||||
</xsl:stylesheet> |
@ -1,30 +0,0 @@
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you under the Apache License, Version 2.0 (the |
||||
"License"); you may not use this file except in compliance |
||||
with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, |
||||
software distributed under the License is distributed on an |
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations |
||||
under the License. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="urn:docbkx:stylesheet"/> |
||||
<xsl:import href="html.xsl"/> |
||||
|
||||
<xsl:param name="html.stylesheet">css/manual-singlepage.css</xsl:param> |
||||
|
||||
</xsl:stylesheet> |
@ -1,141 +0,0 @@
@@ -1,141 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you under the Apache License, Version 2.0 (the |
||||
"License"); you may not use this file except in compliance |
||||
with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, |
||||
software distributed under the License is distributed on an |
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations |
||||
under the License. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
xmlns:d="http://docbook.org/ns/docbook" |
||||
exclude-result-prefixes="xslthl" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="urn:docbkx:stylesheet/highlight.xsl"/> |
||||
<xsl:import href="common.xsl"/> |
||||
|
||||
<!-- Only use scaling in FO --> |
||||
<xsl:param name="ignore.image.scaling">1</xsl:param> |
||||
|
||||
<!-- Use code syntax highlighting --> |
||||
<xsl:param name="highlight.source">1</xsl:param> |
||||
|
||||
<!-- Activate Graphics --> |
||||
<xsl:param name="callout.graphics" select="1" /> |
||||
<xsl:param name="callout.defaultcolumn">120</xsl:param> |
||||
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param> |
||||
<xsl:param name="callout.graphics.extension">.png</xsl:param> |
||||
|
||||
<xsl:param name="table.borders.with.css" select="1"/> |
||||
<xsl:param name="html.stylesheet.type">text/css</xsl:param> |
||||
|
||||
<xsl:param name="admonition.title.properties">text-align: left</xsl:param> |
||||
|
||||
<!-- Leave image paths as relative when navigating XInclude --> |
||||
<xsl:param name="keep.relative.image.uris" select="1"/> |
||||
|
||||
<!-- Label Chapters and Sections (numbering) --> |
||||
<xsl:param name="chapter.autolabel" select="1"/> |
||||
<xsl:param name="section.autolabel" select="1"/> |
||||
<xsl:param name="section.autolabel.max.depth" select="2"/> |
||||
<xsl:param name="section.label.includes.component.label" select="1"/> |
||||
<xsl:param name="table.footnote.number.format" select="'1'"/> |
||||
|
||||
<!-- Remove "Chapter" from the Chapter titles... --> |
||||
<xsl:param name="local.l10n.xml" select="document('')"/> |
||||
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> |
||||
<l:l10n language="en"> |
||||
<l:context name="title-numbered"> |
||||
<l:template name="chapter" text="%n. %t"/> |
||||
<l:template name="section" text="%n %t"/> |
||||
</l:context> |
||||
</l:l10n> |
||||
</l:i18n> |
||||
|
||||
<!-- Syntax Highlighting --> |
||||
<xsl:template match='xslthl:keyword' mode="xslthl"> |
||||
<span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:oneline-comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:multiline-comment' mode="xslthl"> |
||||
<span class="hl-multiline-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:tag' mode="xslthl"> |
||||
<span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:attribute' mode="xslthl"> |
||||
<span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:value' mode="xslthl"> |
||||
<span class="hl-value"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:string' mode="xslthl"> |
||||
<span class="hl-string"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<!-- Custom Title Page --> |
||||
<xsl:template match="d:author" mode="titlepage.mode"> |
||||
<xsl:if test="name(preceding-sibling::*[1]) = 'author'"> |
||||
<xsl:text>, </xsl:text> |
||||
</xsl:if> |
||||
<span class="{name(.)}"> |
||||
<xsl:call-template name="person.name"/> |
||||
<xsl:apply-templates mode="titlepage.mode" select="./contrib"/> |
||||
</span> |
||||
</xsl:template> |
||||
<xsl:template match="d:authorgroup" mode="titlepage.mode"> |
||||
<div class="{name(.)}"> |
||||
<h2>Authors</h2> |
||||
<xsl:apply-templates mode="titlepage.mode"/> |
||||
</div> |
||||
</xsl:template> |
||||
|
||||
<!-- Title Links --> |
||||
<xsl:template name="anchor"> |
||||
<xsl:param name="node" select="."/> |
||||
<xsl:param name="conditional" select="1"/> |
||||
<xsl:variable name="id"> |
||||
<xsl:call-template name="object.id"> |
||||
<xsl:with-param name="object" select="$node"/> |
||||
</xsl:call-template> |
||||
</xsl:variable> |
||||
<xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id"> |
||||
<xsl:element name="a"> |
||||
<xsl:attribute name="name"> |
||||
<xsl:value-of select="$id"/> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="href"> |
||||
<xsl:text>#</xsl:text> |
||||
<xsl:value-of select="$id"/> |
||||
</xsl:attribute> |
||||
</xsl:element> |
||||
</xsl:if> |
||||
</xsl:template> |
||||
|
||||
</xsl:stylesheet> |
@ -1,582 +0,0 @@
@@ -1,582 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you under the Apache License, Version 2.0 (the |
||||
"License"); you may not use this file except in compliance |
||||
with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, |
||||
software distributed under the License is distributed on an |
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations |
||||
under the License. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
xmlns:d="http://docbook.org/ns/docbook" |
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format" |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
xmlns:xlink='http://www.w3.org/1999/xlink' |
||||
xmlns:exsl="http://exslt.org/common" |
||||
exclude-result-prefixes="exsl xslthl d xlink" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="urn:docbkx:stylesheet"/> |
||||
<xsl:import href="urn:docbkx:stylesheet/highlight.xsl"/> |
||||
<xsl:import href="common.xsl"/> |
||||
|
||||
<!-- Extensions --> |
||||
<xsl:param name="fop1.extensions" select="1"/> |
||||
|
||||
<xsl:param name="paper.type" select="'A4'"/> |
||||
<xsl:param name="page.margin.top" select="'1cm'"/> |
||||
<xsl:param name="region.before.extent" select="'1cm'"/> |
||||
<xsl:param name="body.margin.top" select="'1.5cm'"/> |
||||
|
||||
<xsl:param name="body.margin.bottom" select="'1.5cm'"/> |
||||
<xsl:param name="region.after.extent" select="'1cm'"/> |
||||
<xsl:param name="page.margin.bottom" select="'1cm'"/> |
||||
<xsl:param name="title.margin.left" select="'0cm'"/> |
||||
|
||||
<!-- allow break across pages --> |
||||
<xsl:attribute-set name="formal.object.properties"> |
||||
<xsl:attribute name="keep-together.within-column">auto</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<!-- use color links and sensible rendering --> |
||||
<xsl:attribute-set name="xref.properties"> |
||||
<xsl:attribute name="text-decoration">underline</xsl:attribute> |
||||
<xsl:attribute name="color">#204060</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
<xsl:param name="ulink.show" select="0"></xsl:param> |
||||
<xsl:param name="ulink.footnotes" select="0"></xsl:param> |
||||
|
||||
<!-- TITLE PAGE --> |
||||
|
||||
<xsl:template name="book.titlepage.recto"> |
||||
<fo:block> |
||||
<fo:table table-layout="fixed" width="175mm"> |
||||
<fo:table-column column-width="175mm"/> |
||||
<fo:table-body> |
||||
<fo:table-row> |
||||
<fo:table-cell text-align="center"> |
||||
<fo:block> |
||||
<fo:external-graphic src="images/logo.png" width="240px" |
||||
height="auto" content-width="scale-to-fit" |
||||
content-height="scale-to-fit" |
||||
content-type="content-type:image/png" text-align="center" |
||||
/> |
||||
</fo:block> |
||||
<fo:block font-family="Helvetica" font-size="20pt" font-weight="bold" padding="10mm"> |
||||
<xsl:value-of select="d:info/d:title"/> |
||||
</fo:block> |
||||
<fo:block font-family="Helvetica" font-size="14pt" padding-before="2mm"> |
||||
<xsl:value-of select="d:info/d:subtitle"/> |
||||
</fo:block> |
||||
<fo:block font-family="Helvetica" font-size="14pt" padding="2mm"> |
||||
<xsl:value-of select="d:info/d:releaseinfo"/> |
||||
</fo:block> |
||||
</fo:table-cell> |
||||
</fo:table-row> |
||||
<fo:table-row> |
||||
<fo:table-cell text-align="center"> |
||||
<fo:block font-family="Helvetica" font-size="14pt" padding="5mm"> |
||||
<xsl:value-of select="d:info/d:pubdate"/> |
||||
</fo:block> |
||||
</fo:table-cell> |
||||
</fo:table-row> |
||||
<fo:table-row> |
||||
<fo:table-cell text-align="center"> |
||||
<fo:block font-family="Helvetica" font-size="10pt" padding="10mm"> |
||||
<xsl:for-each select="d:info/d:authorgroup/d:author"> |
||||
<xsl:if test="position() > 1"> |
||||
<xsl:text>, </xsl:text> |
||||
</xsl:if> |
||||
<xsl:value-of select="."/> |
||||
</xsl:for-each> |
||||
</fo:block> |
||||
|
||||
<fo:block font-family="Helvetica" font-size="10pt" padding="5mm"> |
||||
<xsl:value-of select="d:info/d:pubdate"/> |
||||
</fo:block> |
||||
|
||||
<fo:block font-family="Helvetica" font-size="10pt" padding="5mm" padding-before="25em"> |
||||
<xsl:text>Copyright © </xsl:text><xsl:value-of select="d:info/d:copyright"/> |
||||
</fo:block> |
||||
|
||||
<fo:block font-family="Helvetica" font-size="8pt" padding="1mm"> |
||||
<xsl:value-of select="d:info/d:legalnotice"/> |
||||
</fo:block> |
||||
</fo:table-cell> |
||||
</fo:table-row> |
||||
</fo:table-body> |
||||
</fo:table> |
||||
</fo:block> |
||||
</xsl:template> |
||||
|
||||
<!-- Prevent blank pages in output --> |
||||
<xsl:template name="book.titlepage.before.verso"> |
||||
</xsl:template> |
||||
<xsl:template name="book.titlepage.verso"> |
||||
</xsl:template> |
||||
<xsl:template name="book.titlepage.separator"> |
||||
</xsl:template> |
||||
|
||||
<!-- HEADER --> |
||||
|
||||
<!-- More space in the center header for long text --> |
||||
<xsl:attribute-set name="header.content.properties"> |
||||
<xsl:attribute name="font-family"> |
||||
<xsl:value-of select="$body.font.family"/> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="margin-left">-5em</xsl:attribute> |
||||
<xsl:attribute name="margin-right">-5em</xsl:attribute> |
||||
<xsl:attribute name="font-size">8pt</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:template name="header.content"> |
||||
<xsl:param name="pageclass" select="''"/> |
||||
<xsl:param name="sequence" select="''"/> |
||||
<xsl:param name="position" select="''"/> |
||||
<xsl:param name="gentext-key" select="''"/> |
||||
|
||||
<xsl:variable name="Version"> |
||||
<xsl:choose> |
||||
<xsl:when test="//d:title"> |
||||
<xsl:value-of select="//d:title"/><xsl:text> </xsl:text> |
||||
</xsl:when> |
||||
<xsl:otherwise> |
||||
<xsl:text>please define title in your docbook file!</xsl:text> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:variable> |
||||
|
||||
<xsl:choose> |
||||
<xsl:when test="$sequence='blank'"> |
||||
<xsl:choose> |
||||
<xsl:when test="$position='center'"> |
||||
<xsl:value-of select="$Version"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:otherwise> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$pageclass='titlepage'"> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$position='center'"> |
||||
<xsl:value-of select="$Version"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:otherwise> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:template> |
||||
|
||||
<!-- FOOTER--> |
||||
<xsl:attribute-set name="footer.content.properties"> |
||||
<xsl:attribute name="font-family"> |
||||
<xsl:value-of select="$body.font.family"/> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="font-size">8pt</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:template name="footer.content"> |
||||
<xsl:param name="pageclass" select="''"/> |
||||
<xsl:param name="sequence" select="''"/> |
||||
<xsl:param name="position" select="''"/> |
||||
<xsl:param name="gentext-key" select="''"/> |
||||
|
||||
<xsl:variable name="Version"> |
||||
<xsl:choose> |
||||
<xsl:when test="//d:releaseinfo"> |
||||
<xsl:value-of select="//d:releaseinfo"/> |
||||
</xsl:when> |
||||
<xsl:otherwise> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:variable> |
||||
|
||||
<xsl:variable name="Title"> |
||||
<xsl:choose> |
||||
<xsl:when test="//d:productname"> |
||||
<xsl:value-of select="//d:productname"/><xsl:text> </xsl:text> |
||||
</xsl:when> |
||||
<xsl:otherwise> |
||||
<xsl:text>please define title in your docbook file!</xsl:text> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:variable> |
||||
|
||||
<xsl:choose> |
||||
<xsl:when test="$sequence='blank'"> |
||||
<xsl:choose> |
||||
<xsl:when test="$double.sided != 0 and $position = 'left'"> |
||||
<xsl:value-of select="$Version"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided = 0 and $position = 'center'"> |
||||
</xsl:when> |
||||
|
||||
<xsl:otherwise> |
||||
<fo:page-number/> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$pageclass='titlepage'"> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'"> |
||||
<fo:page-number/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'"> |
||||
<fo:page-number/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided = 0 and $position='right'"> |
||||
<fo:page-number/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'"> |
||||
<xsl:value-of select="$Version"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'"> |
||||
<xsl:value-of select="$Version"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$double.sided = 0 and $position='left'"> |
||||
<xsl:value-of select="$Version"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:when test="$position='center'"> |
||||
<xsl:value-of select="$Title"/> |
||||
</xsl:when> |
||||
|
||||
<xsl:otherwise> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match="processing-instruction('hard-pagebreak')"> |
||||
<fo:block break-before='page'/> |
||||
</xsl:template> |
||||
|
||||
|
||||
<!-- PAPER & PAGE SIZE --> |
||||
|
||||
<!-- Paper type, no headers on blank pages, no double sided printing --> |
||||
<xsl:param name="double.sided">0</xsl:param> |
||||
<xsl:param name="headers.on.blank.pages">0</xsl:param> |
||||
<xsl:param name="footers.on.blank.pages">0</xsl:param> |
||||
|
||||
<!-- FONTS & STYLES --> |
||||
|
||||
<xsl:param name="hyphenate">false</xsl:param> |
||||
|
||||
<!-- Default Font size --> |
||||
<xsl:param name="body.font.family">Helvetica</xsl:param> |
||||
<xsl:param name="body.font.master">10</xsl:param> |
||||
<xsl:param name="body.font.small">8</xsl:param> |
||||
<xsl:param name="title.font.family">Helvetica</xsl:param> |
||||
|
||||
<!-- Line height in body text --> |
||||
<xsl:param name="line-height">1.4</xsl:param> |
||||
|
||||
<!-- Chapter title size --> |
||||
<xsl:attribute-set name="chapter.titlepage.recto.style"> |
||||
<xsl:attribute name="text-align">left</xsl:attribute> |
||||
<xsl:attribute name="font-weight">bold</xsl:attribute> |
||||
<xsl:attribute name="font-size"> |
||||
<xsl:value-of select="$body.font.master * 1.8"/> |
||||
<xsl:text>pt</xsl:text> |
||||
</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<!-- Why is the font-size for chapters hardcoded in the XSL FO templates? |
||||
Let's remove it, so this sucker can use our attribute-set only... --> |
||||
<xsl:template match="d:title" mode="chapter.titlepage.recto.auto.mode"> |
||||
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" |
||||
xsl:use-attribute-sets="chapter.titlepage.recto.style"> |
||||
<xsl:call-template name="component.title"> |
||||
<xsl:with-param name="node" select="ancestor-or-self::d:chapter[1]"/> |
||||
</xsl:call-template> |
||||
</fo:block> |
||||
</xsl:template> |
||||
|
||||
<!-- Sections 1, 2 and 3 titles have a small bump factor and padding --> |
||||
<xsl:attribute-set name="section.title.level1.properties"> |
||||
<xsl:attribute name="space-before.optimum">0.6em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0.6em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.6em</xsl:attribute> |
||||
<xsl:attribute name="font-size"> |
||||
<xsl:value-of select="$body.font.master * 1.5"/> |
||||
<xsl:text>pt</xsl:text> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="section.title.level2.properties"> |
||||
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute> |
||||
<xsl:attribute name="font-size"> |
||||
<xsl:value-of select="$body.font.master * 1.25"/> |
||||
<xsl:text>pt</xsl:text> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="section.title.level3.properties"> |
||||
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute> |
||||
<xsl:attribute name="font-size"> |
||||
<xsl:value-of select="$body.font.master * 1.0"/> |
||||
<xsl:text>pt</xsl:text> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="section.title.level4.properties"> |
||||
<xsl:attribute name="space-before.optimum">0.3em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.3em</xsl:attribute> |
||||
<xsl:attribute name="font-size"> |
||||
<xsl:value-of select="$body.font.master * 0.9"/> |
||||
<xsl:text>pt</xsl:text> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
|
||||
<!-- TABLES --> |
||||
|
||||
<!-- Some padding inside tables --> |
||||
<xsl:attribute-set name="table.cell.padding"> |
||||
<xsl:attribute name="padding-left">4pt</xsl:attribute> |
||||
<xsl:attribute name="padding-right">4pt</xsl:attribute> |
||||
<xsl:attribute name="padding-top">4pt</xsl:attribute> |
||||
<xsl:attribute name="padding-bottom">4pt</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<!-- Only hairlines as frame and cell borders in tables --> |
||||
<xsl:param name="table.frame.border.thickness">0.1pt</xsl:param> |
||||
<xsl:param name="table.cell.border.thickness">0.1pt</xsl:param> |
||||
|
||||
<!-- LABELS --> |
||||
|
||||
<!-- Label Chapters and Sections (numbering) --> |
||||
<xsl:param name="chapter.autolabel" select="1"/> |
||||
<xsl:param name="section.autolabel" select="1"/> |
||||
<xsl:param name="section.autolabel.max.depth" select="1"/> |
||||
|
||||
<xsl:param name="section.label.includes.component.label" select="1"/> |
||||
<xsl:param name="table.footnote.number.format" select="'1'"/> |
||||
|
||||
<!-- PROGRAMLISTINGS --> |
||||
|
||||
<!-- Verbatim text formatting (programlistings) --> |
||||
<xsl:attribute-set name="monospace.verbatim.properties"> |
||||
<xsl:attribute name="font-size">7pt</xsl:attribute> |
||||
<xsl:attribute name="wrap-option">wrap</xsl:attribute> |
||||
<xsl:attribute name="keep-together.within-column">1</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="verbatim.properties"> |
||||
<xsl:attribute name="space-before.minimum">1em</xsl:attribute> |
||||
<xsl:attribute name="space-before.optimum">1em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
|
||||
<xsl:attribute name="border-color">#444444</xsl:attribute> |
||||
<xsl:attribute name="border-style">solid</xsl:attribute> |
||||
<xsl:attribute name="border-width">0.1pt</xsl:attribute> |
||||
<xsl:attribute name="padding-top">0.5em</xsl:attribute> |
||||
<xsl:attribute name="padding-left">0.5em</xsl:attribute> |
||||
<xsl:attribute name="padding-right">0.5em</xsl:attribute> |
||||
<xsl:attribute name="padding-bottom">0.5em</xsl:attribute> |
||||
<xsl:attribute name="margin-left">0.5em</xsl:attribute> |
||||
<xsl:attribute name="margin-right">0.5em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<!-- Shade (background) programlistings --> |
||||
<xsl:param name="shade.verbatim">1</xsl:param> |
||||
<xsl:attribute-set name="shade.verbatim.style"> |
||||
<xsl:attribute name="background-color">#F0F0F0</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="list.block.spacing"> |
||||
<xsl:attribute name="space-before.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="example.properties"> |
||||
<xsl:attribute name="space-before.minimum">0.5em</xsl:attribute> |
||||
<xsl:attribute name="space-before.optimum">0.5em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="sidebar.properties"> |
||||
<xsl:attribute name="border-color">#444444</xsl:attribute> |
||||
<xsl:attribute name="border-style">solid</xsl:attribute> |
||||
<xsl:attribute name="border-width">0.1pt</xsl:attribute> |
||||
<xsl:attribute name="background-color">#F0F0F0</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
|
||||
<!-- TITLE INFORMATION FOR FIGURES, EXAMPLES ETC. --> |
||||
|
||||
<xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing"> |
||||
<xsl:attribute name="font-weight">normal</xsl:attribute> |
||||
<xsl:attribute name="font-style">italic</xsl:attribute> |
||||
<xsl:attribute name="font-size"> |
||||
<xsl:value-of select="$body.font.master"/> |
||||
<xsl:text>pt</xsl:text> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="hyphenate">false</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-before.optimum">0.1em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0.1em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<!-- CALLOUTS --> |
||||
|
||||
<!-- don't use images for callouts --> |
||||
<xsl:param name="callout.graphics">0</xsl:param> |
||||
<xsl:param name="callout.unicode">1</xsl:param> |
||||
|
||||
<!-- Place callout marks at this column in annotated areas --> |
||||
<xsl:param name="callout.defaultcolumn">90</xsl:param> |
||||
|
||||
<!-- MISC --> |
||||
|
||||
<!-- Placement of titles --> |
||||
<xsl:param name="formal.title.placement"> |
||||
figure after |
||||
example after |
||||
equation before |
||||
table before |
||||
procedure before |
||||
</xsl:param> |
||||
|
||||
<!-- Format Variable Lists as Blocks (prevents horizontal overflow) --> |
||||
<xsl:param name="variablelist.as.blocks">1</xsl:param> |
||||
<xsl:param name="body.start.indent">0pt</xsl:param> |
||||
|
||||
<!-- Remove "Chapter" from the Chapter titles... --> |
||||
<xsl:param name="local.l10n.xml" select="document('')"/> |
||||
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> |
||||
<l:l10n language="en"> |
||||
<l:context name="title-numbered"> |
||||
<l:template name="chapter" text="%n. %t"/> |
||||
<l:template name="section" text="%n %t"/> |
||||
</l:context> |
||||
<l:context name="title"> |
||||
<l:template name="example" text="Example %n %t"/> |
||||
</l:context> |
||||
</l:l10n> |
||||
</l:i18n> |
||||
|
||||
<!-- admon --> |
||||
<xsl:param name="admon.graphics" select="0"/> |
||||
|
||||
<xsl:attribute-set name="nongraphical.admonition.properties"> |
||||
<xsl:attribute name="margin-left">0.1em</xsl:attribute> |
||||
<xsl:attribute name="margin-right">2em</xsl:attribute> |
||||
<xsl:attribute name="border-left-width">.75pt</xsl:attribute> |
||||
<xsl:attribute name="border-left-style">solid</xsl:attribute> |
||||
<xsl:attribute name="border-left-color">#5c5c4f</xsl:attribute> |
||||
<xsl:attribute name="padding-left">0.5em</xsl:attribute> |
||||
<xsl:attribute name="space-before.optimum">1.5em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">1.5em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">1.5em</xsl:attribute> |
||||
<xsl:attribute name="space-after.optimum">1.5em</xsl:attribute> |
||||
<xsl:attribute name="space-after.minimum">1.5em</xsl:attribute> |
||||
<xsl:attribute name="space-after.maximum">1.5em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="admonition.title.properties"> |
||||
<xsl:attribute name="font-size">10pt</xsl:attribute> |
||||
<xsl:attribute name="font-weight">bold</xsl:attribute> |
||||
<xsl:attribute name="hyphenate">false</xsl:attribute> |
||||
<xsl:attribute name="keep-with-next.within-column">always</xsl:attribute> |
||||
<xsl:attribute name="margin-left">0</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<xsl:attribute-set name="admonition.properties"> |
||||
<xsl:attribute name="space-before.optimum">0em</xsl:attribute> |
||||
<xsl:attribute name="space-before.minimum">0em</xsl:attribute> |
||||
<xsl:attribute name="space-before.maximum">0em</xsl:attribute> |
||||
</xsl:attribute-set> |
||||
|
||||
<!-- Asciidoc --> |
||||
<xsl:template match="processing-instruction('asciidoc-br')"> |
||||
<fo:block/> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match="processing-instruction('asciidoc-hr')"> |
||||
<fo:block space-after="1em"> |
||||
<fo:leader leader-pattern="rule" rule-thickness="0.5pt" rule-style="solid" leader-length.minimum="100%"/> |
||||
</fo:block> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match="processing-instruction('asciidoc-pagebreak')"> |
||||
<fo:block break-after='page'/> |
||||
</xsl:template> |
||||
|
||||
<!-- SYNTAX HIGHLIGHT --> |
||||
|
||||
<xsl:template match='xslthl:keyword' mode="xslthl"> |
||||
<fo:inline font-weight="bold" color="#7F0055"><xsl:apply-templates mode="xslthl"/></fo:inline> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:string' mode="xslthl"> |
||||
<fo:inline font-weight="bold" font-style="italic" color="#2A00FF"><xsl:apply-templates mode="xslthl"/></fo:inline> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:comment' mode="xslthl"> |
||||
<fo:inline font-style="italic" color="#3F5FBF"><xsl:apply-templates mode="xslthl"/></fo:inline> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:tag' mode="xslthl"> |
||||
<fo:inline font-weight="bold" color="#3F7F7F"><xsl:apply-templates mode="xslthl"/></fo:inline> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:attribute' mode="xslthl"> |
||||
<fo:inline font-weight="bold" color="#7F007F"><xsl:apply-templates mode="xslthl"/></fo:inline> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:value' mode="xslthl"> |
||||
<fo:inline font-weight="bold" color="#2A00FF"><xsl:apply-templates mode="xslthl"/></fo:inline> |
||||
</xsl:template> |
||||
|
||||
</xsl:stylesheet> |
@ -1,23 +0,0 @@
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<xslthl-config> |
||||
<highlighter id="java" file="./xslthl/java-hl.xml" /> |
||||
<highlighter id="groovy" file="./xslthl/java-hl.xml" /> |
||||
<highlighter id="html" file="./xslthl/html-hl.xml" /> |
||||
<highlighter id="ini" file="./xslthl/ini-hl.xml" /> |
||||
<highlighter id="php" file="./xslthl/php-hl.xml" /> |
||||
<highlighter id="c" file="./xslthl/c-hl.xml" /> |
||||
<highlighter id="cpp" file="./xslthl/cpp-hl.xml" /> |
||||
<highlighter id="csharp" file="./xslthl/csharp-hl.xml" /> |
||||
<highlighter id="python" file="./xslthl/python-hl.xml" /> |
||||
<highlighter id="ruby" file="./xslthl/ruby-hl.xml" /> |
||||
<highlighter id="perl" file="./xslthl/perl-hl.xml" /> |
||||
<highlighter id="javascript" file="./xslthl/javascript-hl.xml" /> |
||||
<highlighter id="bash" file="./xslthl/bourne-hl.xml" /> |
||||
<highlighter id="css" file="./xslthl/css-hl.xml" /> |
||||
<highlighter id="sql" file="./xslthl/sql2003-hl.xml" /> |
||||
<highlighter id="asciidoc" file="./xslthl/asciidoc-hl.xml" /> |
||||
<highlighter id="properties" file="./xslthl/properties-hl.xml" /> |
||||
<highlighter id="json" file="./xslthl/json-hl.xml" /> |
||||
<highlighter id="yaml" file="./xslthl/yaml-hl.xml" /> |
||||
<namespace prefix="xslthl" uri="http://xslthl.sf.net" /> |
||||
</xslthl-config> |
@ -1,41 +0,0 @@
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for AsciiDoc files |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>////</start> |
||||
<end>////</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<start>//</start> |
||||
<solitary/> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(={1,6} .+)$</pattern> |
||||
<style>heading</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(\.[^\.\s].+)$</pattern> |
||||
<style>title</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(:!?\w.*?:)</pattern> |
||||
<style>attribute</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(-|\*{1,5}|\d*\.{1,5})(?= .+$)</pattern> |
||||
<style>bullet</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(\[.+\])$</pattern> |
||||
<style>attribute</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,95 +0,0 @@
@@ -1,95 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for SH |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2010 Mathieu Malaterre |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="heredoc"> |
||||
<start><<</start> |
||||
<quote>'</quote> |
||||
<quote>"</quote> |
||||
<flag>-</flag> |
||||
<noWhiteSpace /> |
||||
<looseTerminator /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
<spanNewLines /> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<!-- reserved words --> |
||||
<keyword>if</keyword> |
||||
<keyword>then</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>elif</keyword> |
||||
<keyword>fi</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>esac</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>while</keyword> |
||||
<keyword>until</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>done</keyword> |
||||
<!-- built-ins --> |
||||
<keyword>exec</keyword> |
||||
<keyword>shift</keyword> |
||||
<keyword>exit</keyword> |
||||
<keyword>times</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>export</keyword> |
||||
<keyword>trap</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>readonly</keyword> |
||||
<keyword>wait</keyword> |
||||
<keyword>eval</keyword> |
||||
<keyword>return</keyword> |
||||
<!-- other commands --> |
||||
<keyword>cd</keyword> |
||||
<keyword>echo</keyword> |
||||
<keyword>hash</keyword> |
||||
<keyword>pwd</keyword> |
||||
<keyword>read</keyword> |
||||
<keyword>set</keyword> |
||||
<keyword>test</keyword> |
||||
<keyword>type</keyword> |
||||
<keyword>ulimit</keyword> |
||||
<keyword>umask</keyword> |
||||
<keyword>unset</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,117 +0,0 @@
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
Syntax highlighting definition for C |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/**</start> |
||||
<end>*/</end> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<start><![CDATA[/// ]]></start> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">//</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<!-- use the online-comment highlighter to detect directives --> |
||||
<start>#</start> |
||||
<lineBreakEscape>\</lineBreakEscape> |
||||
<style>directive</style> |
||||
<solitary /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<suffix>ul</suffix> |
||||
<suffix>lu</suffix> |
||||
<suffix>u</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<exponent>e</exponent> |
||||
<suffix>ul</suffix> |
||||
<suffix>lu</suffix> |
||||
<suffix>u</suffix> |
||||
<suffix>f</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>auto</keyword> |
||||
<keyword>_Bool</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>char</keyword> |
||||
<keyword>_Complex</keyword> |
||||
<keyword>const</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>double</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>enum</keyword> |
||||
<keyword>extern</keyword> |
||||
<keyword>float</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>_Imaginary</keyword> |
||||
<keyword>inline</keyword> |
||||
<keyword>int</keyword> |
||||
<keyword>long</keyword> |
||||
<keyword>register</keyword> |
||||
<keyword>restrict</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>short</keyword> |
||||
<keyword>signed</keyword> |
||||
<keyword>sizeof</keyword> |
||||
<keyword>static</keyword> |
||||
<keyword>struct</keyword> |
||||
<keyword>switch</keyword> |
||||
<keyword>typedef</keyword> |
||||
<keyword>union</keyword> |
||||
<keyword>unsigned</keyword> |
||||
<keyword>void</keyword> |
||||
<keyword>volatile</keyword> |
||||
<keyword>while</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,151 +0,0 @@
@@ -1,151 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for C++ |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/**</start> |
||||
<end>*/</end> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<start><![CDATA[/// ]]></start> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">//</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<!-- use the online-comment highlighter to detect directives --> |
||||
<start>#</start> |
||||
<lineBreakEscape>\</lineBreakEscape> |
||||
<style>directive</style> |
||||
<solitary/> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<suffix>ul</suffix> |
||||
<suffix>lu</suffix> |
||||
<suffix>u</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<exponent>e</exponent> |
||||
<suffix>ul</suffix> |
||||
<suffix>lu</suffix> |
||||
<suffix>u</suffix> |
||||
<suffix>f</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<!-- C keywords --> |
||||
<keyword>auto</keyword> |
||||
<keyword>_Bool</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>char</keyword> |
||||
<keyword>_Complex</keyword> |
||||
<keyword>const</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>double</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>enum</keyword> |
||||
<keyword>extern</keyword> |
||||
<keyword>float</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>_Imaginary</keyword> |
||||
<keyword>inline</keyword> |
||||
<keyword>int</keyword> |
||||
<keyword>long</keyword> |
||||
<keyword>register</keyword> |
||||
<keyword>restrict</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>short</keyword> |
||||
<keyword>signed</keyword> |
||||
<keyword>sizeof</keyword> |
||||
<keyword>static</keyword> |
||||
<keyword>struct</keyword> |
||||
<keyword>switch</keyword> |
||||
<keyword>typedef</keyword> |
||||
<keyword>union</keyword> |
||||
<keyword>unsigned</keyword> |
||||
<keyword>void</keyword> |
||||
<keyword>volatile</keyword> |
||||
<keyword>while</keyword> |
||||
<!-- C++ keywords --> |
||||
<keyword>asm</keyword> |
||||
<keyword>dynamic_cast</keyword> |
||||
<keyword>namespace</keyword> |
||||
<keyword>reinterpret_cast</keyword> |
||||
<keyword>try</keyword> |
||||
<keyword>bool</keyword> |
||||
<keyword>explicit</keyword> |
||||
<keyword>new</keyword> |
||||
<keyword>static_cast</keyword> |
||||
<keyword>typeid</keyword> |
||||
<keyword>catch</keyword> |
||||
<keyword>false</keyword> |
||||
<keyword>operator</keyword> |
||||
<keyword>template</keyword> |
||||
<keyword>typename</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>friend</keyword> |
||||
<keyword>private</keyword> |
||||
<keyword>this</keyword> |
||||
<keyword>using</keyword> |
||||
<keyword>const_cast</keyword> |
||||
<keyword>inline</keyword> |
||||
<keyword>public</keyword> |
||||
<keyword>throw</keyword> |
||||
<keyword>virtual</keyword> |
||||
<keyword>delete</keyword> |
||||
<keyword>mutable</keyword> |
||||
<keyword>protected</keyword> |
||||
<keyword>true</keyword> |
||||
<keyword>wchar_t</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,194 +0,0 @@
@@ -1,194 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for C# |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/**</start> |
||||
<end>*/</end> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<start>///</start> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">//</highlighter> |
||||
<highlighter type="annotation"> |
||||
<!-- annotations are called (custom) "attributes" in .NET --> |
||||
<start>[</start> |
||||
<end>]</end> |
||||
<valueStart>(</valueStart> |
||||
<valueEnd>)</valueEnd> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<!-- C# supports a couple of directives --> |
||||
<start>#</start> |
||||
<lineBreakEscape>\</lineBreakEscape> |
||||
<style>directive</style> |
||||
<solitary/> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<!-- strings starting with an "@" can span multiple lines --> |
||||
<string>@"</string> |
||||
<endString>"</endString> |
||||
<escape>\</escape> |
||||
<spanNewLines /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<suffix>ul</suffix> |
||||
<suffix>lu</suffix> |
||||
<suffix>u</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<exponent>e</exponent> |
||||
<suffix>ul</suffix> |
||||
<suffix>lu</suffix> |
||||
<suffix>u</suffix> |
||||
<suffix>f</suffix> |
||||
<suffix>d</suffix> |
||||
<suffix>m</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>abstract</keyword> |
||||
<keyword>as</keyword> |
||||
<keyword>base</keyword> |
||||
<keyword>bool</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>byte</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>catch</keyword> |
||||
<keyword>char</keyword> |
||||
<keyword>checked</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>const</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>decimal</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>delegate</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>double</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>enum</keyword> |
||||
<keyword>event</keyword> |
||||
<keyword>explicit</keyword> |
||||
<keyword>extern</keyword> |
||||
<keyword>false</keyword> |
||||
<keyword>finally</keyword> |
||||
<keyword>fixed</keyword> |
||||
<keyword>float</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>foreach</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>implicit</keyword> |
||||
<keyword>in</keyword> |
||||
<keyword>int</keyword> |
||||
<keyword>interface</keyword> |
||||
<keyword>internal</keyword> |
||||
<keyword>is</keyword> |
||||
<keyword>lock</keyword> |
||||
<keyword>long</keyword> |
||||
<keyword>namespace</keyword> |
||||
<keyword>new</keyword> |
||||
<keyword>null</keyword> |
||||
<keyword>object</keyword> |
||||
<keyword>operator</keyword> |
||||
<keyword>out</keyword> |
||||
<keyword>override</keyword> |
||||
<keyword>params</keyword> |
||||
<keyword>private</keyword> |
||||
<keyword>protected</keyword> |
||||
<keyword>public</keyword> |
||||
<keyword>readonly</keyword> |
||||
<keyword>ref</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>sbyte</keyword> |
||||
<keyword>sealed</keyword> |
||||
<keyword>short</keyword> |
||||
<keyword>sizeof</keyword> |
||||
<keyword>stackalloc</keyword> |
||||
<keyword>static</keyword> |
||||
<keyword>string</keyword> |
||||
<keyword>struct</keyword> |
||||
<keyword>switch</keyword> |
||||
<keyword>this</keyword> |
||||
<keyword>throw</keyword> |
||||
<keyword>true</keyword> |
||||
<keyword>try</keyword> |
||||
<keyword>typeof</keyword> |
||||
<keyword>uint</keyword> |
||||
<keyword>ulong</keyword> |
||||
<keyword>unchecked</keyword> |
||||
<keyword>unsafe</keyword> |
||||
<keyword>ushort</keyword> |
||||
<keyword>using</keyword> |
||||
<keyword>virtual</keyword> |
||||
<keyword>void</keyword> |
||||
<keyword>volatile</keyword> |
||||
<keyword>while</keyword> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<!-- special words, not really keywords --> |
||||
<keyword>add</keyword> |
||||
<keyword>alias</keyword> |
||||
<keyword>from</keyword> |
||||
<keyword>get</keyword> |
||||
<keyword>global</keyword> |
||||
<keyword>group</keyword> |
||||
<keyword>into</keyword> |
||||
<keyword>join</keyword> |
||||
<keyword>orderby</keyword> |
||||
<keyword>partial</keyword> |
||||
<keyword>remove</keyword> |
||||
<keyword>select</keyword> |
||||
<keyword>set</keyword> |
||||
<keyword>value</keyword> |
||||
<keyword>where</keyword> |
||||
<keyword>yield</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,176 +0,0 @@
@@ -1,176 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for CSS files |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2011-2012 Martin Hujer, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Martin Hujer <mhujer at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
Reference: http://www.w3.org/TR/CSS21/propidx.html |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
<spanNewLines/> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
<spanNewLines/> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
</highlighter> |
||||
<highlighter type="word"> |
||||
<word>@charset</word> |
||||
<word>@import</word> |
||||
<word>@media</word> |
||||
<word>@page</word> |
||||
<style>directive</style> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<partChars>-</partChars> |
||||
<keyword>azimuth</keyword> |
||||
<keyword>background-attachment</keyword> |
||||
<keyword>background-color</keyword> |
||||
<keyword>background-image</keyword> |
||||
<keyword>background-position</keyword> |
||||
<keyword>background-repeat</keyword> |
||||
<keyword>background</keyword> |
||||
<keyword>border-collapse</keyword> |
||||
<keyword>border-color</keyword> |
||||
<keyword>border-spacing</keyword> |
||||
<keyword>border-style</keyword> |
||||
<keyword>border-top</keyword> |
||||
<keyword>border-right</keyword> |
||||
<keyword>border-bottom</keyword> |
||||
<keyword>border-left</keyword> |
||||
<keyword>border-top-color</keyword> |
||||
<keyword>border-right-color</keyword> |
||||
<keyword>border-bottom-color</keyword> |
||||
<keyword>border-left-color</keyword> |
||||
<keyword>border-top-style</keyword> |
||||
<keyword>border-right-style</keyword> |
||||
<keyword>border-bottom-style</keyword> |
||||
<keyword>border-left-style</keyword> |
||||
<keyword>border-top-width</keyword> |
||||
<keyword>border-right-width</keyword> |
||||
<keyword>border-bottom-width</keyword> |
||||
<keyword>border-left-width</keyword> |
||||
<keyword>border-width</keyword> |
||||
<keyword>border</keyword> |
||||
<keyword>bottom</keyword> |
||||
<keyword>caption-side</keyword> |
||||
<keyword>clear</keyword> |
||||
<keyword>clip</keyword> |
||||
<keyword>color</keyword> |
||||
<keyword>content</keyword> |
||||
<keyword>counter-increment</keyword> |
||||
<keyword>counter-reset</keyword> |
||||
<keyword>cue-after</keyword> |
||||
<keyword>cue-before</keyword> |
||||
<keyword>cue</keyword> |
||||
<keyword>cursor</keyword> |
||||
<keyword>direction</keyword> |
||||
<keyword>display</keyword> |
||||
<keyword>elevation</keyword> |
||||
<keyword>empty-cells</keyword> |
||||
<keyword>float</keyword> |
||||
<keyword>font-family</keyword> |
||||
<keyword>font-size</keyword> |
||||
<keyword>font-style</keyword> |
||||
<keyword>font-variant</keyword> |
||||
<keyword>font-weight</keyword> |
||||
<keyword>font</keyword> |
||||
<keyword>height</keyword> |
||||
<keyword>left</keyword> |
||||
<keyword>letter-spacing</keyword> |
||||
<keyword>line-height</keyword> |
||||
<keyword>list-style-image</keyword> |
||||
<keyword>list-style-position</keyword> |
||||
<keyword>list-style-type</keyword> |
||||
<keyword>list-style</keyword> |
||||
<keyword>margin-right</keyword> |
||||
<keyword>margin-left</keyword> |
||||
<keyword>margin-top</keyword> |
||||
<keyword>margin-bottom</keyword> |
||||
<keyword>margin</keyword> |
||||
<keyword>max-height</keyword> |
||||
<keyword>max-width</keyword> |
||||
<keyword>min-height</keyword> |
||||
<keyword>min-width</keyword> |
||||
<keyword>orphans</keyword> |
||||
<keyword>outline-color</keyword> |
||||
<keyword>outline-style</keyword> |
||||
<keyword>outline-width</keyword> |
||||
<keyword>outline</keyword> |
||||
<keyword>overflow</keyword> |
||||
<keyword>padding-top</keyword> |
||||
<keyword>padding-right</keyword> |
||||
<keyword>padding-bottom</keyword> |
||||
<keyword>padding-left</keyword> |
||||
<keyword>padding</keyword> |
||||
<keyword>page-break-after</keyword> |
||||
<keyword>page-break-before</keyword> |
||||
<keyword>page-break-inside</keyword> |
||||
<keyword>pause-after</keyword> |
||||
<keyword>pause-before</keyword> |
||||
<keyword>pause</keyword> |
||||
<keyword>pitch-range</keyword> |
||||
<keyword>pitch</keyword> |
||||
<keyword>play-during</keyword> |
||||
<keyword>position</keyword> |
||||
<keyword>quotes</keyword> |
||||
<keyword>richness</keyword> |
||||
<keyword>right</keyword> |
||||
<keyword>speak-header</keyword> |
||||
<keyword>speak-numeral</keyword> |
||||
<keyword>speak-punctuation</keyword> |
||||
<keyword>speak</keyword> |
||||
<keyword>speech-rate</keyword> |
||||
<keyword>stress</keyword> |
||||
<keyword>table-layout</keyword> |
||||
<keyword>text-align</keyword> |
||||
<keyword>text-decoration</keyword> |
||||
<keyword>text-indent</keyword> |
||||
<keyword>text-transform</keyword> |
||||
<keyword>top</keyword> |
||||
<keyword>unicode-bidi</keyword> |
||||
<keyword>vertical-align</keyword> |
||||
<keyword>visibility</keyword> |
||||
<keyword>voice-family</keyword> |
||||
<keyword>volume</keyword> |
||||
<keyword>white-space</keyword> |
||||
<keyword>widows</keyword> |
||||
<keyword>width</keyword> |
||||
<keyword>word-spacing</keyword> |
||||
<keyword>z-index</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
<?xml version='1.0'?> |
||||
<!-- |
||||
|
||||
Bakalarska prace: Zvyraznovani syntaxe v XSLT |
||||
Michal Molhanec 2005 |
||||
|
||||
myxml-hl.xml - konfigurace zvyraznovace XML, ktera zvlast zvyrazni |
||||
HTML elementy a XSL elementy |
||||
|
||||
This file has been customized for the Asciidoctor project (http://asciidoctor.org). |
||||
--> |
||||
<highlighters> |
||||
<highlighter type="xml"> |
||||
<elementSet> |
||||
<style>htmltag</style> |
||||
<element>a</element> |
||||
<element>abbr</element> |
||||
<element>address</element> |
||||
<element>area</element> |
||||
<element>article</element> |
||||
<element>aside</element> |
||||
<element>audio</element> |
||||
<element>b</element> |
||||
<element>base</element> |
||||
<element>bdi</element> |
||||
<element>blockquote</element> |
||||
<element>body</element> |
||||
<element>br</element> |
||||
<element>button</element> |
||||
<element>caption</element> |
||||
<element>canvas</element> |
||||
<element>cite</element> |
||||
<element>code</element> |
||||
<element>command</element> |
||||
<element>col</element> |
||||
<element>colgroup</element> |
||||
<element>dd</element> |
||||
<element>del</element> |
||||
<element>dialog</element> |
||||
<element>div</element> |
||||
<element>dl</element> |
||||
<element>dt</element> |
||||
<element>em</element> |
||||
<element>embed</element> |
||||
<element>fieldset</element> |
||||
<element>figcaption</element> |
||||
<element>figure</element> |
||||
<element>font</element> |
||||
<element>form</element> |
||||
<element>footer</element> |
||||
<element>h1</element> |
||||
<element>h2</element> |
||||
<element>h3</element> |
||||
<element>h4</element> |
||||
<element>h5</element> |
||||
<element>h6</element> |
||||
<element>head</element> |
||||
<element>header</element> |
||||
<element>hr</element> |
||||
<element>html</element> |
||||
<element>i</element> |
||||
<element>iframe</element> |
||||
<element>img</element> |
||||
<element>input</element> |
||||
<element>ins</element> |
||||
<element>kbd</element> |
||||
<element>label</element> |
||||
<element>legend</element> |
||||
<element>li</element> |
||||
<element>link</element> |
||||
<element>map</element> |
||||
<element>mark</element> |
||||
<element>menu</element> |
||||
<element>menu</element> |
||||
<element>meta</element> |
||||
<element>nav</element> |
||||
<element>noscript</element> |
||||
<element>object</element> |
||||
<element>ol</element> |
||||
<element>optgroup</element> |
||||
<element>option</element> |
||||
<element>p</element> |
||||
<element>param</element> |
||||
<element>pre</element> |
||||
<element>q</element> |
||||
<element>samp</element> |
||||
<element>script</element> |
||||
<element>section</element> |
||||
<element>select</element> |
||||
<element>small</element> |
||||
<element>source</element> |
||||
<element>span</element> |
||||
<element>strong</element> |
||||
<element>style</element> |
||||
<element>sub</element> |
||||
<element>summary</element> |
||||
<element>sup</element> |
||||
<element>table</element> |
||||
<element>tbody</element> |
||||
<element>td</element> |
||||
<element>textarea</element> |
||||
<element>tfoot</element> |
||||
<element>th</element> |
||||
<element>thead</element> |
||||
<element>time</element> |
||||
<element>title</element> |
||||
<element>tr</element> |
||||
<element>track</element> |
||||
<element>u</element> |
||||
<element>ul</element> |
||||
<element>var</element> |
||||
<element>video</element> |
||||
<element>wbr</element> |
||||
<element>xmp</element> |
||||
<ignoreCase/> |
||||
</elementSet> |
||||
<elementPrefix> |
||||
<style>namespace</style> |
||||
<prefix>xsl:</prefix> |
||||
</elementPrefix> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for ini files |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">;</highlighter> |
||||
<highlighter type="regex"> |
||||
<!-- ini sections --> |
||||
<pattern>^(\[.+\]\s*)$</pattern> |
||||
<style>keyword</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<!-- the keys in an ini section --> |
||||
<pattern>^(.+)(?==)</pattern> |
||||
<style>attribute</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,117 +0,0 @@
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for Java |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/**</start> |
||||
<end>*/</end> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">//</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="annotation"> |
||||
<start>@</start> |
||||
<valueStart>(</valueStart> |
||||
<valueEnd>)</valueEnd> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<exponent>e</exponent> |
||||
<suffix>f</suffix> |
||||
<suffix>d</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>abstract</keyword> |
||||
<keyword>boolean</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>byte</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>catch</keyword> |
||||
<keyword>char</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>const</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>double</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>extends</keyword> |
||||
<keyword>final</keyword> |
||||
<keyword>finally</keyword> |
||||
<keyword>float</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>implements</keyword> |
||||
<keyword>import</keyword> |
||||
<keyword>instanceof</keyword> |
||||
<keyword>int</keyword> |
||||
<keyword>interface</keyword> |
||||
<keyword>long</keyword> |
||||
<keyword>native</keyword> |
||||
<keyword>new</keyword> |
||||
<keyword>package</keyword> |
||||
<keyword>private</keyword> |
||||
<keyword>protected</keyword> |
||||
<keyword>public</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>short</keyword> |
||||
<keyword>static</keyword> |
||||
<keyword>strictfp</keyword> |
||||
<keyword>super</keyword> |
||||
<keyword>switch</keyword> |
||||
<keyword>synchronized</keyword> |
||||
<keyword>this</keyword> |
||||
<keyword>throw</keyword> |
||||
<keyword>throws</keyword> |
||||
<keyword>transient</keyword> |
||||
<keyword>try</keyword> |
||||
<keyword>void</keyword> |
||||
<keyword>volatile</keyword> |
||||
<keyword>while</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,147 +0,0 @@
@@ -1,147 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for JavaScript |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">//</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<exponent>e</exponent> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>break</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>catch</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>delete</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>finally</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>function</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>in</keyword> |
||||
<keyword>instanceof</keyword> |
||||
<keyword>new</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>switch</keyword> |
||||
<keyword>this</keyword> |
||||
<keyword>throw</keyword> |
||||
<keyword>try</keyword> |
||||
<keyword>typeof</keyword> |
||||
<keyword>var</keyword> |
||||
<keyword>void</keyword> |
||||
<keyword>while</keyword> |
||||
<keyword>with</keyword> |
||||
<!-- future keywords --> |
||||
<keyword>abstract</keyword> |
||||
<keyword>boolean</keyword> |
||||
<keyword>byte</keyword> |
||||
<keyword>char</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>const</keyword> |
||||
<keyword>debugger</keyword> |
||||
<keyword>double</keyword> |
||||
<keyword>enum</keyword> |
||||
<keyword>export</keyword> |
||||
<keyword>extends</keyword> |
||||
<keyword>final</keyword> |
||||
<keyword>float</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>implements</keyword> |
||||
<keyword>import</keyword> |
||||
<keyword>int</keyword> |
||||
<keyword>interface</keyword> |
||||
<keyword>long</keyword> |
||||
<keyword>native</keyword> |
||||
<keyword>package</keyword> |
||||
<keyword>private</keyword> |
||||
<keyword>protected</keyword> |
||||
<keyword>public</keyword> |
||||
<keyword>short</keyword> |
||||
<keyword>static</keyword> |
||||
<keyword>super</keyword> |
||||
<keyword>synchronized</keyword> |
||||
<keyword>throws</keyword> |
||||
<keyword>transient</keyword> |
||||
<keyword>volatile</keyword> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>prototype</keyword> |
||||
<!-- Global Objects --> |
||||
<keyword>Array</keyword> |
||||
<keyword>Boolean</keyword> |
||||
<keyword>Date</keyword> |
||||
<keyword>Error</keyword> |
||||
<keyword>EvalError</keyword> |
||||
<keyword>Function</keyword> |
||||
<keyword>Math</keyword> |
||||
<keyword>Number</keyword> |
||||
<keyword>Object</keyword> |
||||
<keyword>RangeError</keyword> |
||||
<keyword>ReferenceError</keyword> |
||||
<keyword>RegExp</keyword> |
||||
<keyword>String</keyword> |
||||
<keyword>SyntaxError</keyword> |
||||
<keyword>TypeError</keyword> |
||||
<keyword>URIError</keyword> |
||||
<!-- Global functions --> |
||||
<keyword>decodeURI</keyword> |
||||
<keyword>decodeURIComponent</keyword> |
||||
<keyword>encodeURI</keyword> |
||||
<keyword>encodeURIComponent</keyword> |
||||
<keyword>eval</keyword> |
||||
<keyword>isFinite</keyword> |
||||
<keyword>isNaN</keyword> |
||||
<keyword>parseFloat</keyword> |
||||
<keyword>parseInt</keyword> |
||||
<!-- Global properties --> |
||||
<keyword>Infinity</keyword> |
||||
<keyword>NaN</keyword> |
||||
<keyword>undefined</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,37 +0,0 @@
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="annotation"> |
||||
<start>@</start> |
||||
<valueStart>(</valueStart> |
||||
<valueEnd>)</valueEnd> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<exponent>e</exponent> |
||||
<suffix>f</suffix> |
||||
<suffix>d</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>true</keyword> |
||||
<keyword>false</keyword> |
||||
</highlighter> |
||||
<highlighter type="word"> |
||||
<word>{</word> |
||||
<word>}</word> |
||||
<word>,</word> |
||||
<word>[</word> |
||||
<word>]</word> |
||||
<style>keyword</style> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for Perl |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="heredoc"> |
||||
<start><<</start> |
||||
<quote>'</quote> |
||||
<quote>"</quote> |
||||
<noWhiteSpace/> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
<spanNewLines/> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>if</keyword> |
||||
<keyword>unless</keyword> |
||||
<keyword>while</keyword> |
||||
<keyword>until</keyword> |
||||
<keyword>foreach</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>elsif</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>when</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>given</keyword> |
||||
<!-- Keywords related to the control flow of your perl program --> |
||||
<keyword>caller</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>die</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>dump</keyword> |
||||
<keyword>eval</keyword> |
||||
<keyword>exit</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>last</keyword> |
||||
<keyword>next</keyword> |
||||
<keyword>redo</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>sub</keyword> |
||||
<keyword>wantarray</keyword> |
||||
<!-- Keywords related to scoping --> |
||||
<keyword>caller</keyword> |
||||
<keyword>import</keyword> |
||||
<keyword>local</keyword> |
||||
<keyword>my</keyword> |
||||
<keyword>package</keyword> |
||||
<keyword>use</keyword> |
||||
<!-- Keywords related to perl modules --> |
||||
<keyword>do</keyword> |
||||
<keyword>import</keyword> |
||||
<keyword>no</keyword> |
||||
<keyword>package</keyword> |
||||
<keyword>require</keyword> |
||||
<keyword>use</keyword> |
||||
<!-- Keywords related to classes and object-orientedness --> |
||||
<keyword>bless</keyword> |
||||
<keyword>dbmclose</keyword> |
||||
<keyword>dbmopen</keyword> |
||||
<keyword>package</keyword> |
||||
<keyword>ref</keyword> |
||||
<keyword>tie</keyword> |
||||
<keyword>tied</keyword> |
||||
<keyword>untie</keyword> |
||||
<keyword>use</keyword> |
||||
<!-- operators --> |
||||
<keyword>and</keyword> |
||||
<keyword>or</keyword> |
||||
<keyword>not</keyword> |
||||
<keyword>eq</keyword> |
||||
<keyword>ne</keyword> |
||||
<keyword>lt</keyword> |
||||
<keyword>gt</keyword> |
||||
<keyword>le</keyword> |
||||
<keyword>ge</keyword> |
||||
<keyword>cmp</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,154 +0,0 @@
@@ -1,154 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for PHP |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/**</start> |
||||
<end>*/</end> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment"> |
||||
<start><![CDATA[/// ]]></start> |
||||
<style>doccomment</style> |
||||
</highlighter> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">//</highlighter> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
<spanNewLines /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
<spanNewLines /> |
||||
</highlighter> |
||||
<highlighter type="heredoc"> |
||||
<start><<<</start> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<exponent>e</exponent> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>and</keyword> |
||||
<keyword>or</keyword> |
||||
<keyword>xor</keyword> |
||||
<keyword>__FILE__</keyword> |
||||
<keyword>exception</keyword> |
||||
<keyword>__LINE__</keyword> |
||||
<keyword>array</keyword> |
||||
<keyword>as</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>const</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>declare</keyword> |
||||
<keyword>default</keyword> |
||||
<keyword>die</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>echo</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>elseif</keyword> |
||||
<keyword>empty</keyword> |
||||
<keyword>enddeclare</keyword> |
||||
<keyword>endfor</keyword> |
||||
<keyword>endforeach</keyword> |
||||
<keyword>endif</keyword> |
||||
<keyword>endswitch</keyword> |
||||
<keyword>endwhile</keyword> |
||||
<keyword>eval</keyword> |
||||
<keyword>exit</keyword> |
||||
<keyword>extends</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>foreach</keyword> |
||||
<keyword>function</keyword> |
||||
<keyword>global</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>include</keyword> |
||||
<keyword>include_once</keyword> |
||||
<keyword>isset</keyword> |
||||
<keyword>list</keyword> |
||||
<keyword>new</keyword> |
||||
<keyword>print</keyword> |
||||
<keyword>require</keyword> |
||||
<keyword>require_once</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>static</keyword> |
||||
<keyword>switch</keyword> |
||||
<keyword>unset</keyword> |
||||
<keyword>use</keyword> |
||||
<keyword>var</keyword> |
||||
<keyword>while</keyword> |
||||
<keyword>__FUNCTION__</keyword> |
||||
<keyword>__CLASS__</keyword> |
||||
<keyword>__METHOD__</keyword> |
||||
<keyword>final</keyword> |
||||
<keyword>php_user_filter</keyword> |
||||
<keyword>interface</keyword> |
||||
<keyword>implements</keyword> |
||||
<keyword>extends</keyword> |
||||
<keyword>public</keyword> |
||||
<keyword>private</keyword> |
||||
<keyword>protected</keyword> |
||||
<keyword>abstract</keyword> |
||||
<keyword>clone</keyword> |
||||
<keyword>try</keyword> |
||||
<keyword>catch</keyword> |
||||
<keyword>throw</keyword> |
||||
<keyword>cfunction</keyword> |
||||
<keyword>old_function</keyword> |
||||
<keyword>true</keyword> |
||||
<keyword>false</keyword> |
||||
<!-- PHP 5.3 --> |
||||
<keyword>namespace</keyword> |
||||
<keyword>__NAMESPACE__</keyword> |
||||
<keyword>goto</keyword> |
||||
<keyword>__DIR__</keyword> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="word"> |
||||
<!-- highlight the php open and close tags as directives --> |
||||
<word>?></word> |
||||
<word><?php</word> |
||||
<word><?=</word> |
||||
<style>directive</style> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,38 +0,0 @@
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for Java |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(.+?)(?==|:)</pattern> |
||||
<style>attribute</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,100 +0,0 @@
@@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for Python |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="annotation"> |
||||
<!-- these are actually called decorators --> |
||||
<start>@</start> |
||||
<valueStart>(</valueStart> |
||||
<valueEnd>)</valueEnd> |
||||
</highlighter> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"""</string> |
||||
<spanNewLines /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'''</string> |
||||
<spanNewLines /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<exponent>e</exponent> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>and</keyword> |
||||
<keyword>del</keyword> |
||||
<keyword>from</keyword> |
||||
<keyword>not</keyword> |
||||
<keyword>while</keyword> |
||||
<keyword>as</keyword> |
||||
<keyword>elif</keyword> |
||||
<keyword>global</keyword> |
||||
<keyword>or</keyword> |
||||
<keyword>with</keyword> |
||||
<keyword>assert</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>pass</keyword> |
||||
<keyword>yield</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>except</keyword> |
||||
<keyword>import</keyword> |
||||
<keyword>print</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>exec</keyword> |
||||
<keyword>in</keyword> |
||||
<keyword>raise</keyword> |
||||
<keyword>continue</keyword> |
||||
<keyword>finally</keyword> |
||||
<keyword>is</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>def</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>lambda</keyword> |
||||
<keyword>try</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,109 +0,0 @@
@@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for Ruby |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
Michal Molhanec <mol1111 at users.sourceforge.net> |
||||
Jirka Kosek <kosek at users.sourceforge.net> |
||||
Michiel Hendriks <elmuerte at users.sourceforge.net> |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="heredoc"> |
||||
<start><<</start> |
||||
<noWhiteSpace/> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>%Q{</string> |
||||
<endString>}</endString> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>%/</string> |
||||
<endString>/</endString> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>%q{</string> |
||||
<endString>}</endString> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="hexnumber"> |
||||
<prefix>0x</prefix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<exponent>e</exponent> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>alias</keyword> |
||||
<keyword>and</keyword> |
||||
<keyword>BEGIN</keyword> |
||||
<keyword>begin</keyword> |
||||
<keyword>break</keyword> |
||||
<keyword>case</keyword> |
||||
<keyword>class</keyword> |
||||
<keyword>def</keyword> |
||||
<keyword>defined</keyword> |
||||
<keyword>do</keyword> |
||||
<keyword>else</keyword> |
||||
<keyword>elsif</keyword> |
||||
<keyword>END</keyword> |
||||
<keyword>end</keyword> |
||||
<keyword>ensure</keyword> |
||||
<keyword>false</keyword> |
||||
<keyword>for</keyword> |
||||
<keyword>if</keyword> |
||||
<keyword>in</keyword> |
||||
<keyword>module</keyword> |
||||
<keyword>next</keyword> |
||||
<keyword>nil</keyword> |
||||
<keyword>not</keyword> |
||||
<keyword>or</keyword> |
||||
<keyword>redo</keyword> |
||||
<keyword>rescue</keyword> |
||||
<keyword>retry</keyword> |
||||
<keyword>return</keyword> |
||||
<keyword>self</keyword> |
||||
<keyword>super</keyword> |
||||
<keyword>then</keyword> |
||||
<keyword>true</keyword> |
||||
<keyword>undef</keyword> |
||||
<keyword>unless</keyword> |
||||
<keyword>until</keyword> |
||||
<keyword>when</keyword> |
||||
<keyword>while</keyword> |
||||
<keyword>yield</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,565 +0,0 @@
@@ -1,565 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- |
||||
|
||||
Syntax highlighting definition for SQL:1999 |
||||
|
||||
xslthl - XSLT Syntax Highlighting |
||||
http://sourceforge.net/projects/xslthl/ |
||||
Copyright (C) 2012 Michiel Hendriks, Martin Hujer, k42b3 |
||||
|
||||
This software is provided 'as-is', without any express or implied |
||||
warranty. In no event will the authors be held liable for any damages |
||||
arising from the use of this software. |
||||
|
||||
Permission is granted to anyone to use this software for any purpose, |
||||
including commercial applications, and to alter it and redistribute it |
||||
freely, subject to the following restrictions: |
||||
|
||||
1. The origin of this software must not be misrepresented; you must not |
||||
claim that you wrote the original software. If you use this software |
||||
in a product, an acknowledgment in the product documentation would be |
||||
appreciated but is not required. |
||||
2. Altered source versions must be plainly marked as such, and must not be |
||||
misrepresented as being the original software. |
||||
3. This notice may not be removed or altered from any source distribution. |
||||
|
||||
--> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">--</highlighter> |
||||
<highlighter type="multiline-comment"> |
||||
<start>/*</start> |
||||
<end>*/</end> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<doubleEscapes /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>U'</string> |
||||
<endString>'</endString> |
||||
<doubleEscapes /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>B'</string> |
||||
<endString>'</endString> |
||||
<doubleEscapes /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>N'</string> |
||||
<endString>'</endString> |
||||
<doubleEscapes /> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>X'</string> |
||||
<endString>'</endString> |
||||
<doubleEscapes /> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<pointStarts /> |
||||
<exponent>e</exponent> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<ignoreCase /> |
||||
<!-- reserved --> |
||||
<keyword>A</keyword> |
||||
<keyword>ABS</keyword> |
||||
<keyword>ABSOLUTE</keyword> |
||||
<keyword>ACTION</keyword> |
||||
<keyword>ADA</keyword> |
||||
<keyword>ADMIN</keyword> |
||||
<keyword>AFTER</keyword> |
||||
<keyword>ALWAYS</keyword> |
||||
<keyword>ASC</keyword> |
||||
<keyword>ASSERTION</keyword> |
||||
<keyword>ASSIGNMENT</keyword> |
||||
<keyword>ATTRIBUTE</keyword> |
||||
<keyword>ATTRIBUTES</keyword> |
||||
<keyword>AVG</keyword> |
||||
<keyword>BEFORE</keyword> |
||||
<keyword>BERNOULLI</keyword> |
||||
<keyword>BREADTH</keyword> |
||||
<keyword>C</keyword> |
||||
<keyword>CARDINALITY</keyword> |
||||
<keyword>CASCADE</keyword> |
||||
<keyword>CATALOG_NAME</keyword> |
||||
<keyword>CATALOG</keyword> |
||||
<keyword>CEIL</keyword> |
||||
<keyword>CEILING</keyword> |
||||
<keyword>CHAIN</keyword> |
||||
<keyword>CHAR_LENGTH</keyword> |
||||
<keyword>CHARACTER_LENGTH</keyword> |
||||
<keyword>CHARACTER_SET_CATALOG</keyword> |
||||
<keyword>CHARACTER_SET_NAME</keyword> |
||||
<keyword>CHARACTER_SET_SCHEMA</keyword> |
||||
<keyword>CHARACTERISTICS</keyword> |
||||
<keyword>CHARACTERS</keyword> |
||||
<keyword>CHECKED</keyword> |
||||
<keyword>CLASS_ORIGIN</keyword> |
||||
<keyword>COALESCE</keyword> |
||||
<keyword>COBOL</keyword> |
||||
<keyword>CODE_UNITS</keyword> |
||||
<keyword>COLLATION_CATALOG</keyword> |
||||
<keyword>COLLATION_NAME</keyword> |
||||
<keyword>COLLATION_SCHEMA</keyword> |
||||
<keyword>COLLATION</keyword> |
||||
<keyword>COLLECT</keyword> |
||||
<keyword>COLUMN_NAME</keyword> |
||||
<keyword>COMMAND_FUNCTION_CODE</keyword> |
||||
<keyword>COMMAND_FUNCTION</keyword> |
||||
<keyword>COMMITTED</keyword> |
||||
<keyword>CONDITION_NUMBER</keyword> |
||||
<keyword>CONDITION</keyword> |
||||
<keyword>CONNECTION_NAME</keyword> |
||||
<keyword>CONSTRAINT_CATALOG</keyword> |
||||
<keyword>CONSTRAINT_NAME</keyword> |
||||
<keyword>CONSTRAINT_SCHEMA</keyword> |
||||
<keyword>CONSTRAINTS</keyword> |
||||
<keyword>CONSTRUCTORS</keyword> |
||||
<keyword>CONTAINS</keyword> |
||||
<keyword>CONVERT</keyword> |
||||
<keyword>CORR</keyword> |
||||
<keyword>COUNT</keyword> |
||||
<keyword>COVAR_POP</keyword> |
||||
<keyword>COVAR_SAMP</keyword> |
||||
<keyword>CUME_DIST</keyword> |
||||
<keyword>CURRENT_COLLATION</keyword> |
||||
<keyword>CURSOR_NAME</keyword> |
||||
<keyword>DATA</keyword> |
||||
<keyword>DATETIME_INTERVAL_CODE</keyword> |
||||
<keyword>DATETIME_INTERVAL_PRECISION</keyword> |
||||
<keyword>DEFAULTS</keyword> |
||||
<keyword>DEFERRABLE</keyword> |
||||
<keyword>DEFERRED</keyword> |
||||
<keyword>DEFINED</keyword> |
||||
<keyword>DEFINER</keyword> |
||||
<keyword>DEGREE</keyword> |
||||
<keyword>DENSE_RANK</keyword> |
||||
<keyword>DEPTH</keyword> |
||||
<keyword>DERIVED</keyword> |
||||
<keyword>DESC</keyword> |
||||
<keyword>DESCRIPTOR</keyword> |
||||
<keyword>DIAGNOSTICS</keyword> |
||||
<keyword>DISPATCH</keyword> |
||||
<keyword>DOMAIN</keyword> |
||||
<keyword>DYNAMIC_FUNCTION_CODE</keyword> |
||||
<keyword>DYNAMIC_FUNCTION</keyword> |
||||
<keyword>EQUALS</keyword> |
||||
<keyword>EVERY</keyword> |
||||
<keyword>EXCEPTION</keyword> |
||||
<keyword>EXCLUDE</keyword> |
||||
<keyword>EXCLUDING</keyword> |
||||
<keyword>EXP</keyword> |
||||
<keyword>EXTRACT</keyword> |
||||
<keyword>FINAL</keyword> |
||||
<keyword>FIRST</keyword> |
||||
<keyword>FLOOR</keyword> |
||||
<keyword>FOLLOWING</keyword> |
||||
<keyword>FORTRAN</keyword> |
||||
<keyword>FOUND</keyword> |
||||
<keyword>FUSION</keyword> |
||||
<keyword>G</keyword> |
||||
<keyword>GENERAL</keyword> |
||||
<keyword>GO</keyword> |
||||
<keyword>GOTO</keyword> |
||||
<keyword>GRANTED</keyword> |
||||
<keyword>HIERARCHY</keyword> |
||||
<keyword>IMPLEMENTATION</keyword> |
||||
<keyword>INCLUDING</keyword> |
||||
<keyword>INCREMENT</keyword> |
||||
<keyword>INITIALLY</keyword> |
||||
<keyword>INSTANCE</keyword> |
||||
<keyword>INSTANTIABLE</keyword> |
||||
<keyword>INTERSECTION</keyword> |
||||
<keyword>INVOKER</keyword> |
||||
<keyword>ISOLATION</keyword> |
||||
<keyword>K</keyword> |
||||
<keyword>KEY_MEMBER</keyword> |
||||
<keyword>KEY_TYPE</keyword> |
||||
<keyword>KEY</keyword> |
||||
<keyword>LAST</keyword> |
||||
<keyword>LENGTH</keyword> |
||||
<keyword>LEVEL</keyword> |
||||
<keyword>LN</keyword> |
||||
<keyword>LOCATOR</keyword> |
||||
<keyword>LOWER</keyword> |
||||
<keyword>M</keyword> |
||||
<keyword>MAP</keyword> |
||||
<keyword>MATCHED</keyword> |
||||
<keyword>MAX</keyword> |
||||
<keyword>MAXVALUE</keyword> |
||||
<keyword>MESSAGE_LENGTH</keyword> |
||||
<keyword>MESSAGE_OCTET_LENGTH</keyword> |
||||
<keyword>MESSAGE_TEXT</keyword> |
||||
<keyword>MIN</keyword> |
||||
<keyword>MINVALUE</keyword> |
||||
<keyword>MOD</keyword> |
||||
<keyword>MORE</keyword> |
||||
<keyword>MUMPS</keyword> |
||||
<keyword>NAME</keyword> |
||||
<keyword>NAMES</keyword> |
||||
<keyword>NESTING</keyword> |
||||
<keyword>NEXT</keyword> |
||||
<keyword>NORMALIZE</keyword> |
||||
<keyword>NORMALIZED</keyword> |
||||
<keyword>NULLABLE</keyword> |
||||
<keyword>NULLIF</keyword> |
||||
<keyword>NULLS</keyword> |
||||
<keyword>NUMBER</keyword> |
||||
<keyword>OBJECT</keyword> |
||||
<keyword>OCTET_LENGTH</keyword> |
||||
<keyword>OCTETS</keyword> |
||||
<keyword>OPTION</keyword> |
||||
<keyword>OPTIONS</keyword> |
||||
<keyword>ORDERING</keyword> |
||||
<keyword>ORDINALITY</keyword> |
||||
<keyword>OTHERS</keyword> |
||||
<keyword>OVERLAY</keyword> |
||||
<keyword>OVERRIDING</keyword> |
||||
<keyword>PAD</keyword> |
||||
<keyword>PARAMETER_MODE</keyword> |
||||
<keyword>PARAMETER_NAME</keyword> |
||||
<keyword>PARAMETER_ORDINAL_POSITION</keyword> |
||||
<keyword>PARAMETER_SPECIFIC_CATALOG</keyword> |
||||
<keyword>PARAMETER_SPECIFIC_NAME</keyword> |
||||
<keyword>PARAMETER_SPECIFIC_SCHEMA</keyword> |
||||
<keyword>PARTIAL</keyword> |
||||
<keyword>PASCAL</keyword> |
||||
<keyword>PATH</keyword> |
||||
<keyword>PERCENT_RANK</keyword> |
||||
<keyword>PERCENTILE_CONT</keyword> |
||||
<keyword>PERCENTILE_DISC</keyword> |
||||
<keyword>PLACING</keyword> |
||||
<keyword>PLI</keyword> |
||||
<keyword>POSITION</keyword> |
||||
<keyword>POWER</keyword> |
||||
<keyword>PRECEDING</keyword> |
||||
<keyword>PRESERVE</keyword> |
||||
<keyword>PRIOR</keyword> |
||||
<keyword>PRIVILEGES</keyword> |
||||
<keyword>PUBLIC</keyword> |
||||
<keyword>RANK</keyword> |
||||
<keyword>READ</keyword> |
||||
<keyword>RELATIVE</keyword> |
||||
<keyword>REPEATABLE</keyword> |
||||
<keyword>RESTART</keyword> |
||||
<keyword>RETURNED_CARDINALITY</keyword> |
||||
<keyword>RETURNED_LENGTH</keyword> |
||||
<keyword>RETURNED_OCTET_LENGTH</keyword> |
||||
<keyword>RETURNED_SQLSTATE</keyword> |
||||
<keyword>ROLE</keyword> |
||||
<keyword>ROUTINE_CATALOG</keyword> |
||||
<keyword>ROUTINE_NAME</keyword> |
||||
<keyword>ROUTINE_SCHEMA</keyword> |
||||
<keyword>ROUTINE</keyword> |
||||
<keyword>ROW_COUNT</keyword> |
||||
<keyword>ROW_NUMBER</keyword> |
||||
<keyword>SCALE</keyword> |
||||
<keyword>SCHEMA_NAME</keyword> |
||||
<keyword>SCHEMA</keyword> |
||||
<keyword>SCOPE_CATALOG</keyword> |
||||
<keyword>SCOPE_NAME</keyword> |
||||
<keyword>SCOPE_SCHEMA</keyword> |
||||
<keyword>SECTION</keyword> |
||||
<keyword>SECURITY</keyword> |
||||
<keyword>SELF</keyword> |
||||
<keyword>SEQUENCE</keyword> |
||||
<keyword>SERIALIZABLE</keyword> |
||||
<keyword>SERVER_NAME</keyword> |
||||
<keyword>SESSION</keyword> |
||||
<keyword>SETS</keyword> |
||||
<keyword>SIMPLE</keyword> |
||||
<keyword>SIZE</keyword> |
||||
<keyword>SOURCE</keyword> |
||||
<keyword>SPACE</keyword> |
||||
<keyword>SPECIFIC_NAME</keyword> |
||||
<keyword>SQRT</keyword> |
||||
<keyword>STATE</keyword> |
||||
<keyword>STATEMENT</keyword> |
||||
<keyword>STDDEV_POP</keyword> |
||||
<keyword>STDDEV_SAMP</keyword> |
||||
<keyword>STRUCTURE</keyword> |
||||
<keyword>STYLE</keyword> |
||||
<keyword>SUBCLASS_ORIGIN</keyword> |
||||
<keyword>SUBSTRING</keyword> |
||||
<keyword>SUM</keyword> |
||||
<keyword>TABLE_NAME</keyword> |
||||
<keyword>TABLESAMPLE</keyword> |
||||
<keyword>TEMPORARY</keyword> |
||||
<keyword>TIES</keyword> |
||||
<keyword>TOP_LEVEL_COUNT</keyword> |
||||
<keyword>TRANSACTION_ACTIVE</keyword> |
||||
<keyword>TRANSACTION</keyword> |
||||
<keyword>TRANSACTIONS_COMMITTED</keyword> |
||||
<keyword>TRANSACTIONS_ROLLED_BACK</keyword> |
||||
<keyword>TRANSFORM</keyword> |
||||
<keyword>TRANSFORMS</keyword> |
||||
<keyword>TRANSLATE</keyword> |
||||
<keyword>TRIGGER_CATALOG</keyword> |
||||
<keyword>TRIGGER_NAME</keyword> |
||||
<keyword>TRIGGER_SCHEMA</keyword> |
||||
<keyword>TRIM</keyword> |
||||
<keyword>TYPE</keyword> |
||||
<keyword>UNBOUNDED</keyword> |
||||
<keyword>UNCOMMITTED</keyword> |
||||
<keyword>UNDER</keyword> |
||||
<keyword>UNNAMED</keyword> |
||||
<keyword>USAGE</keyword> |
||||
<keyword>USER_DEFINED_TYPE_CATALOG</keyword> |
||||
<keyword>USER_DEFINED_TYPE_CODE</keyword> |
||||
<keyword>USER_DEFINED_TYPE_NAME</keyword> |
||||
<keyword>USER_DEFINED_TYPE_SCHEMA</keyword> |
||||
<keyword>VIEW</keyword> |
||||
<keyword>WORK</keyword> |
||||
<keyword>WRITE</keyword> |
||||
<keyword>ZONE</keyword> |
||||
<!-- non reserved --> |
||||
<keyword>ADD</keyword> |
||||
<keyword>ALL</keyword> |
||||
<keyword>ALLOCATE</keyword> |
||||
<keyword>ALTER</keyword> |
||||
<keyword>AND</keyword> |
||||
<keyword>ANY</keyword> |
||||
<keyword>ARE</keyword> |
||||
<keyword>ARRAY</keyword> |
||||
<keyword>AS</keyword> |
||||
<keyword>ASENSITIVE</keyword> |
||||
<keyword>ASYMMETRIC</keyword> |
||||
<keyword>AT</keyword> |
||||
<keyword>ATOMIC</keyword> |
||||
<keyword>AUTHORIZATION</keyword> |
||||
<keyword>BEGIN</keyword> |
||||
<keyword>BETWEEN</keyword> |
||||
<keyword>BIGINT</keyword> |
||||
<keyword>BINARY</keyword> |
||||
<keyword>BLOB</keyword> |
||||
<keyword>BOOLEAN</keyword> |
||||
<keyword>BOTH</keyword> |
||||
<keyword>BY</keyword> |
||||
<keyword>CALL</keyword> |
||||
<keyword>CALLED</keyword> |
||||
<keyword>CASCADED</keyword> |
||||
<keyword>CASE</keyword> |
||||
<keyword>CAST</keyword> |
||||
<keyword>CHAR</keyword> |
||||
<keyword>CHARACTER</keyword> |
||||
<keyword>CHECK</keyword> |
||||
<keyword>CLOB</keyword> |
||||
<keyword>CLOSE</keyword> |
||||
<keyword>COLLATE</keyword> |
||||
<keyword>COLUMN</keyword> |
||||
<keyword>COMMIT</keyword> |
||||
<keyword>CONNECT</keyword> |
||||
<keyword>CONSTRAINT</keyword> |
||||
<keyword>CONTINUE</keyword> |
||||
<keyword>CORRESPONDING</keyword> |
||||
<keyword>CREATE</keyword> |
||||
<keyword>CROSS</keyword> |
||||
<keyword>CUBE</keyword> |
||||
<keyword>CURRENT_DATE</keyword> |
||||
<keyword>CURRENT_DEFAULT_TRANSFORM_GROUP</keyword> |
||||
<keyword>CURRENT_PATH</keyword> |
||||
<keyword>CURRENT_ROLE</keyword> |
||||
<keyword>CURRENT_TIME</keyword> |
||||
<keyword>CURRENT_TIMESTAMP</keyword> |
||||
<keyword>CURRENT_TRANSFORM_GROUP_FOR_TYPE</keyword> |
||||
<keyword>CURRENT_USER</keyword> |
||||
<keyword>CURRENT</keyword> |
||||
<keyword>CURSOR</keyword> |
||||
<keyword>CYCLE</keyword> |
||||
<keyword>DATE</keyword> |
||||
<keyword>DAY</keyword> |
||||
<keyword>DEALLOCATE</keyword> |
||||
<keyword>DEC</keyword> |
||||
<keyword>DECIMAL</keyword> |
||||
<keyword>DECLARE</keyword> |
||||
<keyword>DEFAULT</keyword> |
||||
<keyword>DELETE</keyword> |
||||
<keyword>DEREF</keyword> |
||||
<keyword>DESCRIBE</keyword> |
||||
<keyword>DETERMINISTIC</keyword> |
||||
<keyword>DISCONNECT</keyword> |
||||
<keyword>DISTINCT</keyword> |
||||
<keyword>DOUBLE</keyword> |
||||
<keyword>DROP</keyword> |
||||
<keyword>DYNAMIC</keyword> |
||||
<keyword>EACH</keyword> |
||||
<keyword>ELEMENT</keyword> |
||||
<keyword>ELSE</keyword> |
||||
<keyword>END</keyword> |
||||
<keyword>END-EXEC</keyword> |
||||
<keyword>ESCAPE</keyword> |
||||
<keyword>EXCEPT</keyword> |
||||
<keyword>EXEC</keyword> |
||||
<keyword>EXECUTE</keyword> |
||||
<keyword>EXISTS</keyword> |
||||
<keyword>EXTERNAL</keyword> |
||||
<keyword>FALSE</keyword> |
||||
<keyword>FETCH</keyword> |
||||
<keyword>FILTER</keyword> |
||||
<keyword>FLOAT</keyword> |
||||
<keyword>FOR</keyword> |
||||
<keyword>FOREIGN</keyword> |
||||
<keyword>FREE</keyword> |
||||
<keyword>FROM</keyword> |
||||
<keyword>FULL</keyword> |
||||
<keyword>FUNCTION</keyword> |
||||
<keyword>GET</keyword> |
||||
<keyword>GLOBAL</keyword> |
||||
<keyword>GRANT</keyword> |
||||
<keyword>GROUP</keyword> |
||||
<keyword>GROUPING</keyword> |
||||
<keyword>HAVING</keyword> |
||||
<keyword>HOLD</keyword> |
||||
<keyword>HOUR</keyword> |
||||
<keyword>IDENTITY</keyword> |
||||
<keyword>IMMEDIATE</keyword> |
||||
<keyword>IN</keyword> |
||||
<keyword>INDICATOR</keyword> |
||||
<keyword>INNER</keyword> |
||||
<keyword>INOUT</keyword> |
||||
<keyword>INPUT</keyword> |
||||
<keyword>INSENSITIVE</keyword> |
||||
<keyword>INSERT</keyword> |
||||
<keyword>INT</keyword> |
||||
<keyword>INTEGER</keyword> |
||||
<keyword>INTERSECT</keyword> |
||||
<keyword>INTERVAL</keyword> |
||||
<keyword>INTO</keyword> |
||||
<keyword>IS</keyword> |
||||
<keyword>ISOLATION</keyword> |
||||
<keyword>JOIN</keyword> |
||||
<keyword>LANGUAGE</keyword> |
||||
<keyword>LARGE</keyword> |
||||
<keyword>LATERAL</keyword> |
||||
<keyword>LEADING</keyword> |
||||
<keyword>LEFT</keyword> |
||||
<keyword>LIKE</keyword> |
||||
<keyword>LOCAL</keyword> |
||||
<keyword>LOCALTIME</keyword> |
||||
<keyword>LOCALTIMESTAMP</keyword> |
||||
<keyword>MATCH</keyword> |
||||
<keyword>MEMBER</keyword> |
||||
<keyword>MERGE</keyword> |
||||
<keyword>METHOD</keyword> |
||||
<keyword>MINUTE</keyword> |
||||
<keyword>MODIFIES</keyword> |
||||
<keyword>MODULE</keyword> |
||||
<keyword>MONTH</keyword> |
||||
<keyword>MULTISET</keyword> |
||||
<keyword>NATIONAL</keyword> |
||||
<keyword>NATURAL</keyword> |
||||
<keyword>NCHAR</keyword> |
||||
<keyword>NCLOB</keyword> |
||||
<keyword>NEW</keyword> |
||||
<keyword>NO</keyword> |
||||
<keyword>NONE</keyword> |
||||
<keyword>NOT</keyword> |
||||
<keyword>NULL</keyword> |
||||
<keyword>NUMERIC</keyword> |
||||
<keyword>OF</keyword> |
||||
<keyword>OLD</keyword> |
||||
<keyword>ON</keyword> |
||||
<keyword>ONLY</keyword> |
||||
<keyword>OPEN</keyword> |
||||
<keyword>OR</keyword> |
||||
<keyword>ORDER</keyword> |
||||
<keyword>OUT</keyword> |
||||
<keyword>OUTER</keyword> |
||||
<keyword>OUTPUT</keyword> |
||||
<keyword>OVER</keyword> |
||||
<keyword>OVERLAPS</keyword> |
||||
<keyword>PARAMETER</keyword> |
||||
<keyword>PARTITION</keyword> |
||||
<keyword>PRECISION</keyword> |
||||
<keyword>PREPARE</keyword> |
||||
<keyword>PRIMARY</keyword> |
||||
<keyword>PROCEDURE</keyword> |
||||
<keyword>RANGE</keyword> |
||||
<keyword>READS</keyword> |
||||
<keyword>REAL</keyword> |
||||
<keyword>RECURSIVE</keyword> |
||||
<keyword>REF</keyword> |
||||
<keyword>REFERENCES</keyword> |
||||
<keyword>REFERENCING</keyword> |
||||
<keyword>REGR_AVGX</keyword> |
||||
<keyword>REGR_AVGY</keyword> |
||||
<keyword>REGR_COUNT</keyword> |
||||
<keyword>REGR_INTERCEPT</keyword> |
||||
<keyword>REGR_R2</keyword> |
||||
<keyword>REGR_SLOPE</keyword> |
||||
<keyword>REGR_SXX</keyword> |
||||
<keyword>REGR_SXY</keyword> |
||||
<keyword>REGR_SYY</keyword> |
||||
<keyword>RELEASE</keyword> |
||||
<keyword>RESULT</keyword> |
||||
<keyword>RETURN</keyword> |
||||
<keyword>RETURNS</keyword> |
||||
<keyword>REVOKE</keyword> |
||||
<keyword>RIGHT</keyword> |
||||
<keyword>ROLLBACK</keyword> |
||||
<keyword>ROLLUP</keyword> |
||||
<keyword>ROW</keyword> |
||||
<keyword>ROWS</keyword> |
||||
<keyword>SAVEPOINT</keyword> |
||||
<keyword>SCROLL</keyword> |
||||
<keyword>SEARCH</keyword> |
||||
<keyword>SECOND</keyword> |
||||
<keyword>SELECT</keyword> |
||||
<keyword>SENSITIVE</keyword> |
||||
<keyword>SESSION_USER</keyword> |
||||
<keyword>SET</keyword> |
||||
<keyword>SIMILAR</keyword> |
||||
<keyword>SMALLINT</keyword> |
||||
<keyword>SOME</keyword> |
||||
<keyword>SPECIFIC</keyword> |
||||
<keyword>SPECIFICTYPE</keyword> |
||||
<keyword>SQL</keyword> |
||||
<keyword>SQLEXCEPTION</keyword> |
||||
<keyword>SQLSTATE</keyword> |
||||
<keyword>SQLWARNING</keyword> |
||||
<keyword>START</keyword> |
||||
<keyword>STATIC</keyword> |
||||
<keyword>SUBMULTISET</keyword> |
||||
<keyword>SYMMETRIC</keyword> |
||||
<keyword>SYSTEM_USER</keyword> |
||||
<keyword>SYSTEM</keyword> |
||||
<keyword>TABLE</keyword> |
||||
<keyword>THEN</keyword> |
||||
<keyword>TIME</keyword> |
||||
<keyword>TIMESTAMP</keyword> |
||||
<keyword>TIMEZONE_HOUR</keyword> |
||||
<keyword>TIMEZONE_MINUTE</keyword> |
||||
<keyword>TO</keyword> |
||||
<keyword>TRAILING</keyword> |
||||
<keyword>TRANSLATION</keyword> |
||||
<keyword>TREAT</keyword> |
||||
<keyword>TRIGGER</keyword> |
||||
<keyword>TRUE</keyword> |
||||
<keyword>UESCAPE</keyword> |
||||
<keyword>UNION</keyword> |
||||
<keyword>UNIQUE</keyword> |
||||
<keyword>UNKNOWN</keyword> |
||||
<keyword>UNNEST</keyword> |
||||
<keyword>UPDATE</keyword> |
||||
<keyword>UPPER</keyword> |
||||
<keyword>USER</keyword> |
||||
<keyword>USING</keyword> |
||||
<keyword>VALUE</keyword> |
||||
<keyword>VALUES</keyword> |
||||
<keyword>VAR_POP</keyword> |
||||
<keyword>VAR_SAMP</keyword> |
||||
<keyword>VARCHAR</keyword> |
||||
<keyword>VARYING</keyword> |
||||
<keyword>WHEN</keyword> |
||||
<keyword>WHENEVER</keyword> |
||||
<keyword>WHERE</keyword> |
||||
<keyword>WIDTH_BUCKET</keyword> |
||||
<keyword>WINDOW</keyword> |
||||
<keyword>WITH</keyword> |
||||
<keyword>WITHIN</keyword> |
||||
<keyword>WITHOUT</keyword> |
||||
<keyword>YEAR</keyword> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<highlighters> |
||||
<highlighter type="oneline-comment">#</highlighter> |
||||
<highlighter type="string"> |
||||
<string>"</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="string"> |
||||
<string>'</string> |
||||
<escape>\</escape> |
||||
</highlighter> |
||||
<highlighter type="annotation"> |
||||
<start>@</start> |
||||
<valueStart>(</valueStart> |
||||
<valueEnd>)</valueEnd> |
||||
</highlighter> |
||||
<highlighter type="number"> |
||||
<point>.</point> |
||||
<exponent>e</exponent> |
||||
<suffix>f</suffix> |
||||
<suffix>d</suffix> |
||||
<suffix>l</suffix> |
||||
<ignoreCase /> |
||||
</highlighter> |
||||
<highlighter type="keywords"> |
||||
<keyword>true</keyword> |
||||
<keyword>false</keyword> |
||||
</highlighter> |
||||
<highlighter type="word"> |
||||
<word>{</word> |
||||
<word>}</word> |
||||
<word>,</word> |
||||
<word>[</word> |
||||
<word>]</word> |
||||
<style>keyword</style> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(---)$</pattern> |
||||
<style>comment</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
<highlighter type="regex"> |
||||
<pattern>^(.+?)(?==|:)</pattern> |
||||
<style>attribute</style> |
||||
<flags>MULTILINE</flags> |
||||
</highlighter> |
||||
</highlighters> |
@ -1,37 +0,0 @@
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env ruby |
||||
|
||||
base_dir = File.join(File.dirname(__FILE__),'../../..') |
||||
src_dir = File.join(base_dir, "/src/main/asciidoc") |
||||
require 'asciidoctor' |
||||
require 'optparse' |
||||
|
||||
options = {} |
||||
file = "#{src_dir}/README.adoc" |
||||
|
||||
OptionParser.new do |o| |
||||
o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' } |
||||
o.on('-h', '--help') { puts o; exit } |
||||
o.parse! |
||||
end |
||||
|
||||
file = ARGV[0] if ARGV.length>0 |
||||
|
||||
# Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/scripts/asciidoc-coalescer.rb |
||||
doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: options[:attributes] |
||||
header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a |
||||
header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k } |
||||
attrs = doc.attributes |
||||
attrs['allow-uri-read'] = true |
||||
puts attrs |
||||
|
||||
out = "// Do not edit this file (e.g. go instead to src/main/asciidoc)\n\n" |
||||
doc = Asciidoctor.load_file file, safe: :unsafe, parse: false, attributes: attrs |
||||
out << doc.reader.read |
||||
|
||||
unless options[:to_file] |
||||
puts out |
||||
else |
||||
File.open(options[:to_file],'w+') do |file| |
||||
file.write(out) |
||||
end |
||||
end |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
/* |
||||
code highlight CSS resemblign the Eclipse IDE default color schema |
||||
@author Costin Leau |
||||
*/ |
||||
|
||||
.hl-keyword { |
||||
color: #7F0055; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hl-comment { |
||||
color: #3F5F5F; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-multiline-comment { |
||||
color: #3F5FBF; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-tag { |
||||
color: #3F7F7F; |
||||
} |
||||
|
||||
.hl-attribute { |
||||
color: #7F007F; |
||||
} |
||||
|
||||
.hl-value { |
||||
color: #2A00FF; |
||||
} |
||||
|
||||
.hl-string { |
||||
color: #2A00FF; |
||||
} |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body.firstpage { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: none; |
||||
} |
@ -1,6 +0,0 @@
@@ -1,6 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
@ -1,344 +0,0 @@
@@ -1,344 +0,0 @@
|
||||
@IMPORT url("highlight.css"); |
||||
|
||||
html { |
||||
padding: 0pt; |
||||
margin: 0pt; |
||||
} |
||||
|
||||
body { |
||||
color: #333333; |
||||
margin: 15px 30px; |
||||
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif; |
||||
line-height: 1.6; |
||||
-webkit-font-smoothing: antialiased; |
||||
} |
||||
|
||||
code { |
||||
font-size: 16px; |
||||
font-family: Consolas, "Liberation Mono", Courier, monospace; |
||||
} |
||||
|
||||
:not(a)>code { |
||||
color: #6D180B; |
||||
} |
||||
|
||||
:not(pre)>code { |
||||
background-color: #F2F2F2; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 4px; |
||||
padding: 1px 3px 0; |
||||
text-shadow: none; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
body>*:first-child { |
||||
margin-top: 0 !important; |
||||
} |
||||
|
||||
div { |
||||
margin: 0pt; |
||||
} |
||||
|
||||
hr { |
||||
border: 1px solid #CCCCCC; |
||||
background: #CCCCCC; |
||||
} |
||||
|
||||
h1,h2,h3,h4,h5,h6 { |
||||
color: #000000; |
||||
cursor: text; |
||||
font-weight: bold; |
||||
margin: 30px 0 10px; |
||||
padding: 0; |
||||
} |
||||
|
||||
h1,h2,h3 { |
||||
margin: 40px 0 10px; |
||||
} |
||||
|
||||
h1 { |
||||
margin: 70px 0 30px; |
||||
padding-top: 20px; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: 1px dotted #CCCCCC; |
||||
} |
||||
|
||||
h1,h1 code { |
||||
font-size: 32px; |
||||
} |
||||
|
||||
h2,h2 code { |
||||
font-size: 24px; |
||||
} |
||||
|
||||
h3,h3 code { |
||||
font-size: 20px; |
||||
} |
||||
|
||||
h4,h1 code,h5,h5 code,h6,h6 code { |
||||
font-size: 18px; |
||||
} |
||||
|
||||
div.book,div.chapter,div.appendix,div.part,div.preface { |
||||
min-width: 300px; |
||||
max-width: 1200px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
p.releaseinfo { |
||||
font-weight: bold; |
||||
margin-bottom: 40px; |
||||
margin-top: 40px; |
||||
} |
||||
|
||||
div.authorgroup { |
||||
line-height: 1; |
||||
} |
||||
|
||||
p.copyright { |
||||
line-height: 1; |
||||
margin-bottom: -5px; |
||||
} |
||||
|
||||
.legalnotice p { |
||||
font-style: italic; |
||||
font-size: 14px; |
||||
line-height: 1; |
||||
} |
||||
|
||||
div.titlepage+p,div.titlepage+p { |
||||
margin-top: 0; |
||||
} |
||||
|
||||
pre { |
||||
line-height: 1.0; |
||||
color: black; |
||||
} |
||||
|
||||
a { |
||||
color: #4183C4; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
p { |
||||
margin: 15px 0; |
||||
text-align: left; |
||||
} |
||||
|
||||
ul,ol { |
||||
padding-left: 30px; |
||||
} |
||||
|
||||
li p { |
||||
margin: 0; |
||||
} |
||||
|
||||
div.table { |
||||
margin: 1em; |
||||
padding: 0.5em; |
||||
text-align: center; |
||||
} |
||||
|
||||
div.table table,div.informaltable table { |
||||
display: table; |
||||
width: 100%; |
||||
} |
||||
|
||||
div.table td { |
||||
padding-left: 7px; |
||||
padding-right: 7px; |
||||
} |
||||
|
||||
.sidebar { |
||||
line-height: 1.4; |
||||
padding: 0 20px; |
||||
background-color: #F8F8F8; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 3px 3px 3px 3px; |
||||
} |
||||
|
||||
.sidebar p.title { |
||||
color: #6D180B; |
||||
} |
||||
|
||||
pre.programlisting,pre.screen { |
||||
font-size: 15px; |
||||
padding: 6px 10px; |
||||
background-color: #F8F8F8; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 3px 3px 3px 3px; |
||||
clear: both; |
||||
overflow: auto; |
||||
line-height: 1.4; |
||||
font-family: Consolas, "Liberation Mono", Courier, monospace; |
||||
} |
||||
|
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
border: 1px solid #DDDDDD !important; |
||||
border-radius: 4px !important; |
||||
border-collapse: separate !important; |
||||
line-height: 1.6; |
||||
} |
||||
|
||||
table thead { |
||||
background: #F5F5F5; |
||||
} |
||||
|
||||
table tr { |
||||
border: none; |
||||
border-bottom: none; |
||||
} |
||||
|
||||
table th { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
table th,table td { |
||||
border: none !important; |
||||
padding: 6px 13px; |
||||
} |
||||
|
||||
table tr:nth-child(2n) { |
||||
background-color: #F8F8F8; |
||||
} |
||||
|
||||
td p { |
||||
margin: 0 0 15px 0; |
||||
} |
||||
|
||||
div.table-contents td p { |
||||
margin: 0; |
||||
} |
||||
|
||||
div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist * |
||||
{ |
||||
border: none !important; |
||||
background: none !important; |
||||
margin: 0; |
||||
} |
||||
|
||||
div.important p,div.note p,div.tip p,div.warning p { |
||||
color: #6F6F6F; |
||||
line-height: 1.6; |
||||
} |
||||
|
||||
div.important code,div.note code,div.tip code,div.warning code { |
||||
background-color: #F2F2F2 !important; |
||||
border: 1px solid #CCCCCC !important; |
||||
border-radius: 4px !important; |
||||
padding: 1px 3px 0 !important; |
||||
text-shadow: none !important; |
||||
white-space: nowrap !important; |
||||
} |
||||
|
||||
.note th,.tip th,.warning th { |
||||
display: none; |
||||
} |
||||
|
||||
.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td |
||||
{ |
||||
border-right: 1px solid #CCCCCC !important; |
||||
padding-top: 10px; |
||||
} |
||||
|
||||
div.calloutlist p,div.calloutlist td { |
||||
padding: 0; |
||||
margin: 0; |
||||
} |
||||
|
||||
div.calloutlist>table>tbody>tr>td:first-child { |
||||
padding-left: 10px; |
||||
width: 30px !important; |
||||
} |
||||
|
||||
div.important,div.note,div.tip,div.warning { |
||||
margin-left: 0px !important; |
||||
margin-right: 20px !important; |
||||
margin-top: 20px; |
||||
margin-bottom: 20px; |
||||
padding-top: 10px; |
||||
padding-bottom: 10px; |
||||
} |
||||
|
||||
div.toc { |
||||
line-height: 1.2; |
||||
} |
||||
|
||||
dl,dt { |
||||
margin-top: 1px; |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
div.toc>dl>dt { |
||||
font-size: 32px; |
||||
font-weight: bold; |
||||
margin: 30px 0 10px 0; |
||||
display: block; |
||||
} |
||||
|
||||
div.toc>dl>dd>dl>dt { |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
margin: 20px 0 10px 0; |
||||
display: block; |
||||
} |
||||
|
||||
div.toc>dl>dd>dl>dd>dl>dt { |
||||
font-weight: bold; |
||||
font-size: 20px; |
||||
margin: 10px 0 0 0; |
||||
} |
||||
|
||||
tbody.footnotes * { |
||||
border: none !important; |
||||
} |
||||
|
||||
div.footnote p { |
||||
margin: 0; |
||||
line-height: 1; |
||||
} |
||||
|
||||
div.footnote p sup { |
||||
margin-right: 6px; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
div.navheader { |
||||
border-bottom: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
div.navfooter { |
||||
border-top: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.title { |
||||
margin-left: -1em; |
||||
padding-left: 1em; |
||||
} |
||||
|
||||
.title>a { |
||||
position: absolute; |
||||
visibility: hidden; |
||||
display: block; |
||||
font-size: 0.85em; |
||||
margin-top: 0.05em; |
||||
margin-left: -1em; |
||||
vertical-align: text-top; |
||||
color: black; |
||||
} |
||||
|
||||
.title>a:before { |
||||
content: "\00A7"; |
||||
} |
||||
|
||||
.title:hover>a,.title>a:hover,.title:hover>a:hover { |
||||
visibility: visible; |
||||
} |
||||
|
||||
.title:focus>a,.title>a:focus,.title:focus>a:focus { |
||||
outline: 0; |
||||
} |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 178 KiB |
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_spring-cloud-feign.html" title="1. Declarative REST Client: Feign"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.0.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration |
||||
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Spring Cloud OpenFeign </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top"> 1. Declarative REST Client: Feign</td></tr></table></div></body></html> |
@ -1,199 +0,0 @@
@@ -1,199 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title>1. Declarative REST Client: Feign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_pr01.html" title=""></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1. Declarative REST Client: Feign</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1. Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1 How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code> |
||||
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> |
||||
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@EnableFeignClients</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) { |
||||
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args); |
||||
} |
||||
|
||||
}</pre><p><b>StoreClient.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient("stores")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/stores")</span></em> |
||||
List<Store> getStores(); |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</span></em> |
||||
Store update(<em><span class="hl-annotation" style="color: gray">@PathVariable("storeId")</span></em> Long storeId, Store store); |
||||
}</pre><p> |
||||
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is |
||||
an arbitrary client name, which is used to create a Ribbon load |
||||
balancer (see <a class="link" href="">below for details of Ribbon |
||||
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute |
||||
(absolute value or just a hostname). The name of the bean in the |
||||
application context is the fully qualified name of the interface. |
||||
To specify your own alias value you can use the <code class="literal">qualifier</code> value |
||||
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses |
||||
for the "stores" service. If your application is a Eureka client then |
||||
it will resolve the service in the Eureka service registry. If you |
||||
don’t want to use Eureka, you can simply configure a list of servers |
||||
in your external configuration (see |
||||
<a class="link" href="">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2 Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud’s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an |
||||
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "stores", configuration = FooConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "${feign.name}", url = "${feign.url}")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath. |
||||
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> whe using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection<RequestInterceptor></code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>); |
||||
} |
||||
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>: |
||||
- com.example.FooRequestInterceptor |
||||
- com.example.BarRequestInterceptor |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win. |
||||
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>, |
||||
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the |
||||
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3 Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not |
||||
possible using the methods above. In this case you can create Clients using the |
||||
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example |
||||
which creates two Feign Clients with the same interface but configures each one with |
||||
a separate request interceptor.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Import(FeignClientsConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient; |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController( |
||||
Decoder decoder, Encoder encoder, Client client, Contract contract) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
} |
||||
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration |
||||
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The |
||||
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of |
||||
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4 Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@Scope("prototype")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder(); |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped |
||||
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in |
||||
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5 Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>); |
||||
} |
||||
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Component</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory<HystrixClient> { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage()); |
||||
} |
||||
}; |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_literal_primary_literal" href="#_feign_and_literal_primary_literal"></a>1.6 Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn’t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", primary = false)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span> |
||||
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7 Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces. |
||||
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService { |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</span></em> |
||||
User getUser(<em><span class="hl-annotation" style="color: gray">@PathVariable("id")</span></em> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id); |
||||
}</pre><p> |
||||
</p><p><b>UserResource.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RestController</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><p><b>UserClient.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@FeignClient("users")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a |
||||
server and a client. It introduces tight coupling, and also actually |
||||
doesn’t work with Spring MVC in its current form (method parameter |
||||
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_request_response_compression" href="#_feign_request_response_compression"></a>1.8 Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your |
||||
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.request.mime-types=text/xml,application/xml,application/json |
||||
feign.compression.request.min-request-size=<span class="hl-number">2048</span></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9 Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p> |
||||
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
Logger.Level feignLoggerLevel() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL; |
||||
} |
||||
}</pre><pre class="literallayout"> OtherClass.someMethod(myprop.get()); |
||||
} |
||||
} |
||||
stripped). The proxy uses Ribbon to locate an instance to forward to |
||||
via discovery, and all requests are executed in a |
||||
<<hystrix-fallbacks-for-routes, hystrix command>>, so |
||||
failures will show up in Hystrix metrics, and once the circuit is open |
||||
the proxy will not try to contact the service.</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud OpenFeign</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-feign.html">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-feign.html#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_and_literal_primary_literal">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_request_response_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_logging">1.9. Feign logging</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
/* |
||||
code highlight CSS resemblign the Eclipse IDE default color schema |
||||
@author Costin Leau |
||||
*/ |
||||
|
||||
.hl-keyword { |
||||
color: #7F0055; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hl-comment { |
||||
color: #3F5F5F; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-multiline-comment { |
||||
color: #3F5FBF; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-tag { |
||||
color: #3F7F7F; |
||||
} |
||||
|
||||
.hl-attribute { |
||||
color: #7F007F; |
||||
} |
||||
|
||||
.hl-value { |
||||
color: #2A00FF; |
||||
} |
||||
|
||||
.hl-string { |
||||
color: #2A00FF; |
||||
} |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body.firstpage { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: none; |
||||
} |
@ -1,6 +0,0 @@
@@ -1,6 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
@ -1,344 +0,0 @@
@@ -1,344 +0,0 @@
|
||||
@IMPORT url("highlight.css"); |
||||
|
||||
html { |
||||
padding: 0pt; |
||||
margin: 0pt; |
||||
} |
||||
|
||||
body { |
||||
color: #333333; |
||||
margin: 15px 30px; |
||||
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif; |
||||
line-height: 1.6; |
||||
-webkit-font-smoothing: antialiased; |
||||
} |
||||
|
||||
code { |
||||
font-size: 16px; |
||||
font-family: Consolas, "Liberation Mono", Courier, monospace; |
||||
} |
||||
|
||||
:not(a)>code { |
||||
color: #6D180B; |
||||
} |
||||
|
||||
:not(pre)>code { |
||||
background-color: #F2F2F2; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 4px; |
||||
padding: 1px 3px 0; |
||||
text-shadow: none; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
body>*:first-child { |
||||
margin-top: 0 !important; |
||||
} |
||||
|
||||
div { |
||||
margin: 0pt; |
||||
} |
||||
|
||||
hr { |
||||
border: 1px solid #CCCCCC; |
||||
background: #CCCCCC; |
||||
} |
||||
|
||||
h1,h2,h3,h4,h5,h6 { |
||||
color: #000000; |
||||
cursor: text; |
||||
font-weight: bold; |
||||
margin: 30px 0 10px; |
||||
padding: 0; |
||||
} |
||||
|
||||
h1,h2,h3 { |
||||
margin: 40px 0 10px; |
||||
} |
||||
|
||||
h1 { |
||||
margin: 70px 0 30px; |
||||
padding-top: 20px; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: 1px dotted #CCCCCC; |
||||
} |
||||
|
||||
h1,h1 code { |
||||
font-size: 32px; |
||||
} |
||||
|
||||
h2,h2 code { |
||||
font-size: 24px; |
||||
} |
||||
|
||||
h3,h3 code { |
||||
font-size: 20px; |
||||
} |
||||
|
||||
h4,h1 code,h5,h5 code,h6,h6 code { |
||||
font-size: 18px; |
||||
} |
||||
|
||||
div.book,div.chapter,div.appendix,div.part,div.preface { |
||||
min-width: 300px; |
||||
max-width: 1200px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
p.releaseinfo { |
||||
font-weight: bold; |
||||
margin-bottom: 40px; |
||||
margin-top: 40px; |
||||
} |
||||
|
||||
div.authorgroup { |
||||
line-height: 1; |
||||
} |
||||
|
||||
p.copyright { |
||||
line-height: 1; |
||||
margin-bottom: -5px; |
||||
} |
||||
|
||||
.legalnotice p { |
||||
font-style: italic; |
||||
font-size: 14px; |
||||
line-height: 1; |
||||
} |
||||
|
||||
div.titlepage+p,div.titlepage+p { |
||||
margin-top: 0; |
||||
} |
||||
|
||||
pre { |
||||
line-height: 1.0; |
||||
color: black; |
||||
} |
||||
|
||||
a { |
||||
color: #4183C4; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
p { |
||||
margin: 15px 0; |
||||
text-align: left; |
||||
} |
||||
|
||||
ul,ol { |
||||
padding-left: 30px; |
||||
} |
||||
|
||||
li p { |
||||
margin: 0; |
||||
} |
||||
|
||||
div.table { |
||||
margin: 1em; |
||||
padding: 0.5em; |
||||
text-align: center; |
||||
} |
||||
|
||||
div.table table,div.informaltable table { |
||||
display: table; |
||||
width: 100%; |
||||
} |
||||
|
||||
div.table td { |
||||
padding-left: 7px; |
||||
padding-right: 7px; |
||||
} |
||||
|
||||
.sidebar { |
||||
line-height: 1.4; |
||||
padding: 0 20px; |
||||
background-color: #F8F8F8; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 3px 3px 3px 3px; |
||||
} |
||||
|
||||
.sidebar p.title { |
||||
color: #6D180B; |
||||
} |
||||
|
||||
pre.programlisting,pre.screen { |
||||
font-size: 15px; |
||||
padding: 6px 10px; |
||||
background-color: #F8F8F8; |
||||
border: 1px solid #CCCCCC; |
||||
border-radius: 3px 3px 3px 3px; |
||||
clear: both; |
||||
overflow: auto; |
||||
line-height: 1.4; |
||||
font-family: Consolas, "Liberation Mono", Courier, monospace; |
||||
} |
||||
|
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
border: 1px solid #DDDDDD !important; |
||||
border-radius: 4px !important; |
||||
border-collapse: separate !important; |
||||
line-height: 1.6; |
||||
} |
||||
|
||||
table thead { |
||||
background: #F5F5F5; |
||||
} |
||||
|
||||
table tr { |
||||
border: none; |
||||
border-bottom: none; |
||||
} |
||||
|
||||
table th { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
table th,table td { |
||||
border: none !important; |
||||
padding: 6px 13px; |
||||
} |
||||
|
||||
table tr:nth-child(2n) { |
||||
background-color: #F8F8F8; |
||||
} |
||||
|
||||
td p { |
||||
margin: 0 0 15px 0; |
||||
} |
||||
|
||||
div.table-contents td p { |
||||
margin: 0; |
||||
} |
||||
|
||||
div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist * |
||||
{ |
||||
border: none !important; |
||||
background: none !important; |
||||
margin: 0; |
||||
} |
||||
|
||||
div.important p,div.note p,div.tip p,div.warning p { |
||||
color: #6F6F6F; |
||||
line-height: 1.6; |
||||
} |
||||
|
||||
div.important code,div.note code,div.tip code,div.warning code { |
||||
background-color: #F2F2F2 !important; |
||||
border: 1px solid #CCCCCC !important; |
||||
border-radius: 4px !important; |
||||
padding: 1px 3px 0 !important; |
||||
text-shadow: none !important; |
||||
white-space: nowrap !important; |
||||
} |
||||
|
||||
.note th,.tip th,.warning th { |
||||
display: none; |
||||
} |
||||
|
||||
.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td |
||||
{ |
||||
border-right: 1px solid #CCCCCC !important; |
||||
padding-top: 10px; |
||||
} |
||||
|
||||
div.calloutlist p,div.calloutlist td { |
||||
padding: 0; |
||||
margin: 0; |
||||
} |
||||
|
||||
div.calloutlist>table>tbody>tr>td:first-child { |
||||
padding-left: 10px; |
||||
width: 30px !important; |
||||
} |
||||
|
||||
div.important,div.note,div.tip,div.warning { |
||||
margin-left: 0px !important; |
||||
margin-right: 20px !important; |
||||
margin-top: 20px; |
||||
margin-bottom: 20px; |
||||
padding-top: 10px; |
||||
padding-bottom: 10px; |
||||
} |
||||
|
||||
div.toc { |
||||
line-height: 1.2; |
||||
} |
||||
|
||||
dl,dt { |
||||
margin-top: 1px; |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
div.toc>dl>dt { |
||||
font-size: 32px; |
||||
font-weight: bold; |
||||
margin: 30px 0 10px 0; |
||||
display: block; |
||||
} |
||||
|
||||
div.toc>dl>dd>dl>dt { |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
margin: 20px 0 10px 0; |
||||
display: block; |
||||
} |
||||
|
||||
div.toc>dl>dd>dl>dd>dl>dt { |
||||
font-weight: bold; |
||||
font-size: 20px; |
||||
margin: 10px 0 0 0; |
||||
} |
||||
|
||||
tbody.footnotes * { |
||||
border: none !important; |
||||
} |
||||
|
||||
div.footnote p { |
||||
margin: 0; |
||||
line-height: 1; |
||||
} |
||||
|
||||
div.footnote p sup { |
||||
margin-right: 6px; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
div.navheader { |
||||
border-bottom: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
div.navfooter { |
||||
border-top: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.title { |
||||
margin-left: -1em; |
||||
padding-left: 1em; |
||||
} |
||||
|
||||
.title>a { |
||||
position: absolute; |
||||
visibility: hidden; |
||||
display: block; |
||||
font-size: 0.85em; |
||||
margin-top: 0.05em; |
||||
margin-left: -1em; |
||||
vertical-align: text-top; |
||||
color: black; |
||||
} |
||||
|
||||
.title>a:before { |
||||
content: "\00A7"; |
||||
} |
||||
|
||||
.title:hover>a,.title>a:hover,.title:hover>a:hover { |
||||
visibility: visible; |
||||
} |
||||
|
||||
.title:focus>a,.title>a:focus,.title:focus>a:focus { |
||||
outline: 0; |
||||
} |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 178 KiB |
@ -1,200 +0,0 @@
@@ -1,200 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#spring-cloud-feign">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="#_feign_and_literal_primary_literal">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="#_feign_request_response_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="#_feign_logging">1.9. Feign logging</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.0.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration |
||||
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1. Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1 How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code> |
||||
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> |
||||
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@EnableFeignClients</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) { |
||||
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args); |
||||
} |
||||
|
||||
}</pre><p><b>StoreClient.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient("stores")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/stores")</span></em> |
||||
List<Store> getStores(); |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</span></em> |
||||
Store update(<em><span class="hl-annotation" style="color: gray">@PathVariable("storeId")</span></em> Long storeId, Store store); |
||||
}</pre><p> |
||||
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is |
||||
an arbitrary client name, which is used to create a Ribbon load |
||||
balancer (see <a class="link" href="#">below for details of Ribbon |
||||
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute |
||||
(absolute value or just a hostname). The name of the bean in the |
||||
application context is the fully qualified name of the interface. |
||||
To specify your own alias value you can use the <code class="literal">qualifier</code> value |
||||
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses |
||||
for the "stores" service. If your application is a Eureka client then |
||||
it will resolve the service in the Eureka service registry. If you |
||||
don’t want to use Eureka, you can simply configure a list of servers |
||||
in your external configuration (see |
||||
<a class="link" href="#">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2 Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud’s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an |
||||
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "stores", configuration = FooConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "${feign.name}", url = "${feign.url}")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath. |
||||
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> whe using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection<RequestInterceptor></code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>); |
||||
} |
||||
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>: |
||||
- com.example.FooRequestInterceptor |
||||
- com.example.BarRequestInterceptor |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win. |
||||
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>, |
||||
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the |
||||
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3 Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not |
||||
possible using the methods above. In this case you can create Clients using the |
||||
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example |
||||
which creates two Feign Clients with the same interface but configures each one with |
||||
a separate request interceptor.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Import(FeignClientsConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient; |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController( |
||||
Decoder decoder, Encoder encoder, Client client, Contract contract) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
} |
||||
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration |
||||
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The |
||||
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of |
||||
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4 Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@Scope("prototype")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder(); |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped |
||||
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in |
||||
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5 Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>); |
||||
} |
||||
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Component</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory<HystrixClient> { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage()); |
||||
} |
||||
}; |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_literal_primary_literal" href="#_feign_and_literal_primary_literal"></a>1.6 Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn’t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", primary = false)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span> |
||||
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7 Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces. |
||||
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService { |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</span></em> |
||||
User getUser(<em><span class="hl-annotation" style="color: gray">@PathVariable("id")</span></em> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id); |
||||
}</pre><p> |
||||
</p><p><b>UserResource.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RestController</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><p><b>UserClient.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@FeignClient("users")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a |
||||
server and a client. It introduces tight coupling, and also actually |
||||
doesn’t work with Spring MVC in its current form (method parameter |
||||
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_request_response_compression" href="#_feign_request_response_compression"></a>1.8 Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your |
||||
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.request.mime-types=text/xml,application/xml,application/json |
||||
feign.compression.request.min-request-size=<span class="hl-number">2048</span></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9 Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p> |
||||
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
Logger.Level feignLoggerLevel() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL; |
||||
} |
||||
}</pre><pre class="literallayout"> OtherClass.someMethod(myprop.get()); |
||||
} |
||||
} |
||||
stripped). The proxy uses Ribbon to locate an instance to forward to |
||||
via discovery, and all requests are executed in a |
||||
<<hystrix-fallbacks-for-routes, hystrix command>>, so |
||||
failures will show up in Hystrix metrics, and once the circuit is open |
||||
the proxy will not try to contact the service.</pre></div></div></div></body></html> |
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_spring-cloud-feign.html" title="1. Declarative REST Client: Feign"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.0.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration |
||||
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Spring Cloud OpenFeign </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top"> 1. Declarative REST Client: Feign</td></tr></table></div></body></html> |
@ -1,199 +0,0 @@
@@ -1,199 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title>1. Declarative REST Client: Feign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_pr01.html" title=""></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1. Declarative REST Client: Feign</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1. Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1 How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code> |
||||
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> |
||||
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@EnableFeignClients</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) { |
||||
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args); |
||||
} |
||||
|
||||
}</pre><p><b>StoreClient.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient("stores")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/stores")</span></em> |
||||
List<Store> getStores(); |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</span></em> |
||||
Store update(<em><span class="hl-annotation" style="color: gray">@PathVariable("storeId")</span></em> Long storeId, Store store); |
||||
}</pre><p> |
||||
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is |
||||
an arbitrary client name, which is used to create a Ribbon load |
||||
balancer (see <a class="link" href="">below for details of Ribbon |
||||
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute |
||||
(absolute value or just a hostname). The name of the bean in the |
||||
application context is the fully qualified name of the interface. |
||||
To specify your own alias value you can use the <code class="literal">qualifier</code> value |
||||
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses |
||||
for the "stores" service. If your application is a Eureka client then |
||||
it will resolve the service in the Eureka service registry. If you |
||||
don’t want to use Eureka, you can simply configure a list of servers |
||||
in your external configuration (see |
||||
<a class="link" href="">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2 Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud’s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an |
||||
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "stores", configuration = FooConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "${feign.name}", url = "${feign.url}")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath. |
||||
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> whe using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection<RequestInterceptor></code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>); |
||||
} |
||||
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>: |
||||
- com.example.FooRequestInterceptor |
||||
- com.example.BarRequestInterceptor |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win. |
||||
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>, |
||||
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the |
||||
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3 Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not |
||||
possible using the methods above. In this case you can create Clients using the |
||||
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example |
||||
which creates two Feign Clients with the same interface but configures each one with |
||||
a separate request interceptor.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Import(FeignClientsConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient; |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController( |
||||
Decoder decoder, Encoder encoder, Client client, Contract contract) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
} |
||||
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration |
||||
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The |
||||
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of |
||||
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4 Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@Scope("prototype")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder(); |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped |
||||
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in |
||||
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5 Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>); |
||||
} |
||||
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Component</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory<HystrixClient> { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage()); |
||||
} |
||||
}; |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_literal_primary_literal" href="#_feign_and_literal_primary_literal"></a>1.6 Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn’t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", primary = false)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span> |
||||
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7 Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces. |
||||
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService { |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</span></em> |
||||
User getUser(<em><span class="hl-annotation" style="color: gray">@PathVariable("id")</span></em> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id); |
||||
}</pre><p> |
||||
</p><p><b>UserResource.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RestController</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><p><b>UserClient.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@FeignClient("users")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a |
||||
server and a client. It introduces tight coupling, and also actually |
||||
doesn’t work with Spring MVC in its current form (method parameter |
||||
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_request_response_compression" href="#_feign_request_response_compression"></a>1.8 Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your |
||||
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.request.mime-types=text/xml,application/xml,application/json |
||||
feign.compression.request.min-request-size=<span class="hl-number">2048</span></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9 Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p> |
||||
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
Logger.Level feignLoggerLevel() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL; |
||||
} |
||||
}</pre><pre class="literallayout"> OtherClass.someMethod(myprop.get()); |
||||
} |
||||
} |
||||
stripped). The proxy uses Ribbon to locate an instance to forward to |
||||
via discovery, and all requests are executed in a |
||||
<<hystrix-fallbacks-for-routes, hystrix command>>, so |
||||
failures will show up in Hystrix metrics, and once the circuit is open |
||||
the proxy will not try to contact the service.</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud OpenFeign</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-feign.html">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-feign.html#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_and_literal_primary_literal">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_request_response_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_logging">1.9. Feign logging</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> |
@ -1,200 +0,0 @@
@@ -1,200 +0,0 @@
|
||||
<html><head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
||||
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#spring-cloud-feign">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="#_feign_and_literal_primary_literal">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="#_feign_request_response_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="#_feign_logging">1.9. Feign logging</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.0.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration |
||||
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1. Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1 How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code> |
||||
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> |
||||
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@EnableFeignClients</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) { |
||||
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args); |
||||
} |
||||
|
||||
}</pre><p><b>StoreClient.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient("stores")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/stores")</span></em> |
||||
List<Store> getStores(); |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</span></em> |
||||
Store update(<em><span class="hl-annotation" style="color: gray">@PathVariable("storeId")</span></em> Long storeId, Store store); |
||||
}</pre><p> |
||||
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is |
||||
an arbitrary client name, which is used to create a Ribbon load |
||||
balancer (see <a class="link" href="#">below for details of Ribbon |
||||
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute |
||||
(absolute value or just a hostname). The name of the bean in the |
||||
application context is the fully qualified name of the interface. |
||||
To specify your own alias value you can use the <code class="literal">qualifier</code> value |
||||
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses |
||||
for the "stores" service. If your application is a Eureka client then |
||||
it will resolve the service in the Eureka service registry. If you |
||||
don’t want to use Eureka, you can simply configure a list of servers |
||||
in your external configuration (see |
||||
<a class="link" href="#">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2 Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud’s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an |
||||
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "stores", configuration = FooConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "${feign.name}", url = "${feign.url}")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span> |
||||
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath. |
||||
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> whe using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection<RequestInterceptor></code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>); |
||||
} |
||||
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>: |
||||
- com.example.FooRequestInterceptor |
||||
- com.example.BarRequestInterceptor |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win. |
||||
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>, |
||||
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the |
||||
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span> |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>: |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3 Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not |
||||
possible using the methods above. In this case you can create Clients using the |
||||
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example |
||||
which creates two Feign Clients with the same interface but configures each one with |
||||
a separate request interceptor.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Import(FeignClientsConfiguration.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController { |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient; |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController( |
||||
Decoder decoder, Encoder encoder, Client client, Contract contract) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client) |
||||
.encoder(encoder) |
||||
.decoder(decoder) |
||||
.contract(contract) |
||||
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>)) |
||||
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>); |
||||
} |
||||
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration |
||||
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The |
||||
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of |
||||
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4 Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
<em><span class="hl-annotation" style="color: gray">@Scope("prototype")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder(); |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped |
||||
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in |
||||
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5 Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>); |
||||
} |
||||
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient { |
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em> |
||||
Hello iFailSometimes(); |
||||
} |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@Component</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory<HystrixClient> { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() { |
||||
<em><span class="hl-annotation" style="color: gray">@Override</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage()); |
||||
} |
||||
}; |
||||
} |
||||
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_literal_primary_literal" href="#_feign_and_literal_primary_literal"></a>1.6 Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn’t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", primary = false)</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span> |
||||
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7 Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces. |
||||
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService { |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</span></em> |
||||
User getUser(<em><span class="hl-annotation" style="color: gray">@PathVariable("id")</span></em> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id); |
||||
}</pre><p> |
||||
</p><p><b>UserResource.java. </b> |
||||
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RestController</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><p><b>UserClient.java. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user; |
||||
|
||||
<em><span class="hl-annotation" style="color: gray">@FeignClient("users")</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService { |
||||
|
||||
}</pre><p> |
||||
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a |
||||
server and a client. It introduces tight coupling, and also actually |
||||
doesn’t work with Spring MVC in its current form (method parameter |
||||
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_request_response_compression" href="#_feign_request_response_compression"></a>1.8 Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your |
||||
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true |
||||
feign.compression.request.mime-types=text/xml,application/xml,application/json |
||||
feign.compression.request.min-request-size=<span class="hl-number">2048</span></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9 Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml. </b> |
||||
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p> |
||||
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em> |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration { |
||||
<em><span class="hl-annotation" style="color: gray">@Bean</span></em> |
||||
Logger.Level feignLoggerLevel() { |
||||
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL; |
||||
} |
||||
}</pre><pre class="literallayout"> OtherClass.someMethod(myprop.get()); |
||||
} |
||||
} |
||||
stripped). The proxy uses Ribbon to locate an instance to forward to |
||||
via discovery, and all requests are executed in a |
||||
<<hystrix-fallbacks-for-routes, hystrix command>>, so |
||||
failures will show up in Hystrix metrics, and once the circuit is open |
||||
the proxy will not try to contact the service.</pre></div></div></div></body></html> |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
/* |
||||
code highlight CSS resemblign the Eclipse IDE default color schema |
||||
@author Costin Leau |
||||
*/ |
||||
|
||||
.hl-keyword { |
||||
color: #7F0055; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hl-comment { |
||||
color: #3F5F5F; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-multiline-comment { |
||||
color: #3F5FBF; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hl-tag { |
||||
color: #3F7F7F; |
||||
} |
||||
|
||||
.hl-attribute { |
||||
color: #7F007F; |
||||
} |
||||
|
||||
.hl-value { |
||||
color: #2A00FF; |
||||
} |
||||
|
||||
.hl-string { |
||||
color: #2A00FF; |
||||
} |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body.firstpage { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|
||||
div.part h1 { |
||||
border-top: none; |
||||
} |
@ -1,6 +0,0 @@
@@ -1,6 +0,0 @@
|
||||
@IMPORT url("manual.css"); |
||||
|
||||
body { |
||||
background: url("../images/background.png") no-repeat center top; |
||||
} |
||||
|