Publish 17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc

<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Los estilos de aprendizaje de Kolb - Tecnología, Innovación y más..</title>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta name="description" content="">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Los estilos de aprendizaje de Kolb">
    <meta name="twitter:description" content="">

    <meta property="og:type" content="article">
    <meta property="og:title" content="Los estilos de aprendizaje de Kolb">
    <meta property="og:description" content="">

    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon">

    <link rel="stylesheet" type="text/css" href="//marchelo2212.github.io/themes/uno/assets/css/uno.css?v=1.0.0" />

    <link rel="canonical" href="https://marchelo2212.github.io17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc" />

    <meta property="og:site_name" content="Tecnología, Innovación y más.." />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Los estilos de aprendizaje de Kolb" />
    <meta property="og:description" content="Dentro de las diversas acciones que un docente desarrolla en clase siempre debe tomar en cuenta los divesos estilos de aprendizaje de sus estudiantes, de esta manera podemos asegurar que cada actividad podrá generar un mejor aprendizaje en cada uno..." />
    <meta property="og:url" content="https://marchelo2212.github.io17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc" />
    <meta property="article:published_time" content="Invalid date" />
    <meta property="article:modified_time" content="2016-07-30T18:15:38.993Z" />
    <meta property="article:tag" content="e-learning" />
    <meta property="article:tag" content="innovación" />
    <meta property="article:tag" content="estilos de aprendizaje" />
    <meta property="article:tag" content="TIC" />
    <meta property="article:tag" content="educación" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Los estilos de aprendizaje de Kolb" />
    <meta name="twitter:description" content="Dentro de las diversas acciones que un docente desarrolla en clase siempre debe tomar en cuenta los divesos estilos de aprendizaje de sus estudiantes, de esta manera podemos asegurar que cada actividad podrá generar un mejor aprendizaje en cada uno..." />
    <meta name="twitter:url" content="https://marchelo2212.github.io17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc" />

    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="Tecnología, Innovación y más.." href="https://marchelo2212.github.io/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

Tecnología, Innovación y más..

Sitio dedicado a recopilar las cosas que he realizado en algunos lados, para poder tenerlas todas un poco ordenadas, aquí encontrarás cosas referente a:
    Software Libre - GNU / Linux
    Innovación Educativa
    Ciencia y Tecnología
    Entre otras....

Blog

                      Facebook

                      Twitter

                      Google-plus

                      LinkedIn

                      Email

        <time datetime="Invalid date" class="post-meta__date date">Invalid date</time> • on e-learning,  innovación,  estilos de aprendizaje, TIC,  educación
         by Marcelo Sotaminga

Los estilos de aprendizaje de Kolb

Dentro de las diversas acciones que un docente desarrolla en clase siempre debe tomar en cuenta los divesos estilos de aprendizaje de sus estudiantes, de esta manera podemos asegurar que cada actividad podrá generar un mejor aprendizaje en cada uno de ellos y responder a la diversidad de caracterísiticas de los mismo.

Estilos de aprendizaje

El emplear metodologías que apunten a mantener como eje central al estudiante deberán tomar en cuenta la heterogeneidad del grupo y trabajar (planificando y aplicado) diversas estrategias didáctiva que permitan justamente que todo el grupo genere un aprendizaje significativo. Para esto imprescindible el proponer actividades direccionadas a sus estilos de aprendizaje, por ello, se revisará algunas de ellas con sus características.

Refiriéndose al tema Laura Frade, articula ocho capacidades que deben tener los docentes, estas capacidades interactúan entre sí para dar como resultado la óptima formación de los estudiantes:

Capacidad diagnóstica: capacidad de detectar las necesidades de aprendizaje del estudiante, alienearla a un estilo de aprendizaje y vincularla con una estrategia de aprendizaje.

Capacidad cognitiva: capacidad que guarda relación con la adquisición del conocimiento necesario para impartir los contenidos temáticos.

Capacidad ética: capacidad que incide en la toma de decisiones del docente sobre su compromiso ante la sociedad, la responsabilidad de trabajo, los valores que promoverá, los juicios de  valor que emitirá, la priorización del desarrollo de los estudiantes, la preocupación sobre su futuro laboral.

Capacidad lógica: capacidad para organizar el contenido temáticos de forma lógica-secuencial. Se demuestra por su, orden, graduación y dosificación.

Capacidad empática: capacidad que permite entender a los estudiantes en tres diferentes planos: afectivo, cognitivo y psicomotriz.

Capacidad comunicativa: habilidad para lograr la mediación entre el aprendizaje y la enseñanza.Se evidencia en el uso de los diferentes tipos de lenguaje que posibiliten al estudiante apropiarse del conocimiento y hacer su propia construcción significativa, lo que les permitirá aprender para la vida.

Capacidad lúdica: capacidad que permite diseñar y aplicar diversas estrategias de enseñanza-aprendizaje.

Capacidad metacognitiva: capacidad para evaluar el proceso enseñanza-aprendizaje en dos vías: hacia los alumnos verificando avances y estableciendo medidas correctivas, pero además hacia su propio desempeño como docente, lo que le permitirá mejorar día a día en su profesión.

Si nosotros como docentes contamos con estas habilidades, aseguraremos un buen trabajo con nuestros estudiantes.

¿Qué son?

Se definen como las distintas maneras en que un individuo puede aprender; para Alonso y Gallego (1994) los estilos de aprendizaje son los rasgos cognitivos, afectivos y fisiológicos que sirven como indicadores relativamente estables de cómo los alumnos perciben interacciones y responden a sus ambientes de aprendizaje.

Se cree que todas las personas emplean un método particular de interacción, aceptación y procesado de estímulos e información. Las características sobre estilo de aprendizaje suelen formar parte de cualquier informe psicopedagógico que se elabore sobre un estudiante, y debiera ser el fundamento de las estrategias didácticas y refuerzos pedagógicos para que estos sean los más adecuados para el alumno.

Los diversos investigadores que han propuesto algún estilo de aprendizaje en cierto difieren de los componentes de los estilos de aprendizaje; sin embargo estos serían algunos de los más empleados:

Condiciones ambientales

Bagaje cultural

Edad

Preferencias de agrupamiento (se refiere a si se trabaja mejor individual-
mente o en equipo)

Estilo seguido para la resolución de problemas

Tipo de motivación, locus de control interno o externo

El analizar los diferentes estilos de aprendizjae que tienen nuestros estudiantes sin lugar a dudas permitirá que podamos tomar decisiones dirigidas a satisfacer cada necesidad singular en el grupo y con ellos que el conjunto de estudiantes logre la asimilización de conocimientos planificiada o quizás una superior.

Clasificación

Los modelos existentes sobre estilos de aprendizaje ofrecen un marco conceptual para entender los comportamientos observados en el aula, los cuales brindan una
explicación sobre la relación de esos comportamientos con la forma en que están aprendiendo los alumnos y el tipo de estrategias de enseñanza que pueden resultar más eficaces en un momento determinado, ya sea por el contendido temático en sí, o bien por las diversas interacciones sociales que se desarrollan en el aula.

De esta manera tenemos varias clasificaciones las cuales se muestran en la siguiente tabla:

Modelo de Kolb

El aprendizaje experiencial progresa a través de un ciclo de actividades a las que se conoce habitualmente como ciclo de aprendizaje de Kolb (David Kolb, 1984).

El ciclo tiene cuatro componentes, cada uno de los cuales plantea retos concretos a la hora de planificar actividades académicas.

Acorde este modelo una persona sulee establecer su estilo de aprendizaje en 1 o máximo 2 de estas fases y de esta menera podemos clasificar a nuestros estudiantes acorde la fase que prefieran trabajar.

Activo

Reflexivo

Teórico

Pragmático

Caráterísticas de cada estilo

Para lograr proponer/emplear estrategias de aprendizaje apropiadas para cada estilo revisemos las características de cada uno:

Table 1. Características Estilos de parendizaje modelo Kolb

<colgroup>
<col>
<col>
<col>
<col>
</colgroup>

Estilo
Característica General
Cuando facilita el aprendizaje
Cuando NO facilita el aprendizaje.

Prágmáticos

Gustan de poner en práctica las ideas, teorías, técnicas nuevas y verificar su funcionamiento, forma de uso/aplicación. Generan/buscan ideas y las ejecutan inmediatamente. Se basan en la realidad para plantear alternativas a fin de de tomar decisiones sobre algo. Buscan desafíos, replantear algo con una diferente perspectiva. Discuten un tema brevemenete, les aburren los debates largos. La pregunta que quieren responder es: ¿Qué pasaría si?

Actividades que enlacen la teoría con la práctica. Visualizan trabajo/movimiento/acción. Posibilidad de aplicación de algo aprendido.

Cuando todo queda en teoría. Lo aprendido no se vincula con la realidad o necesidades puntuales. Actividades que no se identifique una finalidad con claridad.

Activos

Se involucran totalmente y sin prejuicios en las experiencias nuevas.
Disfrutan el momento y cada acontecimiiento. Entusiastas ente lo nuevo. Actuan primero y luego piensan en las consecuencias. Disfrutan trabajando en equipo siendo el eje del grupo. Les aburre planificar a largo plazo y consolidar poryectos.
La pregunta que buscan responder en el aprendizaje es: ¿Cómo?

Plantendo actividades desafiantes . Actividades de resultados immediatos o a corto plazo. Actividades activas de emoción, drama, acción.

Siendo pasivos. Demasiado análisis de un tema o mucha reflexión sobre algo. Trabajo individual.

Reflexivo

