Tech Tip: Highlights of Web Database Examples
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: March 17, 2000
Here are the sample databases related to web development using 4th Dimension as of March 2000, listed in order from the simplest to the most complex. Please note that all sample databases are provided in the spirit of exploring the possibilities of programming 4th Dimension and do not necessarily represent the only, or the best, way to accomplish particular tasks. Use them as learning tools and a source of ideas, pick and choose the concepts that are useful and relevant to your projects. You can download 4D MetaBASE, which is a tool that allows you to search the entire catalog of example databases by keyword or name and automatically initiate an FTP download to your desktop.
Room Manager v1
- The simplest demo - minimal design using contextual mode
- Similar to following the directions in the "Web Context Tutorial.pdf"
Context v1
- Another simple demo - minimal design using contextual mode
- One enhanced feature is the use of a QUERY command
Contextual-Non switch
- Shows how to switch back and forth from context to non-context modes
- Context examples: QUERY, DISPLAY SELECTION, MODIFY SELECTION, POST form
- Non-Context examples: simple HTML page, 4DACTION, POST form
SendBlob
- Non-contextual mode demo, uses Start without Context setting
- Shows use of only two commands: DOCUMENT TO BLOB & SEND HTML BLOB
Web Chart
- Non-contextual mode demo, uses Start without Context setting
- On Web Connection simply sends "index.htm" which contains a 4DACTION URL that uses SEND HTML BLOB command to display a 4D Chart in browser
Web Exam v1
- Simple non-contextual mode demo, uses default home page set in db properties
- Uses 4D variable binding to return values from HTML forms, and display results
- No 4DCGIs or 4DACTIONs
- Uses type="hidden" input fields to pass state information
HTML
- Very simple with few comments & sparse code
- Focuses on new web commands in 6.5: WEB CACHE STATISTICS, OPEN WEB URL, SEND HTTP REDIRECT, SET HTTP HEADER, SET WEB TIMEOUT, SET HOME PAGE
- This database contains a separate custom menu environment for non-web access
- Includes an example of setting a cookie in HTML ("Set-Cookie: 4D_User="...)
- Uses 4D_PACK command "AP Select document"
Stack Space Error
- Shows how to avoid a stack error when using multiple SEND HTML FILE commands
Auction
- Non-contextual mode demo, uses Start without Context setting
- On Web Connection simply sends "index.htm" which contains a 4DACTION URL that places HTML into a 4D variable and sends another SHTML page which references that variable in a comment
- Uses type="hidden" input fields to pass state information from page to page (the shopping cart ID field and a special flag indicating order has been validated)
- Contains a single form POST example & uses COMPILER_WEB method
Snap-e
- Non-contextual mode demo, uses Start without Context setting
- On Web Connection simply sends "index.htm" which contains a 4DACTION URL that places HTML into a 4D variable and sends another SHTML page which references that variable in a comment
- Uses type="hidden" input fields to pass state information from page to page (the shopping cart ID field and a special flag indicating order has been validated)
- Uses Internet Commands "SMTP_QuickSend" and "IT_ErrorText"
- Contains multiple forms with POST & COMPILER_WEB
- Uses several Image Maps bound to 4D variables and processed in a case to control execution
- This database contains a separate custom menu environment for non-web access
Different Appearances
- Uses 4DACTION comments to produce in-line HTML based on parameters passed through calling method's process variables
- Stores state information via these dynamically generated URLs
- Points out the fact that process variables persist in 4DACTION methods embedded in a page sent with SEND HTML FILE
- Contains a database of HTML (actually 4DACTION comments) that is indexed by page and style, and selects which snippet to use based on the current location in the site and style setting
- Very generic, wrapperized code
Web Photo Album
- Totally non-contextual, not extremely complex, commented in French
- SEND HTML FILE, SEND HTML BLOB
- Storing paths in database, loading and sending image files based on path
- Storing image thumbnails in database
- Uses extensive SHTML files with action codes embedded into HTML and parsed in On Web Connection (/4DCGI...) which serves as a central clearing house for web to 4D interaction
- Uses one 4DACTION URL for purpose of setting variables equal to text strings in different languages (from a STR resource)
- Uses 4DVAR tags
- Uses 4D_PACK command "AP Read picture file"
- This database also contains a custom menu environment for non-web access
ebiz
- Totally non-contextual, moderately complex, commented in French
- SEND HTML FILE, SEND HTML BLOB
- Includes a simple hit counter function/display (10 GIF LCD-style digits in picture lib)
- Uses extensive SHTML files with action codes embedded into HTML and parsed in On Web Connection (/4DCGI...) which serves as a central clearing house for web to 4D interaction
- Uses 4DACTION URLs for purpose of setting variables equal to text strings in different languages (from a STR resource)
- Uses 4DACTION tags embedded directly in SHTML; e.g. to fill in a dynamic table
- Uses 4DVAR tags
- Contains JavaScript code in SHTML files, used to enable two 'submit' buttons on a page activated via 4DACTION URLs
- Uses type="hidden" input fields to pass state information from page to page (the shopping cart ID field and a special flag indicating order has been validated)
- This database also contains a custom menu environment for non-web access