eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Demos::WebDemoShop':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: WebDemoShop (in Demos)


Inheritance:

   Object
   |
   +--HTTPService
      |
      +--HTTPSelectorService
         |
         +--Demos::WebDemoShop

Package:
stx:goodies/webServer
Category:
Net-Communication-HTTP-Services-Demo-WebApplications
Version:
rev: 1.38 date: 2019/03/07 09:26:21
user: stefan
file: WebDemoShop.st directory: goodies/webServer
module: stx stc-classLibrary: webServer
Author:
Claus Gittinger

Description:


This is a very simple webShop demonstration.
Its main purpose is NOT to show a fancy WebInterface,
but instead:
    how to maintain the concept of sessions (via cookies),
    how to pass state via cookies, arguments, and form fields,
    how to detect repost (try to repost an order)



[access with:]
    http:<host>:<port>/Shop


Class protocol:

defaults
o  canChangeReplyPresenter

o  defaultAllowRobots

o  linkName
return the default linkName path (with slash)

image specs
o  addToCartImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self addToCartImage inspect
     ImageEditor openOnClass:self andSelector:#addToCartImage
     Icon flushCachedIcons

o  addToCartInImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self addToCartInImage inspect
     ImageEditor openOnClass:self andSelector:#addToCartInImage
     Icon flushCachedIcons

o  cartImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self cartImage inspect
     ImageEditor openOnClass:self andSelector:#cartImage
     Icon flushCachedIcons

o  cartInImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self cartInImage inspect
     ImageEditor openOnClass:self andSelector:#cartInImage
     Icon flushCachedIcons

o  inImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self inImage inspect
     ImageEditor openOnClass:self andSelector:#inImage
     Icon flushCachedIcons

o  removeFromCartImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self removeFromCartImage inspect
     ImageEditor openOnClass:self andSelector:#removeFromCartImage
     Icon flushCachedIcons

o  removeFromCartInImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self removeFromCartInImage inspect
     ImageEditor openOnClass:self andSelector:#removeFromCartInImage
     Icon flushCachedIcons

o  shopHomeImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self shopHomeImage inspect
     ImageEditor openOnClass:self andSelector:#shopHomeImage
     Icon flushCachedIcons

o  shopHomeInImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self shopHomeInImage inspect
     ImageEditor openOnClass:self andSelector:#shopHomeInImage
     Icon flushCachedIcons

queries-service
o  settingsApplicationClass
a SettingsApplication class - or nil (used in the settings dialog if non-nil)


Instance protocol:

accessing
o  customers
return the value of the instance variable 'customers' (automatically generated)

o  customers: something
set the value of the instance variable 'customers' (automatically generated)

o  shopID
return the value of the instance variable 'shopID' (automatically generated)

o  shopID: something
set the value of the instance variable 'shopID' (automatically generated)

initialization
o  addRequiredForeignServicesTo: anHTTPServer
I need a file service for the bitmaps and icons

o  id
self new id

o  initStyle
pageParameters at:#bodyColor put:'"#f6feff"'.

o  initWarehouse

o  initialize

misc
o  cookieName

o  customerFromRequest: aRequest
|session cookies customer shopId custId|

misc-html
o  shopBodyEndFor: aRequest

o  shopBodyStart: aString for: aRequest
Write a body with a headline

o  shopFooterIn: aRequest
aRequest nextPutLine:'<CENTER>';

o  shopHeaderIn: aRequest

o  shopNavigationFor: aRequest

o  shopPageParameters

o  shopReply: aString for: aRequest

queries-service
o  allowedMessages

o  defaultMessage

serving
o  addItem: aRequest

o  customer: customer reentersShop: aRequest

o  enterShop: aRequest

o  noCookies: aRequest

o  orderItem: aRequest

o  orderItemSubmit: aRequest
already processed - repost

o  reenterShop: aRequest

o  showItems: aRequest

settings persistency
o  settingSelectors


Private classes:

    Article
    Customer
    Order
    Warehouse

Demonstration:


    Demos::HTTPDemoShop registerServiceIn:(HTTPServer runningServers first) as:'TestShop'


Examples:


step1 - registration self new registerServiceAs:'Shop' step2 - open a browser (mozilla, netscape etc.) navigate to: /Shop
|aServer|

aServer := HTTPServer serverOnPort:8081.
self registerServiceIn:aServer.


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 25 Apr 2024 10:39:44 GMT