Adoptan una postura observadora de análsis en base a datos, experiencias desde varias perpectivas.Establecen conclusiones en base a argumentos sólidos y convincentes. Son precavidos y analizan todas las implicaciones de cualquier acción antes de ponerse en
movimiento. En las reuniones observan y escuchan antes de hablar procurando pasar desapercibidos. La pregunta que quieren responder con el aprendizaje es: ¿Por qué?

Cuando pueden tener una postura de observador. Analizar situaciones. Se les facilita información o datos. Tienen tiempo para reflexionar antes de actuar.

Se exigen ser centro o eje de atención. Actividades de solución inmediata. Improvisación sobre algo. Actividades que le apresuren.

Teóricos

Adaptan e intergran las teorías o fundamentos de forma lógica. Organizan las cosas de forma secuencial, integrada y coherente. Analizan y sintetizan información de forma racional. No son subjetivos ni ilógicos. La pregutna que quieren responder es: ¿Qué?

Cuando se parte de teorías, modelos, sistemas. Ideas o conceptos desafiantes. Actividades que propicien la indagación o cuestionamientos.

Actividades abiguas o que generen incertidumbre. Actividades/situaciones que prioricen sentimientos o emociones. Cuando no se les facilita la teoría o bases conceptuales.

Este valor de 3274 dólares es el cambio del euro (3000) a dolar.

    Please enable JavaScript to view the comments powered by Disqus.
    comments powered by Disqus

                © 2016. All rights reserved.
                Uno theme by Dale-Anthony
                Proudly published with Hubpress

<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Los estilos de aprendizaje de Kolb - Tecnología, Innovación y más..</title>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta name="description" content="">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Los estilos de aprendizaje de Kolb">
    <meta name="twitter:description" content="">

    <meta property="og:type" content="article">
    <meta property="og:title" content="Los estilos de aprendizaje de Kolb">
    <meta property="og:description" content="">

    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon">

    <link rel="stylesheet" type="text/css" href="//marchelo2212.github.io/themes/uno/assets/css/uno.css?v=1.0.0" />

    <link rel="canonical" href="https://marchelo2212.github.io17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc" />

    <meta property="og:site_name" content="Tecnología, Innovación y más.." />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Los estilos de aprendizaje de Kolb" />
    <meta property="og:description" content="Dentro de las diversas acciones que un docente desarrolla en clase siempre debe tomar en cuenta los divesos estilos de aprendizaje de sus estudiantes, de esta manera podemos asegurar que cada actividad podrá generar un mejor aprendizaje en cada uno..." />
    <meta property="og:url" content="https://marchelo2212.github.io17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc" />
    <meta property="article:published_time" content="Invalid date" />
    <meta property="article:modified_time" content="2016-07-30T17:54:22.733Z" />
    <meta property="article:tag" content="e-learning" />
    <meta property="article:tag" content="innovación" />
    <meta property="article:tag" content="estilos de aprendizaje" />
    <meta property="article:tag" content="TIC" />
    <meta property="article:tag" content="educación" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Los estilos de aprendizaje de Kolb" />
    <meta name="twitter:description" content="Dentro de las diversas acciones que un docente desarrolla en clase siempre debe tomar en cuenta los divesos estilos de aprendizaje de sus estudiantes, de esta manera podemos asegurar que cada actividad podrá generar un mejor aprendizaje en cada uno..." />
    <meta name="twitter:url" content="https://marchelo2212.github.io17-07-2016-Los-estilos-de-aprendizaje-de-Kolb.adoc" />

    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="Tecnología, Innovación y más.." href="https://marchelo2212.github.io/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

Tecnología, Innovación y más..

Sitio dedicado a recopilar las cosas que he realizado en algunos lados, para poder tenerlas todas un poco ordenadas, aquí encontrarás cosas referente a:
    Software Libre - GNU / Linux
    Innovación Educativa
    Ciencia y Tecnología
    Entre otras....

Blog

                      Facebook

                      Twitter

                      Google-plus

                      LinkedIn

                      Email

        <time datetime="Invalid date" class="post-meta__date date">Invalid date</time> • on e-learning,  innovación,  estilos de aprendizaje, TIC,  educación
         by Marcelo Sotaminga

Los estilos de aprendizaje de Kolb

Dentro de las diversas acciones que un docente desarrolla en clase siempre debe tomar en cuenta los divesos estilos de aprendizaje de sus estudiantes, de esta manera podemos asegurar que cada actividad podrá generar un mejor aprendizaje en cada uno de ellos y responder a la diversidad de caracterísiticas de los mismo.

Estilos de aprendizaje

El emplear metodologías que apunten a mantener como eje central al estudiante deberán tomar en cuenta la heterogeneidad del grupo y trabajar (planificando y aplicado) diversas estrategias didáctiva que permitan justamente que todo el grupo genere un aprendizaje significativo. Para esto imprescindible el proponer actividades direccionadas a sus estilos de aprendizaje, por ello, se revisará algunas de ellas con sus características.

Refiriéndose al tema Laura Frade, articula ocho capacidades que deben tener los docentes, estas capacidades interactúan entre sí para dar como resultado la óptima formación de los estudiantes:

Capacidad diagnóstica: capacidad de detectar las necesidades de aprendizaje del estudiante, alienearla a un estilo de aprendizaje y vincularla con una estrategia de aprendizaje.

Capacidad cognitiva: capacidad que guarda relación con la adquisición del conocimiento necesario para impartir los contenidos temáticos.

Capacidad ética: capacidad que incide en la toma de decisiones del docente sobre su compromiso ante la sociedad, la responsabilidad de trabajo, los valores que promoverá, los juicios de  valor que emitirá, la priorización del desarrollo de los estudiantes, la preocupación sobre su futuro laboral.

Capacidad lógica: capacidad para organizar el contenido temáticos de forma lógica-secuencial. Se demuestra por su, orden, graduación y dosificación.

Capacidad empática: capacidad que permite entender a los estudiantes en tres diferentes planos: afectivo, cognitivo y psicomotriz.

Capacidad comunicativa: habilidad para lograr la mediación entre el aprendizaje y la enseñanza.Se evidencia en el uso de los diferentes tipos de lenguaje que posibiliten al estudiante apropiarse del conocimiento y hacer su propia construcción significativa, lo que les permitirá aprender para la vida.

Capacidad lúdica: capacidad que permite diseñar y aplicar diversas estrategias de enseñanza-aprendizaje.

Capacidad metacognitiva: capacidad para evaluar el proceso enseñanza-aprendizaje en dos vías: hacia los alumnos verificando avances y estableciendo medidas correctivas, pero además hacia su propio desempeño como docente, lo que le permitirá mejorar día a día en su profesión.

Si nosotros como docentes contamos con estas habilidades, aseguraremos un buen trabajo con nuestros estudiantes.

¿Qué son?

Se definen como las distintas maneras en que un individuo puede aprender; para Alonso y Gallego (1994) los estilos de aprendizaje son los rasgos cognitivos, afectivos y fisiológicos que sirven como indicadores relativamente estables de cómo los alumnos perciben interacciones y responden a sus ambientes de aprendizaje.

Se cree que todas las personas emplean un método particular de interacción, aceptación y procesado de estímulos e información. Las características sobre estilo de aprendizaje suelen formar parte de cualquier informe psicopedagógico que se elabore sobre un estudiante, y debiera ser el fundamento de las estrategias didácticas y refuerzos pedagógicos para que estos sean los más adecuados para el alumno.

Los diversos investigadores que han propuesto algún estilo de aprendizaje en cierto difieren de los componentes de los estilos de aprendizaje; sin embargo estos serían algunos de los más empleados:

Condiciones ambientales

Bagaje cultural

Edad

Preferencias de agrupamiento (se refiere a si se trabaja mejor individual-
mente o en equipo)

Estilo seguido para la resolución de problemas

Tipo de motivación, locus de control interno o externo

El analizar los diferentes estilos de aprendizjae que tienen nuestros estudiantes sin lugar a dudas permitirá que podamos tomar decisiones dirigidas a satisfacer cada necesidad singular en el grupo y con ellos que el conjunto de estudiantes logre la asimilización de conocimientos planificiada o quizás una superior.

Clasificación

Los modelos existentes sobre estilos de aprendizaje ofrecen un marco conceptual para entender los comportamientos observados en el aula, los cuales brindan una
explicación sobre la relación de esos comportamientos con la forma en que están aprendiendo los alumnos y el tipo de estrategias de enseñanza que pueden resultar más eficaces en un momento determinado, ya sea por el contendido temático en sí, o bien por las diversas interacciones sociales que se desarrollan en el aula.

De esta manera tenemos varias clasificaciones las cuales se muestran en la siguiente tabla:

Modelo de Kolb

El aprendizaje experiencial progresa a través de un ciclo de actividades a las que se conoce habitualmente como ciclo de aprendizaje de Kolb (David Kolb, 1984).

El ciclo tiene cuatro componentes, cada uno de los cuales plantea retos concretos a la hora de planificar actividades académicas.

Acorde este modelo una persona sulee establecer su estilo de aprendizaje en 1 o máximo 2 de estas fases y de esta menera podemos clasificar a nuestros estudiantes acorde la fase que prefieran trabajar.

Activo

Reflexivo

Teórico

Pragmático

Caráterísticas de cada estilo

Para lograr proponer/emplear estrategias de aprendizaje apropiadas para cada estilo revisemos las características de cada uno:

Table 1. Características Estilos de parendizaje modelo Kolb

<colgroup>
<col>
<col>
<col>
<col>
</colgroup>

Estilo
Característica General
Cuando facilita el aprendizaje
Cuando NO facilita el aprendizaje.

Prágmáticos

