NetCLX
Overview
- Cross-platform Internet/Web components
- WebBroker is a part of NetCLX
- Includes Socket components
- Indy components will ship in Delphi 6 and Kylix
- Download now from http://www.nevrona.com/indy
- Open source project. You can help!
- Replacement for WinShoes and FastNet components
Demo
- Moving from Windows to Linux requires two {$ifdef} statements groups
- One for the case of the .dpr resource file
- One for the case of the .dfm file. (.xfm is currently used in Kylix)
Session management
- Cookies – Cookie property
- Fat URLs
- Sessions
- Session management integrated in Delphi 6
Web Page Appearance
- Style sheets
- Header and footer templates in AfterDispatch
Error handling
- Find as many error conditions as possible
- Present them at the top of the page
- Prevent round-trips from the client to the server
Caching content
- On-demand content generation
- TCustomCache component
- Cache dirty?
- Interval (time lapse)
- File missing
- Customized through validation event
- Content handling
- Descendants implement content handling
- SetContent
- GetContent
TCustomCache Descendants
- TCustomCache
- TStreamCache
- TFileCache
- TWebCache
- TDataSetCache
- TDataSetPageCache
TStreamCache
- Stream property, but no management
- Create the stream using the events
TFileCache
- Assumes a file-based stream
- Stream is automatically created based on the file name
- Directories will be auto-created
- Helper functions
- DateToPath converts the current date to a directory path to improve content
organization
- Overloaded FileSize() will be in Delphi 6, doesn't require opening the file
TWebCache
- Caches content to a file
- Can create content from TCustomContentProducer, like a TWebActionItem
TDataSetCache
- Caches dataset results to a TClientDataset Briefcase file
- Set or retrieve content using an XML data packet (string)
- Threshold can be used for optimizing retrieval logic. If it's faster to
retrieve from the database than load, don't save the cache
TDataSetPageCache
- Implements page of
- Changing display order by clicking on table heading
- Could use for saving user-specific query results
Personalized cached content
- Embed webbroker tags in the cache output
- Process the WebBroker tags to identify users right before sending response
- Other solutions:
- Custom style sheets per user
- XSL per user