INTRODUCTION
Welcome to the molly framework. You can develop database-driven
dynamic web sites quickly and easily with molly.

SOURCE FILES
The molly source files are under the fc/ tree in this directory.

It's a bit quirky that the molly framework package does not start with
molly.* but with fc.* (fc stands for foundation classes). This is
a historical artifact and it's just been easier to keep it this way.

Molly is a totally independent standalone library with no external
dependencies. 

COMPILING FROM SCRATCH
All of the source files can be compiled again by running the 
"compile.all.sh" script in this directory.

The output of the compilation goes into:
-	The top level compiled/ directory (the same directory where
	this README file is located)
-	The contents of the compiled directory are also jar'ed 
	into a file called molly.jar (also found in the same directory
	where this README file is located)

Note: You will need to have jakarta.servlet.* classes in your 
classpath to compile molly successfully.

You can also compile each sub-package separately. For example,
if hacking/changing classes in just the "fc.util" package

cd fc/util
..edit files in the package..
./compile.sh

The "compile.sh" script in each package directory compiles the package
such that the compiled .class files go into the top level compiled/
directory. (this keeps the .java and .class files seperate and greatly
reduces visual clutter).

As mentioned above, you can always say "compile_all.sh" as well, to 
compile everything. It's a good idea to do this now and then, if 
you've made a lot of changes in various sub-packages.

Of course, since you have all the source, you can always change the 
layout of the code to something different, per your personal preference.

SETTING THE CLASSPATH
Your system or user CLASSPATH should contain either:
1)  the full path to the top-level compiled directory (good 
    when developing/coding) 
    --or--
2)  molly.jar

Oh yes, all the scripts etc., are bash shell scripts. If you use
windows, you will have to roll your own equivalent commands. 

If you simply want to use molly (and don't care about hacking it)
then the simplest thing is to put molly.jar in your CLASSPATH.

RUNNING
Many classes in the framework can be invoked from the command
line and print diagnostic/test output.

Try saying:

command prompt> java fc.util.Platform
-or-
command prompt> java fc.io.TablePrinter
-or-
command prompt> java fc.io.HexOutputStream -file [some_file]

You should see some output if the molly classes are installed
properly (if you get a NoClassDefFoundError, make sure that
your CLASSPATH is set properly).

In bash, you must always say:
export CLASSPATH="your classpath here"

Once you verified that you can run some programs from the
command line, do a quick scan of the javadocs (found in 
the javadocs directory).

You can now start using molly server pages, the database
O/R tools and whatever else you need. Your servlet engine
should be able to see molly.jar in it's CLASSPATH. 

WEBSERVER CONFIGURATION

1.a)DEVELOPERS
	For tomcat, I typically modify the servlet startup scripts (in
	"tomcat_server_dir/bin/*.sh") to include the system CLASSPATH. This
	is highly recommended when you are developing/hacking the framework.
--or--
1.b)END-USERS
	If you are simply using the framework (and I recommend that you
	don't just use it but get comfortable in modifying things to your
	taste)..but if you *are* just using it, then you can simply put
	molly.jar in your servlet containers WEB-INF/lib directory.

2)EVERYONE
	You must modify web.xml for your web application such that 
	your server knows what to do with .mp files. You have to add
	add the following in the appropiate sections of web.xml:
	
	<!-- the molly servlet -->
	<servlet>
		<servlet-name>molly</servlet-name>
		<servlet-class>fc.web.page.PageServlet</servlet-class>
	</servlet>
	
	<!-- The mapping for the molly servlet -->
	<servlet-mapping>
		<servlet-name>molly</servlet-name>
		<!-- This can be anything, I use *.mp (molly page) myself -->		
		<url-pattern>*.mp</url-pattern>
	</servlet-mapping>

	Please see the online configuration docs on setting up the O/R
	tools, JDBC drivers and connection pools, such that all of those
	can be easily used from within a molly page.

FEEDBACK
You can send bug reports, comments, feedback etc., at
http://www.mollypages.org

Enjoy !

--Hursh Jain
hurshjain@yahoo.com

Misc. Addendum
READING THE SOURCE:
The molly source is formatted properly and looks good in my
editor (I use tabs, with 1 tab == 4 spaces). If variable names,
declarations/etc., appear jagged or unaligned in your editor
then, make sure your tab/spaces are set accordingly.

I (personally) use either of the following code styles:

if (foo)                    if (foo) {
    {                           /* stuff */ 
    /* stuff */                 }
    }

Turns out that this bracing style actually has a name. It's 
called "Whitesmiths style".

It also just so happens that the linux kernel coding style is
very good...whereas the mixed case java style is utterly
retarded.

I seldom say: 
	myVariable. 

Instead, I say: 
    my_variable

Think for yourself and use whatever works for you. It's all a 
personal preference.