Gustan de poner en práctica las ideas, teorías, técnicas nuevas y verificar su funcionamiento, forma de uso/aplicación. Generan/buscan ideas y las ejecutan inmediatamente. Se basan en la realidad para plantear alternativas a fin de de tomar decisiones sobre algo. Buscan desafíos, replantear algo con una diferente perspectiva. Discuten un tema brevemenete, les aburren los debates largos. La pregunta que quieren responder es: ¿Qué pasaría si?

Actividades que enlacen la teoría con la práctica. Visualizan trabajo/movimiento/acción. Posibilidad de aplicación de algo aprendido.

Cuando todo queda en teoría. Lo aprendido no se vincula con la realidad o necesidades puntuales. Actividades que no se identifique una finalidad con claridad.

Activos

Se involucran totalmente y sin prejuicios en las experiencias nuevas.
Disfrutan el momento y cada acontecimiiento. Entusiastas ente lo nuevo. Actuan primero y luego piensan en las consecuencias. Disfrutan trabajando en equipo siendo el eje del grupo. Les aburre planificar a largo plazo y consolidar poryectos.
La pregunta que buscan responder en el aprendizaje es: ¿Cómo?

Plantendo actividades desafiantes . Actividades de resultados immediatos o a corto plazo. Actividades activas de emoción, drama, acción.

Siendo pasivos. Demasiado análisis de un tema o mucha reflexión sobre algo. Trabajo individual.

Reflexivo

Adoptan una postura observadora de análsis en base a datos, experiencias desde varias perpectivas.Establecen conclusiones en base a argumentos sólidos y convincentes. Son precavidos y analizan todas las implicaciones de cualquier acción antes de ponerse en
movimiento. En las reuniones observan y escuchan antes de hablar procurando pasar desapercibidos. La pregunta que quieren responder con el aprendizaje es: ¿Por qué?

Cuando pueden tener una postura de observador. Analizar situaciones. Se les facilita información o datos. Tienen tiempo para reflexionar antes de actuar.

Se exigen ser centro o eje de atención. Actividades de solución inmediata. Improvisación sobre algo. Actividades que le apresuren.

Teóricos

Adaptan e intergran las teorías o fundamentos de forma lógica. Organizan las cosas de forma secuencial, integrada y coherente. Analizan y sintetizan información de forma racional. No son subjetivos ni ilógicos. La pregutna que quieren responder es: ¿Qué?

Cuando se parte de teorías, modelos, sistemas. Ideas o conceptos desafiantes. Actividades que propicien la indagación o cuestionamientos.

Actividades abiguas o que generen incertidumbre. Actividades/situaciones que prioricen sentimientos o emociones. Cuando no se les facilita la teoría o bases conceptuales.

Este valor de 3274 dólares es el cambio del euro (3000) a dolar.

    Please enable JavaScript to view the comments powered by Disqus.
    comments powered by Disqus

                © 2016. All rights reserved.
                Uno theme by Dale-Anthony
                Proudly published with Hubpress


Docs: Fix missing comma and boolean true

Closes #9350

[[search-aggregations-metrics-geobounds-aggregation]]
=== Geo Bounds Aggregation

A metric aggregation that computes the bounding box containing all geo_point values for a field.

.Experimental!
[IMPORTANT]
=====
This feature is marked as experimental, and may be subject to change in the
future.  If you use this feature, please let us know your experience with it!
=====

Example:

[source,js]
--------------------------------------------------
{
    "query" : {
        "match" : { "business_type" : "shop" }
    },
    "aggs" : {
        "viewport" : {
            "geo_bounds" : {
                "field" : "location", <1>
                "wrap_longitude" : true <2>
            }
        }
    }
}
--------------------------------------------------

<1> The `geo_bounds` aggregation specifies the field to use to obtain the bounds
<2> `wrap_longitude` is an optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is `true`

The above aggregation demonstrates how one would compute the bounding box of the location field for all documents with a business type of shop

The response for the above aggregation:

[source,js]
--------------------------------------------------
{
    ...

    "aggregations": {
        "viewport": {
            "bounds": {
                "top_left": {
                    "lat": 80.45,
                    "lon": -160.22
                },
                "bottom_right": {
                    "lat": 40.65,
                    "lon": 42.57
                }
            }
        }
    }
}
--------------------------------------------------

[[search-aggregations-metrics-geobounds-aggregation]]
=== Geo Bounds Aggregation

A metric aggregation that computes the bounding box containing all geo_point values for a field.

.Experimental!
[IMPORTANT]
=====
This feature is marked as experimental, and may be subject to change in the
future.  If you use this feature, please let us know your experience with it!
=====

Example:

[source,js]
--------------------------------------------------
{
    "query" : {
        "match" : { "business_type" : "shop" }
    },
    "aggs" : {
        "viewport" : {
            "geo_bounds" : {
                "field" : "location" <1>
                "wrap_longitude" : "true" <2>
            }
        }
    }
}
--------------------------------------------------

<1> The `geo_bounds` aggregation specifies the field to use to obtain the bounds
<2> `wrap_longitude` is an optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is `true`

The above aggregation demonstrates how one would compute the bounding box of the location field for all documents with a business type of shop

The response for the above aggregation:

[source,js]
--------------------------------------------------
{
    ...

    "aggregations": {
        "viewport": {
            "bounds": {
                "top_left": {
                    "lat": 80.45,
                    "lon": -160.22
                },
                "bottom_right": {
                    "lat": 40.65,
                    "lon": 42.57
                }
            }
        }
    }
}
--------------------------------------------------


java packages in doc

java packages in doc

= The Model API

One of the core features and maybe the most important concept of Dolphin Platform is the model synchronization between
client and server. For each view in the client a controller instance "lives" in the server that defines all the logic of
the view. A model is automatically shared and synchronized between the client view and the controller on the server.

.Synchronization of the model
image::model-sync.png[]

Such a model can be a bean or a hierarchy of several beans. Dolphin Platform provides an API to create full observable
beans for the model layer.

== Creating a bean

A model for the Dolphin Platform can simply be defined as a Java bean but instead of using primitive date types for all
the attributes of the bean Dolphin Platform provides the `Property<V>` interface that should be used to define
attributes. Based on this a definition for a bean with only one String attribute will look like this:

[source,java]
----
@DolphinBean
public class MyModel {

    private Property<String> value;

    public Property<String> valueProperty() {
        return value;
    }

    public String getValue() {
        return value.get();
    }

    public void setValue(String value) {
           this.value.set(value);
    }

}
----

NOTE: Maybe you ask yourself why the `@DolphinBean` annotation is needed. Internally the Dolphin Platform checks if a bean
class is annotated with `@DolphinBean` and will trow a `BeanDefinitionException` if the annotation is not present. By
doing so it will be easy to check if you use the right model classes. We plan to add some additional features based on
the annotation in the future. One example can be an annotation processor that checks if all classes that are defined as
the Dolphin Platform beans (by adding the `@DolphinBean` annotation) are valid Dolphin Platform beans.

[[supported-types]]
== Supported types

Currently Dolphin Platform properties and collections support the following types as content:

* `Integer`
* `Long`
* `Float`
* `Double`
* `Byte`
* `Short`
* `Boolean`
* `String`
* `java.util.Date` _(since version 0.8.4)_
* `java.util.Calendar` _(since version 0.8.4)_
* `Enums` _(since version 0.8.4)_
* Dolphin Platform Bean <<bean-hierarchies, (see description)>>

CAUTION: As some browsers have issues with Timezone, one has to use UTC. If the provided Calendar is not set to UTC, it
will be converted.

Since version 0.8.8 the Dolphin Platform contains the optional module `dolphin-platform-date-time-converter` that provides
the support for addition types for properties and collections. All the types are part of the Java 8 date and time API:

* `java.time.Duration`
* `java.time.LocalDateTime`
* `java.time.Period`
* `java.time.ZonedDateTime`

CAUTION: Currently the additional data types are only supported in Java. The support for the JavaScript will be added
in a future version

=== Custom data types

Since version 0.8.8 the Dolphin Platform provides a SPI to add custom data types for properties and collections. To add
support for a new data type a custom converter must be provided. To do so the `com.canoo.dolphin.converter.ConverterFactory`
interface must be implemented and provided for
https://docs.oracle.com/javase/tutorial/ext/basics/spi.html[Java Service Provider Interface (SPI)]. Examples for custom
data types can be found in the sources of the optional `dolphin-platform-date-time-converter` module.

== Using collections

The first example of a Dolphin Platform bean contained only a String property but most of the time you need more complex
beans. That's why we added collection support to the Dolphin Platform model API. Next to the properties a bean can contain
lists that are define by the `ObservableList<V>` interface. The interface extends the default Java `List` interface by adding
support for observers. A Dolphin Platform bean that contains a list might look like this:

[source,java]
----
@DolphinBean
public class MyModel {

    private ObservableList<String> values;

    public ObservableList<String> getValues() {
        return values;
    }

}
----

A `ObservableList<V>` supports <<supported-types, all the same generic types as a property.>>

[[bean-hierarchies]]
== Defining hierarchies

TODO

== Add observer

TODO

== Defining the model of a MVC group

As you can see in the following image each MVC group in the Dolphin Platform contains a model. A MVC group is based on the
MVC pattern and contains a controller, a view and a model. In the Dolphin Platform approach the controller lives on the server
and the view is defined on the client. The model is shared between the client and the server.

.A MVC group
image::model-sync.png[]

