The Web store Web appication is made up of several important pieces:

These pieces are wound together using standard Web Connection application strategies through a project that is generated through Web Connection's New Project Wizard. As such the store runs as follows:

To review: Requests for a page like item.wws hits, the wwStore::item() method which uses business objects to perform the data processing, then uses the item.wws template to display the data.

Cookies and Sessions


The Web Store uses cookies to track users through the site. Web Connection Sessions are used to store user identity information such as generated invoice and customer PKs until orders are actually submitted. If the browser doesn't accept cookies or the user decides to refuse the cookie this application will not work. It can be modified fairly easily by using license plate IDs on Web pages to identify users, but it will require a lot of search and replace to add IDs into every linked URL.

Users are tracked through the cookie which links back into the user's customer 'profile'. The profile in the Web Store is really just the master customer record which contains all of the user's contact info. This information is then used to remember the user when he returns to set defaults for the name, country and all of the contact info so it doesn't have to be re-entered each time.

The Configuration Object


The store requires a number of configuration features which are handled through a standard Web Connection wwConfig object which is stored in your application's INI file (WebStore.ini by default). The wwStore process class automatically assigns the wwstore config object to a PRIVATE variable called config for easy access so you can access any store configuration values simple with Config.cAdminUser for example.

[Wwstore]
Datapath=.\wwStore\
Htmlpagepath=d:\westwind\wwStore\
Adminuser=Any
Secureorderpage=On
XMLDocRoot=wwstore
CookieName=WESTWINDUSER
AdminUser=jdoe,mfry
Storename=West Wind Technologies
Mailfrom=West Wind Technologies
Mailfromemail=sales@west-wind.com
Mailserver=mail.server.net
Mailcc=another@email.com
Banneralias=wwSitebanners
Bannerfile=wwSitebanners

Most of these values should look familiar to you. Important ones include:

HTMLPagePath
This points at the wwStore Web directory so the store can find the HTML templates. This is used in calls to ExpandTemplate(Config.cHTMLPagePage + "default.wws").

AdminUser
The user(s) that'll be allowed access to admin functionality. Use a single username, a comma delimited list, or ANY for any NT account, WCINI for the settings out wc.ini or leave it blank for no authentication. Note: On Windows 98 you probably have to leave this value blank since Basic Authentication is difficult to get to work on Windows 98.

SecureOrderPage
This is an important setting that determines whether the order page goes into secure mode. When you click on Place this Order this flag determines whether an HTTPS link or plain HTTP is used. Your orders should ALWAYS be secure, but this flag is here to allow you to easily test the application on a server that may not have a secure certificate installed.

CookieName
Determines the name of the single Cookie that is created to track users. The cookie is permanent and stored on the users computer unless refused. The cookie is used to reattach the user to his profile when he returns to the store another day.

XMLDocRoot
Determines the doc root name for your store application for all automatically generated XML. This is mainly for consistency and allows you to customize the XML to your implementation.

BannerFile and BannerAlias
The default store uses the wwBanner class to provide rotating banners for some of the products in the store. These values specify the name of the file and alias for the file. This is mainly to allow multiple banner files to co-exist.

XML capabilities


The store is XML enabled to an extent. Most links are capability of returning XML directly and this is provided through the nResultMode property which checks for a querystring value of &display=XML. When this is present the Web store returns data for many operations in XML format. For example to return XML for an item you'd use: items.wws?sku=WCONNECT&display=XML. It works for itemlists, items, your shopping cart and the final invoice.

Several of the adminstration features also allow you to download data generically in XML format. The offline viewer pulls all data from the site in XML format as well. It can also upload data to the Site with XML. XML functionality is generically implemented using the ReturnObjectXML and ReturnCursorXML methods of the wwStore process class which can return any result data into XML quickly.

Administration Features


All administration functions in the wwStore class are name Maint<function>. You can see the various requests by going to the store administration page at /wwstore/admin/. You can view orders placed and access data in XML format to capture the data. You can also view and edit inventory online.

All of the Admin functions force login with a small snippet of code:

IF !THIS.Login(Config.cAdminUser)
   RETURN
ENDIF   


Last Updated: 06/02/03 | Send topic feedback