Docs support toggling Java Config and XML
This is a demo of the functionality and it located in the domain.adoc file. added code to handl PDF ifdef JavaScript added to support slider control If view in local file system use safari. (Cookies not supported on local filesysem on chrome) Remaining bug... if user selects xml and refreshes the examples still show XML but slider goes back to JAVA. Could use a new tool suite. But this is based on the Spring.io toggle. Implemented java vs xml toggle in reference documentation This commit ports the javascript widget used in Sagan for toggling between Maven and Gradle on each project page and uses it to toggle between java based config and XML based config. The preference the user selects is cookied so that it should stick between pages in the multiple page layout as well as for future visits to the documentation. The only page that has implemented the toggle in this commit is the domain.adoc page. The spring-batch-intro.adoc has the toggle reference in it, but it's only there to verify multiple includes are working. Polishing
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,3 +25,4 @@ build
|
||||
pom.xml
|
||||
out
|
||||
|
||||
/.gradletasknamecache
|
||||
|
||||
@@ -1,315 +0,0 @@
|
||||
All
|
||||
assemble
|
||||
spring-batch-core:assemble
|
||||
spring-batch-core-tests:assemble
|
||||
spring-batch-infrastructure:assemble
|
||||
spring-batch-infrastructure-neo4j4:assemble
|
||||
spring-batch-infrastructure-tests:assemble
|
||||
spring-batch-integration:assemble
|
||||
spring-batch-samples:assemble
|
||||
spring-batch-test:assemble
|
||||
spring-build-src:assemble
|
||||
build
|
||||
spring-batch-core:build
|
||||
spring-batch-core-tests:build
|
||||
spring-batch-infrastructure:build
|
||||
spring-batch-infrastructure-neo4j4:build
|
||||
spring-batch-infrastructure-tests:build
|
||||
spring-batch-integration:build
|
||||
spring-batch-samples:build
|
||||
spring-batch-test:build
|
||||
spring-build-src:build
|
||||
spring-batch-core:buildDependents
|
||||
spring-batch-core-tests:buildDependents
|
||||
spring-batch-infrastructure:buildDependents
|
||||
spring-batch-infrastructure-neo4j4:buildDependents
|
||||
spring-batch-infrastructure-tests:buildDependents
|
||||
spring-batch-integration:buildDependents
|
||||
spring-batch-samples:buildDependents
|
||||
spring-batch-test:buildDependents
|
||||
spring-build-src:buildDependents
|
||||
spring-batch-core:buildNeeded
|
||||
spring-batch-core-tests:buildNeeded
|
||||
spring-batch-infrastructure:buildNeeded
|
||||
spring-batch-infrastructure-neo4j4:buildNeeded
|
||||
spring-batch-infrastructure-tests:buildNeeded
|
||||
spring-batch-integration:buildNeeded
|
||||
spring-batch-samples:buildNeeded
|
||||
spring-batch-test:buildNeeded
|
||||
spring-build-src:buildNeeded
|
||||
spring-batch-core:classes
|
||||
spring-batch-core:compileJava
|
||||
spring-batch-core:processResources
|
||||
spring-batch-core-tests:classes
|
||||
spring-batch-core-tests:compileJava
|
||||
spring-batch-core-tests:processResources
|
||||
spring-batch-infrastructure:classes
|
||||
spring-batch-infrastructure:compileJava
|
||||
spring-batch-infrastructure:processResources
|
||||
spring-batch-infrastructure-neo4j4:classes
|
||||
spring-batch-infrastructure-neo4j4:compileJava
|
||||
spring-batch-infrastructure-neo4j4:processResources
|
||||
spring-batch-infrastructure-tests:classes
|
||||
spring-batch-infrastructure-tests:compileJava
|
||||
spring-batch-infrastructure-tests:processResources
|
||||
spring-batch-integration:classes
|
||||
spring-batch-integration:compileJava
|
||||
spring-batch-integration:processResources
|
||||
spring-batch-samples:classes
|
||||
spring-batch-samples:compileJava
|
||||
spring-batch-samples:processResources
|
||||
spring-batch-test:classes
|
||||
spring-batch-test:compileJava
|
||||
spring-batch-test:processResources
|
||||
spring-build-src:classes
|
||||
spring-build-src:compileGroovy
|
||||
spring-build-src:compileJava
|
||||
spring-build-src:processResources
|
||||
spring-batch-core:generateSql
|
||||
spring-batch-core:jar
|
||||
spring-batch-core-tests:jar
|
||||
spring-batch-infrastructure:jar
|
||||
spring-batch-infrastructure-neo4j4:jar
|
||||
spring-batch-infrastructure-tests:jar
|
||||
spring-batch-integration:jar
|
||||
spring-batch-samples:jar
|
||||
spring-batch-test:jar
|
||||
spring-build-src:jar
|
||||
spring-batch-core:testClasses
|
||||
spring-batch-core:compileTestJava
|
||||
spring-batch-core:processTestResources
|
||||
spring-batch-core-tests:testClasses
|
||||
spring-batch-core-tests:compileTestJava
|
||||
spring-batch-core-tests:processTestResources
|
||||
spring-batch-infrastructure:testClasses
|
||||
spring-batch-infrastructure:compileTestJava
|
||||
spring-batch-infrastructure:processTestResources
|
||||
spring-batch-infrastructure-neo4j4:testClasses
|
||||
spring-batch-infrastructure-neo4j4:compileTestJava
|
||||
spring-batch-infrastructure-neo4j4:processTestResources
|
||||
spring-batch-infrastructure-tests:testClasses
|
||||
spring-batch-infrastructure-tests:compileTestJava
|
||||
spring-batch-infrastructure-tests:processTestResources
|
||||
spring-batch-integration:testClasses
|
||||
spring-batch-integration:compileTestJava
|
||||
spring-batch-integration:processTestResources
|
||||
spring-batch-samples:testClasses
|
||||
spring-batch-samples:compileTestJava
|
||||
spring-batch-samples:processTestResources
|
||||
spring-batch-test:testClasses
|
||||
spring-batch-test:compileTestJava
|
||||
spring-batch-test:processTestResources
|
||||
spring-build-src:testClasses
|
||||
spring-build-src:compileTestGroovy
|
||||
spring-build-src:compileTestJava
|
||||
spring-build-src:processTestResources
|
||||
init
|
||||
depsZip
|
||||
dist
|
||||
distZip
|
||||
docsZip
|
||||
schemaZip
|
||||
api
|
||||
spring-build-src:groovydoc
|
||||
spring-batch-core:javadoc
|
||||
spring-batch-core-tests:javadoc
|
||||
spring-batch-infrastructure:javadoc
|
||||
spring-batch-infrastructure-neo4j4:javadoc
|
||||
spring-batch-infrastructure-tests:javadoc
|
||||
spring-batch-integration:javadoc
|
||||
spring-batch-samples:javadoc
|
||||
spring-batch-test:javadoc
|
||||
spring-build-src:javadoc
|
||||
reference
|
||||
referenceEpub
|
||||
referenceHtmlMulti
|
||||
referenceHtmlSingle
|
||||
referencePdf
|
||||
components
|
||||
spring-batch-core:components
|
||||
spring-batch-core-tests:components
|
||||
spring-batch-infrastructure:components
|
||||
spring-batch-infrastructure-neo4j4:components
|
||||
spring-batch-infrastructure-tests:components
|
||||
spring-batch-integration:components
|
||||
spring-batch-samples:components
|
||||
spring-batch-test:components
|
||||
spring-build-src:components
|
||||
dependencies
|
||||
spring-batch-core:dependencies
|
||||
spring-batch-core-tests:dependencies
|
||||
spring-batch-infrastructure:dependencies
|
||||
spring-batch-infrastructure-neo4j4:dependencies
|
||||
spring-batch-infrastructure-tests:dependencies
|
||||
spring-batch-integration:dependencies
|
||||
spring-batch-samples:dependencies
|
||||
spring-batch-test:dependencies
|
||||
spring-build-src:dependencies
|
||||
dependencyInsight
|
||||
spring-batch-core:dependencyInsight
|
||||
spring-batch-core-tests:dependencyInsight
|
||||
spring-batch-infrastructure:dependencyInsight
|
||||
spring-batch-infrastructure-neo4j4:dependencyInsight
|
||||
spring-batch-infrastructure-tests:dependencyInsight
|
||||
spring-batch-integration:dependencyInsight
|
||||
spring-batch-samples:dependencyInsight
|
||||
spring-batch-test:dependencyInsight
|
||||
spring-build-src:dependencyInsight
|
||||
help
|
||||
spring-batch-core:help
|
||||
spring-batch-core-tests:help
|
||||
spring-batch-infrastructure:help
|
||||
spring-batch-infrastructure-neo4j4:help
|
||||
spring-batch-infrastructure-tests:help
|
||||
spring-batch-integration:help
|
||||
spring-batch-samples:help
|
||||
spring-batch-test:help
|
||||
spring-build-src:help
|
||||
model
|
||||
spring-batch-core:model
|
||||
spring-batch-core-tests:model
|
||||
spring-batch-infrastructure:model
|
||||
spring-batch-infrastructure-neo4j4:model
|
||||
spring-batch-infrastructure-tests:model
|
||||
spring-batch-integration:model
|
||||
spring-batch-samples:model
|
||||
spring-batch-test:model
|
||||
spring-build-src:model
|
||||
projects
|
||||
spring-batch-core:projects
|
||||
spring-batch-core-tests:projects
|
||||
spring-batch-infrastructure:projects
|
||||
spring-batch-infrastructure-neo4j4:projects
|
||||
spring-batch-infrastructure-tests:projects
|
||||
spring-batch-integration:projects
|
||||
spring-batch-samples:projects
|
||||
spring-batch-test:projects
|
||||
spring-build-src:projects
|
||||
properties
|
||||
spring-batch-core:properties
|
||||
spring-batch-core-tests:properties
|
||||
spring-batch-infrastructure:properties
|
||||
spring-batch-infrastructure-neo4j4:properties
|
||||
spring-batch-infrastructure-tests:properties
|
||||
spring-batch-integration:properties
|
||||
spring-batch-samples:properties
|
||||
spring-batch-test:properties
|
||||
spring-build-src:properties
|
||||
tasks
|
||||
spring-batch-core:tasks
|
||||
spring-batch-core-tests:tasks
|
||||
spring-batch-infrastructure:tasks
|
||||
spring-batch-infrastructure-neo4j4:tasks
|
||||
spring-batch-infrastructure-tests:tasks
|
||||
spring-batch-integration:tasks
|
||||
spring-batch-samples:tasks
|
||||
spring-batch-test:tasks
|
||||
spring-build-src:tasks
|
||||
spring-batch-core:cleanEclipse
|
||||
spring-batch-core-tests:cleanEclipse
|
||||
spring-batch-infrastructure:cleanEclipse
|
||||
spring-batch-infrastructure-neo4j4:cleanEclipse
|
||||
spring-batch-infrastructure-tests:cleanEclipse
|
||||
spring-batch-integration:cleanEclipse
|
||||
spring-batch-samples:cleanEclipse
|
||||
spring-batch-test:cleanEclipse
|
||||
cleanIdea
|
||||
spring-batch-core:cleanIdea
|
||||
spring-batch-core-tests:cleanIdea
|
||||
spring-batch-infrastructure:cleanIdea
|
||||
spring-batch-infrastructure-neo4j4:cleanIdea
|
||||
spring-batch-infrastructure-tests:cleanIdea
|
||||
spring-batch-integration:cleanIdea
|
||||
spring-batch-samples:cleanIdea
|
||||
spring-batch-test:cleanIdea
|
||||
spring-batch-core:eclipse
|
||||
spring-batch-core:eclipseClasspath
|
||||
spring-batch-core:eclipseJdt
|
||||
spring-batch-core:eclipseProject
|
||||
spring-batch-core-tests:eclipse
|
||||
spring-batch-core-tests:eclipseClasspath
|
||||
spring-batch-core-tests:eclipseJdt
|
||||
spring-batch-core-tests:eclipseProject
|
||||
spring-batch-infrastructure:eclipse
|
||||
spring-batch-infrastructure:eclipseClasspath
|
||||
spring-batch-infrastructure:eclipseJdt
|
||||
spring-batch-infrastructure:eclipseProject
|
||||
spring-batch-infrastructure-neo4j4:eclipse
|
||||
spring-batch-infrastructure-neo4j4:eclipseClasspath
|
||||
spring-batch-infrastructure-neo4j4:eclipseJdt
|
||||
spring-batch-infrastructure-neo4j4:eclipseProject
|
||||
spring-batch-infrastructure-tests:eclipse
|
||||
spring-batch-infrastructure-tests:eclipseClasspath
|
||||
spring-batch-infrastructure-tests:eclipseJdt
|
||||
spring-batch-infrastructure-tests:eclipseProject
|
||||
spring-batch-integration:eclipse
|
||||
spring-batch-integration:eclipseClasspath
|
||||
spring-batch-integration:eclipseJdt
|
||||
spring-batch-integration:eclipseProject
|
||||
spring-batch-samples:eclipse
|
||||
spring-batch-samples:eclipseClasspath
|
||||
spring-batch-samples:eclipseJdt
|
||||
spring-batch-samples:eclipseProject
|
||||
spring-batch-test:eclipse
|
||||
spring-batch-test:eclipseClasspath
|
||||
spring-batch-test:eclipseJdt
|
||||
spring-batch-test:eclipseProject
|
||||
idea
|
||||
ideaModule
|
||||
ideaProject
|
||||
ideaWorkspace
|
||||
spring-batch-core:idea
|
||||
spring-batch-core:ideaModule
|
||||
spring-batch-core-tests:idea
|
||||
spring-batch-core-tests:ideaModule
|
||||
spring-batch-infrastructure:idea
|
||||
spring-batch-infrastructure:ideaModule
|
||||
spring-batch-infrastructure-neo4j4:idea
|
||||
spring-batch-infrastructure-neo4j4:ideaModule
|
||||
spring-batch-infrastructure-tests:idea
|
||||
spring-batch-infrastructure-tests:ideaModule
|
||||
spring-batch-integration:idea
|
||||
spring-batch-integration:ideaModule
|
||||
spring-batch-samples:idea
|
||||
spring-batch-samples:ideaModule
|
||||
spring-batch-test:idea
|
||||
spring-batch-test:ideaModule
|
||||
check
|
||||
spring-batch-core:check
|
||||
spring-batch-core-tests:check
|
||||
spring-batch-infrastructure:check
|
||||
spring-batch-infrastructure-neo4j4:check
|
||||
spring-batch-infrastructure-tests:check
|
||||
spring-batch-integration:check
|
||||
spring-batch-samples:check
|
||||
spring-batch-test:check
|
||||
spring-build-src:check
|
||||
clean
|
||||
spring-batch-core:clean
|
||||
spring-batch-core-tests:clean
|
||||
spring-batch-infrastructure:clean
|
||||
spring-batch-infrastructure-neo4j4:clean
|
||||
spring-batch-infrastructure-tests:clean
|
||||
spring-batch-integration:clean
|
||||
spring-batch-samples:clean
|
||||
spring-batch-test:clean
|
||||
spring-build-src:clean
|
||||
spring-batch-core:test
|
||||
spring-batch-core-tests:test
|
||||
spring-batch-infrastructure:test
|
||||
spring-batch-infrastructure-neo4j4:test
|
||||
spring-batch-infrastructure-tests:test
|
||||
spring-batch-integration:test
|
||||
spring-batch-samples:test
|
||||
spring-batch-test:test
|
||||
spring-build-src:test
|
||||
spring-batch-core:install
|
||||
spring-batch-core-tests:install
|
||||
spring-batch-infrastructure:install
|
||||
spring-batch-infrastructure-neo4j4:install
|
||||
spring-batch-infrastructure-tests:install
|
||||
spring-batch-integration:install
|
||||
spring-batch-samples:install
|
||||
spring-batch-test:install
|
||||
sonarRunner
|
||||
wrapper
|
||||
@@ -631,6 +631,12 @@ asciidoctor {
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
resources {
|
||||
from(sourceDir) {
|
||||
include 'images/**'
|
||||
include 'jsfiles/**'
|
||||
}
|
||||
}
|
||||
logDocuments = true
|
||||
backends = ["html", "pdf"]
|
||||
options doctype: 'book', eruby: 'erubis'
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
== The Domain Language of Batch
|
||||
|
||||
include::toggle.adoc[]
|
||||
|
||||
To any experienced batch architect, the overall concepts of batch
|
||||
processing used in Spring Batch should be familiar and comfortable. There
|
||||
are "Jobs" and "Steps" and developer supplied processing units called
|
||||
@@ -63,12 +65,65 @@ The job configuration contains:
|
||||
* Definition and ordering of Steps
|
||||
* Whether or not the job is restartable
|
||||
|
||||
ifdef::backend-html5[]
|
||||
[role="javaContent"]
|
||||
A default simple implementation of the Job
|
||||
interface is provided by Spring Batch in the form of the
|
||||
`SimpleJob` class which creates some standard
|
||||
functionality on top of `Job`, however the batch
|
||||
namespace abstracts away the need to instantiate it directly. Instead, the
|
||||
`<job>` tag can be used:
|
||||
functionality on top of `Job`. When using java based configuration, a collection of
|
||||
builders are made available for the instantiation of a `Job`:
|
||||
|
||||
[source, java, role="javaContent"]
|
||||
----
|
||||
@Bean
|
||||
public Job footballJob() {
|
||||
return this.jobBuilderFactory.get("footballJob")
|
||||
.start(playerLoad())
|
||||
.next(gameLoad())
|
||||
.next(playerSummarization())
|
||||
.end()
|
||||
.build();
|
||||
}
|
||||
----
|
||||
|
||||
[role="xmlContent"]
|
||||
A default simple implementation of the `Job` interface is provided by Spring Batch in the
|
||||
form of the `SimpleJob` class which creates some standard functionality on top of `Job`,
|
||||
however the batch namespace abstracts away the need to instantiate it directly.
|
||||
Instead, the `<job>` tag can be used:
|
||||
|
||||
[source, xml, role="xmlContent"]
|
||||
----
|
||||
<job id="footballJob">
|
||||
<step id="playerload" next="gameLoad"/>
|
||||
<step id="gameLoad" next="playerSummarization"/>
|
||||
<step id="playerSummarization"/>
|
||||
</job>
|
||||
----
|
||||
endif::backend-html5[]
|
||||
|
||||
ifdef::backend-pdf[]
|
||||
A default simple implementation of the Job
|
||||
interface is provided by Spring Batch in the form of the
|
||||
`SimpleJob` class which creates some standard
|
||||
functionality on top of `Job`. When using java based configuration, a collection of
|
||||
builders are made available for the instantiation of a `Job`:
|
||||
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job footballJob() {
|
||||
return this.jobBuilderFactory.get("footballJob")
|
||||
.start(playerLoad())
|
||||
.next(gameLoad())
|
||||
.next(playerSummarization())
|
||||
.end()
|
||||
.build();
|
||||
}
|
||||
----
|
||||
|
||||
However, when using XML configuration, the batch namespace abstracts away the need to
|
||||
instantiate it directly. Instead, the `<job>` tag can be used:
|
||||
|
||||
[source, xml]
|
||||
----
|
||||
@@ -78,6 +133,7 @@ namespace abstracts away the need to instantiate it directly. Instead, the
|
||||
<step id="playerSummarization"/>
|
||||
</job>
|
||||
----
|
||||
endif::backend-pdf[]
|
||||
|
||||
==== JobInstance
|
||||
|
||||
@@ -607,13 +663,21 @@ Job is first launched, a
|
||||
`JobExecution` is obtained from the repository, and
|
||||
during the course of execution `StepExecution` and
|
||||
`JobExecution` implementations are persisted by
|
||||
passing them to the repository:
|
||||
passing them to the repository.
|
||||
|
||||
[source, xml]
|
||||
[role="xmlContent"]
|
||||
The batch namespace provides support for configuring a `JobRepository` instance simply via
|
||||
the `<job-repository>` tag:
|
||||
|
||||
[source, xml, role="xmlContent"]
|
||||
----
|
||||
<job-repository id="jobRepository"/>
|
||||
----
|
||||
|
||||
[role="javaContent"]
|
||||
When using java configuration, `@EnableBatchProcessing` annotation provides a
|
||||
`JobRepository` as one of the components automatically configured out of the box.
|
||||
|
||||
=== JobLauncher
|
||||
|
||||
`JobLauncher` represents a simple interface for
|
||||
@@ -665,6 +729,7 @@ not be written out. More details about the `ItemProcessor` interface can be
|
||||
found in <<readersAndWriters.adoc#readersAndWriters,Readers And Writers>>.
|
||||
|
||||
|
||||
[role="xmlContent"]
|
||||
=== Batch Namespace
|
||||
|
||||
Many of the domain concepts listed above need to be configured in a
|
||||
@@ -673,7 +738,7 @@ implementations of the interfaces above that can be used in a standard
|
||||
bean definition, a namespace has been provided for ease of
|
||||
configuration:
|
||||
|
||||
[source, xml]
|
||||
[source, xml, role="xmlContent"]
|
||||
----
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
@@ -682,19 +747,20 @@ xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch
|
||||
http://www.springframework.org/schema/batch/spring-batch-2.2.xsd">
|
||||
http://www.springframework.org/schema/batch/spring-batch.xsd">
|
||||
|
||||
<job id="ioSampleJob">
|
||||
<step id="step1">
|
||||
<tasklet>
|
||||
<chunk reader="itemReader" writer="itemWriter" commit-interval="2"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="step1">
|
||||
<tasklet>
|
||||
<chunk reader="itemReader" writer="itemWriter" commit-interval="2"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
</beans:beans>
|
||||
----
|
||||
|
||||
[role="xmlContent"]
|
||||
As long as the batch namespace has been declared, any of its
|
||||
elements can be used. More information on configuring a
|
||||
Job can be found in <<job.adoc#configureJob,Configuring and Running a Job>>. More information on configuring a `Step` can be
|
||||
|
||||
@@ -9,4 +9,4 @@ Copyright © 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Pivotal, 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.
|
||||
Notice, whether distributed in print or electronically.
|
||||
|
||||
12
spring-batch-docs/asciidoc/jsfiles/application.js
Normal file
12
spring-batch-docs/asciidoc/jsfiles/application.js
Normal file
@@ -0,0 +1,12 @@
|
||||
$('.toggleWidget').each(function(index) {
|
||||
if(index > 0) {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
if(!window.widgetInitalized) {
|
||||
window.widgetInitalized = true;
|
||||
new Spring.ProjectDocumentationWidget();
|
||||
}
|
||||
});
|
||||
1571
spring-batch-docs/asciidoc/jsfiles/backbone.js
Normal file
1571
spring-batch-docs/asciidoc/jsfiles/backbone.js
Normal file
File diff suppressed because it is too large
Load Diff
9807
spring-batch-docs/asciidoc/jsfiles/jquery.js
vendored
Normal file
9807
spring-batch-docs/asciidoc/jsfiles/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
165
spring-batch-docs/asciidoc/jsfiles/js.cookie.js
Normal file
165
spring-batch-docs/asciidoc/jsfiles/js.cookie.js
Normal file
@@ -0,0 +1,165 @@
|
||||
/*!
|
||||
* JavaScript Cookie v2.1.4
|
||||
* https://github.com/js-cookie/js-cookie
|
||||
*
|
||||
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
||||
* Released under the MIT license
|
||||
*/
|
||||
;(function (factory) {
|
||||
var registeredInModuleLoader = false;
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(factory);
|
||||
registeredInModuleLoader = true;
|
||||
}
|
||||
if (typeof exports === 'object') {
|
||||
module.exports = factory();
|
||||
registeredInModuleLoader = true;
|
||||
}
|
||||
if (!registeredInModuleLoader) {
|
||||
var OldCookies = window.Cookies;
|
||||
var api = window.Cookies = factory();
|
||||
api.noConflict = function () {
|
||||
window.Cookies = OldCookies;
|
||||
return api;
|
||||
};
|
||||
}
|
||||
}(function () {
|
||||
function extend () {
|
||||
var i = 0;
|
||||
var result = {};
|
||||
for (; i < arguments.length; i++) {
|
||||
var attributes = arguments[ i ];
|
||||
for (var key in attributes) {
|
||||
result[key] = attributes[key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function init (converter) {
|
||||
function api (key, value, attributes) {
|
||||
var result;
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Write
|
||||
|
||||
if (arguments.length > 1) {
|
||||
attributes = extend({
|
||||
path: '/'
|
||||
}, api.defaults, attributes);
|
||||
|
||||
if (typeof attributes.expires === 'number') {
|
||||
var expires = new Date();
|
||||
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
|
||||
attributes.expires = expires;
|
||||
}
|
||||
|
||||
// We're using "expires" because "max-age" is not supported by IE
|
||||
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
|
||||
|
||||
try {
|
||||
result = JSON.stringify(value);
|
||||
if (/^[\{\[]/.test(result)) {
|
||||
value = result;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (!converter.write) {
|
||||
value = encodeURIComponent(String(value))
|
||||
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
||||
} else {
|
||||
value = converter.write(value, key);
|
||||
}
|
||||
|
||||
key = encodeURIComponent(String(key));
|
||||
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
|
||||
key = key.replace(/[\(\)]/g, escape);
|
||||
|
||||
var stringifiedAttributes = '';
|
||||
|
||||
for (var attributeName in attributes) {
|
||||
if (!attributes[attributeName]) {
|
||||
continue;
|
||||
}
|
||||
stringifiedAttributes += '; ' + attributeName;
|
||||
if (attributes[attributeName] === true) {
|
||||
continue;
|
||||
}
|
||||
stringifiedAttributes += '=' + attributes[attributeName];
|
||||
}
|
||||
return (document.cookie = key + '=' + value + stringifiedAttributes);
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
if (!key) {
|
||||
result = {};
|
||||
}
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling "get()"
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
var rdecode = /(%[0-9A-Z]{2})+/g;
|
||||
var i = 0;
|
||||
|
||||
for (; i < cookies.length; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var cookie = parts.slice(1).join('=');
|
||||
|
||||
if (cookie.charAt(0) === '"') {
|
||||
cookie = cookie.slice(1, -1);
|
||||
}
|
||||
|
||||
try {
|
||||
var name = parts[0].replace(rdecode, decodeURIComponent);
|
||||
cookie = converter.read ?
|
||||
converter.read(cookie, name) : converter(cookie, name) ||
|
||||
cookie.replace(rdecode, decodeURIComponent);
|
||||
|
||||
if (this.json) {
|
||||
try {
|
||||
cookie = JSON.parse(cookie);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (key === name) {
|
||||
result = cookie;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
api.set = api;
|
||||
api.get = function (key) {
|
||||
return api.call(api, key);
|
||||
};
|
||||
api.getJSON = function () {
|
||||
return api.apply({
|
||||
json: true
|
||||
}, [].slice.call(arguments));
|
||||
};
|
||||
api.defaults = {};
|
||||
|
||||
api.remove = function (key, attributes) {
|
||||
api(key, '', extend(attributes, {
|
||||
expires: -1
|
||||
}));
|
||||
};
|
||||
|
||||
api.withConverter = init;
|
||||
|
||||
return api;
|
||||
}
|
||||
|
||||
return init(function () {});
|
||||
}));
|
||||
177
spring-batch-docs/asciidoc/jsfiles/projectDocumentationWidget.js
Normal file
177
spring-batch-docs/asciidoc/jsfiles/projectDocumentationWidget.js
Normal file
@@ -0,0 +1,177 @@
|
||||
window.Spring = window.Spring || {};
|
||||
|
||||
var entry = 0;
|
||||
/* ERB style templates conflict with Jekyll HTML escaping */
|
||||
_.templateSettings = {
|
||||
evaluate : /\{@([\s\S]+?)@\}/g,
|
||||
interpolate : /\{@=([\s\S]+?)@\}/g,
|
||||
escape : /\{@-([\s\S]+?)@\}/g
|
||||
};
|
||||
|
||||
Spring.ProjectDocumentationWidget = function () {
|
||||
var codeEl = $('[code-widget-controls]');
|
||||
var codeWidgetEl = $('.js-code-maven-widget');
|
||||
|
||||
Spring.buildCodeWidget(codeEl, codeWidgetEl);
|
||||
|
||||
var displayValue = Cookies.get("widget.display");
|
||||
|
||||
if(displayValue === 'xml') {
|
||||
$('.xml_snip_item').each(function() {
|
||||
var widget = $(this).closest('.toggleWidget');
|
||||
|
||||
if(!widget.is(":hidden")) {
|
||||
$(this).trigger("click");
|
||||
}
|
||||
});
|
||||
}
|
||||
else if(displayValue === 'java') {
|
||||
$('.java_snip_item').each(function() {
|
||||
var widget = $(this).closest('.toggleWidget');
|
||||
|
||||
if(!widget.is(":hidden")) {
|
||||
$(this).trigger("click");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Spring.buildCodeWidget = function (codeEl, codeWidgetEl) {
|
||||
new Spring.CodeSelectorView({
|
||||
el: codeEl,
|
||||
template: $("#code-widget-controls-template").text(),
|
||||
snippetWidgetEl: codeWidgetEl
|
||||
}).render();
|
||||
}
|
||||
|
||||
function isJavaVisible(displayVal, currentVal) {
|
||||
var result= false;
|
||||
if(entry == 1 && (displayVal === '' || displayVal === 'widget.display=java')) {
|
||||
result = true;
|
||||
}
|
||||
else if (entry > 1) {
|
||||
result = (currentVal === 'java');
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Spring.SnippetView = Backbone.View.extend({
|
||||
initialize: function () {
|
||||
var displayVal = document.cookie;
|
||||
entry++;
|
||||
var javaDisplayStatus = this.options.snippetType;
|
||||
|
||||
if(isJavaVisible(displayVal, javaDisplayStatus)) {
|
||||
$('.javaContent').each(function() {
|
||||
$(this).show();
|
||||
});
|
||||
|
||||
$('.xmlContent').each(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
javaDisplayStatus = 'widget.display=java';
|
||||
} else {
|
||||
$('.xmlContent').each(function() {
|
||||
$(this).show();
|
||||
});
|
||||
|
||||
$('.javaContent').each(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
javaDisplayStatus = 'widget.display=xml';
|
||||
}
|
||||
|
||||
document.cookie = javaDisplayStatus;
|
||||
_.bindAll(this, "render");
|
||||
},
|
||||
|
||||
|
||||
remove: function() {
|
||||
this.undelegateEvents();
|
||||
this.$el.empty();
|
||||
this.unbind();
|
||||
}
|
||||
});
|
||||
|
||||
Spring.CodeSelectorView = Backbone.View.extend({
|
||||
events: {
|
||||
"change .selector": "renderActiveWidget",
|
||||
"click .js-item": "changeCodeSource"
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.template = _.template(this.options.template);
|
||||
this.snippetWidgetEl = this.options.snippetWidgetEl;
|
||||
_.bindAll(this, "render", "renderActiveWidget", "changeCodeSource", "_moveItemSlider", "selectCurrent");
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html(
|
||||
this.template(this.model)
|
||||
);
|
||||
this.renderActiveWidget();
|
||||
this.selectCurrent();
|
||||
return this;
|
||||
},
|
||||
|
||||
selectCurrent: function() {
|
||||
var selectedIndex = $('.selectpicker [data-current="true"]').val();
|
||||
if(selectedIndex == undefined) {
|
||||
selectedIndex = 0;
|
||||
}
|
||||
this.$('.selectpicker').val(selectedIndex).change();
|
||||
},
|
||||
|
||||
renderActiveWidget: function() {
|
||||
|
||||
if(this.activeWidget != null) this.activeWidget.remove();
|
||||
this.activeWidget = new Spring.SnippetView({
|
||||
el: this.snippetWidgetEl,
|
||||
snippetType: this.$('.js-active').data('snippet-type')
|
||||
});
|
||||
this.activeWidget.render();
|
||||
|
||||
},
|
||||
|
||||
changeCodeSource: function (event) {
|
||||
var target = $(event.target);
|
||||
|
||||
target.addClass("js-active");
|
||||
target.siblings().removeClass("js-active");
|
||||
|
||||
this._moveItemSlider();
|
||||
this.renderActiveWidget();
|
||||
},
|
||||
|
||||
_moveItemSlider: function () {
|
||||
var activeItem = $(".js-item-slider--wrapper .js-item.js-active");
|
||||
if (activeItem.length == 0) {
|
||||
return;
|
||||
} else {
|
||||
var activeItemPosition = activeItem.position();
|
||||
var activeItemOffset = 34;
|
||||
|
||||
if(activeItem.data("snippet-type") === "xml") {
|
||||
|
||||
if(activeItemPosition.left < 100) {
|
||||
activeItemOffset = activeItemPosition.left - 2;
|
||||
}
|
||||
else {
|
||||
activeItemOffset = 78;
|
||||
}
|
||||
}
|
||||
|
||||
var slider = $(".js-item--slider");
|
||||
var sliderPosition = slider.position();
|
||||
var sliderOffset = sliderPosition.left;
|
||||
var sliderTarget = activeItemOffset - sliderOffset;
|
||||
|
||||
slider.width(40);
|
||||
slider.css("margin-left", sliderTarget);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
1246
spring-batch-docs/asciidoc/jsfiles/underscore.js
Normal file
1246
spring-batch-docs/asciidoc/jsfiles/underscore.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,8 @@
|
||||
|
||||
== Spring Batch Introduction
|
||||
|
||||
include::toggle.adoc[]
|
||||
|
||||
Many applications within the enterprise domain require bulk processing
|
||||
to perform business operations in mission critical environments. These
|
||||
business operations include automated, complex processing of large volumes
|
||||
|
||||
@@ -689,3 +689,5 @@ b.conum * { color: inherit !important; }
|
||||
#toc a:hover { text-decoration: underline; }
|
||||
|
||||
.admonitionblock > table td.content { border-left: none; }
|
||||
|
||||
.js-download-widget-selector{display:inline;}.navbar{margin-bottom:0;}.item-slider-widget{display:inline-block;margin-left:15px;}.item-slider-widget .item--slider{height:32px;position:absolute;width:40px;border-radius:2px;margin-top:-4px;z-index:800;background:#68605a;background:-moz-linear-gradient(top,#68605a 0%,#34302d 100%,#020202 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#68605a),color-stop(100%,#34302d),color-stop(100%,#020202));background:-webkit-linear-gradient(top,#68605a 0%,#34302d 100%,#020202 100%);background:-o-linear-gradient(top,#68605a 0%,#34302d 100%,#020202 100%);background:-ms-linear-gradient(top,#68605a 0%,#34302d 100%,#020202 100%);background:linear-gradient(to bottom,#68605a 0%,#34302d 100%,#020202 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#68605a',endColorstr='#020202',GradientType=0);cursor:pointer;transition:all 0.25s;-webkit-transition:all 0.25s;-moz-webkit-transition:all 0.25s;-ms--webkit-transition:all 0.25s;-o-webkit-transition:all 0.25s;}.item-slider-widget .item-slider--container{background-color:white;border:1px solid #999;padding:0 3px;}.item-slider-widget .item-slider--container .item{display:inline-block;color:#c3c3c3;font-family:"Montserrat",sans-serif;font-size:12px;line-height:12px;text-transform:uppercase;padding:7px 6px 5px;cursor:pointer;transition:color 0.25s;-webkit-transition:color 0.25s;-moz-webkit-transition:color 0.25s;-ms--webkit-transition:color 0.25s;-o-webkit-transition:color 0.25s;}.item-slider-widget .item-slider--container .item:hover{color:black;}.item-slider-widget .item-slider--container .item.js-active{z-index:801;position:relative;color:#f1f1f1;}
|
||||
|
||||
42
spring-batch-docs/asciidoc/toggle.adoc
Normal file
42
spring-batch-docs/asciidoc/toggle.adoc
Normal file
@@ -0,0 +1,42 @@
|
||||
ifdef::backend-html5[]
|
||||
+++
|
||||
<div class="toggleWidget">
|
||||
<script src="./jsfiles/jquery.js"></script>
|
||||
<script src="./jsfiles/underscore.js"></script>
|
||||
<script src="./jsfiles/backbone.js"></script>
|
||||
<script src="./jsfiles/js.cookie.js"></script>
|
||||
<script src="./jsfiles/projectDocumentationWidget.js"></script>
|
||||
<script src="./jsfiles/application.js"></script>
|
||||
<div code-widget-controls="" style="display: inline-block">
|
||||
<div class="item-slider-widget js-item-slider--wrapper">
|
||||
<div class="item-slider--container">
|
||||
<div class="item--slider js-item--slider"
|
||||
style="width: 57px; margin-left: 0.01555px;"></div>
|
||||
<div class="item js-item" data-snippet-type="java">
|
||||
Java
|
||||
</div>
|
||||
<div class="item js-item" data-snippet-type="xml">
|
||||
XML
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="code-widget--body">
|
||||
<div class="js-code-maven-widget"></div>
|
||||
</div>
|
||||
<script type="text/html" id="code-widget-controls-template">
|
||||
<div class="item-slider-widget js-item-slider--wrapper">
|
||||
<div class="item-slider--container">
|
||||
<div class="item--slider js-item--slider"></div>
|
||||
<div class="item js-item java_snip_item" data-snippet-type='java'>
|
||||
Java
|
||||
</div>
|
||||
<div class="item js-item xml_snip_item" data-snippet-type='xml'>
|
||||
XML
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
+++
|
||||
endif::backend-html5[]
|
||||
Reference in New Issue
Block a user