As we have seen until now a model is defined by properties and collections. Since `Property<V>` and `ObservableList<V>` are
defined as interfaces and no model provides a specific constructor it's still not clear how a new instance of a model should
created. Thanks to the Dolphin Platform architecture a developer don't need to think about the model instanciation or the
lifecycle of a model. Whenever a new MVC group is created by the platform the model instance will be created automatically.
To do so the model must be defined in the controller. The Dolphin Platform provides the `@DolphinModel` annotation that is
used to inject the created model instance in the controller instance. The following sample code shows a minimal controller
that defines its model type:

----
@DolphinController
public class MyController {

    @DolphinModel
    private MyModel model;

}
----

The model instance will be automatically synchronized with the client. Since the model is completelly observable you can
 simply bind the properties and lists that are defined in the model to your UI components in the client.

== Working with the BeanManager

TODO

=== Creating new model instances

Since all beans of the Dolphin Platform model layer will be synchronized between client and server a new model instance
can not be created "by hand" (`MyBean bean = new MyBean`). So instead of creating a new bean instance by calling its
constructor the BeanManager interface must be used to create a new bean instance. By doing so the bean instance will
automatically be added to the bean manager and synchronized between client and server. Here is an example how a bean
instance can be created:

----
MyBean bean = beanManager.create(MyBean.class);
----

=== Removing a bean

The BeanManager interface provides several methods to remove beans. Until a bean is removed by the bean manager it will
be synchronized between client and server. Even if a bean isn't referenced in the custom application code anymore it won't
be removed by the Java Garbage Collection since it's still referenced by the bean manager. The following methods can be
used to remove beans from the client-server-synchronization:

* `void remove(Object bean)`
* `void removeAll(Class<?> beanClass)`
* `void removeAll(Object... beans)`
* `void removeAll(Collection<?> beans)`

All this methods do not work transitive. This means that in a hierarchy of beans all beans must be detached from the
bean manager seperately.

In addition the BeanManager interface provides a method to check if a bean is still synchronized between client and
server or if it's already removed from the bean manager:

* `boolean isManaged(Object bean)`

CAUTION: Currently all mentioned methods are deprecated. Since the Dolphin Platform provides its own Garbage
Collector beans can be automatically removed by the bean manager once they are not referenced in the model layer anymore.
Until now the Dolphin Platform garbage collection is an experimental feature that must be activated on the server. Once
the garbage collection will become a default in the Dolphin Platform the deprecated methods will be removed in a future
release.

== The Dolphin Platform garbage collection

The Dolphin Platform contains a garbage collection on the server that will automatically remove all bean instances from
the remoting layer that aren't referenced anymore by other beans. Currently the garbage collection is an experimental
feature and it's not active by default. If you want to use the garbage collection you need to add
`garbageCollectionActive=true` to the `dolphin.properties` file (see chapter *Server configuration*).

== How to work with the Model API

To get a better overview of the API that helps you to define presentation models in Dolphin Platform we added a small
example.
Let's say we have the following view that can be part of a photo library app:

.Example Application
image::model-example-1.png[]

In this view, we have several elements that need a data model. If the data of this app is stored on a server the data
model must be shared between the client and the server. When having a look at the screen we can see 3 different elements
that need data from the data model to visualize itself or provide user interaction:

* The title of the screen needs a String as its content. We can display the title of a photo album or an internationalized
string.
* The slider that defines a value. Let's imagine that the interaction with the slider changes the size of the pictures in
the main area. Maybe the last value of the slider should be stored on the server to automatically save user preferences
* All pictures in the main area. As you can see each card in this area contains an image and maybe a badge in the top
right corner. A badge element in the top right corner visualizes if the photo is flagged.

Based on this definition we would create a presentation model that might look like this one:

.The presentation model
image::model-example-2.png[]

When defining such a model in JavaFX, you can use the cool property API and the observable collections that are part of
JavaFX. Modern JavaScript frameworks like AngularJS or Polymer provide a similar behavior and therefore we decided to
offer the same benefits when defining models with the Dolphin Platform. In Dolphin Platform you work with properties and
observable collections, too. Therefore it really easy to define a hierarchical model for your view. A model for the
shown view might look like this:

[source,java]
----
@DolphinBean
public class PhotoOverviewModel {

  private Property<String> title;

  private Property<Double> sliderValue;

  private ObservableList<PhotoModel> photos;

  //getter & setter

}

@DolphinBean
public class PhotoModel {

  private Property<String> imageUrl;

  private Property<Boolean> flagged;

  //getter & setter

}
----

All properties and collections in the Dolphin Platform are observable and therefore it's quite easy to observe them on
the client and the server:

[source,java]
----
myModel.getTitleProperty().onChange(e -> System.out.println("New title: " + e.getNewValue()));
----

For all client APIs we support first class support for the Dolphin Platform properties. When working with JavaFX for
example it's quite easy and intuitive to bind a synchronized Dolphin Platform property to a JavaFX property:

[source,java]
----
FXBinder.bind(booleanJavaFXProperty).bidirectionalTo(booleanDolphinProperty);
----

On JavaScript clients the handling is even more elegant as you can bind the Dolphin Platform model directly in HTML.

The main benefit of this concept is that you can use the same model classes on the server and the client. Because the
model will automatically be synchronized between the view and the server controller it feels like you work with the same
instance. By doing so you can simply bind a string property to a textfield in the view and observe it's value on the
server. The change events will automatically be fired on the server when you start typing in the textfield.

== Property Binding

The Dolphin Platform provides an easy way to create a bidirectinal binding between 2 properties of the same generic type.
Currently the binding API only supports properties that are defined in the same client session. If you want to sync
properties on several clients the event bus is currently the best way to do this.
To create a binding between 2 properties in the same client session you need the `PropertyBinder` class. An instance of
this class can simply be injected in any controller:

[source,java]
----
@DolphinController
public class MyController {

    @Inject
    private PropertyBinder binder;

}
----

All binding are definied by qualifiers that are representated by the `Qualifier` class. For a new binding you need to
define a `Qualifier` instance that defines the generic type of the properties that should be bound. Since you can reuse
the `Qualifier` instance for all bindings of that type it's best practice to create a static instance:

[source,java]
----
public interface MyConstants {

    public final static Qualifier<String> userNameQualifier = Qualifier<String>.create();

}
----

Once you have the `PropertyBinder` instance and the `Qualifier` you can defining bindings. To do so you define the same
qualifier for all properties that should be bound:

[source,java]
----
propertyBinder.bind(model.userNameProperty(), MyConstants.userNameQualifier);
----

By using the same qualifier in several controller classes you can simply bind properties in a client scope without doing
manual updates.

= The Model API

One of the core features and maybe the most important concept of Dolphin Platform is the model synchronization between
client and server. For each view in the client a controller instance "lives" in the server that defines all the logic of
the view. A model is automatically shared and synchronized between the client view and the controller on the server.

.Synchronization of the model
image::model-sync.png[]

Such a model can be a bean or a hierarchy of several beans. Dolphin Platform provides an API to create full observable
beans for the model layer.

== Creating a bean

A model for the Dolphin Platform can simply be defined as a Java bean but instead of using primitive date types for all
the attributes of the bean Dolphin Platform provides the `Property<V>` interface that should be used to define
attributes. Based on this a definition for a bean with only one String attribute will look like this:

[source,java]
----
@DolphinBean
public class MyModel {

    private Property<String> value;

    public Property<String> valueProperty() {
        return value;
    }

    public String getValue() {
        return value.get();
    }

    public void setValue(String value) {
           this.value.set(value);
    }

}
----

NOTE: Maybe you ask yourself why the `@DolphinBean` annotation is needed. Internally the Dolphin Platform checks if a bean
class is annotated with `@DolphinBean` and will trow a `BeanDefinitionException` if the annotation is not present. By
doing so it will be easy to check if you use the right model classes. We plan to add some additional features based on
the annotation in the future. One example can be an annotation processor that checks if all classes that are defined as
the Dolphin Platform beans (by adding the `@DolphinBean` annotation) are valid Dolphin Platform beans.

[[supported-types]]
== Supported types

Currently Dolphin Platform properties and collections support the following types as content:

* `Integer`
* `Long`
* `Float`
* `Double`
* `Byte`
* `Short`
* `Boolean`
* `String`
* `Date` _(since version 0.8.4)_
* `Calendar` _(since version 0.8.4)_
* `Enums` _(since version 0.8.4)_
* Dolphin Platform Bean <<bean-hierarchies, (see description)>>

CAUTION: As some browsers have issues with Timezone, one has to use UTC. If the provided Calendar is not set to UTC, it
will be converted.

Since version 0.8.8 the Dolphin Platform contains the optional module `dolphin-platform-date-time-converter` that provides
the support for addition types for properties and collections. All the types are part of the Java 8 date and time API:

* Duration
* LocalDateTime
* Period
* ZonedDateTime

CAUTION: Currently the additional data types are only supported in Java. The support for the JavaScript will be added
in a future version

=== Custom data types

Since version 0.8.8 the Dolphin Platform provides a SPI to add custom data types for properties and collections. To add
support for a new data type a custom converter must be provided. To do so the `com.canoo.dolphin.converter.ConverterFactory`
interface must be implemented and provided for
https://docs.oracle.com/javase/tutorial/ext/basics/spi.html[Java Service Provider Interface (SPI)]. Examples for custom
data types can be found in the sources of the optional `dolphin-platform-date-time-converter` module.

== Using collections

The first example of a Dolphin Platform bean contained only a String property but most of the time you need more complex
beans. That's why we added collection support to the Dolphin Platform model API. Next to the properties a bean can contain
lists that are define by the `ObservableList<V>` interface. The interface extends the default Java `List` interface by adding
support for observers. A Dolphin Platform bean that contains a list might look like this:

[source,java]
----
@DolphinBean
public class MyModel {

