On this worksheet, you will learn about code entry points, using FOX’s Entry Theme’s.
CONCEPTS
Analogy: Which ever carriage I get on, this train takes me to London:
- I can choose to get on at the Dining Carriage, and have Lunch.
- Or I can get on at the Quiet Carriage and go to the Dining Carriage later.
- Regardless of where I get on I can always go to the W.C. facilities.
The train is representative of the Fox Module, with a clear purpose, e.g. Manage Orders.
- Where we get on the train is representative of Fox Module Entry Themes.
- The areas of the train I visit are representative of the available States in the Module.
One Fox Module can be used for a variety of different purposes. E.g. Manage Orders:
- To capture a new order. All information is enterable.
- To browse an existing order. All information is presented read only.
- To amend an "In Progress" order. All information is shown, only some fields enterable.
The Manage Orders Fox Module could have 3 entry themes: "new", "browse", "amend". When a Fox Module is called, you can choose which entry theme to use (covered in a later chapter). fm:entry-theme is a definition of how the Module can be called, and what should happen.
- One module invocation has only one theme of entry. This theme is fixed until module ends.
- fm:storage-location references the Data DOM Storage Location (see Storage Location chapter for more information).
- fm:state specifies the initial module state when entry theme is used.
- fm:attach specifies the initial attach point when entry theme is used.
- fm:do is the code that should be run when entry theme is used.
The entry theme fm:do block is often used to initialise or refresh DOM data on entry. E.G.
- Theme "new", all XML DOM structures are initialised (fm:init) before user input starts.
- Theme "browse", no actions are taken, data must remain unchanged.
- Theme "amend", ordered product prices in DOM are refreshed from the PRODUCT table.
Any Fox meta-code can be used in the entry theme fm:do block, including:
- fm:run-query to load data from database into the DOM.
- fm:attach to change the attach point - required when attach point data only just created.
- fm:state (push or replace) – change module state depending on condition