Axis2 Sample Guidelines
All the samples in the Axis2 distro should show consistent behaviour.. In order to achieve that we should define our selves a set of guidelines to follow.
Following is a first draft of such a document.. It is by no means meant to be the final.. Please feel free to edit and improve whatever neccessary..
1. all the samples should adhere to following package structure.
clients - sample.<sample name>.client (eg: sample.mtom.client.Client)
services - sample.<sample name>.service (eg: sample.mtom.service.MTOMSample)
2. all the sample should have ant builds.
- goals
- run.client - compile and run the client (code-generate if necessary)
use the samples/<sample name>/build/client/classes to compile classes (ignore the client part if
- generate.service - compile, create service, copy it to ../../repository/services. (code generate if necessary)
- prefix names of all the sample service archives with "sample". (eg: sample-mtom.aar)
create the service in to the samples/<sample name>/build/service/ dir..
clean - delete the samples/<sample name>/build dir
- run.client - compile and run the client (code-generate if necessary)
- client only samples
- default target should be the run.client
- service+client samples
- defualt target should be generate.service
- code generated samples - defualt targets neede to follow the above rules.
3. Samples should use the jars in the ../../lib for the classpath .. (It would be great if we can first look for the AXIS2_HOME and then fall back to this.. But I still could not find how to do that conditional with ant )
4. All the samples should contain a Readme.txt explaining the the objective of the sample(what we expect the users to gain by looking at the sample) and how to use it. In the case of samples with GUI's readme.txt can be superseded by a index.html placed in the samples/<sample name>/docs directory. But the Readme.txt file needs to be present and should redirect the user to the docs/index.html