From eedbec77dc765cfca21c5011d69bf459f4ca79bf Mon Sep 17 00:00:00 2001 From: Mark Pollack Date: Tue, 17 Jul 2012 17:50:14 -0400 Subject: [PATCH] SHL-23 - Create docbook based reference guide --- docs/src/reference/docbook/images/logo.png | Bin 0 -> 9627 bytes docs/src/reference/docbook/index.xml | 49 ++++---- .../docbook/introduction/introduction.xml | 15 +++ .../docbook/introduction/requirements.xml | 18 +++ docs/src/reference/docbook/preface.xml | 61 +++++++++- .../reference/dev-guide/dev-spring-shell.xml | 43 +++++++ .../reference/dev-guide/introduction.xml | 5 + .../docbook/reference/introduction.xml | 7 ++ .../src/reference/docbook/reference/shell.xml | 112 ++++++++++++++++++ .../docbook/samples/introduction.xml | 11 ++ .../docbook/samples/simple-application.xml | 19 +++ 11 files changed, 312 insertions(+), 28 deletions(-) create mode 100644 docs/src/reference/docbook/images/logo.png create mode 100644 docs/src/reference/docbook/introduction/introduction.xml create mode 100644 docs/src/reference/docbook/introduction/requirements.xml create mode 100644 docs/src/reference/docbook/reference/dev-guide/dev-spring-shell.xml create mode 100644 docs/src/reference/docbook/reference/dev-guide/introduction.xml create mode 100644 docs/src/reference/docbook/reference/introduction.xml create mode 100644 docs/src/reference/docbook/reference/shell.xml create mode 100644 docs/src/reference/docbook/samples/introduction.xml create mode 100644 docs/src/reference/docbook/samples/simple-application.xml diff --git a/docs/src/reference/docbook/images/logo.png b/docs/src/reference/docbook/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f6d959e77f14eed6bdb750190ff83289279793 GIT binary patch literal 9627 zcmV;MC1l!(P)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRaMAxT6*RCwC#U1xk$#n(Q!?cQzaZAn5Jgfv14BoKO&UIGeIq**9Rvj8F*5ET&V zN)y3?iqbpMq&I;8fg~h>^v0%cw%;=Ehh0)PVRsV???304FI?`<&dxk@%5%=lUp$5vg)gpX^qM(a79G2Eh^GYio;+j` z|I-IsL;|`=|24@!A-9t69l3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35(eIF3KeNCFJQuzz}da2$VQz-#ZWocY$eIiFAYxJyWsMz7s@>gR-vN8h}&%6QkS zh4M8%J8Ymc^b$cgV&YdbwR)ZPRHA&nQu*ZkMi2)IP0(@HW7$FggPollack SpringSource + + Jarred + Li + VMware + + + Costin + Leau + SpringSource + @@ -32,41 +42,28 @@ - + \ No newline at end of file diff --git a/docs/src/reference/docbook/introduction/introduction.xml b/docs/src/reference/docbook/introduction/introduction.xml new file mode 100644 index 00000000..212f77ab --- /dev/null +++ b/docs/src/reference/docbook/introduction/introduction.xml @@ -0,0 +1,15 @@ + + + The Spring Shell provides an interactive shell that lets you + contribute commands using a simple POJO based programming model. + + This document is the reference guide for the Spring Shell and covers + the key classes that are part of the Shell infrastructure, the plugin model, + how to create commands for the shell as well as discussion of the sample + application. + diff --git a/docs/src/reference/docbook/introduction/requirements.xml b/docs/src/reference/docbook/introduction/requirements.xml new file mode 100644 index 00000000..19dde886 --- /dev/null +++ b/docs/src/reference/docbook/introduction/requirements.xml @@ -0,0 +1,18 @@ + + + Requirements + + The Spring Shell requires JDK level 6.0 (just like Hadoop) and above + and the Spring Framework 3.0 (3.1 + recommended) and above. + diff --git a/docs/src/reference/docbook/preface.xml b/docs/src/reference/docbook/preface.xml index 6800d9d4..74418e05 100644 --- a/docs/src/reference/docbook/preface.xml +++ b/docs/src/reference/docbook/preface.xml @@ -1,6 +1,63 @@ - + Preface - + The Spring Shell provides an interactive shell that allows you to + plugin your own custom commands using a Spring based POJO programming + model. + + The shell has been extracted from the Spring Roo project, giving it a + strong foundation and rich feature set. One significant change from Spring + Roo is that the plugin model is no longer based on OSGi but instead uses + Spring IoC container to discover commands through classpath scanning. There + is currently no classloader isolation between plugins, however that maybe + added in future versions. + + Spring Shell's features include + + + + A POJO based programming model to contribute custom + commands + + + + Use Spring's classpath scanning functionality as a basis for a + command plugin strategy + + + + Inheritance of the Roo + Shell features + + + + Tab completion + + + + Scripting and Script recording + + + + Customize command prompt, banner, shell history file name. + + + + This document assumes that the reader already has a basic familiarity + with the Spring Framework. + + While every effort has been made to ensure that this documentation is + comprehensive and there are no errors, nevertheless some topics might + require more explanation and some typos might have crept in. If you do spot + any mistakes or even more serious errors and you can spare a few cycles + during lunch, please do bring the error to the attention of the Spring Shell + team by raising an + issue. diff --git a/docs/src/reference/docbook/reference/dev-guide/dev-spring-shell.xml b/docs/src/reference/docbook/reference/dev-guide/dev-spring-shell.xml new file mode 100644 index 00000000..34e6922e --- /dev/null +++ b/docs/src/reference/docbook/reference/dev-guide/dev-spring-shell.xml @@ -0,0 +1,43 @@ + + + Developing Spring Shell Applications + + The commands are + + + + + + + +
+ Marker Interface + + The marker interface.... +
+ +
+ CLI Annotations + + annotations +
+ +
+ Logging + + +
+ +
+ Building and running the shell + + +
+
diff --git a/docs/src/reference/docbook/reference/dev-guide/introduction.xml b/docs/src/reference/docbook/reference/dev-guide/introduction.xml new file mode 100644 index 00000000..a0f0a240 --- /dev/null +++ b/docs/src/reference/docbook/reference/dev-guide/introduction.xml @@ -0,0 +1,5 @@ + + + This section provides some guidance on how one can create commands for + the Spring Shell. + diff --git a/docs/src/reference/docbook/reference/introduction.xml b/docs/src/reference/docbook/reference/introduction.xml new file mode 100644 index 00000000..825f2b95 --- /dev/null +++ b/docs/src/reference/docbook/reference/introduction.xml @@ -0,0 +1,7 @@ + + + Document structure + + This part of the reference documentation explains the core componets + of the Spring Shell. + diff --git a/docs/src/reference/docbook/reference/shell.xml b/docs/src/reference/docbook/reference/shell.xml new file mode 100644 index 00000000..81558b7a --- /dev/null +++ b/docs/src/reference/docbook/reference/shell.xml @@ -0,0 +1,112 @@ + + + Spring Shell + + The core components of the shell are its plugin model, built-in + commands, and converters + +
+ Plugin Model + + The plugin model is based Spring. Each plugin jar is required to + contain the file + META-INF/spring/spring-shell-plugin.xml. These files + will be loaded to bootstrap a Spring + ApplicationContext when the shell is + started. The essential boostrapping code that looks for your contributions + looks like thisnew ClassPathXmlApplicationContext("classpath*:/META-INF/spring/spring-shell-plugin.xml"); + + In the spring-shell-plugin.xml file you should + declare the commands and any collaboration objects that support the + commands actions. An easy way to declare the commands is to use Spring's + component scanning functionality. + + Here is an example spring-shell-plugin.xml that + from the sample application. + + <beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> + + <context:component-scan base-package="org.springframework.shell.samples.helloworld.commands" /> + +</beans> + + The commands are Spring components, demarcated as such using the + @Component annotation. For example, the + HelloWorldCommands class from the sample + application looks like this + + @Component +public class HelloWorldCommands implements CommandMarker { + + // methods with @Cli annotations go here + + // use any Spring annotations for Dependency Injection or other Spring interfaces as required. + +} + + One the commands are registered and instantiated by the Spring + container, they are registered with the core shell parser so that the + @Cli annotationscan be processed. The way the commands + are identified is through the use of the + CommandMarker interface. + +
+ Converters + + The + org.springframework.shell.core.Converter + interface provides the contract to convert the strings that are entered + in the command to rich Java types passed into the arguments of + @Cli-annotated methods. + + By default converters for common types are registered. These cover + primitive types (boolean, int, float...) as well as Date, Character, and + File. + + If you need to register any additional + Converter instances, register them with + the Spring container in the + spring-shell-plugin.xml file and they will be + picked up automatically. +
+
+ +
+ Built in commands + + There are a few built in commands. Here is a listing of their class + name and functionality + + + + EssentialCommands - + exit and quit - to exit the + shell. + + + + HelpCommands - help - + list all commands and their usage + + + + OsCommands - the keyword for this command + is the exclamation point, !. After the exclamation + point you can pass in a unix/windows command string to be + executed. + + + + +
+
diff --git a/docs/src/reference/docbook/samples/introduction.xml b/docs/src/reference/docbook/samples/introduction.xml new file mode 100644 index 00000000..2b34c4d4 --- /dev/null +++ b/docs/src/reference/docbook/samples/introduction.xml @@ -0,0 +1,11 @@ + + + Document structure + + This part of the reference documentation covers the sample + applications included with Spring Shell that demonstrate the features in a + code centric manner. + + Describes a simple Spring Shell + application that echo's the command parameters to the console + diff --git a/docs/src/reference/docbook/samples/simple-application.xml b/docs/src/reference/docbook/samples/simple-application.xml new file mode 100644 index 00000000..cad272a1 --- /dev/null +++ b/docs/src/reference/docbook/samples/simple-application.xml @@ -0,0 +1,19 @@ + + + Simple sample application using the Spring Shell + +
+ Introduction + + This sample demonstrates how to execute a MapReduce application and a script that interacts with HDFS inside a Spring based application. It does not use spring Batch or Spring Integration. + + The example code is located in the distribution directory + <spring-hadoop-install-dir>/samples/wordcount. +
+