Hi Pierre

> In this instance I need a general overview of what happens when the Active4D 
> on web connection gets a call (either static data) or dynamic database data

Although the Fusebox flow control diagram is pretty useful once you start to 
use Fusebox, it can be a bit confusing at first to understand where it "fits 
in" in the scheme of things. Basically, the big picture has 2 "layers" - a 4D 
layer and an Active 4D layer.

A. THE 4D LAYER: - A SINGLE METHOD

[1] - a request comes in to 4D's "On Web Connection" handler (just like with 
regular web requests)

[2] - it gets passed to Active4D in a single plugin call. Inside that one 
Plugin call, the whole Active 4D "world" takes place - all your web scripts, 
fusebox stuff, Active4D code etc

[3] - when the response comes back from the plugin call, it simply gets sent 
straight to the browser (using a regular 4D command like SEND HTML BLOB)

This 4D layer is a single method  and is supplied as part of the A4D "Shell". 
You never have to modify it or worry about it and we never do any work in there

B. THE ACTIVE 4D LAYER - EVERYTHING ELSE

[1] - its best to think of this layer as "your website". Just take of any 
static website you care to think of. That is the Active 4D "layer" and if its 
just a static site, Active4D will serve it without any modification, even if 
was not originally designed for Active4D and you just dragged your web folder 
in from another web server

[2] - since Active4D is serving your site however, you can now extend your page 
content to include regular 4D code which is inserted between <% %> tags. Active 
4D will execute that code prior to serving the page if you change the page 
extension to .a4d.

So, for example, this piece of code in a webpage will spew out a list of 
surnames:

<html>
<body>

<some other html>

<% 
        QUERY([CONTACTS];[CONTACTS]City='Barcelona')

        For($r;1;Records in Selection([CONTACTS])

                writebr([CONTACTS]Surname)   <-- only this line gets written to 
the body of the web page (writebr command). A4D discards everything else in the 
<% %> block.

        End For %>

</body>
</html>

C. ADVANCED STUFF

[1] - That is about as simple as it gets. However, once you're familiar with 
the "Active4D layer" (and if you understood that example above, the you already 
are) you can do one of 2 things:

a) - just plough on ahead and build your website using your favourite editor 
(Dreamweaver, Textmate or Sublime etc), inserting regular 4D Code (and Active 
4D code) between the <% %> tags wherever you need to do anything dynamic

b) - use an advanced methodology like Fusebox

The reason Fusebox is used with Active4D is because the product comes with the 
Fusebox model already built for you. It's purpose os to separate presentation 
from function (on steroids). i.e. you have sections of your website (called 
fuses) whose scripts are pure code - they just do dynamic stuff. Then other 
sections whose scripts are pure presention. This means that you can revise the 
logic of your dynamic code without having to wade around in a syrup of html.

Hope that's useful for now and I haven't been too over-simplistic, telling you 
things you already know :)

Regards

Peter


_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to