    private ObservableList<String> values;

    public ObservableList<String> getValues() {
        return values;
    }

}
----

A `ObservableList<V>` supports <<supported-types, all the same generic types as a property.>>

[[bean-hierarchies]]
== Defining hierarchies

TODO

== Add observer

TODO

== Defining the model of a MVC group

As you can see in the following image each MVC group in the Dolphin Platform contains a model. A MVC group is based on the
MVC pattern and contains a controller, a view and a model. In the Dolphin Platform approach the controller lives on the server
and the view is defined on the client. The model is shared between the client and the server.

.A MVC group
image::model-sync.png[]

As we have seen until now a model is defined by properties and collections. Since `Property<V>` and `ObservableList<V>` are
defined as interfaces and no model provides a specific constructor it's still not clear how a new instance of a model should
created. Thanks to the Dolphin Platform architecture a developer don't need to think about the model instanciation or the
lifecycle of a model. Whenever a new MVC group is created by the platform the model instance will be created automatically.
To do so the model must be defined in the controller. The Dolphin Platform provides the `@DolphinModel` annotation that is
used to inject the created model instance in the controller instance. The following sample code shows a minimal controller
that defines its model type:

----
@DolphinController
public class MyController {

    @DolphinModel
    private MyModel model;

}
----

The model instance will be automatically synchronized with the client. Since the model is completelly observable you can
 simply bind the properties and lists that are defined in the model to your UI components in the client.

== Working with the BeanManager

TODO

=== Creating new model instances

Since all beans of the Dolphin Platform model layer will be synchronized between client and server a new model instance
can not be created "by hand" (`MyBean bean = new MyBean`). So instead of creating a new bean instance by calling its
constructor the BeanManager interface must be used to create a new bean instance. By doing so the bean instance will
automatically be added to the bean manager and synchronized between client and server. Here is an example how a bean
instance can be created:

----
MyBean bean = beanManager.create(MyBean.class);
----

=== Removing a bean

The BeanManager interface provides several methods to remove beans. Until a bean is removed by the bean manager it will
be synchronized between client and server. Even if a bean isn't referenced in the custom application code anymore it won't
be removed by the Java Garbage Collection since it's still referenced by the bean manager. The following methods can be
used to remove beans from the client-server-synchronization:

* `void remove(Object bean)`
* `void removeAll(Class<?> beanClass)`
* `void removeAll(Object... beans)`
* `void removeAll(Collection<?> beans)`

All this methods do not work transitive. This means that in a hierarchy of beans all beans must be detached from the
bean manager seperately.

In addition the BeanManager interface provides a method to check if a bean is still synchronized between client and
server or if it's already removed from the bean manager:

* `boolean isManaged(Object bean)`

CAUTION: Currently all mentioned methods are deprecated. Since the Dolphin Platform provides its own Garbage
Collector beans can be automatically removed by the bean manager once they are not referenced in the model layer anymore.
Until now the Dolphin Platform garbage collection is an experimental feature that must be activated on the server. Once
the garbage collection will become a default in the Dolphin Platform the deprecated methods will be removed in a future
release.

== The Dolphin Platform garbage collection

The Dolphin Platform contains a garbage collection on the server that will automatically remove all bean instances from
the remoting layer that aren't referenced anymore by other beans. Currently the garbage collection is an experimental
feature and it's not active by default. If you want to use the garbage collection you need to add
`garbageCollectionActive=true` to the `dolphin.properties` file (see chapter *Server configuration*).

== How to work with the Model API

To get a better overview of the API that helps you to define presentation models in Dolphin Platform we added a small
example.
Let's say we have the following view that can be part of a photo library app:

.Example Application
image::model-example-1.png[]

In this view, we have several elements that need a data model. If the data of this app is stored on a server the data
model must be shared between the client and the server. When having a look at the screen we can see 3 different elements
that need data from the data model to visualize itself or provide user interaction:

* The title of the screen needs a String as its content. We can display the title of a photo album or an internationalized
string.
* The slider that defines a value. Let's imagine that the interaction with the slider changes the size of the pictures in
the main area. Maybe the last value of the slider should be stored on the server to automatically save user preferences
* All pictures in the main area. As you can see each card in this area contains an image and maybe a badge in the top
right corner. A badge element in the top right corner visualizes if the photo is flagged.

Based on this definition we would create a presentation model that might look like this one:

.The presentation model
image::model-example-2.png[]

When defining such a model in JavaFX, you can use the cool property API and the observable collections that are part of
JavaFX. Modern JavaScript frameworks like AngularJS or Polymer provide a similar behavior and therefore we decided to
offer the same benefits when defining models with the Dolphin Platform. In Dolphin Platform you work with properties and
observable collections, too. Therefore it really easy to define a hierarchical model for your view. A model for the
shown view might look like this:

[source,java]
----
@DolphinBean
public class PhotoOverviewModel {

  private Property<String> title;

  private Property<Double> sliderValue;

  private ObservableList<PhotoModel> photos;

  //getter & setter

}

@DolphinBean
public class PhotoModel {

  private Property<String> imageUrl;

  private Property<Boolean> flagged;

  //getter & setter

}
----

All properties and collections in the Dolphin Platform are observable and therefore it's quite easy to observe them on
the client and the server:

[source,java]
----
myModel.getTitleProperty().onChange(e -> System.out.println("New title: " + e.getNewValue()));
----

For all client APIs we support first class support for the Dolphin Platform properties. When working with JavaFX for
example it's quite easy and intuitive to bind a synchronized Dolphin Platform property to a JavaFX property:

[source,java]
----
FXBinder.bind(booleanJavaFXProperty).bidirectionalTo(booleanDolphinProperty);
----

On JavaScript clients the handling is even more elegant as you can bind the Dolphin Platform model directly in HTML.

The main benefit of this concept is that you can use the same model classes on the server and the client. Because the
model will automatically be synchronized between the view and the server controller it feels like you work with the same
instance. By doing so you can simply bind a string property to a textfield in the view and observe it's value on the
server. The change events will automatically be fired on the server when you start typing in the textfield.

== Property Binding

The Dolphin Platform provides an easy way to create a bidirectinal binding between 2 properties of the same generic type.
Currently the binding API only supports properties that are defined in the same client session. If you want to sync
properties on several clients the event bus is currently the best way to do this.
To create a binding between 2 properties in the same client session you need the `PropertyBinder` class. An instance of
this class can simply be injected in any controller:

[source,java]
----
@DolphinController
public class MyController {

    @Inject
    private PropertyBinder binder;

}
----

All binding are definied by qualifiers that are representated by the `Qualifier` class. For a new binding you need to
define a `Qualifier` instance that defines the generic type of the properties that should be bound. Since you can reuse
the `Qualifier` instance for all bindings of that type it's best practice to create a static instance:

[source,java]
----
public interface MyConstants {

    public final static Qualifier<String> userNameQualifier = Qualifier<String>.create();

}
----

Once you have the `PropertyBinder` instance and the `Qualifier` you can defining bindings. To do so you define the same
qualifier for all properties that should be bound:

[source,java]
----
propertyBinder.bind(model.userNameProperty(), MyConstants.userNameQualifier);
----

By using the same qualifier in several controller classes you can simply bind properties in a client scope without doing
manual updates.


Docs updated dependency samples to use starter instead of core

resolves #362

[[getting-started]]
= Getting started

[[partintro]]
--
If you're just getting started with Spring Cloud Task, this is the section
for you! Here we answer the basic "`what?`", "`how?`" and "`why?`" questions. You'll
find a gentle introduction to Spring Cloud Task.  We'll then build our first Spring Cloud
Task application, discussing some core principles as we go.
--

[[getting-started-introducing-spring-cloud-task]]
== Introducing Spring Cloud Task

Spring Cloud Task makes it easy to create short lived microservices.  We provide
capabilities that allow short lived JVM processes to be executed on demand in a production
environment.

[[getting-started-system-requirements]]
== System Requirements

You need Java installed (Java 7 or better, we recommend Java 8) and to build you need to have Maven installed as well.

=== Database Requirements

Spring Cloud Task uses a relational database to store the results of an executed task.
While you can begin developing a task without a database (the status of the task is logged
 as part of the task repository's updates), for production environments, you'll want to
utilize a supported database.  Below is a list of the ones currently supported:

- DB2
- H2
- HSQLDB
- MySql
- Oracle
- Postgres
- SqlServer

[[getting-started-developing-first-task]]
== Developing your first Spring Cloud Task application

A good place to start is with a simple "Hello World!" application so we'll create the
Spring Cloud Task equivalent to highlight the features of the framework.  We'll use Apache
Maven as a build tool for this project since most IDEs have good support for it.

NOTE: The spring.io web site contains many “Getting Started” guides that use Spring Boot.
If you’re looking to solve a specific problem; check there first.  You can shortcut the
steps below by going to start.spring.io and creating a new project. This will
automatically generate a new project structure so that you can start coding right the way.
Check the documentation for more details.

Before we begin, open a terminal to check that you have valid versions of Java and Maven
installed.

[source]
$ java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

[source]
$ mvn -v
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T15:58:10-05:00)
Maven home: /usr/local/Cellar/maven/3.2.3/libexec
Java version: 1.8.0_31, vendor: Oracle Corporation

NOTE: This sample needs to be created in its own folder.  Subsequent instructions assume
you have created a suitable folder and that it is your "current directory".

[[getting-started-creating-the-pom]]
=== Creating the POM

We need to start by creating a Maven `pom.xml` file.  The `pom.xml` is the recipe that
will be used to build your project.  Open your favorite text editor and add the following:

