Web Development Challenges and How They are Solved
Web Development Challenges and How They are Solved in ps: e. Script Matt Verrinder Progress Software UK Internet & Integration Technologies
Agenda Services Session Management Record Locking PDF Generation Debugging Profiling n n n Simplify your business n 2 © 2004 Progress Software Ltd
Services Persistent procedures n – Contain business/UI logic Registered as super procedures n – On web object (Local) – Session (Global) Managed Simplify your business n – Auto-start on agent startup – Startup on demand Can run remotely on App. Server n 3 © 2004 Progress Software Ltd
Services Core services n – Session management – Security – Menu – Search Custom services Simplify your business n – Extend core functionality – Add functionality 4 © 2004 Progress Software Ltd
Search Service Provides functions to execute query Display page of results Navigate n n Simplify your business n – First – Previous – Next – Last – To Specific Page 5 © 2004 Progress Software Ltd
Execute Query Simplify your business PROCEDURE execute. Query ( INPUT pc. Search. Id AS CHARACTER, INPUT pc. Query. String AS CHARACTER, INPUT pi. Rows. Per. Page AS INTEGER, INPUT pi. Max. Results AS INTEGER ) PROCEDURE store. Results ( INPUT pc. Search. Id AS CHARACTER, INPUT TABLE temp-table, INPUT pi. Rows. Per. Page AS INTEGER, INPUT pi. Max. Results AS INTEGER ) 6 © 2004 Progress Software Ltd
Results Temp-table Definition Define temp-table for results page n – Can be LIKE table(s) in query string To retains correct sequence n n n To get ROWID(s) n Simplify your business FIELD Result. Num LIKE ps. Result. Num INDEX idx. Result. Num IS PRIMARY idx. Result. Num n 7 FIELD Result. Value LIKE ps. Result. Value © 2004 Progress Software Ltd
Select Page FUNCTION select. Page RETURNS INTEGER ( INPUT pc. Search. Id AS CHARACTER, INPUT pc. Select AS CHARACTER ) pc. Select can be first, last, next, previous or a page number Simplify your business n 8 © 2004 Progress Software Ltd
Fetch Results Page PROCEDURE fetch. Results. Page ( INPUT pc. Search. Id AS CHARACTER, INPUT pi. Page. Number AS INTEGER, INPUT pi. Rows. Per. Page AS INTEGER, INPUT-OUTPUT TABLE tt. Results ) Simplify your business PROCEDURE fetch. Result. Row ( INPUT pc. Search. Id AS CHARACTER, INPUT pi. Row. Number AS INTEGER, INPUT-OUTPUT TABLE tt. Results ) If using store. Results(), the same temp-table definitions must be used for fetch. Results. Page() and fetch. Results. Row() n 9 © 2004 Progress Software Ltd
Remove Result Row PROCEDURE ( INPUT remove. Result. Row pc. Search. Id AS CHARACTER, pi. Result. Num AS INTEGER, pl. Renumber AS LOGICAL ) Simplify your business PROCEDURE refresh. Results ( INPUT pc. Search. Id AS CHARACTER, INPUT PARAMETER TABLE tt. Results ) n Note: temp-table definition must be same as that used by store. Results() 10 © 2004 Progress Software Ltd
Demo 1 Data Service
Session Service n Web. Speed agent is stateless – No memory of user or user actions n n Application responsibility to track context of user Data stored against session id Simplify your business – Available to subsequent requests 12 © 2004 Progress Software Ltd
Session Service n n Global service Session id – Created on first request – Passed with every request n n URL parameter Cookie Simplify your business – Used to re-establish context 13 © 2004 Progress Software Ltd
Session Data n n n Loaded when request initialises Saved when request complete Data stored as character – Functions for get/set of specific data types n Simplify your business n n Can store temp-tables Virtual lock table Session viewer in Web. Tools 14 © 2004 Progress Software Ltd
Demo 2 Record Locking
PDF Generation n n Use e. Script to generate an XML document Override standard output behaviour Simplify your business – Transform XML into PDF – Stream generated file to browser 16 © 2004 Progress Software Ltd
Demo 3 Generating PDFs
Demo 4 Debugging
Demo 5 Profiling
Simplify your business Questions 20 © 2004 Progress Software Ltd
- Slides: 20