Add Gemfire Samples and Migrate to Spring Cloud Dataflow Doc Framework
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.DS_Store
|
||||
target/
|
||||
|
||||
38
README.adoc
@@ -1,37 +1,9 @@
|
||||
# Spring Cloud Data Flow Samples
|
||||
|
||||
This repository provides sample starter applications and code for use with the Spring Cloud Data Flow project. The following samples are available:
|
||||
This repository provides various developer tutorials and samples for building data pipelines with Spring Cloud Data Flow. The samples are included in a document available in HTML and PDF.
|
||||
|
||||
## Streaming
|
||||
To build the documents
|
||||
|
||||
### link:streaming/http-to-cassandra/README.adoc[http-cassandra]
|
||||
|
||||
A data pipeline demonstration that consumes data from an `http` endpoint and writes the payload to Cassandra database using the `cassandra` sink application.
|
||||
|
||||
### link:streaming/http-to-mysql/README.adoc[http-mysql]
|
||||
|
||||
A data pipeline demonstration that consumes data from an `http` endpoint and writes the payload to MySQL database using the `jdbc` sink application.
|
||||
|
||||
## Task / Batch
|
||||
|
||||
### link:tasks/simple-batch-job/README.adoc[simple-batch-job]
|
||||
|
||||
A simple Spring Batch job running as short-lived task in Cloud Foundry.
|
||||
|
||||
## Functions
|
||||
|
||||
### link:functions/README.adoc[functions-in-scdf]
|
||||
|
||||
A simple demonstration of Spring Cloud Function and Spring Cloud Data Flow integration.
|
||||
|
||||
## Analytics
|
||||
|
||||
### link:analytics/twitter-analytics/README.adoc[twitter-analytics]
|
||||
|
||||
A data pipeline demonstration that consumes data from twitter-firehose using `twitterstream` source application and computes simple analytics over data-in-transit with the help of `field-value-counter` sink application.
|
||||
|
||||
## Data Science
|
||||
|
||||
### link:datascience/species-prediction/README.adoc[species-prediction]
|
||||
|
||||
A simple demonstration to walkthrough the steps to compute real-time predictions using https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language[PMML] application.
|
||||
```
|
||||
$mvn package
|
||||
```
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
# Custom Spring Cloud Stream Processor
|
||||
=======================================
|
||||
|
||||
### Creating the project
|
||||
|
||||
Today we're going to talk about how to create a custom Spring Cloud Stream application and running it on Spring Cloud Data Flow.
|
||||
We're going to go through all the steps for making a simple processor that will allow you to convert temperature from Fahrenheit to Celsius.
|
||||
We will be running the demo locally, but all the steps will work in a Cloud Foundry environment as well.
|
||||
The first step is to create a new spring cloud stream project.
|
||||
We can do that by going to http://start.spring.io/, which is the spring initializer.
|
||||
|
||||
Choose the group as `demo.celsius.converter` and enter artifact name as celsius-converter-processor.
|
||||
Next, we need to choose a message transport binding as a dependency for the custom app.
|
||||
There are options for choosing ***rabbitmq*** or ***kafka*** as the message transport.
|
||||
For this demo, we choose rabbit by typing rabbit in the search bar under "Search for dependencies" and then selecting "stream rabbit".
|
||||
|
||||
Hit the generate project button and then open the new project in an IDE of your choice.
|
||||
|
||||
### Developing the app
|
||||
|
||||
Now we're at a point where we can actually create our custom app. In our Spring Cloud Stream application, the minimum configuration is going to require two Java class files.
|
||||
* CelsiusConverterProcessorAplication.java
|
||||
* CelsiusConverterProcessorConfiguration.java
|
||||
|
||||
Spring Cloud Stream applications are stand alone spring boot applications that can be run on their own.
|
||||
Spring Cloud Data Flow is the orchestration layer that ties these individual Spring Cloud Stream apps together.
|
||||
|
||||
Since we named the project as celsius-converter-processor, the initializer created a class called CelsiusConverterProcessorAplication.
|
||||
We are creating a transformer that takes a Fahrenheit input and converts it to Celsius.
|
||||
We want to follow the same naming convention as the application file, so create a new file in the same directory called `CelsiusConverterProcessorConfiguration.java`.
|
||||
|
||||
##### CelsiusConverterProcessorConfiguration.java
|
||||
```
|
||||
@EnableBinding(Processor.class)
|
||||
public class CelsiusConverterProcessorConfiguration {
|
||||
|
||||
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
|
||||
public int convertToCelsius(String payload) {
|
||||
int fahrenheitTemperature = Integer.parseInt(payload);
|
||||
return (farenheitTemperature-30)/2;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
There are two important spring annotations that we introduced in the above code.
|
||||
First we annotated the class with **@EnableBinding(Processor.class)**.
|
||||
Second we created a method and annotated it with ***@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)***.
|
||||
By adding these two annotations we are basically classifying this stream app as a Processor(as opposed to a source or a sink).
|
||||
This allows us to specify that the application is receiving input from upstream(Processor.input) and send the output data downstream(Processor.OUTPUT).
|
||||
|
||||
The convertToCelsius method takes a `String` as input for Fahrenheit and then returns the converted Celsius as an integer.
|
||||
This method is very simple, but that is also the beauty of this programming style.
|
||||
We can add as much logic as we want to this method to enrich this processor.
|
||||
As long as we annotate it properly and return valid output, it works as a proper Spring Cloud Stream processor.
|
||||
|
||||
Once we're done putting together the app, move into the origin of the project directory and build a deployable jar with Maven, possibly on the command line.
|
||||
```
|
||||
cd <PATH/TO/PROJECT>
|
||||
mvn clean install
|
||||
|
||||
Make sure you have a running instance of RabbitMQ https://www.rabbitmq.com/
|
||||
|
||||
java -jar target/celsius-converter-processor-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
If all goes well, we should have a running standalone Spring Boot Application.
|
||||
Once we verify that the app is started and running without any errors, we can stop it.
|
||||
|
||||
## Deploying Locally on Spring Cloud Data Flow
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
In order to get started, make sure that you have the following components:
|
||||
|
||||
* Local build of https://github.com/spring-cloud/spring-cloud-dataflow [Spring Cloud Data Flow]
|
||||
* Running instance of RabbitMQ https://www.rabbitmq.com/
|
||||
|
||||
|
||||
Launch the locally built `server`
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-server-local/target/spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
```
|
||||
|
||||
Connect to Spring Cloud Data Flow's `shell`
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
|
||||
[Register](https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app) RabbitMQ binder variant of out-of-the-box applications
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
|
||||
```
|
||||
app register --type processor --name convertToCelsius --uri <File URL of the jar file on the local filesystem where you built the project above> --force
|
||||
```
|
||||
|
||||
Create the stream.
|
||||
We want to create a stream that uses the out of the box apps `http` and `log` and then connect them with our custom celsius converter app.
|
||||
|
||||
```
|
||||
dataflow:>stream create --name convertToCelsiusStream --definition "http --port=9090 | convertToCelsius | log" --deploy
|
||||
|
||||
Created and deployed new stream 'convertToCelsiusStream'
|
||||
```
|
||||
|
||||
Verify the stream is successfully deployed
|
||||
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
|
||||
Verify that the apps have successfully deployed
|
||||
|
||||
```
|
||||
dataflow:>runtime apps
|
||||
```
|
||||
|
||||
Since we are running locally, note the file location of the logs.
|
||||
|
||||
|
||||
```
|
||||
2016-09-27 10:03:11.988 INFO 95234 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalAppDeployer : deploying app convertToCelsiusStream.log instance 0
|
||||
Logs will be in /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-3236898888473815319/convertToCelsiusStream-1474984991968/convertToCelsiusStream.log
|
||||
2016-09-27 10:03:12.397 INFO 95234 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalAppDeployer : deploying app convertToCelsiusStream.convertToCelsius instance 0
|
||||
Logs will be in /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-3236898888473815319/convertToCelsiusStream-1474984992392/convertToCelsiusStream.convertToCelsius
|
||||
2016-09-27 10:03:14.445 INFO 95234 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalAppDeployer : deploying app convertToCelsiusStream.http instance 0
|
||||
Logs will be in /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-3236898888473815319/convertToCelsiusStream-1474984994440/convertToCelsiusStream.http
|
||||
```
|
||||
|
||||
Post sample data pointing to the `http` endpoint: `http://localhost:9090` [`9090` is the `server.port` we specified for the `http` source in this case]
|
||||
|
||||
|
||||
```
|
||||
dataflow:>http post --target http://localhost:9090 --data 76
|
||||
> POST (text/plain;Charset=UTF-8) http://localhost:9090 76
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
|
||||
Open the log file for the convertToCelsiusStream.log app to see the output of our stream
|
||||
```
|
||||
tail -f /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-7563139704229890655/convertToCelsiusStream-1474990317406/convertToCelsiusStream.log/stdout_0.log
|
||||
```
|
||||
You should see the temperature you posted converted to Celsius!
|
||||
```
|
||||
2016-09-27 10:05:34.933 INFO 95616 --- [CelsiusStream-1] log.sink : 23
|
||||
```
|
||||
|
||||
In conclusion, we created a simple Spring Cloud Stream processor that converts the incoming Fahrenheit temperature data to Celsius.
|
||||
We ran it first as a standalone Spring Boot microservice application and then took the same app to Spring Cloud Data Flow to orchestrate it to be part of a stream that contains other apps.
|
||||
315
pom.xml
Normal file
@@ -0,0 +1,315 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>spring-cloud-dataflow-samples</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
|
||||
<description>Spring Cloud Data Flow Samples</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<spring-cloud-dataflow.version>1.2.3.RELEASE</spring-cloud-dataflow.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<version>1.5.3</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctorj-pdf</artifactId>
|
||||
<version>1.5.0-alpha.11</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<sourceDocumentName>index.adoc</sourceDocumentName>
|
||||
<doctype>book</doctype>
|
||||
<attributes>
|
||||
<allow-uri-read>true</allow-uri-read>
|
||||
<attribute-missing>warn</attribute-missing>
|
||||
<project-version>${project.version}</project-version>
|
||||
<project-artifactId>${project.artifactId}</project-artifactId>
|
||||
<version-type-lowercase>${version-type-lowercase}</version-type-lowercase>
|
||||
<dataflow-project-version>${spring-cloud-dataflow.version}</dataflow-project-version>
|
||||
<dataflow-version-type-lowercase>${dataflow-version-type-lowercase}</dataflow-version-type-lowercase>
|
||||
<dataflow-branch-or-tag>${dataflow-branch-or-tag}</dataflow-branch-or-tag>
|
||||
<dataflow-asciidoc>https://raw.githubusercontent.com/spring-cloud/spring-cloud-dataflow/${dataflow-branch-or-tag}/spring-cloud-dataflow-docs/src/main/asciidoc</dataflow-asciidoc>
|
||||
|
||||
<!-- The following two are deps of this project and set automatically.-->
|
||||
<!-- Others are loose dependencies, and current-SNAPSHOT typically make sense-->
|
||||
<scdf-core-version>${org.springframework.cloud:spring-cloud-dataflow-core:jar.version}</scdf-core-version>
|
||||
<sct-core-version>${org.springframework.cloud:spring-cloud-task-core:jar.version}</sct-core-version>
|
||||
<scdt-core-version>current-SNAPSHOT</scdt-core-version>
|
||||
<scst-core-version>current-SNAPSHOT</scst-core-version>
|
||||
<scst-starters-core-version>current-SNAPSHOT</scst-starters-core-version>
|
||||
<sct-starters-core-version>current-SNAPSHOT</sct-starters-core-version>
|
||||
|
||||
</attributes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-docbook</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>docbook5</backend>
|
||||
<attributes>
|
||||
<docinfo>true</docinfo>
|
||||
</attributes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generate-html5</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>html5</backend>
|
||||
<attributes>
|
||||
<toc2 />
|
||||
</attributes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.agilejava.docbkx</groupId>
|
||||
<artifactId>docbkx-maven-plugin</artifactId>
|
||||
<version>2.0.15</version>
|
||||
<configuration>
|
||||
<sourceDirectory>${basedir}/target/generated-docs</sourceDirectory>
|
||||
<imgSrcPath />
|
||||
<graphicsize.extension>0</graphicsize.extension>
|
||||
<includes>index.xml</includes>
|
||||
<xincludeSupported>true</xincludeSupported>
|
||||
<chunkedOutput>false</chunkedOutput>
|
||||
<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl</foCustomization>
|
||||
<useExtensions>1</useExtensions>
|
||||
<admonGraphics>1</admonGraphics>
|
||||
|
||||
<highlightSource>1</highlightSource>
|
||||
<highlightXslthlConfig>${basedir}/src/main/docbook/xsl/xslthl-config.xml</highlightXslthlConfig>
|
||||
<preProcess>
|
||||
<copy todir="${basedir}/target/generated-docs/images">
|
||||
<fileset dir="${basedir}/src/main/docbook/images" />
|
||||
</copy>
|
||||
</preProcess>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sf.xslthl</groupId>
|
||||
<artifactId>xslthl</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.docbook</groupId>
|
||||
<artifactId>docbook-xml</artifactId>
|
||||
<version>5.0-all</version>
|
||||
<classifier>resources</classifier>
|
||||
<type>zip</type>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>html</id>
|
||||
<goals>
|
||||
<goal>generate-html</goal>
|
||||
</goals>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<htmlCustomization>${basedir}/src/main/docbook/xsl/html-multipage.xsl</htmlCustomization>
|
||||
<targetDirectory>${basedir}/target/docbook/html</targetDirectory>
|
||||
<chunkedOutput>true</chunkedOutput>
|
||||
<postProcess>
|
||||
<copy todir="${basedir}/target/contents/reference/html">
|
||||
<fileset dir="${basedir}/target/docbook/html">
|
||||
<include name="**/*.html" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${basedir}/target/contents/reference/html/images">
|
||||
<fileset dir="${basedir}/target/generated-docs/images">
|
||||
<exclude name="PLACE_IMAGES_HERE" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${basedir}/target/contents/reference/html/css">
|
||||
<fileset dir="${basedir}/src/main/docbook/css" />
|
||||
</copy>
|
||||
</postProcess>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- <execution>
|
||||
<id>pdf</id>
|
||||
<goals>
|
||||
<goal>generate-pdf</goal>
|
||||
</goals>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl</foCustomization>
|
||||
<targetDirectory>${basedir}/target/docbook/pdf</targetDirectory>
|
||||
<postProcess>
|
||||
<copy todir="${basedir}/target/contents/reference">
|
||||
<fileset dir="${basedir}/target/docbook">
|
||||
<include name="**/*.pdf" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<move file="${basedir}/target/contents/reference/pdf/index.pdf" tofile="${basedir}/target/contents/reference/pdf/spring-cloud-dataflow-samples.pdf" />
|
||||
</postProcess>
|
||||
</configuration>
|
||||
</execution> -->
|
||||
|
||||
<!-- <execution>
|
||||
<id>epub</id>
|
||||
<goals>
|
||||
<goal>generate-epub3</goal>
|
||||
</goals>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<epubCustomization>${basedir}/src/main/docbook/xsl/epub.xsl</epubCustomization>
|
||||
<targetDirectory>${basedir}/target/docbook/epub</targetDirectory>
|
||||
<preProcess>
|
||||
<copy todir="${basedir}/target/docbook/epub/images">
|
||||
<fileset dir="${basedir}/src/main/docbook/images" />
|
||||
<fileset dir="${basedir}/src/main/asciidoc/images">
|
||||
<exclude name="PLACE_IMAGES_HERE" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</preProcess>
|
||||
<postProcess>
|
||||
<copy todir="${basedir}/target/contents/reference/epub">
|
||||
<fileset dir="${basedir}/target/docbook">
|
||||
<include name="**/*.epub" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<move file="${basedir}/target/contents/reference/epub/index.epub" tofile="${basedir}/target/contents/reference/epub/spring-cloud-dataflow-samples.epub" />
|
||||
</postProcess>
|
||||
</configuration>
|
||||
</execution> -->
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.radai</groupId>
|
||||
<artifactId>grep-maven-plugin</artifactId>
|
||||
<version>1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>grep</goal>
|
||||
</goals>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<greps>
|
||||
<grep>
|
||||
<file>target/generated-docs/index.html</file>
|
||||
<grepPattern>Unresolved directive in .*\.adoc - include::</grepPattern>
|
||||
<failIfFound>true</failIfFound>
|
||||
</grep>
|
||||
</greps>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ant-contrib</groupId>
|
||||
<artifactId>ant-contrib</artifactId>
|
||||
<version>1.0b3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant-nodeps</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.tigris.antelope</groupId>
|
||||
<artifactId>antelopetasks</artifactId>
|
||||
<version>3.2.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>package-and-attach-docs-zip</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.zip">
|
||||
|
||||
<fileset dir="${project.build.directory}/contents" />
|
||||
<zipfileset dir="${project.build.directory}/generated-docs" prefix="reference/htmlsingle">
|
||||
<include name="index.html" />
|
||||
<include name="images/**" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>setup-maven-properties</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
<target>
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
|
||||
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" />
|
||||
<var name="version-type" value="${project.version}" />
|
||||
<propertyregex property="version-type" override="true" input="${version-type}" regexp=".*\.(.*)" replace="\1" />
|
||||
<propertyregex property="version-type" override="true" input="${version-type}" regexp="(M)\d+" replace="MILESTONE" />
|
||||
<propertyregex property="version-type" override="true" input="${version-type}" regexp="(RC)\d+" replace="MILESTONE" />
|
||||
<propertyregex property="version-type" override="true" input="${version-type}" regexp="BUILD-(.*)" replace="SNAPSHOT" />
|
||||
<stringutil string="${version-type}" property="version-type-lowercase">
|
||||
<lowercase />
|
||||
</stringutil>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-zip</id>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>
|
||||
${project.build.directory}/${project.artifactId}-${project.version}.zip
|
||||
</file>
|
||||
<type>zip;zip.type=docs;zip.deployed=false</type>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
20
src/main/asciidoc/Guardfile
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'asciidoctor'
|
||||
require 'erb'
|
||||
|
||||
guard 'shell' do
|
||||
watch(/.*\.adoc$/) {|m|
|
||||
Asciidoctor.render_file('index.adoc', \
|
||||
:in_place => true, \
|
||||
:safe => Asciidoctor::SafeMode::UNSAFE, \
|
||||
:attributes=> { \
|
||||
'source-highlighter' => 'prettify', \
|
||||
'icons' => 'font', \
|
||||
'linkcss'=> 'true', \
|
||||
'copycss' => 'true', \
|
||||
'doctype' => 'book'})
|
||||
}
|
||||
end
|
||||
|
||||
guard 'livereload' do
|
||||
watch(%r{^.+\.(css|js|html)$})
|
||||
end
|
||||
@@ -1,80 +1,55 @@
|
||||
[[spring-cloud-data-flow-samples-twitter-analytics-overview]]
|
||||
:sectnums:
|
||||
= Twitter Analytics
|
||||
:docs_dir: ../..
|
||||
=== Twitter Analytics
|
||||
|
||||
In this demonstration, you will learn how to orchestrate a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from _TwitterStream_ and compute simple analytics over data-in-transit using _Field-Value-Counter_.
|
||||
In this demonstration, you will learn how to build a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from _TwitterStream_ and compute simple analytics over data-in-transit using _Field-Value-Counter_.
|
||||
|
||||
We will begin by discussing the steps to prep, configure and operationalize Spring Cloud Data Flow's `Local` server.
|
||||
We will take you through the steps to configure Spring Cloud Data Flow's `Local` server.
|
||||
|
||||
== Using Local Server
|
||||
==== Prerequisites
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
Make sure that you have the following components:
|
||||
|
||||
* Local build of link:https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* Running instance of link:http://redis.io/[Redis]
|
||||
* Running instance of link:http://kafka.apache.org/downloads.html[Kafka]
|
||||
* Twitter credentials from link:https://apps.twitter.com/[Twitter Developers] site
|
||||
|
||||
=== Running the Sample Locally
|
||||
==== Building and Running the Demo
|
||||
|
||||
. Launch the `local-server`
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Kafka binder
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-server-local/target/spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
|
||||
```
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] Kafka binder variant of out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-kafka-10-maven
|
||||
```
|
||||
|
||||
+
|
||||
|
||||
. Create and deploy the following streams
|
||||
+
|
||||
```
|
||||
(1) dataflow:>stream create tweets --definition "twitterstream --consumerKey=<CONSUMER_KEY> --consumerSecret=<CONSUMER_SECRET> --accessToken=<ACCESS_TOKEN> --accessTokenSecret=<ACCESS_TOKEN_SECRET> | log"
|
||||
dataflow:>stream create tweets --definition "twitterstream --consumerKey=<CONSUMER_KEY> --consumerSecret=<CONSUMER_SECRET> --accessToken=<ACCESS_TOKEN> --accessTokenSecret=<ACCESS_TOKEN_SECRET> | log"
|
||||
Created new stream 'tweets'
|
||||
|
||||
(2) dataflow:>stream create tweetlang --definition ":tweets.twitterstream > field-value-counter --fieldName=lang --name=language" --deploy
|
||||
```
|
||||
+
|
||||
```
|
||||
dataflow:>stream create tweetlang --definition ":tweets.twitterstream > field-value-counter --fieldName=lang --name=language" --deploy
|
||||
Created and deployed new stream 'tweetlang'
|
||||
|
||||
(3) dataflow:>stream create tagcount --definition ":tweets.twitterstream > field-value-counter --fieldName=entities.hashtags.text --name=hashtags" --deploy
|
||||
```
|
||||
+
|
||||
```
|
||||
dataflow:>stream create tagcount --definition ":tweets.twitterstream > field-value-counter --fieldName=entities.hashtags.text --name=hashtags" --deploy
|
||||
Created and deployed new stream 'tagcount'
|
||||
|
||||
(4) dataflow:>stream deploy tweets
|
||||
```
|
||||
+
|
||||
```
|
||||
dataflow:>stream deploy tweets
|
||||
Deployed stream 'tweets'
|
||||
```
|
||||
+
|
||||
NOTE: To get a consumerKey and consumerSecret you need to register a twitter application. If you don’t already have one set up, you can create an app at the link:https://apps.twitter.com/[Twitter Developers] site to get these credentials. The tokens `<CONSUMER_KEY>`, `<CONSUMER_SECRET>`, `<ACCESS_TOKEN>`, and `<ACCESS_TOKEN_SECRET>` are required to be replaced with your account credentials.
|
||||
|
||||
+
|
||||
@@ -88,7 +63,8 @@ dataflow:>stream list
|
||||
. Notice that `tweetlang.field-value-counter`, `tagcount.field-value-counter`, `tweets.log` and `tweets.twitterstream` link:https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running as Spring Boot applications within the `local-server`.
|
||||
+
|
||||
|
||||
```
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2016-02-16 11:43:26.174 INFO 10189 --- [nio-9393-exec-2] o.s.c.d.d.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:field-value-counter-sink:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-6990537012958280418/tweetlang-1455651806160/tweetlang.field-value-counter
|
||||
2016-02-16 11:43:26.206 INFO 10189 --- [nio-9393-exec-3] o.s.c.d.d.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:field-value-counter-sink:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
@@ -97,11 +73,13 @@ dataflow:>stream list
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-6990537012958280418/tweets-1455651806800/tweets.log
|
||||
2016-02-16 11:43:26.813 INFO 10189 --- [nio-9393-exec-4] o.s.c.d.d.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:twitterstream-source:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-6990537012958280418/tweets-1455651806800/tweets.twitterstream
|
||||
```
|
||||
----
|
||||
+
|
||||
. Verify that two `field-value-counter` with the names `hashtags` and `language` is listing successfully
|
||||
+
|
||||
```
|
||||
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
dataflow:>field-value-counter list
|
||||
╔════════════════════════╗
|
||||
║Field Value Counter name║
|
||||
@@ -109,11 +87,12 @@ dataflow:>field-value-counter list
|
||||
║hashtags ║
|
||||
║language ║
|
||||
╚════════════════════════╝
|
||||
```
|
||||
----
|
||||
+
|
||||
. Verify you can query individual `field-value-counter` results successfully
|
||||
+
|
||||
```
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
dataflow:>field-value-counter display hashtags
|
||||
Displaying values for field value counter 'hashtags'
|
||||
╔══════════════════════════════════════╤═════╗
|
||||
@@ -144,7 +123,7 @@ Displaying values for field value counter 'language'
|
||||
║.. │ ...║
|
||||
╚═════╧═════╝
|
||||
|
||||
```
|
||||
----
|
||||
|
||||
+
|
||||
. Go to `Dashboard` accessible at `http://localhost:9393/dashboard` and launch the `Analytics` tab. From the default `Dashboard` menu, select the following combinations to visualize real-time updates on `field-value-counter`.
|
||||
@@ -158,9 +137,9 @@ Displaying values for field value counter 'language'
|
||||
.. Stream as `hashtags`
|
||||
.. Visualization as `Bubble-Chart` or `Pie-Chart`
|
||||
|
||||
image::images/twitter_analytics.png[Twitter Analytics Visualization]
|
||||
image::twitter_analytics.png[Twitter Analytics Visualization, scaledwidth="50%"]
|
||||
|
||||
== Summary
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
66
src/main/asciidoc/cloudfoundry-server.adoc
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
The Cloud Foundry Data Flow Server is Spring Boot application available for http://cloud.spring.io/spring-cloud-dataflow/#platform-implementations/[download] or you can https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry[build] it yourself.
|
||||
If you build it yourself, the executable jar will be in `spring-cloud-dataflow-server-cloudfoundry/target`
|
||||
|
||||
NOTE: Although you can run the Data Flow Cloud Foundry Server locally and configure it to deploy to any Cloud Foundry instance, we will
|
||||
deploy the server to Cloud Foundry as recommended.
|
||||
|
||||
. Verify that CF instance is reachable (Your endpoint urls will be different from what is shown here).
|
||||
+
|
||||
|
||||
```
|
||||
$ cf api
|
||||
API endpoint: https://api.system.io (API version: ...)
|
||||
|
||||
$ cf apps
|
||||
Getting apps in org [your-org] / space [your-space] as user...
|
||||
OK
|
||||
|
||||
No apps found
|
||||
```
|
||||
. Follow the instructions to deploy the https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle[Spring Cloud Data Flow Cloud Foundry server]. Don't worry about creating a Redis service. We won't need it. If you are familiar with Cloud Foundry
|
||||
application manifests, we recommend creating a manifest for the the Data Flow server as shown https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle/#sample-manifest-template[here].
|
||||
+
|
||||
WARNING: As of this writing, there is a typo on the `SPRING_APPLICATION_JSON` entry in the sample manifest. `SPRING_APPLICATION_JSON` must be followed by `:` and The JSON string must be
|
||||
wrapped in single quotes. Alternatively, you can replace that line with `MAVEN_REMOTE_REPOSITORIES_REPO1_URL: https://repo.spring.io/libs-snapshot`. If your Cloud Foundry installation is behind a firewall, you may need to install the stream apps used in this sample in your internal Maven repository and https://docs.spring.io/spring-cloud-dataflow/docs/1.3.0.M2/reference/htmlsingle/#getting-started-maven-configuration[configure] the server to access that repository.
|
||||
. Once you have successfully executed `cf push`, verify the dataflow server is running
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org [your-org] / space [your-space] as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
|
||||
. Notice that the `dataflow-server` application is started and ready for interaction via the url endpoint
|
||||
|
||||
. Connect the `shell` with `server` running on Cloud Foundry, e.g., `http://dataflow-server.app.io`
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW-SHELL-JAR>
|
||||
$ java -jar spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
server-unknown:>
|
||||
```
|
||||
+
|
||||
```
|
||||
server-unknown:>dataflow config server http://dataflow-server.app.io
|
||||
Successfully targeted http://dataflow-server.app.io
|
||||
dataflow:>
|
||||
```
|
||||
62
src/main/asciidoc/coalesce.rb
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# This script coalesces the AsciiDoc content from a document master into a
|
||||
# single output file. It does so by resolving all preprocessor directives in
|
||||
# the document, and in any files which are included. The resolving of include
|
||||
# directives is likely of most interest to users of this script.
|
||||
#
|
||||
# This script works by using Asciidoctor's PreprocessorReader to read and
|
||||
# resolve all the lines in the specified input file. The script then writes the
|
||||
# result to the output.
|
||||
#
|
||||
# The script only recognizes attributes passed in as options or those defined
|
||||
# in the document header. It does not currently process attributes defined in
|
||||
# other, arbitrary locations within the document.
|
||||
|
||||
# TODO
|
||||
# - add cli option to write attributes passed to cli to header of document
|
||||
# - escape all preprocessor directives after lines are processed (these are preprocessor directives that were escaped in the input)
|
||||
|
||||
require 'asciidoctor'
|
||||
require 'optparse'
|
||||
|
||||
options = { attributes: [], output: '-' }
|
||||
OptionParser.new do |opts|
|
||||
opts.banner = 'Usage: ruby asciidoc-coalescer.rb [OPTIONS] FILE'
|
||||
opts.on('-a', '--attribute key[=value]', 'A document attribute to set in the form of key[=value]') do |a|
|
||||
options[:attributes] << a
|
||||
end
|
||||
opts.on('-o', '--output FILE', 'Write output to FILE instead of stdout.') do |o|
|
||||
options[:output] = o
|
||||
end
|
||||
end.parse!
|
||||
|
||||
unless (source_file = ARGV.shift)
|
||||
warn 'Please specify an AsciiDoc source file to coalesce.'
|
||||
exit 1
|
||||
end
|
||||
|
||||
unless (output_file = options[:output]) == '-'
|
||||
if (output_file = File.expand_path output_file) == (File.expand_path source_file)
|
||||
warn 'Source and output cannot be the same file.'
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
||||
# NOTE first, resolve attributes defined at the end of the document header
|
||||
# QUESTION can we do this in a single load?
|
||||
doc = Asciidoctor.load_file source_file, safe: :unsafe, header_only: true, attributes: options[:attributes]
|
||||
# NOTE quick and dirty way to get the attributes set or unset by the document header
|
||||
header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a
|
||||
header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k }
|
||||
|
||||
doc = Asciidoctor.load_file source_file, safe: :unsafe, parse: false, attributes: doc.attributes
|
||||
# FIXME also escape ifdef, ifndef, ifeval and endif directives
|
||||
# FIXME do this more carefully by reading line by line; if input differs by output by leading backslash, restore original line
|
||||
lines = doc.reader.read.gsub(/^include::(?=.*\[\]$)/m, '\\include::').gsub(/^:docs_dir:.*/,'')
|
||||
|
||||
if output_file == '-'
|
||||
puts lines
|
||||
else
|
||||
File.open(output_file, 'w') {|f| f.write lines }
|
||||
end
|
||||
@@ -1,62 +1,28 @@
|
||||
:sectnums:
|
||||
= Species Prediction
|
||||
:docs_dir: ../..
|
||||
=== Species Prediction
|
||||
|
||||
In this demonstration, you will learn how to use https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language[PMML] model in the context of streaming data pipeline orchestrated by http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow].
|
||||
|
||||
We will begin by discussing the steps to prep, configure and operationalize Spring Cloud Data Flow's `Local` server, a Spring Boot application.
|
||||
We will present the steps to prep, configure and rub Spring Cloud Data Flow's `Local` server, a Spring Boot application.
|
||||
|
||||
== Using Local Server
|
||||
==== Prerequisites
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
Make sure that you have the following components:
|
||||
|
||||
* Local build of link:https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* Running instance of link:http://kafka.apache.org/downloads.html[Kafka]
|
||||
|
||||
=== Running the Sample Locally
|
||||
==== Building and Running the Demo
|
||||
|
||||
. Launch the `local-server`
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Kafka binder
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-server-local/target/spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
|
||||
```
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] Kafka binder variant of out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-kafka-10-maven
|
||||
```
|
||||
|
||||
+
|
||||
. Create and deploy the following stream
|
||||
+
|
||||
@@ -79,16 +45,17 @@ dataflow:>stream list
|
||||
. Notice that `pmmlTest.http`, `pmmlTest.pmml`, and `pmmlTest.log` link:https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running within the `local-server`.
|
||||
+
|
||||
|
||||
```
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2016-02-18 06:36:45.396 INFO 31194 --- [nio-9393-exec-1] o.s.c.d.d.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:log-sink:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-3038434123335455382/pmmlTest-1455806205386/pmmlTest.log
|
||||
2016-02-18 06:36:45.402 INFO 31194 --- [nio-9393-exec-1] o.s.c.d.d.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:pmml-processor:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-3038434123335455382/pmmlTest-1455806205386/pmmlTest.pmml
|
||||
2016-02-18 06:36:45.407 INFO 31194 --- [nio-9393-exec-1] o.s.c.d.d.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:http-source:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-3038434123335455382/pmmlTest-1455806205386/pmmlTest.http
|
||||
```
|
||||
----
|
||||
+
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:9001` [`9001` is the `server.port` we specified for the `http` source in this case]
|
||||
. Post sample data to the `http` endpoint: `http://localhost:9001` (`9001` is the `port` we specified for the `http` source in this case)
|
||||
+
|
||||
```
|
||||
dataflow:>http post --target http://localhost:9001 --contentType application/json --data "{ \"sepalLength\": 6.4, \"sepalWidth\": 3.2, \"petalLength\":4.5, \"petalWidth\":1.5 }"
|
||||
@@ -157,7 +124,7 @@ NOTE: `petalWidth` value changed from `1.5` to `1.8`
|
||||
}
|
||||
```
|
||||
|
||||
== Summary
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
76
src/main/asciidoc/docinfo.html
Normal file
@@ -0,0 +1,76 @@
|
||||
<!-- Generate a nice TOC -->
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>
|
||||
<!-- We do not need the tocify CSS because the asciidoc CSS already provides most of what we neeed -->
|
||||
|
||||
<style>
|
||||
.tocify-header {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.tocify-subheader {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.tocify ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tocify-focus {
|
||||
color: #7a2518;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.tocify-focus > a {
|
||||
color: #7a2518;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// Add a new container for the tocify toc into the existing toc so we can re-use its
|
||||
// styling
|
||||
$("#toc").append("<div id='generated-toc'></div>");
|
||||
$("#generated-toc").tocify({
|
||||
extendPage: false,
|
||||
context: "#content",
|
||||
highlightOnScroll: false,
|
||||
hideEffect: "slideUp",
|
||||
// Turn this on to enable collapsible TOC
|
||||
showAndHide: false
|
||||
// Use the IDs that asciidoc already provides so that TOC links and intra-document
|
||||
// links are the same. Anything else might confuse users when they create bookmarks.
|
||||
hashGenerator: function(text, element) {
|
||||
return $(element).attr("id");
|
||||
},
|
||||
// Smooth scrolling doesn't work properly if we use the asciidoc IDs
|
||||
smoothScroll: false,
|
||||
// Set to 'none' to use the tocify classes
|
||||
theme: "none",
|
||||
// Handle book (may contain h1) and article (only h2 deeper)
|
||||
selectors: $( "#content" ).has( "h1" ).size() > 0 ? "h1,h2,h3,h4,h5" : "h2,h3,h4,h5",
|
||||
ignoreSelector: ".discrete"
|
||||
});
|
||||
|
||||
// Switch between static asciidoc toc and dynamic tocify toc based on browser size
|
||||
// This is set to match the media selectors in the asciidoc CSS
|
||||
// Without this, we keep the dynamic toc even if it is moved from the side to preamble
|
||||
// position which will cause odd scrolling behavior
|
||||
var handleTocOnResize = function() {
|
||||
if ($(document).width() < 768) {
|
||||
$("#generated-toc").hide();
|
||||
$(".sectlevel0").show();
|
||||
$(".sectlevel1").show();
|
||||
}
|
||||
else {
|
||||
$("#generated-toc").show();
|
||||
$(".sectlevel0").hide();
|
||||
$(".sectlevel1").hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(window).resize(handleTocOnResize);
|
||||
handleTocOnResize();
|
||||
});
|
||||
</script>
|
||||
@@ -1,70 +1,34 @@
|
||||
:sectnums:
|
||||
= Functions in Spring Cloud Data Flow
|
||||
:docs_dir: ..
|
||||
=== Functions in Spring Cloud Data Flow
|
||||
|
||||
In this sample, you will learn how to use https://github.com/spring-cloud/spring-cloud-function[Spring Cloud Function] based streaming applications in Spring Cloud Data Flow. To learn more about Spring Cloud Function, check out the http://cloud.spring.io/spring-cloud-function/[project page].
|
||||
|
||||
== Prerequisites
|
||||
==== Prerequisites
|
||||
|
||||
Make sure that you have the following components:
|
||||
|
||||
* Local build of link:https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* Local build of link:https://github.com/spring-cloud/spring-cloud-function[Spring Cloud Function]
|
||||
* Running instance of RabbitMQ
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* A local build of link:https://github.com/spring-cloud/spring-cloud-function[Spring Cloud Function]
|
||||
* A running instance of https://www.rabbitmq.com/[Rabbit MQ]
|
||||
* General understanding of the out-of-the-box https://github.com/spring-cloud-stream-app-starters/function/blob/master/spring-cloud-starter-stream-app-function/README.adoc[function-runner] application
|
||||
|
||||
=== Running the Sample Locally
|
||||
==== Building and Running the Demo
|
||||
|
||||
. Launch the `Local-server`
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-server-local/target/spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
|
||||
```
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
|
||||
. Connect the `shell`
|
||||
+
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
----
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the RabbitMQ-binder variant of the out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
|
||||
+
|
||||
. Register the out-of-the-box https://github.com/spring-cloud-stream-app-starters/function/blob/master/spring-cloud-starter-stream-app-function/README.adoc[function-runner] application (_we will use the `1.0.0.BUILD-SNAPSHOT` built by the Spring CI system_)
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app register --name function-runner --type processor --uri http://repo.spring.io/libs-snapshot/org/springframework/cloud/stream/app/function-app-rabbit/1.0.0.BUILD-SNAPSHOT/function-app-rabbit-1.0.0.BUILD-SNAPSHOT.jar --metadata-uri http://repo.spring.io/libs-snapshot/org/springframework/cloud/stream/app/function-app-rabbit/1.0.0.BUILD-SNAPSHOT/function-app-rabbit-1.0.0.BUILD-SNAPSHOT-metadata.jar
|
||||
```
|
||||
|
||||
+
|
||||
. Create and deploy the following stream
|
||||
+
|
||||
@@ -72,29 +36,33 @@ dataflow:>app register --name function-runner --type processor --uri http://repo
|
||||
dataflow:>stream create foo --definition "http --server.port=9001 | function-runner --function.className=com.example.functions.CharCounter --function.location=file:///<PATH/TO/SPRING-CLOUD-FUNCTION>/spring-cloud-function-samples/function-sample/target/spring-cloud-function-sample-1.0.0.BUILD-SNAPSHOT.jar | log" --deploy
|
||||
|
||||
```
|
||||
+
|
||||
NOTE: Replace the `<PATH/TO/SPRING-CLOUD-FUNCTION>` with the correct path.
|
||||
|
||||
+
|
||||
NOTE: The source core of `CharCounter` function is in Spring cloud Function's https://github.com/spring-cloud/spring-cloud-function/blob/master/spring-cloud-function-samples/function-sample/src/main/java/com/example/functions/CharCounter.java[samples repo].
|
||||
+
|
||||
|
||||
+
|
||||
. Verify the stream is successfully deployed.
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
////
|
||||
TODO: Doesn't render correctly in PDF
|
||||
[source,bash,options="nowrap"]
|
||||
----
|
||||
dataflow:>stream list
|
||||
╔══════╤══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╤════════════╗
|
||||
║Stream│ Stream Definition │ Status ║
|
||||
║ Name │ │ ║
|
||||
╠══════╪══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╪════════════╣
|
||||
║foo │http --server.port=9001 | function-runner --function.className=com.example.functions.CharCounter │All apps ║
|
||||
║ │--function.location=file:///<PATH/TO/SPRING-CLOUD-FUNCTION>/spring-cloud-function-samples/function-sample/target/spring-cloud-function-sample-1.0.0.BUILD-<SNAPSHOT class="jar"></SNAPSHOT> │have been ║
|
||||
║ │--function.location=file:///<PATH/TO/SPRING-CLOUD-FUNCTION>/spring-cloud-function-samples/function-sample/target/spring-cloud-function-sample-1.0.0.BUILD-<SNAPSHOT class="jar"></SNAPSHOT> │have been ║
|
||||
║ │| log │successfully║
|
||||
║ │ │deployed ║
|
||||
╚══════╧══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╧════════════╝
|
||||
----
|
||||
|
||||
////
|
||||
+
|
||||
. Notice that `foo-http`, `foo-function-runner`, and `foo-log` link:https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running as Spring Boot applications and the log locations will be printed in the Local-server console.
|
||||
+
|
||||
@@ -116,7 +84,7 @@ dataflow:>stream list
|
||||
----
|
||||
|
||||
+
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:9001` [`9001` is the `server.port` we specified for the `http` source in this case]
|
||||
. Post sample data to the `http` endpoint: `http://localhost:9001` (`9001` is the `port` we specified for the `http` source in this case)
|
||||
+
|
||||
```
|
||||
dataflow:>http post --target http://localhost:9001 --data "hello world"
|
||||
@@ -146,7 +114,7 @@ $ tail -f /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gs/T/spring-cloud-dataflow
|
||||
....
|
||||
----
|
||||
|
||||
== Summary
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
13
src/main/asciidoc/geode-setup.adoc
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
If you do not have access an existing Geode installation, install http://geode.apache.org[Apache Geode] or
|
||||
http://geode.apache.org/[Pivotal Gemfire] and start the `gfsh` CLI in a separate terminal.
|
||||
```
|
||||
_________________________ __
|
||||
/ _____/ ______/ ______/ /____/ /
|
||||
/ / __/ /___ /_____ / _____ /
|
||||
/ /__/ / ____/ _____/ / / / /
|
||||
/______/_/ /______/_/ /_/ 1.2.1
|
||||
|
||||
Monitor and Manage Apache Geode
|
||||
gfsh>
|
||||
```
|
||||
BIN
src/main/asciidoc/images/scdf-dashboard.png
Normal file
|
After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 416 KiB After Width: | Height: | Size: 416 KiB |
27
src/main/asciidoc/index-docinfo.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<productname>Spring Cloud Data Flow Samples</productname>
|
||||
<releaseinfo>{project-version}</releaseinfo>
|
||||
<copyright>
|
||||
<year>2013-2017</year>
|
||||
<holder>Pivotal Software, Inc.</holder>
|
||||
</copyright>
|
||||
<legalnotice>
|
||||
<para>
|
||||
Copies of this document may be made for your own use and for distribution to
|
||||
others, provided that you do not charge any fee for such copies and further
|
||||
provided that each copy contains this Copyright Notice, whether distributed in
|
||||
print or electronically.
|
||||
</para>
|
||||
</legalnotice>
|
||||
<cover>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/cover.png">
|
||||
<info>
|
||||
<othercredit>
|
||||
<orgname>Pivotal Software, Inc.</orgname>
|
||||
</othercredit>
|
||||
</info>
|
||||
</imagedata>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</cover>
|
||||
35
src/main/asciidoc/index.adoc
Normal file
@@ -0,0 +1,35 @@
|
||||
= Spring Cloud Data Flow Samples
|
||||
Sabby Anandan; David Turanski; Glenn Renfro; Eric Bottard; Mark Pollack;
|
||||
:doctype: book
|
||||
:toc:
|
||||
:toclevels: 4
|
||||
:source-highlighter: prettify
|
||||
:numbered:
|
||||
:icons: font
|
||||
:hide-uri-scheme:
|
||||
:docinfo: shared
|
||||
|
||||
:spring-cloud-stream-docs: http://docs.spring.io/spring-cloud-stream/docs/{scst-core-version}/reference/htmlsingle/index.html
|
||||
:github-code: https://github.com/spring-cloud/spring-cloud-dataflow-samples
|
||||
|
||||
|
||||
ifdef::backend-html5[]
|
||||
|
||||
Version {project-version}
|
||||
|
||||
(C) 2012-2017 Pivotal Software, Inc.
|
||||
|
||||
_Copies of this document may be made for your own use and for distribution to
|
||||
others, provided that you do not charge any fee for such copies and further
|
||||
provided that each copy contains this Copyright Notice, whether distributed in
|
||||
print or electronically._
|
||||
|
||||
endif::backend-html5[]
|
||||
|
||||
// ======================================================================================
|
||||
|
||||
[[overview]]
|
||||
|
||||
include::overview.adoc[]
|
||||
|
||||
// ======================================================================================
|
||||
9
src/main/asciidoc/local-server.adoc
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
The Local Data Flow Server is Spring Boot application available for http://cloud.spring.io/spring-cloud-dataflow/#platform-implementations[download] or you can https://github.com/spring-cloud/spring-cloud-dataflow[build] it yourself.
|
||||
If you build it yourself, the executable jar will be in `spring-cloud-dataflow-server-local/target`
|
||||
|
||||
To run the Local Data Flow server Open a new terminal session:
|
||||
```
|
||||
$cd <PATH/TO/SPRING-CLOUD-DATAFLOW-LOCAL-JAR>
|
||||
$java -jar spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
```
|
||||
7
src/main/asciidoc/maven-access.adoc
Normal file
@@ -0,0 +1,7 @@
|
||||
NOTE: These samples assume that the Data Flow Server can access a remote Maven repository, `https://repo.spring.io/libs-release` by default. If your Data Flow server is running behind a firewall, or you are using a maven proxy preventing
|
||||
access to public repositories, you will need to install the sample apps in your internal Maven repository and https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started-maven-configuration[configure]
|
||||
the server accordingly. The sample applications are typically registered using Data Flow's bulk import facility. For example, the Shell command `dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven` (The actual URI is release and binder specific so refer to the sample instructions for the actual URL).
|
||||
The bulk import URI references a plain text file containing entries for all of the publicly available Spring Cloud Stream and Task applications published to `https://repo.spring.io`. For example,
|
||||
`source.http=maven://org.springframework.cloud.stream.app:http-source-rabbit:1.2.0.RELEASE` registers the `http` source app at the corresponding Maven address, relative to the remote repository(ies) configured for the
|
||||
Data Flow server. The format is `maven://<groupId>:<artifactId>:<version>` You will need to https://repo.spring.io/libs-release/org/springframework/cloud/stream/app/spring-cloud-stream-app-descriptor/Bacon.RELEASE/spring-cloud-stream-app-descriptor-Bacon.RELEASE.rabbit-apps-maven-repo-url.properties[download] the required apps or https://github.com/spring-cloud-stream-app-starters[build] them and then install them in your Maven repository, using whatever group, artifact, and version you choose. If you do
|
||||
this, register individual apps using `dataflow:>app register...` using the `maven://` resource URI format corresponding to your installed app.
|
||||
23
src/main/asciidoc/overview.adoc
Normal file
@@ -0,0 +1,23 @@
|
||||
[[spring-cloud-data-flow-samples-overview]]
|
||||
== Overview
|
||||
This guide contains samples and demonstrations of how to build data pipelines with https://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow].
|
||||
|
||||
== Streaming
|
||||
include::streaming/cassandra/http-to-cassandra/main.adoc[]
|
||||
include::streaming/jdbc/http-mysql/main.adoc[]
|
||||
include::streaming/gemfire/http-gemfire/main.adoc[]
|
||||
include::streaming/gemfire/gemfire-cq-log/main.adoc[]
|
||||
include::streaming/gemfire/gemfire-log/main.adoc[]
|
||||
include::streaming/custom-apps/celsius-converter-processor/main.adoc[]
|
||||
|
||||
== Task / Batch
|
||||
include::tasks/simple-batch-job/main.adoc[]
|
||||
|
||||
== Analytics
|
||||
include::analytics/twitter-analytics/main.adoc[]
|
||||
|
||||
== Data Science
|
||||
include::datascience/species-prediction/main.adoc[]
|
||||
|
||||
== Functions
|
||||
include::functions/main.adoc[]
|
||||
30
src/main/asciidoc/shell.adoc
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
The Spring Cloud Data Flow Shell is available for https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started-deploying-spring-cloud-dataflow[download] or you can https://github.com/spring-cloud/spring-cloud-dataflow[build] it yourself.
|
||||
|
||||
NOTE: the Spring Cloud Data Flow Shell and Local server implementation are in the same repository and are both built by running `./mvnw install` from the project root directory. If you have already run the build, use the jar in `spring-cloud-dataflow-shell/target`
|
||||
|
||||
To run the Shell open a new terminal session:
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW-SHELL-JAR>
|
||||
$ java -jar spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>
|
||||
```
|
||||
NOTE: The Spring Cloud Data Flow Shell is a Spring Boot application that connects to the Data Flow Server’s REST API and supports a DSL that simplifies the process of defining a stream or task and managing its lifecycle. Most of these samples
|
||||
use the shell. If you prefer, you can use the Data Flow UI http://localhost:9393/dashboard, (or wherever it the server is hosted) to perform equivalent operations.
|
||||
|
||||
ifdef::backend-pdf[]
|
||||
image::scdf-dashboard.png[SCDF Dashboard, scaledwidth="50%"]
|
||||
endif::[]
|
||||
@@ -0,0 +1,78 @@
|
||||
[[http-cassandra-local]]
|
||||
==== Using the Local Server
|
||||
|
||||
===== Additional Prerequisites
|
||||
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
|
||||
* Running instance of link:http://kafka.apache.org/downloads.html[Kafka]
|
||||
* Running instance of link:http://cassandra.apache.org/[Apache Cassandra]
|
||||
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] to connect to the Cassandra instance. You might have to provide `host`, `port`, `username` and `password` depending on the Cassandra configuration you are using.
|
||||
* Create a keyspace and a `book` table in Cassandra using:
|
||||
|
||||
```
|
||||
CREATE KEYSPACE clouddata WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
|
||||
USE clouddata;
|
||||
CREATE TABLE book (
|
||||
id uuid PRIMARY KEY,
|
||||
isbn text,
|
||||
author text,
|
||||
title text
|
||||
);
|
||||
```
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Kafka binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-kafka-10-maven
|
||||
```
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
```
|
||||
dataflow:>stream create cassandrastream --definition "http --server.port=8888 --spring.cloud.stream.bindings.output.contentType='application/json' | cassandra --ingestQuery='insert into book (id, isbn, title, author) values (uuid(), ?, ?, ?)' --keyspace=clouddata" --deploy
|
||||
|
||||
Created and deployed new stream 'cassandrastream'
|
||||
```
|
||||
NOTE: If Cassandra isn't running on default port on `localhost` or if you need username and password to connect, use one of the following options to specify the necessary connection parameters: `--username='<USERNAME>' --password='<PASSWORD>' --port=<PORT> --contact-points=<LIST-OF-HOSTS>`
|
||||
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `cassandrastream-http` and `cassandrastream-cassandra` link:https://github.com/spring-cloud-stream-app-starters//[Spring Cloud Stream] applications are running as Spring Boot applications within the `server` as a collocated process.
|
||||
+
|
||||
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2015-12-15 15:52:31.576 INFO 18337 --- [nio-9393-exec-1] o.s.c.d.a.s.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:cassandra-sink:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-284240942697761420/cassandrastream.cassandra
|
||||
2015-12-15 15:52:31.583 INFO 18337 --- [nio-9393-exec-1] o.s.c.d.a.s.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:http-source:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-284240942697761420/cassandrastream.http
|
||||
----
|
||||
+
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:8888` (`8888` is the `server.port` we specified for the `http` source in this case)
|
||||
+
|
||||
```
|
||||
dataflow:>http post --contentType 'application/json' --data '{"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}' --target http://localhost:8888
|
||||
> POST (application/json;charset=UTF-8) http://localhost:8888 {"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the Cassandra instance and query the table `clouddata.book` to list the persisted records
|
||||
+
|
||||
```
|
||||
select * from clouddata.book;
|
||||
```
|
||||
|
||||
+
|
||||
. You're done!
|
||||
@@ -0,0 +1,25 @@
|
||||
[[spring-cloud-data-flow-samples-http-cassandra-overview]]
|
||||
:sectnums:
|
||||
:docs_dir: ../../..
|
||||
=== HTTP to Cassandra Demo
|
||||
|
||||
In this demonstration, you will learn how to build a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from an _HTTP_ endpoint and write the payload to a _Cassandra_ database.
|
||||
|
||||
We will take you through the steps to configure and Spring Cloud Data Flow server in either a https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started/[local] or https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle/#getting-started[Cloud Foundry] environment.
|
||||
|
||||
==== Prerequisites
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
|
||||
include::local.adoc[]
|
||||
|
||||
include::pcf.adoc[]
|
||||
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and write to `Cassandra`
|
||||
* How to scale applications on `Pivotal Cloud Foundry`
|
||||
@@ -0,0 +1,99 @@
|
||||
[[http-cassandra-cf]]
|
||||
==== Using the Cloud Foundry Server
|
||||
|
||||
===== Additional Prerequisites
|
||||
|
||||
* Cloud Foundry instance
|
||||
* A `rabbit` service instance
|
||||
|
||||
* A Running instance of `cassandra` in Cloud Foundry or from another Cloud provider
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] to connect to the Cassandra instance. You might have to provide `host`, `port`, `username` and `password` depending on the Cassandra configuration you are using.
|
||||
* Create a `book` table in your Cassandra keyspace using:
|
||||
+
|
||||
```
|
||||
CREATE TABLE book (
|
||||
id uuid PRIMARY KEY,
|
||||
isbn text,
|
||||
author text,
|
||||
title text
|
||||
);
|
||||
```
|
||||
* The Spring Cloud Data Flow Cloud Foundry Server
|
||||
include::{docs_dir}/cloudfoundry-server.adoc[]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>stream create cassandrastream --definition "http --spring.cloud.stream.bindings.output.contentType='application/json' | cassandra --ingestQuery='insert into book (id, isbn, title, author) values (uuid(), ?, ?, ?)' --username='<USERNAME>' --password='<PASSWORD>' --port=<PORT> --contact-points=<HOST> --keyspace='<KEYSPACE>'" --deploy
|
||||
|
||||
Created and deployed new stream 'cassandrastream'
|
||||
```
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `cassandrastream-http` and `cassandrastream-cassandra` https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running as _cloud-native_ (microservice) applications in Cloud Foundry
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org [your-org] / space [your-space] as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
cassandrastream-cassandra started 1/1 1G 1G cassandrastream-cassandra.app.io
|
||||
cassandrastream-http started 1/1 1G 1G cassandrastream-http.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. Lookup the `url` for `cassandrastream-http` application from the list above. Post sample data pointing to the `http` endpoint: `<YOUR-cassandrastream-http-APP-URL>`
|
||||
+
|
||||
```
|
||||
http post --contentType 'application/json' --data '{"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}' --target http://<YOUR-cassandrastream-http-APP-URL>
|
||||
> POST (application/json;charset=UTF-8) http://cassandrastream-http.app.io {"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the Cassandra instance and query the table `book` to list the data inserted
|
||||
+
|
||||
```
|
||||
select * from book;
|
||||
```
|
||||
|
||||
+
|
||||
. Now, let's try to take advantage of Pivotal Cloud Foundry's platform capability. Let's scale the `cassandrastream-http` application from 1 to 3 instances
|
||||
+
|
||||
```
|
||||
$ cf scale cassandrastream-http -i 3
|
||||
Scaling app cassandrastream-http in org user-dataflow / space development as user...
|
||||
OK
|
||||
```
|
||||
+
|
||||
. Verify App instances (3/3) running successfully
|
||||
+
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
cassandrastream-cassandra started 1/1 1G 1G cassandrastream-cassandra.app.io
|
||||
cassandrastream-http started 3/3 1G 1G cassandrastream-http.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. You're done!
|
||||
@@ -0,0 +1,161 @@
|
||||
[[spring-cloud-data-flow-samples-custom-application-overview]]
|
||||
:sectnums:
|
||||
:docs_dir: ../../..
|
||||
|
||||
=== Custom Spring Cloud Stream Processor
|
||||
|
||||
==== Prerequisites
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* A Java IDE
|
||||
* https://maven.apache.org/[Maven] Installed
|
||||
* A running instance of https://www.rabbitmq.com/[Rabbit MQ]
|
||||
|
||||
==== Creating the Custom Stream App
|
||||
We will create a custom https://cloud.spring.io/spring-cloud-stream/[Spring Cloud Stream] application and run it on Spring Cloud Data Flow.
|
||||
We'll go through the steps to make a simple processor that converts temperature from Fahrenheit to Celsius.
|
||||
We will be running the demo locally, but all the steps will work in a Cloud Foundry environment as well.
|
||||
|
||||
. Create a new spring cloud stream project
|
||||
+
|
||||
* Create a http://start.spring.io/[Spring initializer] project
|
||||
|
||||
* Set the group to `demo.celsius.converter` and the artifact name as `celsius-converter-processor`
|
||||
|
||||
* Choose a message transport binding as a dependency for the custom app
|
||||
There are options for choosing `Rabbit MQ` or `Kafka` as the message transport.
|
||||
For this demo, we will use `rabbit`. Type _rabbit_ in the search bar under _Search for dependencies_ and select `Stream Rabbit`.
|
||||
|
||||
* Hit the generate project button and open the new project in an IDE of your choice
|
||||
+
|
||||
. Develop the app
|
||||
+
|
||||
We can now create our custom app. Our Spring Cloud Stream application is a Spring Boot application that runs as an executable jar. The application will include two Java classes:
|
||||
|
||||
* `CelsiusConverterProcessorAplication.java` - the main Spring Boot application class, generated by Spring initializr
|
||||
|
||||
* `CelsiusConverterProcessorConfiguration.java` - the Spring Cloud Stream code that we will write
|
||||
+
|
||||
We are creating a transformer that takes a Fahrenheit input and converts it to Celsius.
|
||||
Following the same naming convention as the application file, create a new Java class in the same package called `CelsiusConverterProcessorConfiguration.java`.
|
||||
+
|
||||
.CelsiusConverterProcessorConfiguration.java
|
||||
[source,java]
|
||||
```
|
||||
@EnableBinding(Processor.class)
|
||||
public class CelsiusConverterProcessorConfiguration {
|
||||
|
||||
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
|
||||
public int convertToCelsius(String payload) {
|
||||
int fahrenheitTemperature = Integer.parseInt(payload);
|
||||
return (farenheitTemperature-32)*5/9;
|
||||
}
|
||||
}
|
||||
```
|
||||
+
|
||||
Here we introduced two important Spring annotations.
|
||||
First we annotated the class with `@EnableBinding(Processor.class)`.
|
||||
Second we created a method and annotated it with `@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)`.
|
||||
By adding these two annotations we have configured this stream app as a `Processor` (as opposed to a `Source` or a `Sink`).
|
||||
This means that the application receives input from an upstream application via the `Processor.INPUT` channel and sends its output to a downstream application via the `Processor.OUTPUT` channel.
|
||||
+
|
||||
The `convertToCelsius` method takes a `String` as input for Fahrenheit and then returns the converted Celsius as an integer.
|
||||
This method is very simple, but that is also the beauty of this programming style.
|
||||
We can add as much logic as we want to this method to enrich this processor.
|
||||
As long as we annotate it properly and return valid output, it works as a Spring Cloud Stream Processor. Also note that it is straightforward to unit test this code.
|
||||
+
|
||||
. Build the Spring Boot application with Maven
|
||||
+
|
||||
```
|
||||
$cd <PROJECT_DIR>
|
||||
$./mvnw clean package
|
||||
```
|
||||
+
|
||||
. Run the Application standalone
|
||||
+
|
||||
```
|
||||
java -jar target/celsius-converter-processor-0.0.1-SNAPSHOT.jar
|
||||
```
|
||||
+
|
||||
If all goes well, we should have a running standalone Spring Boot Application.
|
||||
Once we verify that the app is started and running without any errors, we can stop it.
|
||||
|
||||
==== Deploying the App to Spring Cloud Data Flow
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
+
|
||||
. Register the custom processor
|
||||
+
|
||||
```
|
||||
app register --type processor --name convertToCelsius --uri <File URL of the jar file on the local filesystem where you built the project above> --force
|
||||
```
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
We will create a stream that uses the out of the box `http` source and `log` sink and our custom transformer.
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name convertToCelsiusStream --definition "http --port=9090 | convertToCelsius | log" --deploy
|
||||
|
||||
Created and deployed new stream 'convertToCelsiusStream'
|
||||
```
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Verify that the apps have successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>runtime apps
|
||||
```
|
||||
+
|
||||
.Note the file location of the application logs
|
||||
+
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2016-09-27 10:03:11.988 INFO 95234 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalAppDeployer : deploying app convertToCelsiusStream.log instance 0
|
||||
Logs will be in /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-3236898888473815319/convertToCelsiusStream-1474984991968/convertToCelsiusStream.log
|
||||
2016-09-27 10:03:12.397 INFO 95234 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalAppDeployer : deploying app convertToCelsiusStream.convertToCelsius instance 0
|
||||
Logs will be in /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-3236898888473815319/convertToCelsiusStream-1474984992392/convertToCelsiusStream.convertToCelsius
|
||||
2016-09-27 10:03:14.445 INFO 95234 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalAppDeployer : deploying app convertToCelsiusStream.http instance 0
|
||||
Logs will be in /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-3236898888473815319/convertToCelsiusStream-1474984994440/convertToCelsiusStream.http
|
||||
----
|
||||
+
|
||||
. Post sample data to the `http` endpoint: `http://localhost:9090` (`9090` is the `port` we specified for the `http` source in this case)
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>http post --target http://localhost:9090 --data 76
|
||||
> POST (text/plain;Charset=UTF-8) http://localhost:9090 76
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Open the log file for the `convertToCelsiusStream.log` app to see the output of our stream
|
||||
+
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
tail -f /var/folders/2q/krqwcbhj2d58csmthyq_n1nw0000gp/T/spring-cloud-dataflow-7563139704229890655/convertToCelsiusStream-1474990317406/convertToCelsiusStream.log/stdout_0.log
|
||||
----
|
||||
+
|
||||
You should see the temperature you posted converted to Celsius!
|
||||
```
|
||||
2016-09-27 10:05:34.933 INFO 95616 --- [CelsiusStream-1] log.sink : 24
|
||||
```
|
||||
|
||||
==== Summary
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to write a custom `Processor` stream application
|
||||
* How to use Spring Cloud Data Flow's `Local` server
|
||||
* How to use Spring Cloud Data Flow's `shell` application
|
||||
@@ -0,0 +1,91 @@
|
||||
[[gemfire-cq-log-local]]
|
||||
==== Using the Local Server
|
||||
===== Additional Prerequisites
|
||||
* A Running Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* A running instance of https://www.rabbitmq.com[Rabbit MQ]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. Use gfsh to start a locator and server
|
||||
+
|
||||
```
|
||||
gfsh>start locator --name=locator1
|
||||
gfsh>start server --name=server1
|
||||
|
||||
```
|
||||
. Create a region called `Orders`
|
||||
+
|
||||
```
|
||||
gfsh>create region --name Orders --type=REPLICATE
|
||||
```
|
||||
+
|
||||
*Use the Shell to create the sample stream*
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
. Create the stream
|
||||
+
|
||||
This example creates an gemfire-cq source to which will publish events matching a query criteria on a region. In this case we will monitor the `Orders` region. For simplicity, we will avoid creating a data structure for the order.
|
||||
Each cache entry contains an integer value representing the quantity of the ordered item. This stream will fire a message whenever the value>999. By default, the source emits only the value. Here we will override that using the
|
||||
`cq-event-expression` property. This accepts a SpEL expression bound to a https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/query/CqEvent.html[CQEvent]. To reference the entire CQEvent instace, we use `#this`.
|
||||
In order to display the contents in the log, we will invoke `toString()` on the instance.
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name orders --definition " gemfire-cq --query='SELECT * from /Orders o where o > 999' --cq-event-expression=#this.toString() | log" --deploy
|
||||
Created and deployed new stream 'events'
|
||||
```
|
||||
NOTE: If the Geode locator isn't running on default port on `localhost`, add the options `--connect-type=locator --host-addresses=<host>:<port>`. If there are multiple
|
||||
locators, you can provide a comma separated list of locator addresses. This is not necessary for the sample but is typical for production environments to enable fail-over.
|
||||
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
|
||||
. Monitor stdout for the log sink. When you deploy the stream, you will see log messages in the Data Flow server console like this
|
||||
+
|
||||
```
|
||||
2017-10-30 09:39:36.283 INFO 8167 --- [nio-9393-exec-5] o.s.c.d.spi.local.LocalAppDeployer : Deploying app with deploymentId orders.log instance 0.
|
||||
Logs will be in /var/folders/hd/5yqz2v2d3sxd3n879f4sg4gr0000gn/T/spring-cloud-dataflow-5375107584795488581/orders-1509370775940/orders.log
|
||||
```
|
||||
+
|
||||
Copy the location of the `log` sink logs. This is a directory that ends in `orders.log`. The log files will be in `stdout_0.log` under this directory. You can monitor the output of the log sink using `tail`, or something similar:
|
||||
+
|
||||
```
|
||||
$tail -f /var/folders/hd/5yqz2v2d3sxd3n879f4sg4gr0000gn/T/spring-cloud-dataflow-5375107584795488581/orders-1509370775940/orders.log/stdout_0.log
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, create and update some cache entries
|
||||
+
|
||||
```
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 01234 --value 1000
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 11234 --value 1005
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 21234 --value 100
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 31234 --value 999
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 21234 --value 1000
|
||||
|
||||
```
|
||||
+
|
||||
. Observe the log output
|
||||
You should see messages like:
|
||||
+
|
||||
```
|
||||
2017-10-30 09:53:02.231 INFO 8563 --- [ire-cq.orders-1] log-sink : CqEvent [CqName=GfCq1; base operation=CREATE; cq operation=CREATE; key=01234; value=1000]
|
||||
2017-10-30 09:53:19.732 INFO 8563 --- [ire-cq.orders-1] log-sink : CqEvent [CqName=GfCq1; base operation=CREATE; cq operation=CREATE; key=11234; value=1005]
|
||||
2017-10-30 09:53:53.242 INFO 8563 --- [ire-cq.orders-1] log-sink : CqEvent [CqName=GfCq1; base operation=UPDATE; cq operation=CREATE; key=21234; value=1000]
|
||||
```
|
||||
+
|
||||
. Another interesting demonstration combines `gemfire-cq` with the link::../http-gemfire/README.adoc[http-gemfire] example.
|
||||
```
|
||||
dataflow:> stream create --name stocks --definition "http --port=9090 | gemfire-json-server --regionName=Stocks --keyExpression=payload.getField('symbol')" --deploy
|
||||
dataflow:> stream create --name stock_watch --definition "gemfire-cq --query='Select * from /Stocks where symbol=''VMW''' | log" --deploy
|
||||
```
|
||||
|
||||
. You're done!
|
||||
31
src/main/asciidoc/streaming/gemfire/gemfire-cq-log/main.adoc
Normal file
@@ -0,0 +1,31 @@
|
||||
[[spring-cloud-data-flow-samples-gemfire-cq-log-overview]]
|
||||
:sectnums:
|
||||
:docs_dir: ../../..
|
||||
|
||||
=== Gemfire CQ to Log Demo
|
||||
|
||||
In this demonstration, you will learn how to build a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from a `gemfire-cq` (Continuous Query) endpoint and write to a log using the `log` sink.
|
||||
The `gemfire-cq` source creates a Continuous Query to monitor events for a region that match the query's result set and publish a message whenever such an event is emitted. In this example, we simulate monitoring orders to trigger a process whenever
|
||||
the quantity ordered is above a defined limit.
|
||||
|
||||
We will take you through the steps to configure and run Spring Cloud Data Flow server in either a https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started/[local] or https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle/#getting-started[Cloud Foundry] environment.
|
||||
|
||||
NOTE: For legacy reasons the `gemfire` Spring Cloud Stream Apps are named after `Pivotal GemFire`. The code base for the commercial product has since been open sourced as `Apache Geode`. These samples should work with compatible versions of Pivotal GemFire or Apache Geode. Herein we will refer to the installed IMDG simply as `Geode`.
|
||||
|
||||
==== Prerequisites
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A Geode installation with a locator and cache server running
|
||||
include::{docs_dir}/geode-setup.adoc[]
|
||||
|
||||
include::local.adoc[]
|
||||
|
||||
include::pcf.adoc[]
|
||||
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and publish CQ events from `gemfire`
|
||||
114
src/main/asciidoc/streaming/gemfire/gemfire-cq-log/pcf.adoc
Normal file
@@ -0,0 +1,114 @@
|
||||
[[gemfire-cq-log-cf]]
|
||||
==== Using the Cloud Foundry Server
|
||||
===== Additional Prerequisites
|
||||
|
||||
* A Cloud Foundry instance
|
||||
|
||||
* Running instance of a `rabbit` service in Cloud Foundry
|
||||
|
||||
* Running instance of the https://docs.pivotal.io/p-cloud-cache/1-0/developer.html[Pivotal Cloud Cache for PCF] (PCC) service `cloudcache` in Cloud Foundry.
|
||||
|
||||
* The Spring Cloud Data Flow Cloud Foundry Server
|
||||
|
||||
include::{docs_dir}/cloudfoundry-server.adoc[]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
+
|
||||
. Get the PCC connection information
|
||||
+
|
||||
```
|
||||
$ cf service-key cloudcache my-service-key
|
||||
Getting key my-service-key for service instance cloudcache as <user>...
|
||||
|
||||
{
|
||||
"locators": [
|
||||
"10.0.16.9[55221]",
|
||||
"10.0.16.11[55221]",
|
||||
"10.0.16.10[55221]"
|
||||
],
|
||||
"urls": {
|
||||
"gfsh": "http://...",
|
||||
"pulse": "http://.../pulse"
|
||||
},
|
||||
"users": [
|
||||
{
|
||||
"password": <password>,
|
||||
"username": "cluster_operator"
|
||||
},
|
||||
{
|
||||
"password": <password>,
|
||||
"username": "developer"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, connect to the PCC instance as `cluster_operator` using the service key values and create the Test region.
|
||||
+
|
||||
```
|
||||
gfsh>connect --use-http --url=<gfsh-url> --user=cluster_operator --password=<cluster_operator_password>
|
||||
gfsh>create region --name Orders --type=REPLICATE
|
||||
```
|
||||
+
|
||||
. Create the stream using the Data Flow Shell
|
||||
+
|
||||
This example creates an gemfire-cq source to which will publish events matching a query criteria on a region. In this case we will monitor the `Orders` region. For simplicity, we will avoid creating a data structure for the order.
|
||||
Each cache entry contains an integer value representing the quantity of the ordered item. This stream will fire a message whenever the value>999. By default, the source emits only the value. Here we will override that using the
|
||||
`cq-event-expression` property. This accepts a SpEL expression bound to a https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/query/CqEvent.html[CQEvent]. To reference the entire CQEvent instance, we use `#this`.
|
||||
In order to display the contents in the log, we will invoke `toString()` on the instance.
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name orders --definition " gemfire-cq --username=developer --password=<developer-password> --connect-type=locator --host-addresses=10.0.16.9:55221 --query='SELECT * from /Orders o where o > 999' --cq-event-expression=#this.toString() | log" --deploy
|
||||
Created and deployed new stream 'events'
|
||||
```
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Monitor stdout for the log sink
|
||||
+
|
||||
```
|
||||
cf logs <log-sink-app-name>
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, create and update some cache entries
|
||||
+
|
||||
```
|
||||
gfsh>connect --use-http --url=<gfsh-url> --user=cluster_operator --password=<cluster_operator_password>
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 01234 --value 1000
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 11234 --value 1005
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 21234 --value 100
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 31234 --value 999
|
||||
gfsh>put --region Orders --value-class java.lang.Integer --key 21234 --value 1000
|
||||
|
||||
```
|
||||
+
|
||||
. Observe the log output
|
||||
You should see messages like:
|
||||
+
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2017-10-30 09:53:02.231 INFO 8563 --- [ire-cq.orders-1] log-sink : CqEvent [CqName=GfCq1; base operation=CREATE; cq operation=CREATE; key=01234; value=1000]
|
||||
2017-10-30 09:53:19.732 INFO 8563 --- [ire-cq.orders-1] log-sink : CqEvent [CqName=GfCq1; base operation=CREATE; cq operation=CREATE; key=11234; value=1005]
|
||||
2017-10-30 09:53:53.242 INFO 8563 --- [ire-cq.orders-1] log-sink : CqEvent [CqName=GfCq1; base operation=UPDATE; cq operation=CREATE; key=21234; value=1000]
|
||||
----
|
||||
+
|
||||
. Another interesting demonstration combines `gemfire-cq` with the link:../http-gemfire/README.adoc[http-gemfire] example.
|
||||
+
|
||||
```
|
||||
dataflow:> stream create --name stocks --definition "http --port=9090 | gemfire-json-server --regionName=Stocks --keyExpression=payload.getField('symbol')" --deploy
|
||||
dataflow:> stream create --name stock_watch --definition "gemfire-cq --query='Select * from /Stocks where symbol=''VMW''' | log" --deploy
|
||||
```
|
||||
+
|
||||
. You're done!
|
||||
106
src/main/asciidoc/streaming/gemfire/gemfire-log/local.adoc
Normal file
@@ -0,0 +1,106 @@
|
||||
[[gemfire-log-local]]
|
||||
==== Using the Local Server
|
||||
===== Additional Prerequisites
|
||||
|
||||
* A Running Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* A running instance of https://www.rabbitmq.com[Rabbit MQ]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. Use gfsh to start a locator and server
|
||||
+
|
||||
```
|
||||
gfsh>start locator --name=locator1
|
||||
gfsh>start server --name=server1
|
||||
|
||||
```
|
||||
. Create a region called `Test`
|
||||
+
|
||||
```
|
||||
gfsh>create region --name Test --type=REPLICATE
|
||||
```
|
||||
+
|
||||
*Use the Shell to create the sample stream*
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
. Create the stream
|
||||
+
|
||||
This example creates an gemfire source to which will publish events on a region
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name events --definition " gemfire --regionName=Test | log" --deploy
|
||||
Created and deployed new stream 'events'
|
||||
```
|
||||
NOTE: If the Geode locator isn't running on default port on `localhost`, add the options `--connect-type=locator --host-addresses=<host>:<port>`. If there are multiple
|
||||
locators, you can provide a comma separated list of locator addresses. This is not necessary for the sample but is typical for production environments to enable fail-over.
|
||||
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
|
||||
. Monitor stdout for the log sink. When you deploy the stream, you will see log messages in the Data Flow server console like this
|
||||
+
|
||||
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2017-10-28 17:28:23.275 INFO 15603 --- [nio-9393-exec-2] o.s.c.d.spi.local.LocalAppDeployer : Deploying app with deploymentId events.log instance 0.
|
||||
Logs will be in /var/folders/hd/5yqz2v2d3sxd3n879f4sg4gr0000gn/T/spring-cloud-dataflow-4093992067314402881/events-1509226103269/events.log
|
||||
2017-10-28 17:28:23.277 INFO 15603 --- [nio-9393-exec-2] o.s.c.d.s.c.StreamDeploymentController : Downloading resource URI [maven://org.springframework.cloud.stream.app:gemfire-source-rabbit:1.2.0.RELEASE]
|
||||
2017-10-28 17:28:23.311 INFO 15603 --- [nio-9393-exec-2] o.s.c.d.s.c.StreamDeploymentController : Deploying application named [gemfire] as part of stream named [events] with resource URI [maven://org.springframework.cloud.stream.app:gemfire-source-rabbit:1.2.0.RELEASE]
|
||||
2017-10-28 17:28:23.318 INFO 15603 --- [nio-9393-exec-2] o.s.c.d.spi.local.LocalAppDeployer : Deploying app with deploymentId events.gemfire instance 0.
|
||||
Logs will be in /var/folders/hd/5yqz2v2d3sxd3n879f4sg4gr0000gn/T/spring-cloud-dataflow-4093992067314402881/events-1509226103311/events.gemfire
|
||||
----
|
||||
|
||||
+
|
||||
Copy the location of the `log` sink logs. This is a directory that ends in `events.log`. The log files will be in `stdout_0.log` under this directory. You can monitor the output of the log sink using `tail`, or something similar:
|
||||
+
|
||||
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
$tail -f /var/folders/hd/5yqz2v2d3sxd3n879f4sg4gr0000gn/T/spring-cloud-dataflow-4093992067314402881/events-1509226103269/events.log/stdout_0.log
|
||||
----
|
||||
|
||||
+
|
||||
. Using `gfsh`, create and update some cache entries
|
||||
+
|
||||
```
|
||||
gfsh>put --region /Test --key 1 --value "value 1"
|
||||
gfsh>put --region /Test --key 2 --value "value 2"
|
||||
gfsh>put --region /Test --key 3 --value "value 3"
|
||||
gfsh>put --region /Test --key 1 --value "new value 1"
|
||||
```
|
||||
+
|
||||
. Observe the log output
|
||||
You should see messages like:
|
||||
+
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : value 1"
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : value 2"
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : value 3"
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : new value 1"
|
||||
----
|
||||
|
||||
+
|
||||
By default, the message payload contains the updated value. Depending on your application, you may need additional information. The data comes from https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/EntryEvent.html[EntryEvent]. You
|
||||
can access any fields using the source's `cache-event-expression` property. This takes a SpEL expression bound to the EntryEvent. Try something like `--cache-event-expression='{key:'\+key+',new_value:'\+newValue+'}'` (HINT: You will need to destroy the stream and recreate it to
|
||||
add this property, an exercise left to the reader). Now you should see log messages like:
|
||||
+
|
||||
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log-sink : {key:1,new_value:value 1}
|
||||
2017-10-28 17:41:24.466 INFO 18986 --- [emfire.events-1] log-sink : {key:2,new_value:value 2}
|
||||
----
|
||||
|
||||
+
|
||||
. You're done!
|
||||
30
src/main/asciidoc/streaming/gemfire/gemfire-log/main.adoc
Normal file
@@ -0,0 +1,30 @@
|
||||
[[spring-cloud-data-flow-samples-gemfire-log-overview]]
|
||||
:sectnums:
|
||||
:docs_dir: ../../..
|
||||
|
||||
=== Gemfire to Log Demo
|
||||
|
||||
In this demonstration, you will learn how to build a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from a `gemfire` endpoint and write to a log using the `log` sink.
|
||||
The `gemfire` source creates a https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/CacheListener.html[CacheListener] to monitor events for a region and publish a message whenever an entry is changed.
|
||||
|
||||
We will take you through the steps to configure and run Spring Cloud Data Flow server in either a https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started/[local] or https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle/#getting-started[Cloud Foundry] environment.
|
||||
|
||||
NOTE: For legacy reasons the `gemfire` Spring Cloud Stream Apps are named after `Pivotal GemFire`. The code base for the commercial product has since been open sourced as `Apache Geode`. These samples should work with compatible versions of Pivotal GemFire or Apache Geode. Herein we will refer to the installed IMDG simply as `Geode`.
|
||||
|
||||
==== Prerequisites
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A Geode installation with a locator and cache server running
|
||||
include::{docs_dir}/geode-setup.adoc[]
|
||||
|
||||
include::local.adoc[]
|
||||
|
||||
include::pcf.adoc[]
|
||||
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and publish events from `gemfire`
|
||||
110
src/main/asciidoc/streaming/gemfire/gemfire-log/pcf.adoc
Normal file
@@ -0,0 +1,110 @@
|
||||
[[gemfire-log-cf]]
|
||||
==== Using the Cloud Foundry Server
|
||||
===== Additional Prerequisites
|
||||
* A Cloud Foundry instance
|
||||
|
||||
* Running instance of a `rabbit` service in Cloud Foundry
|
||||
|
||||
* Running instance of the https://docs.pivotal.io/p-cloud-cache/1-0/developer.html[Pivotal Cloud Cache for PCF] (PCC) service `cloudcache` in Cloud Foundry.
|
||||
|
||||
* The Spring Cloud Data Flow Cloud Foundry Server
|
||||
|
||||
include::{docs_dir}/cloudfoundry-server.adoc[]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
+
|
||||
. Get the PCC connection information
|
||||
+
|
||||
```
|
||||
$ cf service-key cloudcache my-service-key
|
||||
Getting key my-service-key for service instance cloudcache as <user>...
|
||||
|
||||
{
|
||||
"locators": [
|
||||
"10.0.16.9[55221]",
|
||||
"10.0.16.11[55221]",
|
||||
"10.0.16.10[55221]"
|
||||
],
|
||||
"urls": {
|
||||
"gfsh": "http://...",
|
||||
"pulse": "http://.../pulse"
|
||||
},
|
||||
"users": [
|
||||
{
|
||||
"password": <password>,
|
||||
"username": "cluster_operator"
|
||||
},
|
||||
{
|
||||
"password": <password>,
|
||||
"username": "developer"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, connect to the PCC instance as `cluster_operator` using the service key values and create the Test region.
|
||||
+
|
||||
```
|
||||
gfsh>connect --use-http --url=<gfsh-url> --user=cluster_operator --password=<cluster_operator_password>
|
||||
gfsh>create region --name Test --type=REPLICATE
|
||||
```
|
||||
+
|
||||
. Create the stream, connecting to the PCC instance as developer. This example creates an gemfire source to which will publish events on a region
|
||||
+
|
||||
```
|
||||
dataflow stream create --name events --definition " gemfire --username=developer --password=<developer-password> --connect-type=locator --host-addresses=10.0.16.9:55221 --regionName=Test | log" --deploy
|
||||
```
|
||||
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Monitor stdout for the log sink
|
||||
+
|
||||
```
|
||||
cf logs <log-sink-app-name>
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, create and update some cache entries
|
||||
+
|
||||
```
|
||||
gfsh>connect --use-http --url=<gfsh-url> --user=cluster_operator --password=<cluster_operator_password>
|
||||
gfsh>put --region /Test --key 1 --value "value 1"
|
||||
gfsh>put --region /Test --key 2 --value "value 2"
|
||||
gfsh>put --region /Test --key 3 --value "value 3"
|
||||
gfsh>put --region /Test --key 1 --value "new value 1"
|
||||
```
|
||||
+
|
||||
. Observe the log output
|
||||
+
|
||||
You should see messages like:
|
||||
+
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : value 1"
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : value 2"
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : value 3"
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log sink : new value 1"
|
||||
----
|
||||
+
|
||||
By default, the message payload contains the updated value. Depending on your application, you may need additional information. The data comes from https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/EntryEvent.html[EntryEvent]. You
|
||||
can access any fields using the source's `cache-event-expression` property. This takes a SpEL expression bound to the EntryEvent. Try something like `--cache-event-expression='{key:'\+key+',new_value:'\+newValue+'}'` (HINT: You will need to destroy the stream and recreate it to
|
||||
add this property, an exercise left to the reader). Now you should see log messages like:
|
||||
+
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2017-10-28 17:28:52.893 INFO 18986 --- [emfire.events-1] log-sink : {key:1,new_value:value 1}
|
||||
2017-10-28 17:41:24.466 INFO 18986 --- [emfire.events-1] log-sink : {key:2,new_value:value 2}
|
||||
----
|
||||
+
|
||||
. You're done!
|
||||
78
src/main/asciidoc/streaming/gemfire/http-gemfire/local.adoc
Normal file
@@ -0,0 +1,78 @@
|
||||
[[gemfire-http-local]]
|
||||
==== Using the Local Server
|
||||
===== Additional Prerequisites
|
||||
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
* A running instance of https://www.rabbitmq.com[Rabbit MQ]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. Use gfsh to start a locator and server
|
||||
+
|
||||
```
|
||||
gfsh>start locator --name=locator1
|
||||
gfsh>start server --name=server1
|
||||
|
||||
```
|
||||
. Create a region called `Stocks`
|
||||
+
|
||||
```
|
||||
gfsh>create region --name Stocks --type=REPLICATE
|
||||
```
|
||||
+
|
||||
*Use the Shell to create the sample stream*
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
. Create the stream
|
||||
+
|
||||
This example creates an http endpoint to which we will post stock prices as a JSON document containing `symbol` and `price` fields.
|
||||
The property `--json=true` to enable Geode's JSON support and configures the sink to convert JSON String payloads to https://geode.apache.org/releases/latest/javadoc/org/apache/geode/pdx/PdxInstance.html[PdxInstance], the recommended way
|
||||
to store JSON documents in Geode. The `keyExpression` property is a SpEL expression used to extract the `symbol` value the PdxInstance to use as an entry key.
|
||||
+
|
||||
NOTE: PDX serialization is very efficient and supports OQL queries without requiring a custom domain class.
|
||||
Use of custom domain types requires these classes to be in the class path of both the stream apps and the cache server.
|
||||
For this reason, the use of custom payload types is generally discouraged.
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name stocks --definition "http --port=9090 | gemfire --json=true --regionName=Stocks --keyExpression=payload.getField('symbol')" --deploy
|
||||
Created and deployed new stream 'stocks'
|
||||
```
|
||||
NOTE: If the Geode locator isn't running on default port on `localhost`, add the options `--connect-type=locator --host-addresses=<host>:<port>`. If there are multiple
|
||||
locators, you can provide a comma separated list of locator addresses. This is not necessary for the sample but is typical for production environments to enable fail-over.
|
||||
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:9090` (`9090` is the `port` we specified for the `http` source)
|
||||
+
|
||||
```
|
||||
dataflow:>http post --target http://localhost:9090 --contentType application/json --data '{"symbol":"VMW","price":117.06}'
|
||||
> POST (application/json) http://localhost:9090 {"symbol":"VMW","price":117.06}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, connect to the locator if not already connected, and verify the cache entry was created.
|
||||
+
|
||||
```
|
||||
gfsh>get --key='VMW' --region=/Stocks
|
||||
Result : true
|
||||
Key Class : java.lang.String
|
||||
Key : VMW
|
||||
Value Class : org.apache.geode.pdx.internal.PdxInstanceImpl
|
||||
|
||||
symbol | price
|
||||
------ | ------
|
||||
VMW | 117.06
|
||||
```
|
||||
+
|
||||
. You're done!
|
||||
29
src/main/asciidoc/streaming/gemfire/http-gemfire/main.adoc
Normal file
@@ -0,0 +1,29 @@
|
||||
[[spring-cloud-data-flow-samples-gemfire-http-overview]]
|
||||
:sectnums:
|
||||
:docs_dir: ../../..
|
||||
|
||||
=== HTTP to Gemfire Demo
|
||||
|
||||
In this demonstration, you will learn how to build a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from an `http` endpoint and write to Gemfire using the `gemfire` sink.
|
||||
|
||||
We will take you through the steps to configure and run Spring Cloud Data Flow server in either a https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started/[local] or https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle/#getting-started[Cloud Foundry] environment.
|
||||
|
||||
NOTE: For legacy reasons the `gemfire` Spring Cloud Stream Apps are named after `Pivotal GemFire`. The code base for the commercial product has since been open sourced as `Apache Geode`. These samples should work with compatible versions of Pivotal GemFire or Apache Geode. Herein we will refer to the installed IMDG simply as `Geode`.
|
||||
|
||||
==== Prerequisites
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* A Geode installation with a locator and cache server running
|
||||
include::{docs_dir}/geode-setup.adoc[]
|
||||
|
||||
include::local.adoc[]
|
||||
|
||||
include::pcf.adoc[]
|
||||
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and write to `gemfire`
|
||||
106
src/main/asciidoc/streaming/gemfire/http-gemfire/pcf.adoc
Normal file
@@ -0,0 +1,106 @@
|
||||
[[gemfire-http-cf]]
|
||||
===== Using the Cloud Foundry Server
|
||||
====== Additional Prerequisites
|
||||
|
||||
* A Cloud Foundry instance
|
||||
|
||||
* Running instance of a `rabbit` service in Cloud Foundry
|
||||
|
||||
* Running instance of the https://docs.pivotal.io/p-cloud-cache/1-0/developer.html[Pivotal Cloud Cache for PCF] (PCC) service `cloudcache` in Cloud Foundry.
|
||||
|
||||
* Cloud Data Flow Cloud Foundry Server
|
||||
include::{docs_dir}/cloudfoundry-server.adoc[]
|
||||
|
||||
====== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
+
|
||||
. Get the PCC connection information
|
||||
+
|
||||
```
|
||||
$ cf service-key cloudcache my-service-key
|
||||
Getting key my-service-key for service instance cloudcache as <user>...
|
||||
|
||||
{
|
||||
"locators": [
|
||||
"10.0.16.9[55221]",
|
||||
"10.0.16.11[55221]",
|
||||
"10.0.16.10[55221]"
|
||||
],
|
||||
"urls": {
|
||||
"gfsh": "http://...",
|
||||
"pulse": "http://.../pulse"
|
||||
},
|
||||
"users": [
|
||||
{
|
||||
"password": <password>,
|
||||
"username": "cluster_operator"
|
||||
},
|
||||
{
|
||||
"password": <password>,
|
||||
"username": "developer"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, connect to the PCC instance as `cluster_operator` using the service key values and create the Stocks region.
|
||||
+
|
||||
```
|
||||
gfsh>connect --use-http --url=<gfsh-url> --user=cluster_operator --password=<cluster_operator_password>
|
||||
gfsh>create region --name Stocks --type=REPLICATE
|
||||
```
|
||||
+
|
||||
. Create the stream, connecting to the PCC instance as developer
|
||||
+
|
||||
This example creates an http endpoint to which we will post stock prices as a JSON document containing `symbol` and `price` fields.
|
||||
The property `--json=true` to enable Geode's JSON support and configures the sink to convert JSON String payloads to https://geode.apache.org/releases/latest/javadoc/org/apache/geode/pdx/PdxInstance.html[PdxInstance], the recommended way
|
||||
to store JSON documents in Geode. The `keyExpression` property is a SpEL expression used to extract the `symbol` value the PdxInstance to use as an entry key.
|
||||
+
|
||||
NOTE: PDX serialization is very efficient and supports OQL queries without requiring a custom domain class.
|
||||
Use of custom domain types requires these classes to be in the class path of both the stream apps and the cache server.
|
||||
For this reason, the use of custom payload types is generally discouraged.
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name stocks --definition "http --security.basic.enabled=false | gemfire --username=developer --password=<developer-password> --connect-type=locator --host-addresses=10.0.16.9:55221 --regionName=Stocks --keyExpression=payload.getField('symbol')" --deploy
|
||||
```
|
||||
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
|
||||
. Post sample data pointing to the `http` endpoint
|
||||
+
|
||||
|
||||
Get the url of the http source using `cf apps`
|
||||
+
|
||||
```
|
||||
dataflow:>http post --target http://<http source url> --contentType application/json --data '{"symbol":"VMW","price":117.06}'
|
||||
> POST (application/json) http://... {"symbol":"VMW","price":117.06}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Using `gfsh`, connect to the PCC instance as `cluster_operator` using the service key values.
|
||||
+
|
||||
```
|
||||
gfsh>connect --use-http --url=<gfsh-url> --user=cluster_operator --password=<cluster_operator_password>
|
||||
gfsh>get --key='VMW' --region=/Stocks
|
||||
Result : true
|
||||
Key Class : java.lang.String
|
||||
Key : VMW
|
||||
Value Class : org.apache.geode.pdx.internal.PdxInstanceImpl
|
||||
|
||||
symbol | price
|
||||
------ | ------
|
||||
VMW | 117.06
|
||||
```
|
||||
+
|
||||
. You're done!
|
||||
74
src/main/asciidoc/streaming/jdbc/http-mysql/local.adoc
Normal file
@@ -0,0 +1,74 @@
|
||||
==== Using the Local Server
|
||||
|
||||
===== Additional Prerequisites
|
||||
|
||||
* A running local Data Flow Server
|
||||
include::{docs_dir}/local-server.adoc[]
|
||||
|
||||
* Running instance of link:http://kafka.apache.org/downloads.html[Kafka]
|
||||
* Running instance of link:http://www.mysql.com/[MySQL]
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] or link:https://www.dbvis.com/[DbVisualizer]
|
||||
* Create the `test` database with a `names` table (in MySQL) using:
|
||||
+
|
||||
```
|
||||
CREATE DATABASE test;
|
||||
USE test;
|
||||
CREATE TABLE names
|
||||
(
|
||||
name varchar(255)
|
||||
);
|
||||
```
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Kafka binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-kafka-10-maven
|
||||
```
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name mysqlstream --definition "http --server.port=8787 | jdbc --tableName=names --columns=name --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver --spring.datasource.url='jdbc:mysql://localhost:3306/test'" --deploy
|
||||
|
||||
Created and deployed new stream 'mysqlstream'
|
||||
```
|
||||
NOTE: If MySQL isn't running on default port on `localhost` or if you need username and password to connect, use one of the following options to specify the necessary connection parameters: `--spring.datasource.url='jdbc:mysql://<HOST>:<PORT>/<NAME>' --spring.datasource.username=<USERNAME> --spring.datasource.password=<PASSWORD>`
|
||||
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `mysqlstream-http` and `mysqlstream-jdbc` https://github.com/spring-cloud-stream-app-starters//[Spring Cloud Stream] applications are running as Spring Boot applications within the Local `server` as collocated processes.
|
||||
+
|
||||
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
2016-05-03 09:29:55.918 INFO 65162 --- [nio-9393-exec-3] o.s.c.d.spi.local.LocalAppDeployer : deploying app mysqlstream.jdbc instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-dataflow-6850863945840320040/mysqlstream1-1462292995903/mysqlstream.jdbc
|
||||
2016-05-03 09:29:55.939 INFO 65162 --- [nio-9393-exec-3] o.s.c.d.spi.local.LocalAppDeployer : deploying app mysqlstream.http instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-dataflow-6850863945840320040/mysqlstream-1462292995934/mysqlstream.http
|
||||
----
|
||||
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:8787` [`8787` is the `server.port` we specified for the `http` source in this case]
|
||||
|
||||
+
|
||||
```
|
||||
dataflow:>http post --contentType 'application/json' --target http://localhost:8787 --data "{\"name\": \"Foo\"}"
|
||||
> POST (application/json;charset=UTF-8) http://localhost:8787 {"name": "Spring Boot"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the MySQL instance and query the table `test.names` to list the new rows:
|
||||
+
|
||||
```
|
||||
select * from test.names;
|
||||
```
|
||||
+
|
||||
. You're done!
|
||||
25
src/main/asciidoc/streaming/jdbc/http-mysql/main.adoc
Normal file
@@ -0,0 +1,25 @@
|
||||
:sectnums:
|
||||
:docs_dir: ../../..
|
||||
|
||||
=== HTTP to MySQL Demo
|
||||
|
||||
In this demonstration, you will learn how to build a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from an `http` endpoint and write to MySQL database using `jdbc` sink.
|
||||
|
||||
We will take you through the steps to configure and Spring Cloud Data Flow server in either a https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#getting-started/[local] or https://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current/reference/htmlsingle/#getting-started[Cloud Foundry] environment.
|
||||
|
||||
==== Prerequisites
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
|
||||
include::local.adoc[]
|
||||
|
||||
include::pcf.adoc[]
|
||||
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and write to `MySQL`
|
||||
* How to scale applications on `Pivotal Cloud Foundry`
|
||||
104
src/main/asciidoc/streaming/jdbc/http-mysql/pcf.adoc
Normal file
@@ -0,0 +1,104 @@
|
||||
|
||||
==== Using the Cloud Foundry Server
|
||||
|
||||
===== Additional Prerequisites
|
||||
|
||||
* Cloud Foundry instance
|
||||
|
||||
* Running instance of `rabbit` in Cloud Foundry
|
||||
* Running instance of `mysql` in Cloud Foundry
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] or link:https://www.dbvis.com/[DbVisualizer]
|
||||
* Create the `names` table (in MySQL) using:
|
||||
+
|
||||
```
|
||||
CREATE TABLE names
|
||||
(
|
||||
name varchar(255)
|
||||
);
|
||||
```
|
||||
+
|
||||
* The Spring Cloud Data Flow Cloud Foundry Server
|
||||
include::{docs_dir}/cloudfoundry-server.adoc[]
|
||||
|
||||
===== Building and Running the Demo
|
||||
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] the out-of-the-box applications for the Rabbit binder
|
||||
+
|
||||
include::{docs_dir}/maven-access.adoc[]
|
||||
+
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>stream create --name mysqlstream --definition "http | jdbc --tableName=names --columns=name"
|
||||
Created new stream 'mysqlstream'
|
||||
|
||||
dataflow:>stream deploy --name mysqlstream --properties "app.jdbc.spring.cloud.deployer.cloudfoundry.services=mysql"
|
||||
Deployed stream 'mysqlstream'
|
||||
|
||||
```
|
||||
+
|
||||
|
||||
NOTE: By supplying the `app.jdbc.spring.cloud.deployer.cloudfoundry.services=mysql` property, we are deploying the stream with `jdbc-sink` to automatically bind to `mysql` service and only this application in the stream gets the service binding. This also eliminates the requirement to supply `datasource` credentials in stream definition.
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `mysqlstream-http` and `mysqlstream-jdbc` https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running as _cloud-native_ (microservice) applications in Cloud Foundry
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
mysqlstream-http started 1/1 1G 1G mysqlstream-http.app.io
|
||||
mysqlstream-jdbc started 1/1 1G 1G mysqlstream-jdbc.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. Lookup the `url` for `mysqlstream-http` application from the list above. Post sample data pointing to the `http` endpoint: `<YOUR-mysqlstream-http-APP-URL>`
|
||||
+
|
||||
```
|
||||
http post --contentType 'application/json' --target http://mysqlstream-http.app.io --data "{\"name\": \"Bar"}"
|
||||
> POST (application/json;charset=UTF-8) http://mysqlstream-http.app.io {"name": "Bar"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the MySQL instance and query the table `names` to list the new rows:
|
||||
+
|
||||
```
|
||||
select * from names;
|
||||
```
|
||||
|
||||
+
|
||||
. Now, let's take advantage of Pivotal Cloud Foundry's platform capability. Let's scale the `mysqlstream-http` application from 1 to 3 instances
|
||||
+
|
||||
```
|
||||
$ cf scale mysqlstream-http -i 3
|
||||
Scaling app mysqlstream-http in org user-dataflow / space development as user...
|
||||
OK
|
||||
```
|
||||
+
|
||||
. Verify App instances (3/3) running successfully
|
||||
+
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
mysqlstream-http started 3/3 1G 1G mysqlstream-http.app.io
|
||||
mysqlstream-jdbc started 1/1 1G 1G mysqlstream-jdbc.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. You're done!
|
||||
@@ -1,39 +1,23 @@
|
||||
:sectnums:
|
||||
= Batch Job on Cloud Foundry
|
||||
:docs_dir: ../..
|
||||
=== Batch Job on Cloud Foundry
|
||||
|
||||
In this demonstration, you will learn how to orchestrate short-lived data processing application (_eg: Spring Batch Jobs_) using http://cloud.spring.io/spring-cloud-task/[Spring Cloud Task] and http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] on Cloud Foundry.
|
||||
|
||||
== Using Cloud Foundry Server
|
||||
==== Prerequisites
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
In order to get started, make sure that you have the following components:
|
||||
|
||||
* Local https://pivotal.io/pcf-dev[PCFDev] instance
|
||||
* Local https://pivotal.io/pcf-dev[PCFDev] instance
|
||||
* Local install of https://github.com/cloudfoundry/cli[cf CLI] command line tool
|
||||
* Local build of https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* Local build of Spring Cloud Data Flow's https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry[Cloud Foundry Server]
|
||||
* Running instance of mysql in PCFDev
|
||||
* A Running Data Flow Shell
|
||||
include::{docs_dir}/shell.adoc[]
|
||||
* The Spring Cloud Data Flow Cloud Foundry Server running in PCFDev
|
||||
include::{docs_dir}/cloudfoundry-server.adoc[]
|
||||
|
||||
==== Building and Running the Demo
|
||||
|
||||
NOTE: PCF 1.7.12 or greater is required to run Tasks on Spring Cloud Data Flow. As of this writing, PCFDev and PWS supports builds upon this version.
|
||||
|
||||
=== Running the Sample in Cloud Foundry
|
||||
|
||||
. Verify that CF instance is reachable
|
||||
+
|
||||
|
||||
```
|
||||
→ cf api
|
||||
api endpoint: https://api.local.pcfdev.io
|
||||
api version: 2.75.0
|
||||
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
No apps found
|
||||
```
|
||||
+
|
||||
. Task support needs to be enabled on pcf-dev. Being logged as `admin`, issue the following command:
|
||||
+
|
||||
```
|
||||
@@ -44,32 +28,14 @@ OK
|
||||
|
||||
Feature task_creation Enabled.
|
||||
```
|
||||
+
|
||||
. Follow the http://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current-SNAPSHOT/reference/htmlsingle/#getting-started[getting-started] instructions to deploy Spring Cloud Data Flow's Cloud Foundry Server
|
||||
|
||||
+
|
||||
NOTE: For this sample, all you need is the `mysql` service and in PCFDev, the `mysql` service comes with a different plan. From CF CLI, create the service by: `cf create-service p-mysql 512mb mysql` and bind this service to `dataflow-server` by: `cf bind-service dataflow-server mysql`.
|
||||
+
|
||||
|
||||
NOTE: All the apps deployed to PCFDev start with low memory by default. It is recommended to change it to at least 768MB for `dataflow-server`. Ditto for every app spawned *by* Spring Cloud Data Flow. Change the memory by: `cf set-env dataflow-server SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_MEMORY 512`. Likewise, we would have to skip SSL validation by: `cf set-env dataflow-server SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION true`.
|
||||
|
||||
. Once you complete the instructions, you'll be able to list the newly deployed `dataflow-server`
|
||||
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
dataflow-server started 1/1 512M 512M dataflow-server.local.pcfdev.io
|
||||
```
|
||||
+
|
||||
|
||||
NOTE: The `ORG`, `SPACE` and `USER` could vary depending on your Cloud Foundry environment in use.
|
||||
|
||||
. Tasks in Spring Cloud Data Flow require an RDBMS to host "task repository" (see http://docs.spring.io/spring-cloud-dataflow/docs/current-SNAPSHOT/reference/htmlsingle/#spring-cloud-dataflow-task-repository[here] for more details), so let's instruct the Spring Cloud Data Flow server to bind the `mysql` service to each deployed task:
|
||||
. Tasks in Spring Cloud Data Flow require an RDBMS to host "task repository" (see http://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#spring-cloud-dataflow-task-repository[here] for more details), so let's instruct the Spring Cloud Data Flow server to bind the `mysql` service to each deployed task:
|
||||
|
||||
+
|
||||
|
||||
@@ -106,43 +72,10 @@ No staging env variables have been set
|
||||
|
||||
. Notice that `dataflow-server` application is started and ready for interaction via `http://dataflow-server.local.pcfdev.io` endpoint
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`.
|
||||
+
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
server-unknown:>
|
||||
```
|
||||
+
|
||||
. Connect `shell` with the `server` running at `http://dataflow-server.local.pcfdev.io`
|
||||
+
|
||||
|
||||
```
|
||||
server-unknown:>dataflow config server http://dataflow-server.local.pcfdev.io
|
||||
Successfully targeted http://dataflow-server.local.pcfdev.io
|
||||
```
|
||||
+
|
||||
|
||||
. Let's build and register the batch-job https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/batch-job[example] from Spring Cloud Task samples. For convenience, the final https://github.com/spring-cloud/spring-cloud-dataflow-samples/raw/master/tasks/simple-batch-job/batch-job-1.0.0.BUILD-SNAPSHOT.jar[uber-jar artifact] is provided with this sample
|
||||
. Build and register the batch-job https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/batch-job[example] from Spring Cloud Task samples. For convenience, the final https://github.com/spring-cloud/spring-cloud-dataflow-samples/raw/master/src/main/asciidoc/tasks/simple-batch-job/batch-job-1.0.0.BUILD-SNAPSHOT.jar[uber-jar artifact] is provided with this sample.
|
||||
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app register --type task --name simple_batch_job --uri https://github.com/spring-cloud/spring-cloud-dataflow-samples/raw/master/tasks/simple-batch-job/batch-job-1.3.0.BUILD-SNAPSHOT.jar
|
||||
```
|
||||
@@ -154,7 +87,7 @@ dataflow:>app register --type task --name simple_batch_job --uri https://github.
|
||||
```
|
||||
dataflow:>task create foo --definition "simple_batch_job"
|
||||
```
|
||||
NOTE: Unlike Streams, the Task definitions don't require explicit deployment. They can be launched on-demand, scheduled, or triggered by streams.
|
||||
NOTE: Unlike Streams, the Task definitions don't require explicit deployment. They can be launched on-demand, scheduled, or triggered by streams.
|
||||
|
||||
+
|
||||
|
||||
@@ -162,7 +95,7 @@ NOTE: Unlike Streams, the Task definitions don't require explicit deployment. Th
|
||||
|
||||
+
|
||||
```
|
||||
cf apps
|
||||
$ cf apps
|
||||
Getting apps in org pcfdev-org / space pcfdev-space as user...
|
||||
OK
|
||||
|
||||
@@ -176,7 +109,7 @@ dataflow-server started 1/1 768M 512M dataflow-server.
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>task launch foo
|
||||
dataflow:>task launch foo
|
||||
```
|
||||
+
|
||||
|
||||
@@ -184,8 +117,9 @@ dataflow:>task launch foo
|
||||
|
||||
+
|
||||
|
||||
```
|
||||
→ cf logs foo
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
$ cf logs foo
|
||||
Retrieving logs for app foo in org pcfdev-org / space pcfdev-space as user...
|
||||
|
||||
2016-08-14T18:48:54.22-0700 [APP/TASK/foo/0]OUT Creating container
|
||||
@@ -214,12 +148,13 @@ Retrieving logs for app foo in org pcfdev-org / space pcfdev-space as user...
|
||||
2016-08-14T18:49:07.71-0700 [APP/TASK/foo/0]OUT Exit status 0
|
||||
2016-08-14T18:49:07.78-0700 [APP/TASK/foo/0]OUT Destroying container
|
||||
2016-08-14T18:49:08.47-0700 [APP/TASK/foo/0]OUT Successfully destroyed container
|
||||
|
||||
```
|
||||
NOTE: Verify `job1` and `job2` operations embeddded in `simple-batch-job` application are launched independently and they returned with the status `COMPLETED`.
|
||||
----
|
||||
|
||||
+
|
||||
NOTE: Verify `job1` and `job2` operations embeddded in `simple-batch-job` application are launched independently and they returned with the status `COMPLETED`.
|
||||
+
|
||||
|
||||
+
|
||||
NOTE: Unlike LRPs in Cloud Foundry, tasks are short-lived, so the logs aren't always available. They are generated only when the Task application runs; at the end of Task operation, the container that ran the Task application is destroyed to free-up resources.
|
||||
+
|
||||
|
||||
@@ -228,7 +163,7 @@ NOTE: Unlike LRPs in Cloud Foundry, tasks are short-lived, so the logs aren't al
|
||||
+
|
||||
|
||||
```
|
||||
→ cf apps
|
||||
$ cf apps
|
||||
Getting apps in org pcfdev-org / space pcfdev-space as user...
|
||||
OK
|
||||
|
||||
@@ -242,20 +177,22 @@ foo stopped 0/1 1G 1G
|
||||
|
||||
+
|
||||
|
||||
```
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
dataflow:>task execution list
|
||||
╔══════════════════════════╤══╤════════════════════════════╤════════════════════════════╤═════════╗
|
||||
║ Task Name │ID│ Start Time │ End Time │Exit Code║
|
||||
╠══════════════════════════╪══╪════════════════════════════╪════════════════════════════╪═════════╣
|
||||
║foo │1 │Sun Aug 14 18:49:05 PDT 2016│Sun Aug 14 18:49:07 PDT 2016│0 ║
|
||||
╚══════════════════════════╧══╧════════════════════════════╧════════════════════════════╧═════════╝
|
||||
```
|
||||
----
|
||||
|
||||
. Verify Job execution details
|
||||
|
||||
+
|
||||
|
||||
```
|
||||
[source,console,options=nowrap]
|
||||
----
|
||||
dataflow:>job execution list
|
||||
╔═══╤═══════╤═════════╤════════════════════════════╤═════════════════════╤══════════════════╗
|
||||
║ID │Task ID│Job Name │ Start Time │Step Execution Count │Definition Status ║
|
||||
@@ -263,14 +200,14 @@ dataflow:>job execution list
|
||||
║2 │1 │job2 │Sun Aug 14 18:49:07 PDT 2016│1 │Destroyed ║
|
||||
║1 │1 │job1 │Sun Aug 14 18:49:06 PDT 2016│1 │Destroyed ║
|
||||
╚═══╧═══════╧═════════╧════════════════════════════╧═════════════════════╧══════════════════╝
|
||||
```
|
||||
----
|
||||
+
|
||||
|
||||
|
||||
== Summary
|
||||
==== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to register and orchestrate Spring Batch jobs in Spring Cloud Data Flow
|
||||
* How to use the `cf` CLI in the context of Task applications orchestrated by Spring Cloud Data Flow
|
||||
* How to verify task executions and task repository
|
||||
* How to verify task executions and task repository
|
||||
35
src/main/docbook/css/highlight.css
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
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;
|
||||
}
|
||||
9
src/main/docbook/css/manual-multipage.css
Normal file
@@ -0,0 +1,9 @@
|
||||
@IMPORT url("manual.css");
|
||||
|
||||
body.firstpage {
|
||||
background: url("../images/background.png") no-repeat center top;
|
||||
}
|
||||
|
||||
div.part h1 {
|
||||
border-top: none;
|
||||
}
|
||||
6
src/main/docbook/css/manual-singlepage.css
Normal file
@@ -0,0 +1,6 @@
|
||||
@IMPORT url("manual.css");
|
||||
|
||||
body {
|
||||
background: url("../images/background.png") no-repeat center top;
|
||||
}
|
||||
|
||||
348
src/main/docbook/css/manual.css
Normal file
@@ -0,0 +1,348 @@
|
||||
@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;
|
||||
}
|
||||
|
||||
.mediaobject img {
|
||||
max-width: 100%;
|
||||
}
|
||||
BIN
src/main/docbook/images/background.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/main/docbook/images/caution.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/main/docbook/images/cover.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
src/main/docbook/images/important.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/main/docbook/images/logo.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
16
src/main/docbook/images/logo.svg
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 358 237" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
||||
<g transform="matrix(1,0,0,1,-9.9998,-60.6186)">
|
||||
<path d="M196.349,60.619C150.339,60.619 106.426,88.13 89.574,126.519C44.991,130.32 10,166.329 10,211.897C10,259.99 48.988,297.382 97.081,297.382L292.107,297.382C334.021,297.382 368,264.16 368,222.245C368,187.442 344.544,157.916 312.599,148.965C299.898,96.651 248.932,60.619 196.349,60.619M196.349,69.93C246.221,69.93 292.308,104.852 303.55,151.161L304.837,156.46L310.087,157.93C338.703,165.949 358.689,192.396 358.689,222.245C358.689,239.959 351.779,256.529 339.233,268.902C326.699,281.263 309.963,288.07 292.107,288.07L97.081,288.07C53.472,288.07 19.311,254.611 19.311,211.897C19.311,171.967 49.858,139.251 90.365,135.796L95.877,135.326L98.1,130.262C113.694,94.739 154.095,69.93 196.349,69.93" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M117.543,249.699C115.869,249.699 115.326,249.88 114.963,250.197C114.466,250.648 113.742,251.871 113.742,259.7C113.742,267.529 114.466,268.751 114.963,269.157C115.326,269.52 115.869,269.655 117.543,269.655L121.661,269.655C123.381,269.655 123.879,269.52 124.286,269.157C124.784,268.751 125.508,267.529 125.508,259.7C125.508,251.871 124.784,250.648 124.286,250.197C123.879,249.88 123.381,249.699 121.661,249.699L117.543,249.699ZM123.291,243.861C126.775,243.861 128.449,244.269 129.807,245.535C131.662,247.21 133.201,250.513 133.201,259.7C133.201,268.841 131.662,272.145 129.807,273.864C128.449,275.086 126.775,275.539 123.291,275.539L115.914,275.539C112.43,275.539 110.801,275.086 109.443,273.864C107.542,272.145 106.049,268.841 106.049,259.7C106.049,250.513 107.542,247.21 109.443,245.535C110.801,244.269 112.43,243.861 115.914,243.861L123.291,243.861Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M151.182,268.74L151.182,246.372L146.684,247.912L145.063,243.13L152.56,240.334L157.747,240.334L157.747,268.74L151.182,268.74Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M181.9,238.18C180.64,238.18 180.231,238.316 179.958,238.555C179.584,238.896 179.038,239.815 179.038,245.71C179.038,251.603 179.584,252.524 179.958,252.83C180.231,253.103 180.64,253.205 181.9,253.205L185.001,253.205C186.295,253.205 186.67,253.103 186.977,252.83C187.351,252.524 187.896,251.603 187.896,245.71C187.896,239.815 187.351,238.896 186.977,238.555C186.67,238.316 186.295,238.18 185.001,238.18L181.9,238.18ZM186.227,233.785C188.851,233.785 190.111,234.092 191.133,235.046C192.53,236.306 193.688,238.793 193.688,245.71C193.688,252.592 192.53,255.079 191.133,256.373C190.111,257.293 188.851,257.634 186.227,257.634L180.674,257.634C178.051,257.634 176.824,257.293 175.802,256.373C174.371,255.079 173.246,252.592 173.246,245.71C173.246,238.793 174.371,236.306 175.802,235.046C176.824,234.092 178.051,233.785 180.674,233.785L186.227,233.785Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M207.993,246.058L207.993,229.122L204.587,230.288L203.36,226.667L209.036,224.55L212.963,224.55L212.963,246.058L207.993,246.058Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M227.673,233.867L227.673,218.302L224.543,219.373L223.415,216.046L228.632,214.101L232.241,214.101L232.241,233.867L227.673,233.867Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M245.784,204.528C244.964,204.528 244.698,204.617 244.521,204.772C244.277,204.993 243.922,205.592 243.922,209.426C243.922,213.26 244.277,213.859 244.521,214.058C244.698,214.236 244.964,214.302 245.784,214.302L247.801,214.302C248.643,214.302 248.887,214.236 249.087,214.058C249.33,213.859 249.685,213.26 249.685,209.426C249.685,205.592 249.33,204.993 249.087,204.772C248.887,204.617 248.643,204.528 247.801,204.528L245.784,204.528ZM248.599,201.669C250.306,201.669 251.125,201.868 251.79,202.489C252.699,203.309 253.453,204.927 253.453,209.426C253.453,213.903 252.699,215.521 251.79,216.363C251.125,216.962 250.306,217.183 248.599,217.183L244.986,217.183C243.279,217.183 242.482,216.962 241.817,216.363C240.886,215.521 240.155,213.903 240.155,209.426C240.155,204.927 240.886,203.309 241.817,202.489C242.482,201.868 243.279,201.669 244.986,201.669L248.599,201.669Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M260.397,189.018C259.718,189.018 259.497,189.091 259.351,189.22C259.149,189.404 258.855,189.899 258.855,193.075C258.855,196.251 259.149,196.747 259.351,196.912C259.497,197.059 259.718,197.114 260.397,197.114L262.068,197.114C262.765,197.114 262.967,197.059 263.133,196.912C263.334,196.747 263.628,196.251 263.628,193.075C263.628,189.899 263.334,189.404 263.133,189.22C262.967,189.091 262.765,189.018 262.068,189.018L260.397,189.018ZM262.729,186.65C264.142,186.65 264.822,186.815 265.372,187.329C266.125,188.008 266.749,189.348 266.749,193.075C266.749,196.784 266.125,198.124 265.372,198.822C264.822,199.317 264.142,199.501 262.729,199.501L259.736,199.501C258.322,199.501 257.662,199.317 257.111,198.822C256.34,198.124 255.734,196.784 255.734,193.075C255.734,189.348 256.34,188.008 257.111,187.329C257.662,186.815 258.322,186.65 259.736,186.65L262.729,186.65Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M271.225,174.377C270.731,174.377 270.571,174.43 270.464,174.524C270.317,174.657 270.103,175.018 270.103,177.328C270.103,179.638 270.317,179.998 270.464,180.119C270.571,180.225 270.731,180.265 271.225,180.265L272.44,180.265C272.948,180.265 273.095,180.225 273.215,180.119C273.362,179.998 273.576,179.638 273.576,177.328C273.576,175.018 273.362,174.657 273.215,174.524C273.095,174.43 272.948,174.377 272.44,174.377L271.225,174.377ZM272.922,172.655C273.949,172.655 274.444,172.775 274.844,173.149C275.391,173.643 275.845,174.618 275.845,177.329C275.845,180.026 275.391,181.001 274.844,181.508C274.444,181.869 273.949,182.002 272.922,182.002L270.744,182.002C269.716,182.002 269.237,181.869 268.835,181.508C268.274,181.001 267.833,180.026 267.833,177.329C267.833,174.618 268.274,173.643 268.835,173.149C269.237,172.775 269.716,172.655 270.744,172.655L272.922,172.655Z" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
<path d="M295.781,74.844C285.502,104.632 249.445,127.961 220.221,134.908C192.822,141.431 168.578,136.074 143.229,145.827C94.177,164.682 90.9,210.795 107.402,237.646C108.689,239.74 172.488,234.658 203.829,221.226C245.552,203.345 270.463,169.593 276.926,157.026C277.414,156.508 278.989,155.151 281.516,155.956C284.146,156.795 284.291,158.966 284.263,159.696C281.416,172.76 269.221,217.845 220.787,246.439C198.758,259.444 181.874,265.843 169.53,269.203C167.455,269.768 167.558,271.302 169.92,271.284C200.124,271.052 269.052,275.466 297.762,238.991C330.998,194.727 313.402,124.98 295.781,74.844" style="fill:rgb(50,181,47);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.9 KiB |
BIN
src/main/docbook/images/note.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/main/docbook/images/tip.png
Normal file
|
After Width: | Height: | Size: 931 B |
BIN
src/main/docbook/images/warning.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
45
src/main/docbook/xsl/common.xsl
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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>
|
||||
31
src/main/docbook/xsl/epub.xsl
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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>
|
||||
73
src/main/docbook/xsl/html-multipage.xsl
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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>
|
||||
30
src/main/docbook/xsl/html-singlepage.xsl
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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>
|
||||
141
src/main/docbook/xsl/html.xsl
Normal file
@@ -0,0 +1,141 @@
|
||||
<?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>
|
||||
591
src/main/docbook/xsl/pdf.xsl
Normal file
@@ -0,0 +1,591 @@
|
||||
<?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.svg" width="240px"
|
||||
height="auto" content-width="scale-to-fit"
|
||||
content-height="scale-to-fit"
|
||||
content-type="content-type:image/svg" 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="d:personname/d:firstname"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="d:personname/d:surname"/>
|
||||
</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/d:year"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="d:info/d:copyright/d:holder"/>
|
||||
</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:template match="*" mode="admon.graphic.width">
|
||||
<xsl:text>18pt</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<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>
|
||||
23
src/main/docbook/xsl/xslthl-config.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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>
|
||||
41
src/main/docbook/xsl/xslthl/asciidoc-hl.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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>
|
||||
95
src/main/docbook/xsl/xslthl/bourne-hl.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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>
|
||||
117
src/main/docbook/xsl/xslthl/c-hl.xml
Normal file
@@ -0,0 +1,117 @@
|
||||
<?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>
|
||||
151
src/main/docbook/xsl/xslthl/cpp-hl.xml
Normal file
@@ -0,0 +1,151 @@
|
||||
<?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>
|
||||
194
src/main/docbook/xsl/xslthl/csharp-hl.xml
Normal file
@@ -0,0 +1,194 @@
|
||||
<?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>
|
||||
176
src/main/docbook/xsl/xslthl/css-hl.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<?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>
|
||||
122
src/main/docbook/xsl/xslthl/html-hl.xml
Normal file
@@ -0,0 +1,122 @@
|
||||
<?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>
|
||||
45
src/main/docbook/xsl/xslthl/ini-hl.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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>
|
||||
117
src/main/docbook/xsl/xslthl/java-hl.xml
Normal file
@@ -0,0 +1,117 @@
|
||||
<?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>
|
||||
147
src/main/docbook/xsl/xslthl/javascript-hl.xml
Normal file
@@ -0,0 +1,147 @@
|
||||
<?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>
|
||||
37
src/main/docbook/xsl/xslthl/json-hl.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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>
|
||||
120
src/main/docbook/xsl/xslthl/perl-hl.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
154
src/main/docbook/xsl/xslthl/php-hl.xml
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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>
|
||||
38
src/main/docbook/xsl/xslthl/properties-hl.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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>
|
||||
100
src/main/docbook/xsl/xslthl/python-hl.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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>
|
||||
109
src/main/docbook/xsl/xslthl/ruby-hl.xml
Normal file
@@ -0,0 +1,109 @@
|
||||
<?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>
|
||||
565
src/main/docbook/xsl/xslthl/sql2003-hl.xml
Normal file
@@ -0,0 +1,565 @@
|
||||
<?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>
|
||||
47
src/main/docbook/xsl/xslthl/yaml-hl.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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,295 +0,0 @@
|
||||
:sectnums:
|
||||
= HTTP to Cassandra Demo
|
||||
|
||||
In this demonstration, you will learn how to orchestrate a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from an _HTTP_ endpoint and write the payload to a _Cassandra_ database.
|
||||
|
||||
We will begin by discussing the steps to prep, configure and operationalize Spring Cloud Data Flow's `server` Spring Boot application. We will deploy the `server` using https://github.com/spring-cloud/spring-cloud-dataflow/tree/master/spring-cloud-dataflow-server-local[Local] as well as https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry[Cloud Foundry] SPIs (Service Provider Interface) to demonstrate how Spring Cloud Data Flow takes advantage of _dev-sandbox_ and _cloud-native_ platform capabilities respectively.
|
||||
|
||||
== Using Local Server
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
Make sure that you have the following components:
|
||||
|
||||
* Local build of link:https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* Running instance of link:http://kafka.apache.org/downloads.html[Kafka]
|
||||
* Running instance of link:http://cassandra.apache.org/[Apache Cassandra]
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] to connect to the Cassandra instance. You might have to provide `host`, `port`, `username` and `password` depending on the Cassandra configuration you are using.
|
||||
* Create a keyspace and a `book` table in Cassandra using:
|
||||
+
|
||||
```
|
||||
CREATE KEYSPACE clouddata WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1' } AND DURABLE_WRITES = true;
|
||||
USE clouddata;
|
||||
CREATE TABLE book (
|
||||
id uuid PRIMARY KEY,
|
||||
isbn text,
|
||||
author text,
|
||||
title text
|
||||
);
|
||||
```
|
||||
|
||||
=== Running the Sample Locally
|
||||
|
||||
. Launch the locally built `server` application
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-server-local/target/spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
|
||||
```
|
||||
+
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`
|
||||
+
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] Kafka binder variant of out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-kafka-10-maven
|
||||
```
|
||||
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
```
|
||||
dataflow:>stream create cassandrastream --definition "http --server.port=8888 --spring.cloud.stream.bindings.output.contentType='application/json' | cassandra --ingestQuery='insert into book (id, isbn, title, author) values (uuid(), ?, ?, ?)' --keyspace=clouddata" --deploy
|
||||
|
||||
Created and deployed new stream 'cassandrastream'
|
||||
```
|
||||
NOTE: If Cassandra isn't running on default port on `localhost` or if you need username and password to connect, use one of the following options to specify the necessary connection parameters: `--username='<USERNAME>' --password='<PASSWORD>' --port=<PORT> --contact-points=<LIST-OF-HOSTS>`
|
||||
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `cassandrastream-http` and `cassandrastream-cassandra` link:https://github.com/spring-cloud-stream-app-starters//[Spring Cloud Stream] applications are running as Spring Boot applications within the `server` as a collocated process.
|
||||
+
|
||||
|
||||
```
|
||||
2015-12-15 15:52:31.576 INFO 18337 --- [nio-9393-exec-1] o.s.c.d.a.s.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:cassandra-sink:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-284240942697761420/cassandrastream.cassandra
|
||||
2015-12-15 15:52:31.583 INFO 18337 --- [nio-9393-exec-1] o.s.c.d.a.s.l.OutOfProcessModuleDeployer : deploying module org.springframework.cloud.stream.module:http-source:jar:exec:1.0.0.BUILD-SNAPSHOT instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-data-flow-284240942697761420/cassandrastream.http
|
||||
```
|
||||
+
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:8888` [`8888` is the `server.port` we specified for the `http` source in this case]
|
||||
+
|
||||
```
|
||||
dataflow:>http post --contentType 'application/json' --data '{"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}' --target http://localhost:8888
|
||||
> POST (application/json;charset=UTF-8) http://localhost:8888 {"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the Cassandra instance and query the table `clouddata.book` to list the persisted records
|
||||
+
|
||||
```
|
||||
select * from clouddata.book;
|
||||
```
|
||||
|
||||
+
|
||||
. That's it; you're done!
|
||||
|
||||
|
||||
== Using Cloud Foundry Server
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
In order to get started, make sure that you have the following components:
|
||||
|
||||
* Cloud Foundry instance
|
||||
* Local build of https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* Local build of Spring Cloud Data Flow's https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry[Cloud Foundry Server]
|
||||
* Running instance of `rabbit` in Cloud Foundry
|
||||
* Running instance of `cassandra` in Cloud Foundry or from another Cloud provider
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] to connect to the Cassandra instance. You might have to provide `host`, `port`, `username` and `password` depending on the Cassandra configuration you are using.
|
||||
* Create a `book` table in your Cassandra keyspace using:
|
||||
+
|
||||
```
|
||||
CREATE TABLE book (
|
||||
id uuid PRIMARY KEY,
|
||||
isbn text,
|
||||
author text,
|
||||
title text
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
=== Running the Sample in Cloud Foundry
|
||||
|
||||
. Verify that CF instance is reachable
|
||||
+
|
||||
|
||||
```
|
||||
$ cf api
|
||||
API endpoint: https://api.system.io (API version: 2.43.0)
|
||||
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
No apps found
|
||||
```
|
||||
+
|
||||
. Follow the instructions to deploy Spring Cloud Data Flow's `server` from https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry/blob/master/README.adoc[Cloud Foundry Server] repo
|
||||
|
||||
+
|
||||
. Once you complete step#3 from https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry/blob/master/README.adoc[Cloud Foundry Server] instructions, you'll be able to list the newly deployed `dataflow-server` application in Cloud Foundry
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
|
||||
+
|
||||
. Notice that `dataflow-server` application is started and ready for interaction via `http://dataflow-server.app.io` endpoint
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`.
|
||||
+
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
server-unknown:>
|
||||
```
|
||||
+
|
||||
. Connect the `shell` with `server` running at `http://dataflow-server.app.io`
|
||||
+
|
||||
|
||||
```
|
||||
server-unknown:>dataflow config server http://dataflow-server.app.io
|
||||
Successfully targeted http://dataflow-server.app.io
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] RabbitMQ binder variant of out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>stream create cassandrastream --definition "http --spring.cloud.stream.bindings.output.contentType='application/json' | cassandra --ingestQuery='insert into book (id, isbn, title, author) values (uuid(), ?, ?, ?)' --username='<USERNAME>' --password='<PASSWORD>' --port=<PORT> --contact-points=<HOST> --keyspace='<KEYSPACE>'" --deploy
|
||||
|
||||
Created and deployed new stream 'cassandrastream'
|
||||
```
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `cassandrastream-http` and `cassandrastream-cassandra` https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running as _cloud-native_ (microservice) applications in Cloud Foundry
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
cassandrastream-cassandra started 1/1 1G 1G cassandrastream-cassandra.app.io
|
||||
cassandrastream-http started 1/1 1G 1G cassandrastream-http.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. Lookup the `url` for `cassandrastream-http` application from the list above. Post sample data pointing to the `http` endpoint: `<YOUR-cassandrastream-http-APP-URL>`
|
||||
+
|
||||
```
|
||||
http post --contentType 'application/json' --data '{"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}' --target http://<YOUR-cassandrastream-http-APP-URL>
|
||||
> POST (application/json;charset=UTF-8) http://cassandrastream-http.app.io {"isbn": "1599869772", "title": "The Art of War", "author": "Sun Tzu"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the Cassandra instance and query the table `book` to list the data inserted
|
||||
+
|
||||
```
|
||||
select * from book;
|
||||
```
|
||||
|
||||
+
|
||||
. Now, let's try to take advantage of Pivotal Cloud Foundry's platform capability. Let's scale the `cassandrastream-http` application from 1 to 3 instances
|
||||
+
|
||||
```
|
||||
$ cf scale cassandrastream-http -i 3
|
||||
Scaling app cassandrastream-http in org user-dataflow / space development as user...
|
||||
OK
|
||||
```
|
||||
+
|
||||
. Verify App instances (3/3) running successfully
|
||||
+
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
cassandrastream-cassandra started 1/1 1G 1G cassandrastream-cassandra.app.io
|
||||
cassandrastream-http started 3/3 1G 1G cassandrastream-http.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. That's it; you're done!
|
||||
|
||||
:!sectnums:
|
||||
== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and write to `Cassandra`
|
||||
* How to scale data microservice applications on `Pivotal Cloud Foundry`
|
||||
@@ -1,297 +0,0 @@
|
||||
:sectnums:
|
||||
= HTTP to MySQL Demo
|
||||
|
||||
In this demonstration, you will learn how to orchestrate a data pipeline using http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] to consume data from an `http` endpoint and write to MySQL database using `jdbc` sink.
|
||||
|
||||
We will begin by discussing the steps to prep, configure and operationalize Spring Cloud Data Flow's `server` Spring Boot application. We will deploy the `server` using https://github.com/spring-cloud/spring-cloud-dataflow/tree/master/spring-cloud-dataflow-server-local[Local] as well as https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry[Cloud Foundry] SPIs (Service Provider Interface) to demonstrate how Spring Cloud Data Flow takes advantage of _dev-sandbox_ and _cloud-native_ platform capabilities, respectively.
|
||||
|
||||
== Using Local Server
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
Make sure that you have the following components:
|
||||
|
||||
* Local build of https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* Running instance of link:http://kafka.apache.org/downloads.html[Kafka]
|
||||
* Running instance of link:http://www.mysql.com/[MySQL]
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] or link:https://www.dbvis.com/[DbVisualizer]
|
||||
* Create the `test` database with a `names` table (in MySQL) using:
|
||||
+
|
||||
```
|
||||
CREATE DATABASE test;
|
||||
USE test;
|
||||
CREATE TABLE names
|
||||
(
|
||||
name varchar(255)
|
||||
);
|
||||
```
|
||||
|
||||
=== Running the Sample Locally
|
||||
|
||||
. Launch the locally built `server`
|
||||
+
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-server-local/target/spring-cloud-dataflow-server-local-<VERSION>.jar
|
||||
|
||||
```
|
||||
+
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`
|
||||
+
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] Kafka binder variant of out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-kafka-10-maven
|
||||
```
|
||||
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
```
|
||||
dataflow:>stream create --name mysqlstream --definition "http --server.port=8787 | jdbc --tableName=names --columns=name --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver --spring.datasource.url='jdbc:mysql://localhost:3306/test'" --deploy
|
||||
|
||||
Created and deployed new stream 'mysqlstream'
|
||||
```
|
||||
NOTE: If MySQL isn't running on default port on `localhost` or if you need username and password to connect, use one of the following options to specify the necessary connection parameters: `--spring.datasource.url='jdbc:mysql://<HOST>:<PORT>/<NAME>' --spring.datasource.username=<USERNAME> --spring.datasource.password=<PASSWORD>`
|
||||
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `mysqlstream-http` and `mysqlstream-jdbc` https://github.com/spring-cloud-stream-app-starters//[Spring Cloud Stream] applications are running as Spring Boot applications within the Local `server` as collocated processes.
|
||||
+
|
||||
|
||||
```
|
||||
2016-05-03 09:29:55.918 INFO 65162 --- [nio-9393-exec-3] o.s.c.d.spi.local.LocalAppDeployer : deploying app mysqlstream.jdbc instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-dataflow-6850863945840320040/mysqlstream1-1462292995903/mysqlstream.jdbc
|
||||
2016-05-03 09:29:55.939 INFO 65162 --- [nio-9393-exec-3] o.s.c.d.spi.local.LocalAppDeployer : deploying app mysqlstream.http instance 0
|
||||
Logs will be in /var/folders/c3/ctx7_rns6x30tq7rb76wzqwr0000gp/T/spring-cloud-dataflow-6850863945840320040/mysqlstream-1462292995934/mysqlstream.http
|
||||
```
|
||||
|
||||
. Post sample data pointing to the `http` endpoint: `http://localhost:8787` [`8787` is the `server.port` we specified for the `http` source in this case]
|
||||
|
||||
+
|
||||
```
|
||||
dataflow:>http post --contentType 'application/json' --target http://localhost:8787 --data "{\"name\": \"Foo\"}"
|
||||
> POST (application/json;charset=UTF-8) http://localhost:8787 {"name": "Spring Boot"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the MySQL instance and query the table `test.names` to list the new rows:
|
||||
+
|
||||
```
|
||||
select * from test.names;
|
||||
```
|
||||
+
|
||||
. That's it; you're done!
|
||||
|
||||
== Using Cloud Foundry Server
|
||||
|
||||
=== Prerequisites
|
||||
|
||||
In order to get started, make sure that you have the following components:
|
||||
|
||||
* Cloud Foundry instance
|
||||
* Local build of https://github.com/spring-cloud/spring-cloud-dataflow[Spring Cloud Data Flow]
|
||||
* Local build of Spring Cloud Data Flow's https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry[Cloud Foundry Server]
|
||||
* Running instance of `rabbit` in Cloud Foundry
|
||||
* Running instance of `mysql` in Cloud Foundry
|
||||
* A database utility tool such as link:http://dbeaver.jkiss.org/[DBeaver] or link:https://www.dbvis.com/[DbVisualizer]
|
||||
* Create the `names` table (in MySQL) using:
|
||||
+
|
||||
```
|
||||
CREATE TABLE names
|
||||
(
|
||||
name varchar(255)
|
||||
);
|
||||
```
|
||||
|
||||
=== Running the Sample in Cloud Foundry
|
||||
|
||||
. Verify that CF instance is reachable
|
||||
+
|
||||
|
||||
```
|
||||
$ cf api
|
||||
API endpoint: https://api.system.io (API version: 2.43.0)
|
||||
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
No apps found
|
||||
```
|
||||
+
|
||||
. Follow the instructions to deploy Spring Cloud Data Flow's `server` from https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry/blob/master/README.adoc[Cloud Foundry Server] repo
|
||||
|
||||
+
|
||||
. Once you complete step#3 from https://github.com/spring-cloud/spring-cloud-dataflow-server-cloudfoundry/blob/master/README.adoc[Cloud Foundry Server] instructions, you'll be able to list the newly deployed `dataflow-server` application in Cloud Foundry
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
|
||||
+
|
||||
. Notice that `dataflow-server` application is started and ready for interaction via `http://dataflow-server.app.io` endpoint
|
||||
|
||||
. Connect to Spring Cloud Data Flow's `shell`
|
||||
+
|
||||
|
||||
```
|
||||
$ cd <PATH/TO/SPRING-CLOUD-DATAFLOW>
|
||||
$ java -jar spring-cloud-dataflow-shell/target/spring-cloud-dataflow-shell-<VERSION>.jar
|
||||
|
||||
____ ____ _ __
|
||||
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
|
||||
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
|
||||
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|
||||
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
|
||||
____ |_| _ __|___/ __________
|
||||
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
|
||||
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
|
||||
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|
||||
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/
|
||||
|
||||
<VERSION>
|
||||
|
||||
Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
|
||||
server-unknown:>
|
||||
```
|
||||
+
|
||||
. Connect the `shell` with `server` running at `http://dataflow-server.app.io`
|
||||
+
|
||||
|
||||
```
|
||||
server-unknown:>dataflow config server http://dataflow-server.app.io
|
||||
Successfully targeted http://dataflow-server.app.io
|
||||
dataflow:>version
|
||||
<VERSION>
|
||||
```
|
||||
|
||||
+
|
||||
. https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc#register-a-stream-app[Register] RabbitMQ binder variant of out-of-the-box applications
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>app import --uri http://bit.ly/Bacon-RELEASE-stream-applications-rabbit-maven
|
||||
```
|
||||
|
||||
+
|
||||
. Create the stream
|
||||
+
|
||||
|
||||
```
|
||||
dataflow:>stream create --name mysqlstream --definition "http | jdbc --tableName=names --columns=name"
|
||||
Created new stream 'mysqlstream'
|
||||
|
||||
dataflow:>stream deploy --name mysqlstream --properties "app.jdbc.spring.cloud.deployer.cloudfoundry.services=mysql"
|
||||
Deployed stream 'mysqlstream'
|
||||
|
||||
```
|
||||
+
|
||||
|
||||
NOTE: By supplying `mysql` property through `app.jdbc.spring.cloud.deployer.cloudfoundry.services` token, we are deploying the stream with `jdbc-sink` to automatically bind to `mysql` service and only this application in the stream gets the service binding. This also eliminates the requirement to supply `datasource` credentials in stream definition.
|
||||
+
|
||||
. Verify the stream is successfully deployed
|
||||
+
|
||||
```
|
||||
dataflow:>stream list
|
||||
```
|
||||
+
|
||||
. Notice that `mysqlstream-http` and `mysqlstream-jdbc` https://github.com/spring-cloud-stream-app-starters/[Spring Cloud Stream] applications are running as _cloud-native_ (microservice) applications in Cloud Foundry
|
||||
+
|
||||
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
mysqlstream-http started 1/1 1G 1G mysqlstream-http.app.io
|
||||
mysqlstream-jdbc started 1/1 1G 1G mysqlstream-jdbc.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. Lookup the `url` for `mysqlstream-http` application from the list above. Post sample data pointing to the `http` endpoint: `<YOUR-mysqlstream-http-APP-URL>`
|
||||
+
|
||||
```
|
||||
http post --contentType 'application/json' --target http://mysqlstream-http.app.io --data "{\"name\": \"Bar"}"
|
||||
> POST (application/json;charset=UTF-8) http://mysqlstream-http.app.io {"name": "Bar"}
|
||||
> 202 ACCEPTED
|
||||
```
|
||||
+
|
||||
. Connect to the MySQL instance and query the table `names` to list the new rows:
|
||||
+
|
||||
```
|
||||
select * from names;
|
||||
```
|
||||
|
||||
+
|
||||
. Now, let's take advantage of Pivotal Cloud Foundry's platform capability. Let's scale the `mysqlstream-http` application from 1 to 3 instances
|
||||
+
|
||||
```
|
||||
$ cf scale mysqlstream-http -i 3
|
||||
Scaling app mysqlstream-http in org user-dataflow / space development as user...
|
||||
OK
|
||||
```
|
||||
+
|
||||
. Verify App instances (3/3) running successfully
|
||||
+
|
||||
```
|
||||
$ cf apps
|
||||
Getting apps in org user-dataflow / space development as user...
|
||||
OK
|
||||
|
||||
name requested state instances memory disk urls
|
||||
mysqlstream-http started 3/3 1G 1G mysqlstream-http.app.io
|
||||
mysqlstream-jdbc started 1/1 1G 1G mysqlstream-jdbc.app.io
|
||||
dataflow-server started 1/1 1G 1G dataflow-server.app.io
|
||||
```
|
||||
+
|
||||
. That's it; you're done!
|
||||
|
||||
:!sectnums:
|
||||
== Summary
|
||||
|
||||
In this sample, you have learned:
|
||||
|
||||
* How to use Spring Cloud Data Flow's `Local` and `Cloud Foundry` servers
|
||||
* How to use Spring Cloud Data Flow's `shell`
|
||||
* How to create streaming data pipeline to connect and write to `MySQL`
|
||||
* How to scale data microservice applications on `Pivotal Cloud Foundry`
|
||||