[code,xml]
----
<?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>

	<groupId>com.example</groupId>
	<artifactId>myproject</artifactId>
	<packaging>jar</packaging>
	<version>0.0.1-SNAPSHOT</version>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.2.RELEASE</version>
	</parent>

	<properties>
		<start-class>com.example.SampleTask</start-class>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>
----

This should give you a working build.  You can test it out by running `mvn package` (you
can ignore the "jar will be empty - no content was marked for inclusion!" warning for
now).

NOTE: At this point you could import the project into an IDE (most modern Java IDE's
include built-in support for Maven).  For simplicity we will continue to use a plain text
editor for this example.

[[getting-started-adding-classpath-dependencies]]
=== Adding classpath dependencies

A Spring Cloud Task is made up of a Spring Boot application that is expected to end.  In
our POM above, we created the shell of a Spring Boot application from a dependency
perspective by setting our parent to use the `spring-boot-starter-parent`.

Spring Boot provides a number of additional "Starter POMs".  Some of which are appropriate
for use within tasks (`spring-boot-starter-batch`, `spring-boot-starter-jdbc`, etc) and
some may not be ('spring-boot-starter-web` is probably not going to be used in a task).
The indicator of if a starter makes sense or not comes down to if the resulting
application will end (batch based applications typically end, the
`spring-boot-starter-web` dependency bootstraps a servlet container which probably wont').

For this example, we'll only need to add a single additional dependency, the one for
Spring Cloud Task itself:

[source,xml]
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-task</artifactId>
			<version>1.2.3.RELEASE</version>
		</dependency>

[[getting-started-writing-the-code]]
=== Writing the code

To finish our application, we need to create a single Java file.  Maven will compile the
sources from `src/main/java` by default so you need to create that folder structure.  Then
add a file named `src/main/java/com/example/SampleTask.java`:

[source,java]
----
package com.example;

import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableTask
public class SampleTask {

	@Bean
	public CommandLineRunner commandLineRunner() {
		return new HelloWorldCommandLineRunner();
	}

	public static void main(String[] args) {
		SpringApplication.run(SampleTask.class, args);
	}

	public static class HelloWorldCommandLineRunner implements CommandLineRunner {

		@Override
		public void run(String... strings) throws Exception {
			System.out.println("Hello World!");
		}
	}
}
----

While it may not look like much, quite a bit is going on.  To read more about the Spring
Boot specifics, take a look at their reference documentation here:
http://docs.spring.io/spring-boot/docs/current/reference/html/[http://docs.spring.io/spring-boot/docs/current/reference/html/]

We'll also need to create an `application.properties` in `src/main/resources`.  We'll
configure two properties in it: the application name (which is translated to the task name)
and we'll set the logging for spring cloud task to `DEBUG` so that we can see what's going
on:

[source]
----
logging.level.org.springframework.cloud.task=DEBUG
spring.application.name=helloWorld
----

[[getting-started-at-task]]
==== The @EnableTask annotation

The first non boot annotation in our example is the `@EnableTask` annotation.  This class
level annotation tells Spring Cloud Task to bootstrap it's functionality.  This occurs by
importing an additional configuration class, `SimpleTaskConfiguration` by default.  This
additional configuration registers the `TaskRepository` and the infrastructure for its
use.

Out of the box, the `TaskRepository` will use an in memory `Map` to record the results
of a task.  Obviously this isn't a practical solution for a production environment since
the `Map` goes away once the task ends.  However, for a quick getting started
experience we use this as a default as well as echoing to the logs what is being updated
in that repository.  Later in this documentation we'll cover how to customize the
configuration of the pieces provided by Spring Cloud Task.

When our sample application is run, Spring Boot will launch our
`HelloWorldCommandLineRunner` outputting our "Hello World!" message to standard out.  The
`TaskLifecyceListener` will record the start of the task and the end of the task in the
repository.

[[getting-started-main-method]]
==== The main method

The main method serves as the entry point to any java application.  Our main method
delegates to Spring Boot's `SpringApplication` class.  You can read more about it in the
Spring Boot documentation.

[[getting-started-clr]]
==== The CommandLineRunner

In Spring, there are many ways to bootstrap an application's logic.  Spring Boot provides
a convenient method of doing so in an organized manner via their `*Runner` interfaces
(`CommandLineRunner` or `ApplicationRunner`).  A well behaved task will bootstrap any
logic via one of these two runners.

The lifecycle of a task is considered from before the `*Runner#run` methods are executed
to once they are all complete.  Spring Boot allows an application to use multiple
`*Runner` implementation and Spring Cloud Task doesn't attempt to impede on this convention.

NOTE: Any processing bootstrapped from mechanisms other than a `CommandLineRunner` or
`ApplicationRunner` (using `InitializingBean#afterPropertiesSet` for example) will not be
 recorded by Spring Cloud Task.

[[getting-started-running-the-example]]
=== Running the example

At this point, your application should work.  Since this application is Spring Boot based,
 we can run it from the command line via the command `$ mvn spring-boot:run` from the root
 of our applicaiton:

[source]
----
$ mvn clean spring-boot:run
....... . . .
....... . . . (Maven log output here)
....... . . .

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.3.RELEASE)

2016-01-25 11:08:10.183  INFO 12943 --- [           main] com.example.SampleTask                   : Starting SampleTask on Michaels-MacBook-Pro-2.local with PID 12943 (/Users/mminella/Documents/IntelliJWorkspace/spring-cloud-task-example/target/classes started by mminella in /Users/mminella/Documents/IntelliJWorkspace/spring-cloud-task-example)
2016-01-25 11:08:10.185  INFO 12943 --- [           main] com.example.SampleTask                   : No active profile set, falling back to default profiles: default
2016-01-25 11:08:10.226  INFO 12943 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a2c3676: startup date [Mon Jan 25 11:08:10 CST 2016]; root of context hierarchy
2016-01-25 11:08:11.051  INFO 12943 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-01-25 11:08:11.065  INFO 12943 --- [           main] o.s.c.t.r.support.SimpleTaskRepository   : Creating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=null, statusCode='null', exitMessage='null', arguments=[]}
Hello World!
2016-01-25 11:08:11.071  INFO 12943 --- [           main] com.example.SampleTask                   : Started SampleTask in 1.095 seconds (JVM running for 3.826)
2016-01-25 11:08:11.220  INFO 12943 --- [       Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a2c3676: startup date [Mon Jan 25 11:08:10 CST 2016]; root of context hierarchy
2016-01-25 11:08:11.222  INFO 12943 --- [       Thread-1] o.s.c.t.r.support.SimpleTaskRepository   : Updating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=Mon Jan 25 11:08:11 CST 2016, statusCode='null', exitMessage='null', arguments=[]}
2016-01-25 11:08:11.222  INFO 12943 --- [       Thread-1] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
----

If you notice, there are three lines of interest in the above output:

* `SimpleTaskRepository` logged out the creation of the entry in the `TaskRepository`.
* The execution of our `CommandLineRunner`, demonstrated by the "Hello World!" output.
* `SimpleTaskRepository` logging the completion of the task in the `TaskRepository`.

NOTE: A simple task application can be found in the samples module
of the Spring Cloud Task Project
https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/timestamp[here].

=== Writing your test

When writing your unit tests for a Spring Cloud Task application we have to keep
in mind that Spring Cloud Task closes the context at the completion of the task
as discussed <<features.adoc#features-lifecycle, here>>.  If you are using Spring
Framework's testing functionality to manage the application context, you'll want to turn
off Spring Cloud Task's auto-closing of the context.  Add the following
line: `@TestPropertySource(properties = {"spring.cloud.task.closecontext_enable=false"})`
to your tests will keep the context open.  For example:

```
@RunWith(SpringRunner.class)
@SpringBootTest
@TestPropertySource(properties = {"spring.cloud.task.closecontext_enabled=false"})
public class DemoApplicationTests {

	@Test
	public void contextLoads() {
	//your test here
	}

}
```

[[getting-started]]
= Getting started

[[partintro]]
--
If you're just getting started with Spring Cloud Task, this is the section
for you! Here we answer the basic "`what?`", "`how?`" and "`why?`" questions. You'll
find a gentle introduction to Spring Cloud Task.  We'll then build our first Spring Cloud
Task application, discussing some core principles as we go.
--

[[getting-started-introducing-spring-cloud-task]]
== Introducing Spring Cloud Task

Spring Cloud Task makes it easy to create short lived microservices.  We provide
capabilities that allow short lived JVM processes to be executed on demand in a production
environment.

[[getting-started-system-requirements]]
== System Requirements

You need Java installed (Java 7 or better, we recommend Java 8) and to build you need to have Maven installed as well.

=== Database Requirements

Spring Cloud Task uses a relational database to store the results of an executed task.
While you can begin developing a task without a database (the status of the task is logged
 as part of the task repository's updates), for production environments, you'll want to
utilize a supported database.  Below is a list of the ones currently supported:

- DB2
- H2
- HSQLDB
- MySql
- Oracle
- Postgres
- SqlServer

[[getting-started-developing-first-task]]
== Developing your first Spring Cloud Task application

A good place to start is with a simple "Hello World!" application so we'll create the
Spring Cloud Task equivalent to highlight the features of the framework.  We'll use Apache
Maven as a build tool for this project since most IDEs have good support for it.

NOTE: The spring.io web site contains many “Getting Started” guides that use Spring Boot.
If you’re looking to solve a specific problem; check there first.  You can shortcut the
steps below by going to start.spring.io and creating a new project. This will
automatically generate a new project structure so that you can start coding right the way.
Check the documentation for more details.

Before we begin, open a terminal to check that you have valid versions of Java and Maven
installed.

[source]
$ java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

[source]
$ mvn -v
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T15:58:10-05:00)
Maven home: /usr/local/Cellar/maven/3.2.3/libexec
Java version: 1.8.0_31, vendor: Oracle Corporation

