eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Demos::WebSlideShow':

Home

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

Class: WebSlideShow (in Demos)


Inheritance:

   Object
   |
   +--HTTPService
      |
      +--Demos::WebSlideShow

Package:
stx:goodies/webServer
Category:
Net-Communication-HTTP-Services-Demo-WebApplications
Version:
rev: 1.114 date: 2018/04/26 10:49:01
user: cg
file: WebSlideShow.st directory: goodies/webServer
module: stx stc-classLibrary: webServer
Author:
Claus Gittinger (cg@exept)

Description:


Provides a thumbnailed slides presentation;
for the given slideDirectory, referring pages are synthesized,
and thumbnails automatically generated, as required.
To add more slides, simply create a sub-folder of the slidesDirectory,
put the slides there, and open a browser; that's it - all done automatically
and on the fly.

To start:

  start the HTTPServer at some port:
      aServer := HTTPServer startServerOnPort:8080

  register the class (towards the HTTPServer) with:
      service := Demos::WebSlideShow new.
      service slideDirectory:'someDirectory'.
      service registerServiceIn:(HTTPServer runningServers first) as:'slides'.

Open a netscape or internet explorer (somewhere);
enter the URL:
    httP://host:port/slides


Related information:

    HTTPServer

Class protocol:

defaults
o  defaultReplyPresenterClass

o  isThreadSafe

o  linkName
return the default path (with slash)

o  newSetIndicationFile

o  slideDirectory
my default slides directory

queries-service
o  settingsApplicationClass
my application in the settings dialog


Instance protocol:

accessing
o  allowSlideShow

o  allowSlideShow: aBoolean

o  allowUploads

o  allowUploads: something

o  numberOfColumns
the number of columns to generate (default: 5)

o  numberOfColumns: something
set the number of columns to generate

o  numberOfSlidesPerPage
the number of thumbs per page (default: 25)

o  numberOfSlidesPerPage: something
set the number of thumbs per page

o  showExeptFrame
old instance var keep selector for loading old settings files

o  showExeptFrame: aBoolean
old instance var keep selector for loading old settings files

o  showFileNames

o  showFileNames: aBoolean

o  showFileSizes

o  showFileSizes: aBoolean

o  slideDirectory
where the slides are

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

o  slideShowDelay

o  smoothThumbs

o  thumbBorders

o  thumbBorders: aBoolean

o  thumbFileFormat
^ #gif

o  thumbSize
the size of the generated thumbs (default: 128@128)

o  thumbSize: anExtent
the size of the generated thumbs (default: 128@128)

o  thumbStyle

o  thumbStyle: aSymbol

o  uploadRealm

o  uploadRealm: something

o  withImageWidthOption

o  withImageWidthOption: something

helpers
o  areAnyImagesIn: aDirectory
true if there are any files with an image mimeType in aDirectory

o  criticalDirectoryAccessIn: anAbsolutePath do: aBlock
synchronized critical update of the thumb directory

o  filesInDirectory: path

o  imageFilesInDirectory: path

o  newSetIn: aDirectory
true if there are any files with an image mimeType in aDirectory

maintenance html presentation
o  specificChangeFromRequest: aRequest
extracts parameter from an html-maintenance post-request

o  specificInputFieldsForRequest: aRequest
generates the html-fragment for the maintenance form

misc
o  flushCachedThumbImages
self allInstancesDo:#flushCachedThumbImages

o  styleDescriptionsAndSymbols
('Cartoon' #cartoon) "/ does not work yet

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

request handling
o  process: aRequest
process an http request

serving-private
o  authenticateUploadFor: aRequest

o  createNewImageSet: aRequest forRelativePath: relPath
self showExeptFrame ifTrue:[

o  doFormActions: aRequest forRelativePath: relPath
process all the form actions

o  file: absolutePathToFile for: aRequest
return a files complete contents

o  generateTableForSlidesIn: path relative: relativePath for: aRequest
generate an html table containing the thumbs

o  generateTableForSubdirectoriesIn: path relative: relativePath for: aRequest
generate an html table containing links to subdirectories

o  generateZipLinksForFilesIn: path relative: relativePath for: aRequest
generate a link for zip/tgz files

o  image: absolutePathToImage for: aRequest
return a full image

o  imagePageBody: aRequest for: path relative: relativePath
the body of an image page

o  isDirectoryVisible: aDirectory

o  linkToThumbFor: aRealativeImageFilename
generate a hyperlink to a thumb

o  pageFinish: aRequest
showExeptFrame ifTrue:[

o  slidePage: aRequest forRelativePath: relativePathOfSlideDirectory
after validating the request, generate a page containing the tables

o  slidePageBody: aRequest for: path relative: relativePath
the body of a slide page

o  slidePageTables: aRequest for: path relative: relativePath
generates the two tables

o  thumb: absolutePathToThumb for: aRequest
look for or create and cache a thumb image.
When invoked for the first time, generate a dithered 8-bit version.

o  upLoadImage: aRequest forRelativePath: relPath

o  upLoadInputFor: aRequest relative: relativePath

serving-thumbs
o  generateButtonImageFor: anImage buttonLevel: bw

o  generateCartoonImageFor: anImage
must convert - GIF only supports Depth8.

o  generateGrayImageFor: anImage

o  generateShadowImageFor: anImage shadowWidth: sw

o  generateSlideImageFor: anImage
must convert - GIF only supports Depth8.

o  generateThumbFor: anImage
must convert - GIF only supports Depth8.

settings persistency
o  settingSelectors
answer the selectors that are used to configure a service - i.e. those which are
saved in the webServer-settings file.
usage example(s):
     HTTPService new settingSelectors
     self new settingSelectors


Private classes:

    CachedDirectoryEntry

Examples:


start the HTTPServer at some port and register the class (towards the HTTPServer) Open a netscape or internet explorer (somewhere); enter the URL: http://host:port/WebSlideShow
|aServer service|

aServer := HTTPServer serverOnPort:8081.

service := Demos::WebSlideShow new.
service slideDirectory:'/phys/exept/unsaved3/cg/camp smalltalk bilder'.
service numberOfColumns:5.
service numberOfSlidesPerPage:30.
service registerServiceIn:aServer as:'campSmalltalk'.


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 19 Sep 2018 05:01:27 GMT