|
Install: Prerequisites: Tutorial:
More info: |
SANDev readme:Welcome to the SANDev readme. This file explains how to install and get
started. For general info on Structs and Nodes Development (SAND), please
see sandev.org. If you are reading this
online, you can download the latest SANDev release from
sourceforge and
unzip to a convenient location on your hard drive. Alternatively you
can pull down the latest via CVS. Once you have the source, define
SAND_HOME to point to the sand directory (for example
Install java as appropriate for your platform. After installing, define JAVA_HOME to be the location where it was placed. The build will look for JAVA_HOME/lib to find .jar files to compile with. SAND is currently set up to work with java 1.5. If you compiling
with 1.4, then the build will be unable to resolve some doclet classes
that were introduced in 1.5. These are needed for symbol resolution
when compiling the generators, but their content is not referenced
so you can get past this by defining a few empty stub classes in
At the time of this writing, the core SAND source doesn't make use of any of the 1.5 features, so we can continue to support 1.4. If you are using 1.5 you may see a few "uses unchecked or unsafe operations" compiler messages from the earlier collections use. The output of a SANDev build is a .war file which is deployed to
the local servlet
container. Apache Tomcat is
pretty much assumed, although references to it are fairly minimal
(primarily the platform build control targets) should you need to swap
this out. In any case after installing a servlet container, set the
TOMCAT_HOME environment variable to where the runtime can be found
(for example
SANDev requires a few things beyond basic java. One way to deal with this is to pull down J2EE, but that's frequently overkill. The recommended way is to add the extra .jars to tomcat lib to supplement the servlet support. Here's what you need to add:
The build looks in J2EE_HOME/lib for the .jar files it needs to
compile with, so set the J2EE_HOME environment variable accordingly
(for example
SAND handles all persistency and query processing through a generalized
By default, the build is currently set up assuming you are using PostgreSQL, although HSQL and MySQL have been used in the past. Any database with a reasonably modern JDBC driver should work. Install the database according to your platform, and place the driver into the tomcat lib area so it will be found at runtime. If you are using a database other than PostgreSQL, then you will
need to change a couple of lines in the
structMapperClass="org.sandev.generator.PostgreSQLStructMapper"
dataSource="direct:org.postgresql.Driver,jdbc:postgresql:taskheap,${LOCDB_USERPASS}"
dataSource, refer to your database documentation.
For the structMapperClass, you can specify the name of an
existing StructMapper
implementation (for example
MySQLStructMapper,
DefaultSQLStructMapper) or write your own custom mapper to reflect how things structs should be translated into tables.
Depending on your database and JDBC driver, you may need to create
the database named in the If you are using the default build, set the LOCDB_USERPASS environment variable to be username/password for the database user. The SANDev build is based on extensions to Apache Ant, which you will need to download and install if you haven't already got it. To build, you will need both ant.jar and sandbuild.jar in your classpath, for example:
CLASSPATH=c:\apache-ant-1.6.2\lib\ant.jar;c:\sand\platform\sandbuild\env\sandbuild.jar
/Developer/Java/Ant/lib/ant.jar:/dev/sand/platform/sandbuild/env/sandbuild.jar
The release zip contains sandbuild.jar prebuilt. If you need to rebuild this, simply > cd $SAND_HOME/platform/sandbuild/build> ant clean> antBuilding the sample TaskHeap application To build the sample app: > cd $SAND_HOME/deploy/TaskHeapDemo/build> antTo access the sample app, follow the last link in the "Generated
tools" section of
the deployment doc
page. If this link is broken or the build failed, verify the
prerequisite software is installed and the main environment variables
referenced in
The SANDev build process has the following stages:
For a development build (as opposed to a release build), the servlet container is bounced by default to avoid accumulating garbage. The build process checks dependencies as best it can to make
incremental development builds as fast as possible. So
typing If you want to play with the TaskHeap app, login
as A typical SAND project consists of an application and a deployment.
So for a project called
The easiest way to set up a new SANDev project is to run the initproj
script in the TaskHeapDemo deployment build directory:
A struct is a plain java class declaration with a name ending in "Struct" which is placed into the structs source directory. So the source file would be something like: sand/apps/MyApp/src/org/MYDOMAIN/MyApp/structs/MyDataStruct.java
A struct contains only protected data member variables and meta tags. The base types for data members can be:
By convention the struct level tags are named A struct may extend another struct. By default, the AuthFilter will deny all access to messages not
explicitely authorized. You will need to edit the AuthFilter
implementation (in the A node is a plain java class declaration with a name ending in "NodeDecl" which is placed into its own source package. So the source file would be something like: sand/apps/MyApp/src/org/MYDOMAIN/MyApp/MyLogic/MyLogicNodeDecl.java
A node may declare configuration parameters using the primitive types
NodeBase source file and used by the business logic in the
hand coded Node file. For MyLogicNode, the
source file structure is: public class MyLogicNodeDecl public class MyLogicNodeBase extends MyLogicNodeDecl //generated filepublic class MyLogicNode extends MyLogicNodeBase
The node declaration describes what messages are processed. Where messages are sent to and received from is set in the configuration. The bootstrap data for your application, the server(s) it runs on, and
the nodes that make up the runtime architecture are declared using the
Until the graphical configuration editor is completed, we recommend
placing a drawing of your configuration into the intro.html file for your
deployment to serve as a reference. For details on the configuration
structure, see the description of the struct in the The screens that make up your application, the forms, custom tabs,
custom action buttons, and generated output values are declared using the
For details on the SandUI structure, see the description of the struct
in the With the SandUI and supporting code defined, the default templates
provide enough functionality to enter development data, which completes the
raw material for creating a custom UI display. To customize, edit the XSLT
templates are stored in the During the early stages of UI development, it is sometimes helpful to
retrieve the raw XHTML output from your application, save it to a file, and
then work applying your template to that file directly rather than
rebuilding and redeploying the app for each minor change. To retrieve the
unconverted XHTML output from your app, specify the
http://localhost:8080/THD_TaskHeapDemo/TaskHeap?scr=Main&class=Resource&id=1202
http://localhost:8080/THD_TaskHeapDemo/TaskHeap?scr=Main&class=Resource&id=1202&button=edit
http://localhost:8080/THD_TaskHeapDemo/TaskHeap?scr=Main&class=Resource&id=1202&raw=true
See the templates in the TaskHeapDemo webapp directory for other useful techniques. |