NOTE: This sample needs to be created in its own folder.  Subsequent instructions assume
you have created a suitable folder and that it is your "current directory".

[[getting-started-creating-the-pom]]
=== Creating the POM

We need to start by creating a Maven `pom.xml` file.  The `pom.xml` is the recipe that
will be used to build your project.  Open your favorite text editor and add the following:

[code,xml]
----
<?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>

	<groupId>com.example</groupId>
	<artifactId>myproject</artifactId>
	<packaging>jar</packaging>
	<version>0.0.1-SNAPSHOT</version>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.2.RELEASE</version>
	</parent>

	<properties>
		<start-class>com.example.SampleTask</start-class>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>
----

This should give you a working build.  You can test it out by running `mvn package` (you
can ignore the "jar will be empty - no content was marked for inclusion!" warning for
now).

NOTE: At this point you could import the project into an IDE (most modern Java IDE's
include built-in support for Maven).  For simplicity we will continue to use a plain text
editor for this example.

[[getting-started-adding-classpath-dependencies]]
=== Adding classpath dependencies

A Spring Cloud Task is made up of a Spring Boot application that is expected to end.  In
our POM above, we created the shell of a Spring Boot application from a dependency
perspective by setting our parent to use the `spring-boot-starter-parent`.

Spring Boot provides a number of additional "Starter POMs".  Some of which are appropriate
for use within tasks (`spring-boot-starter-batch`, `spring-boot-starter-jdbc`, etc) and
some may not be ('spring-boot-starter-web` is probably not going to be used in a task).
The indicator of if a starter makes sense or not comes down to if the resulting
application will end (batch based applications typically end, the
`spring-boot-starter-web` dependency bootstraps a servlet container which probably wont').

For this example, we'll only need to add a single additional dependency, the one for
Spring Cloud Task itself:

[source,xml]
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-task-core</artifactId>
			<version>1.2.1.RELEASE</version>
		</dependency>

[[getting-started-writing-the-code]]
=== Writing the code

To finish our application, we need to create a single Java file.  Maven will compile the
sources from `src/main/java` by default so you need to create that folder structure.  Then
add a file named `src/main/java/com/example/SampleTask.java`:

[source,java]
----
package com.example;

import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableTask
public class SampleTask {

	@Bean
	public CommandLineRunner commandLineRunner() {
		return new HelloWorldCommandLineRunner();
	}

	public static void main(String[] args) {
		SpringApplication.run(SampleTask.class, args);
	}

	public static class HelloWorldCommandLineRunner implements CommandLineRunner {

		@Override
		public void run(String... strings) throws Exception {
			System.out.println("Hello World!");
		}
	}
}
----

While it may not look like much, quite a bit is going on.  To read more about the Spring
Boot specifics, take a look at their reference documentation here:
http://docs.spring.io/spring-boot/docs/current/reference/html/[http://docs.spring.io/spring-boot/docs/current/reference/html/]

We'll also need to create an `application.properties` in `src/main/resources`.  We'll
configure two properties in it: the application name (which is translated to the task name)
and we'll set the logging for spring cloud task to `DEBUG` so that we can see what's going
on:

[source]
----
logging.level.org.springframework.cloud.task=DEBUG
spring.application.name=helloWorld
----

[[getting-started-at-task]]
==== The @EnableTask annotation

The first non boot annotation in our example is the `@EnableTask` annotation.  This class
level annotation tells Spring Cloud Task to bootstrap it's functionality.  This occurs by
importing an additional configuration class, `SimpleTaskConfiguration` by default.  This
additional configuration registers the `TaskRepository` and the infrastructure for its
use.

Out of the box, the `TaskRepository` will use an in memory `Map` to record the results
of a task.  Obviously this isn't a practical solution for a production environment since
the `Map` goes away once the task ends.  However, for a quick getting started
experience we use this as a default as well as echoing to the logs what is being updated
in that repository.  Later in this documentation we'll cover how to customize the
configuration of the pieces provided by Spring Cloud Task.

When our sample application is run, Spring Boot will launch our
`HelloWorldCommandLineRunner` outputting our "Hello World!" message to standard out.  The
`TaskLifecyceListener` will record the start of the task and the end of the task in the
repository.

[[getting-started-main-method]]
==== The main method

The main method serves as the entry point to any java application.  Our main method
delegates to Spring Boot's `SpringApplication` class.  You can read more about it in the
Spring Boot documentation.

[[getting-started-clr]]
==== The CommandLineRunner

In Spring, there are many ways to bootstrap an application's logic.  Spring Boot provides
a convenient method of doing so in an organized manner via their `*Runner` interfaces
(`CommandLineRunner` or `ApplicationRunner`).  A well behaved task will bootstrap any
logic via one of these two runners.

The lifecycle of a task is considered from before the `*Runner#run` methods are executed
to once they are all complete.  Spring Boot allows an application to use multiple
`*Runner` implementation and Spring Cloud Task doesn't attempt to impede on this convention.

NOTE: Any processing bootstrapped from mechanisms other than a `CommandLineRunner` or
`ApplicationRunner` (using `InitializingBean#afterPropertiesSet` for example) will not be
 recorded by Spring Cloud Task.

[[getting-started-running-the-example]]
=== Running the example

At this point, your application should work.  Since this application is Spring Boot based,
 we can run it from the command line via the command `$ mvn spring-boot:run` from the root
 of our applicaiton:

[source]
----
$ mvn clean spring-boot:run
....... . . .
....... . . . (Maven log output here)
....... . . .

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.3.RELEASE)

2016-01-25 11:08:10.183  INFO 12943 --- [           main] com.example.SampleTask                   : Starting SampleTask on Michaels-MacBook-Pro-2.local with PID 12943 (/Users/mminella/Documents/IntelliJWorkspace/spring-cloud-task-example/target/classes started by mminella in /Users/mminella/Documents/IntelliJWorkspace/spring-cloud-task-example)
2016-01-25 11:08:10.185  INFO 12943 --- [           main] com.example.SampleTask                   : No active profile set, falling back to default profiles: default
2016-01-25 11:08:10.226  INFO 12943 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a2c3676: startup date [Mon Jan 25 11:08:10 CST 2016]; root of context hierarchy
2016-01-25 11:08:11.051  INFO 12943 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-01-25 11:08:11.065  INFO 12943 --- [           main] o.s.c.t.r.support.SimpleTaskRepository   : Creating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=null, statusCode='null', exitMessage='null', arguments=[]}
Hello World!
2016-01-25 11:08:11.071  INFO 12943 --- [           main] com.example.SampleTask                   : Started SampleTask in 1.095 seconds (JVM running for 3.826)
2016-01-25 11:08:11.220  INFO 12943 --- [       Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a2c3676: startup date [Mon Jan 25 11:08:10 CST 2016]; root of context hierarchy
2016-01-25 11:08:11.222  INFO 12943 --- [       Thread-1] o.s.c.t.r.support.SimpleTaskRepository   : Updating: TaskExecution{executionId=0, externalExecutionID='null', exitCode=0, taskName='application', startTime=Mon Jan 25 11:08:11 CST 2016, endTime=Mon Jan 25 11:08:11 CST 2016, statusCode='null', exitMessage='null', arguments=[]}
2016-01-25 11:08:11.222  INFO 12943 --- [       Thread-1] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
----

If you notice, there are three lines of interest in the above output:

* `SimpleTaskRepository` logged out the creation of the entry in the `TaskRepository`.
* The execution of our `CommandLineRunner`, demonstrated by the "Hello World!" output.
* `SimpleTaskRepository` logging the completion of the task in the `TaskRepository`.

NOTE: A simple task application can be found in the samples module
of the Spring Cloud Task Project
https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/timestamp[here].

=== Writing your test

When writing your unit tests for a Spring Cloud Task application we have to keep
in mind that Spring Cloud Task closes the context at the completion of the task
as discussed <<features.adoc#features-lifecycle, here>>.  If you are using Spring
Framework's testing functionality to manage the application context, you'll want to turn
off Spring Cloud Task's auto-closing of the context.  Add the following
line: `@TestPropertySource(properties = {"spring.cloud.task.closecontext_enable=false"})`
to your tests will keep the context open.  For example:

```
@RunWith(SpringRunner.class)
@SpringBootTest
@TestPropertySource(properties = {"spring.cloud.task.closecontext_enabled=false"})
public class DemoApplicationTests {

	@Test
	public void contextLoads() {
	//your test here
	}

}
```


Improve clarity on editions and add some links (#2244) (#2305)

Co-authored-by: Michael Hunger <64b2b6d12bfe4baae7dad3d018f8cbf6b0e7a044@jexp.de>

[[introduction]]
= Introduction
:description: This chapter provides an introduction to the APOC library, and instructions for installation and use.

ifdef::backend-html5[]
++++
<iframe width="560" height="315" src="https://www.youtube.com/embed/V1DTBjetIfk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
++++
endif::[]

Neo4j 3.x introduced the concept of user-defined procedures and functions.
Those are custom implementations of certain functionality, that can't be (easily) expressed in Cypher itself.
They are implemented in Java and can be easily deployed into your Neo4j instance, and then be called from Cypher directly.

The APOC library consists of many (about 450) procedures and functions to help with many different tasks in areas like data integration, graph algorithms or data conversion.

[NOTE]
====
.APOC Name History

http://matrix.wikia.com/wiki/Apoc[Apoc^] was the technician and driver on board of the Nebuchadnezzar in the Matrix movie. He was killed by Cypher.

*APOC* was also the first bundled http://neo4j.com/blog/convenient-package-neo4j-apoc-0-1-released/[A Package Of Component^] for Neo4j in 2009.

*APOC* also stands for "Awesome Procedures On Cypher"
====

== APOC Editions - Core and Full

Starting from Neo4j 4.1.1, there are two available versions of the APOC Library:

_APOC Core_ :: battle hardened procedures and functions that don't have external dependencies or require configuration. This is also the based of the functionality available in https://neo4j.com/aura[Neo4j AuraDB^] which lists the https://neo4j.com/docs/aura/current/getting-started/apoc/[available APOC surface in their docs^].
_APOC Full_ :: contains everything in APOC core, as well as additional procedures and functions, which is available both in https://neo4j.com/sandbox[Neo4j Sandbox^], the https://neo4j.com/docs/operations-manual/current/docker/operations/#docker-neo4jlabs-pluginsneo4j.com[Docker image^] and https://neo4j.com/docs/desktop-manual/current/operations/#install-plugin[Neo4j Desktop^], as well as when you self-host the database and add the apoc-full jar.

A list of functions and procedures in _APOC Core_ and _APOC Full_ can be found in xref::overview/index.adoc[].

[[introduction]]
= Introduction
:description: This chapter provides an introduction to the APOC library, and instructions for installation and use.

ifdef::backend-html5[]
++++
<iframe width="560" height="315" src="https://www.youtube.com/embed/V1DTBjetIfk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
++++
endif::[]

Neo4j 3.x introduced the concept of user-defined procedures and functions.
Those are custom implementations of certain functionality, that can't be (easily) expressed in Cypher itself.
They are implemented in Java and can be easily deployed into your Neo4j instance, and then be called from Cypher directly.

The APOC library consists of many (about 450) procedures and functions to help with many different tasks in areas like data integration, graph algorithms or data conversion.

[NOTE]
====
.APOC Name History

http://matrix.wikia.com/wiki/Apoc[Apoc^] was the technician and driver on board of the Nebuchadnezzar in the Matrix movie. He was killed by Cypher.

*APOC* was also the first bundled http://neo4j.com/blog/convenient-package-neo4j-apoc-0-1-released/[A Package Of Component^] for Neo4j in 2009.

*APOC* also stands for "Awesome Procedures On Cypher"
====

Starting from Neo4j 4.1.1, there are two available versions of the APOC Library:

_APOC Core_ :: battle hardened procedures and functions that don't have external dependencies or require configuration.
_APOC Full_ :: contains everything in APOC core, as well as additional procedures and functions.

A list of functions and procedures in _APOC Core_ and _APOC Full_ can be found in xref::overview/index.adoc[].


Changed boost keyword with bool in bounding box query

[[query-dsl-geo-bounding-box-query]]
=== Geo Bounding Box Query

A query allowing to filter hits based on a point location using a
bounding box. Assuming the following indexed document:

[source,js]
--------------------------------------------------
{
    "pin" : {
        "location" : {
            "lat" : 40.12,
            "lon" : -71.34
        }
    }
}
--------------------------------------------------

Then the following simple query can be executed with a
`geo_bounding_box` filter:

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.01,
                        "lon" : -71.12
                    }
                }
            }
        }
    }
}
--------------------------------------------------

