From the posts on the FuseBox DVD/Screencast or whatever, it looks like quite a few people didn't try to dive into fusebox. It really is not that hard - but it took a while to figure out that almost everything you need is in the graphic "Fusebox flow of control".
Where can this graphic be found?

I guess I did not target my PS to those who attended the Active4D screen cast.

The screen cast included a file that I put a copy of at <http:// maxwellgaggle.com/salex/Fuseboxflowofcontrol.pdf>. This describes A4D fusebox.

Said I would not do this, but my "pithy" interpretation of Active4d fusebox follows - right or wrong..

Wish I could set code on this list, but can't through mail - please try to interpret code.

given "http://www.my.dom/foo.a4d?bar=x;..."; as a classic a4d driver call, you would have something like the classic approach below in foo.a4d

<%
bunch of code to decide what needs to happens when foo.a4d is called, or filter what should not happen
        some may be set in "on request"
        this is the classic main driver, php/active4D style
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>untitled</title>
        <!-- css and javascript loads -->
</head>

<body>
        <!-- layout for "foo" defined (header, sidebars and common stuff) -->
        <div id="content">
                <%
//case statement that includes subdrivers based on bunch of code from above for the driver "foo"
                        case of
                                :($bar = "x")
                                        include("x.a4d")
                                :($bar = "y")
                                        include("y.a4d")
                                :($bar = "z")
                                        include("z.a4d")
                        end case
                %>
        </div>
</body>
</html>

FuseBox breaks this classic in-line approch into chunks of code that gets stuff that seems out of order, but puts it back together in the classic form. The converted URL would be "http://www.my.dom/index.a4d? fuseaction=foo.bar/x;..."

foo.a4d is replaced with index.a4d and a query parameter $fuseaction=foo.bar/x that defines driver "foo", action "bar/x" index.a4d does fusebox magic by setting up environment and looks for the following files at the same level as index.a4d
fbx_setting.a4d
        - some of the code that would be in bunch of code
        - sets up css and javascript for "root" circuit
fbx_layout.a4d
        - defines default layout (header, sidebar,"content", footer. etc)
fbx_circuits
        - really replacement for case statement booleans.
- circuits are equal to foo = and points to the "foo" driver include file, which will be a fbx_switch.a4d file in the target directory fusebox magic goes down the circut hierarchy (directories) and looks for fbx_settings.a4d in each directory. If found, it executes code in that file. - code may be: access control, adding to css or javascript, breadcrumbs, part of bunch of code from classic approach, etc. (or nothing!) After reaching target directory, it executes code in the fbx_switch.a4d file, which is really the action part of the classic "case" statement (include("x.a4d")) - by convention, it breaks down what would usually be in "x.a4d" into "qry_x.a4d", "dsp_x.a4d" and "act_x.a4d" and sets "XFA_onXXX" variables - "Exit Fusebox Action"(XFA) varibles in the qry/dsp/act files will set what submit buttons or links will do if clicked when the XFA_onXXX is assigned to the button/link/form. A4D then does whatever the switch statement says to do (basically does what would be in "x.a4d") and exits. - if a fbx_layout.a4d file exists in the target directory, it may replace or adds to the default layout file. (I have never "added") When the circuit is exited (code executed in qry, dsp and/or act executes)
        - DOCTYPE is build from layout(s)
        - HEAD is built from fbx_setting(s) files
        - BODY is built from
                -- layout(s)
-- write statements/response buffer html in the circuit (qry/dsp/ act) files
        - document built and returned as one big chunk.

Sorry but got my foo's and x's mixed up - bar or x is the action you wish to take.
That is all there is!

Steve Alex
        

        



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

Reply via email to