My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 11, 2008 by johan.solve
Labels: Documentation, Featured
ReadMe  

Knop - Lightweight Application Framework

Knop is an open source web application framework for Lasso Professional. Knop provides modules that make it easier to handle web forms, database interaction, record listings, site navigation, user authentication and other common tasks. Knop also defines a file structure and an application flow. The goal with Knop is to be lightweight and flexible so it is helpful without becoming an obstacle. You can use all of Knop or just selected components.

Current downloads and mailinglist can always be found via http://montania.se/projects/knop/

Installation

Put knop.lasso in LassoLibraries in either the LassoSite or in the Lasso Application folder. You don't have to restart Lasso. If you are upgrading from an older version of Knop, execute this Lasso code to use the new version without restarting Lasso:

namespace_unload('knop');

Put urlhandler_atbegin.lasso in LassoStartup in either the LassoSite or in the Lasso Application folder.

Put the actual demo files in the Demo folder in the web root.

Web Server Configuration

To be able to use virtual URLs the web server needs to be configured so that extension-less URLs are sent to Lasso. Easiest is to use the directives in the file "to apache.conf" and then use the atbegin handler supplied in "to LassoStartup" along with urlhandler.inc in the web root.

You can also set up mod_rewrite rules to pass all extension-less requests to /index.lasso. This is left as an exercise for the reader.

If you can't do any of these things, you can configure the demo to use parameter based navigation instead, see "Navigation method" below.

Setting up the MySQL demo database

Create a MySQL database named "knopdemo". Load the knopdemo.sql file in the Demo Database folder into MySQL, it will create a customer table and fill it with sample data.

Then you need to configure access to the database and table properly in Lasso Admin. The database username and password should be configured in config/cfgglobal.inc.

The Demo Database folder also contains a FileMaker 5/6 version of the database to demonstrate that Knop works transparently with FileMaker databases as well. Point the Knop example to the FileMaker database by changing the database name to knopdemo_fm in config/cfgglobal.inc.

Site root

In index.lasso the variable $siteroot is set to '/'. Set it to whatever path you have put the demo solution in, or '/' if you have directly in the web root. It should have a leading and trailing slash (or just a single slash)

Default file

index.lasso is the central hub file for the entire example solution. You want to set up the web server so index.lasso is a default file name.

The extension .inc may have to be added to the File Tags Extensions list in SiteAdmin/Setup/Site/File Extension. This is because urlhandler_atbegin.lasso in LassoStartup uses file_exists to check if urlhandler.inc exists at the web root.

Navigation method

The navigation method for the demo is initially set to 'path', which uses virtual URLs. If you can't use virtual URLs you can change the default navigation method by changing the navmethod variable to 'param' in cfg/cfgglobal.inc.

Lasso versions

Knop should work with Lasso 8.1 and 8.5.

Further Documentation

Knop Manual.pdf presents the framework and the thoughts and goals with it. Code examples discussed in the paper are in the Examples folder.

help.lasso is an online API reference that is built on the fly form the built-in ->help tags throughout Knop. It is also hosted online at http://montania.se/projects/knop/help.lasso

Johan Sölve 2008-09-10


Sign in to add a comment
Hosted by Google Code