[float]
==== Query Options

[cols="<,<",options="header",]
|=======================================================================
|Option |Description
|`_name` |Optional name field to identify the filter

|`coerce` |Set to `true` to normalize longitude and latitude values to a
standard -180:180 / -90:90 coordinate system. (default is `false`).

|`ignore_malformed` |Set to `true` to
accept geo points with invalid latitude or longitude (default is `false`).

|`type` |Set to one of `indexed` or `memory` to defines whether this filter will
be executed in memory or indexed. See <<geo-bbox-type,Type>> below for further details
Default is `memory`.
|=======================================================================

[float]
==== Accepted Formats

In much the same way the geo_point type can accept different
representation of the geo point, the filter can accept it as well:

[float]
===== Lat Lon As Properties

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.01,
                        "lon" : -71.12
                    }
                }
            }
        }
    }
}
--------------------------------------------------

[float]
===== Lat Lon As Array

Format in `[lon, lat]`, note, the order of lon/lat here in order to
conform with http://geojson.org/[GeoJSON].

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : [-74.1, 40.73],
                    "bottom_right" : [-71.12, 40.01]
                }
            }
        }
    }
}
--------------------------------------------------

[float]
===== Lat Lon As String

Format in `lat,lon`.

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : "40.73, -74.1",
                    "bottom_right" : "40.01, -71.12"
                }
            }
        }
    }
}
--------------------------------------------------

[float]
===== Geohash

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : "dr5r9ydj2y73",
                    "bottom_right" : "drj7teegpus6"
                }
            }
        }
    }
}
--------------------------------------------------

[float]
==== Vertices

The vertices of the bounding box can either be set by `top_left` and
`bottom_right` or by `top_right` and `bottom_left` parameters. More
over the names `topLeft`, `bottomRight`, `topRight` and `bottomLeft`
are supported. Instead of setting the values pairwise, one can use
the simple names `top`, `left`, `bottom` and `right` to set the
values separately.

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top" : -74.1,
                    "left" : 40.73,
                    "bottom" : -71.12,
                    "right" : 40.01
                }
            }
        }
    }
}
--------------------------------------------------

[float]
==== geo_point Type

The filter *requires* the `geo_point` type to be set on the relevant
field.

[float]
==== Multi Location Per Document

The filter can work with multiple locations / points per document. Once
a single location / point matches the filter, the document will be
included in the filter

[float]
[[geo-bbox-type]]
==== Type

The type of the bounding box execution by default is set to `memory`,
which means in memory checks if the doc falls within the bounding box
range. In some cases, an `indexed` option will perform faster (but note
that the `geo_point` type must have lat and lon indexed in this case).
Note, when using the indexed option, multi locations per document field
are not supported. Here is an example:

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.10,
                        "lon" : -71.12
                    }
                },
                "type" : "indexed"
            }
        }
    }
}
--------------------------------------------------

[[query-dsl-geo-bounding-box-query]]
=== Geo Bounding Box Query

A query allowing to filter hits based on a point location using a
bounding box. Assuming the following indexed document:

[source,js]
--------------------------------------------------
{
    "pin" : {
        "location" : {
            "lat" : 40.12,
            "lon" : -71.34
        }
    }
}
--------------------------------------------------

Then the following simple query can be executed with a
`geo_bounding_box` filter:

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.01,
                        "lon" : -71.12
                    }
                }
            }
        }
    }
}
--------------------------------------------------

[float]
==== Query Options

[cols="<,<",options="header",]
|=======================================================================
|Option |Description
|`_name` |Optional name field to identify the filter

|`coerce` |Set to `true` to normalize longitude and latitude values to a
standard -180:180 / -90:90 coordinate system. (default is `false`).

|`ignore_malformed` |Set to `true` to
accept geo points with invalid latitude or longitude (default is `false`).

|`type` |Set to one of `indexed` or `memory` to defines whether this filter will
be executed in memory or indexed. See <<geo-bbox-type,Type>> below for further details
Default is `memory`.
|=======================================================================

[float]
==== Accepted Formats

In much the same way the geo_point type can accept different
representation of the geo point, the filter can accept it as well:

[float]
===== Lat Lon As Properties

[source,js]
--------------------------------------------------
{
    "boost" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.01,
                        "lon" : -71.12
                    }
                }
            }
        }
    }
}
--------------------------------------------------

[float]
===== Lat Lon As Array

Format in `[lon, lat]`, note, the order of lon/lat here in order to
conform with http://geojson.org/[GeoJSON].

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : [-74.1, 40.73],
                    "bottom_right" : [-71.12, 40.01]
                }
            }
        }
    }
}
--------------------------------------------------

[float]
===== Lat Lon As String

Format in `lat,lon`.

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : "40.73, -74.1",
                    "bottom_right" : "40.01, -71.12"
                }
            }
        }
    }
}
--------------------------------------------------

[float]
===== Geohash

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : "dr5r9ydj2y73",
                    "bottom_right" : "drj7teegpus6"
                }
            }
        }
    }
}
--------------------------------------------------

[float]
==== Vertices

The vertices of the bounding box can either be set by `top_left` and
`bottom_right` or by `top_right` and `bottom_left` parameters. More
over the names `topLeft`, `bottomRight`, `topRight` and `bottomLeft`
are supported. Instead of setting the values pairwise, one can use
the simple names `top`, `left`, `bottom` and `right` to set the
values separately.

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top" : -74.1,
                    "left" : 40.73,
                    "bottom" : -71.12,
                    "right" : 40.01
                }
            }
        }
    }
}
--------------------------------------------------

[float]
==== geo_point Type

The filter *requires* the `geo_point` type to be set on the relevant
field.

[float]
==== Multi Location Per Document

The filter can work with multiple locations / points per document. Once
a single location / point matches the filter, the document will be
included in the filter

[float]
[[geo-bbox-type]]
==== Type

The type of the bounding box execution by default is set to `memory`,
which means in memory checks if the doc falls within the bounding box
range. In some cases, an `indexed` option will perform faster (but note
that the `geo_point` type must have lat and lon indexed in this case).
Note, when using the indexed option, multi locations per document field
are not supported. Here is an example:

[source,js]
--------------------------------------------------
{
    "bool" : {
        "must" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.10,
                        "lon" : -71.12
                    }
                },
                "type" : "indexed"
            }
        }
    }
}
--------------------------------------------------