presentation services at american express a presentation for: tpg user group may 17, 2004 by: by:...

40
Presentation Presentation Services at Services at American Express American Express A presentation for: A presentation for: TPG User Group TPG User Group May 17, 2004 May 17, 2004 by: by: John Rojewski John Rojewski [email protected] [email protected]

Upload: samson-griffin

Post on 30-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

Presentation Services at Presentation Services at American ExpressAmerican Express

A presentation for:A presentation for:TPG User GroupTPG User GroupMay 17, 2004May 17, 2004

by:by:John RojewskiJohn Rojewski

[email protected]@aexp.com

Page 2: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 22

Presentation ServicesPresentation Services

OverviewOverview Historical PerspectiveHistorical Perspective Distributed ArchitectureDistributed Architecture Multiple LanguagesMultiple Languages Multiple EnvironmentsMultiple Environments Desired Improvement in Customer Desired Improvement in Customer

InteractionInteraction

Page 3: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 33

OverviewOverview

This project began in June, 2002.This project began in June, 2002.

Directions were to begin using Intranet Directions were to begin using Intranet browser-based presentation of browser-based presentation of information previously available only information previously available only on 3270-style devices.on 3270-style devices.

This direction was dictated by the This direction was dictated by the announcement of the demise of SNA.announcement of the demise of SNA.

Page 4: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 44

Historical PerspectiveHistorical PerspectiveIBM 2260IBM 2260

This was the This was the ultimate in 1974!ultimate in 1974!

12 lines of 80 12 lines of 80 printable characters printable characters (960 bytes)(960 bytes)

No more cards or No more cards or keypunch machineskeypunch machines

Real-time data Real-time data entry!entry!

(Yes, I’m that old!)(Yes, I’m that old!)

Page 5: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 55

Historical PerspectiveHistorical PerspectiveIBM 3270IBM 3270

And a few years later And a few years later we got more.we got more.

24 lines by 80 24 lines by 80 characterscharacters

Protected fieldsProtected fields Highlight and invisible Highlight and invisible

fieldsfields Auto cursor positioningAuto cursor positioning Row column addressingRow column addressing

American Express started supporting 3270 data American Express started supporting 3270 data streams within TPF in 1979. We are still supporting streams within TPF in 1979. We are still supporting 3270 today in 2004.3270 today in 2004.

Page 6: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 66

Distributed ArchitectureDistributed Architecture

Unlike the preceding 3270 Unlike the preceding 3270 architecture, which had all message architecture, which had all message formatting performed within the host formatting performed within the host system, today’s approach has system, today’s approach has processing elements spanning:processing elements spanning:

Mainframe (TPF)Mainframe (TPF) Midrange (Linux/WebSphere)Midrange (Linux/WebSphere) Desktop (Windows)Desktop (Windows)

Page 7: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 77

Multiple LanguagesMultiple Languages

While the previous information While the previous information displays were coded in time-tested displays were coded in time-tested Assembler language, the new Assembler language, the new architecture introduces: architecture introduces:

CC Java (J2EE) Java (J2EE) JavaScriptJavaScript XML and XSL StylesheetsXML and XSL Stylesheets HTML and XHTMLHTML and XHTML

Page 8: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 88

Multiple EnvironmentsMultiple Environments

The single interface with the TPF to 3270 The single interface with the TPF to 3270 environment has given way to:environment has given way to:

Internet Explorer on WindowsInternet Explorer on Windows Red Hat LinuxRed Hat Linux Apache HTTP ServerApache HTTP Server IBM’s WebSphere 5 and WebSphere MQIBM’s WebSphere 5 and WebSphere MQ

Within each of these environments are a Within each of these environments are a multiplicity of new systems and utilities to multiplicity of new systems and utilities to understand, configure, and master.understand, configure, and master.

Page 9: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 99

Improvement in Improvement in Customer InteractionCustomer Interaction

As a result of the introduction of the Hypertext As a result of the introduction of the Hypertext Markup Language (HTML), a full range of display Markup Language (HTML), a full range of display and selection constructs are available within the and selection constructs are available within the browser:browser:

Text boxes with wrapping textText boxes with wrapping text Drop-down menusDrop-down menus Checkboxes and Radio ButtonsCheckboxes and Radio Buttons Font selection, Image graphics, etc.Font selection, Image graphics, etc.

All designed to improve the ability of the customer All designed to improve the ability of the customer to interact with the presentation.to interact with the presentation.

Page 10: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1010

Architectural GoalsArchitectural Goals

TransactionalTransactional Utilize new technologyUtilize new technology Remove ‘screen’ formatting from the Remove ‘screen’ formatting from the

TPF environmentTPF environment Expandable functionalityExpandable functionality Utilize ‘C’ Language where possibleUtilize ‘C’ Language where possible

Page 11: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1111

Simplified ViewSimplified View

Page 12: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1212

Vendors and AssociationsVendors and Associations

Page 13: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1313

Major ComponentsMajor Components XMLXML XSL (or XSLT)XSL (or XSLT) JavaScriptJavaScript TPF Assembler and CTPF Assembler and C XML Parser (XML4C)XML Parser (XML4C) Java (J2EE)Java (J2EE) WebSphere MQWebSphere MQ WebSphere Application ServerWebSphere Application Server LinuxLinux IBM HTTP ServerIBM HTTP Server Microsoft Internet ExplorerMicrosoft Internet Explorer

Page 14: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1414

Component - XMLComponent - XML

XML is the single data format utilized.XML is the single data format utilized. Standard XML tag names are defined for Standard XML tag names are defined for

continuity:continuity:• <Transaction> … </Transaction><Transaction> … </Transaction>• <TransactionNm> … </TransactionNm><TransactionNm> … </TransactionNm>

Other tag names are according to Amex Other tag names are according to Amex published standards or established with published standards or established with business product.business product.

XML encoding is EBCDIC within TPF and XML encoding is EBCDIC within TPF and converted to ASCII at the MQ boundaryconverted to ASCII at the MQ boundary

Page 15: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1515

XML ExampleXML Example<?xml version="1.0"?><?xml version="1.0"?><!-- XML document with XSL stylesheet and internal DTD JR-July 18,2002 --><!-- XML document with XSL stylesheet and internal DTD JR-July 18,2002 --><!-- Sample conversion for Message Monitor Counts<!-- Sample conversion for Message Monitor Counts 89 cnt XXXX screen 89 cnt XXXX screen inquiry onlyinquiry only simple controls: quit, refresh, scrollsimple controls: quit, refresh, scroll -->--><?xml-stylesheet type="text/xsl" href="MessageMonitorCounts.xsl"?><?xml-stylesheet type="text/xsl" href="MessageMonitorCounts.xsl"?><Transaction><Transaction> <SystemNm>NADV</SystemNm><SystemNm>NADV</SystemNm> <SystemDesc>Name &amp; Address Verif</SystemDesc><SystemDesc>Name &amp; Address Verif</SystemDesc> <Item> <Item> <Desc>Addr &amp; Zip Correct</Desc><Desc>Addr &amp; Zip Correct</Desc> <Cnt>86557</Cnt><Cnt>86557</Cnt> </Item> </Item> <Item><Item> <Desc> Addr &amp; Zip Incorrect</Desc><Desc> Addr &amp; Zip Incorrect</Desc> <Cnt>28821</Cnt><Cnt>28821</Cnt> </Item> </Item> <Item><Item> <Desc> Reply after Timeout</Desc><Desc> Reply after Timeout</Desc> <Cnt>0</Cnt><Cnt>0</Cnt> </Item> </Item> <Item><Item> <Desc> Service Not Allowed</Desc><Desc> Service Not Allowed</Desc> <Cnt>0</Cnt><Cnt>0</Cnt> </Item> </Item> </Transaction></Transaction>

Page 16: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1616

Component - XSLTComponent - XSLT

Provides all End User screen formatting, Provides all End User screen formatting, removing this task from the mainframe removing this task from the mainframe applicationapplication

Transform runs on the End User Desktop Transform runs on the End User Desktop machine, eliminating performance machine, eliminating performance degradation on TPF Hostdegradation on TPF Host

Standard supported by Internet Explorer Standard supported by Internet Explorer 5.5 and above w/MSXML3 DLL5.5 and above w/MSXML3 DLL

Page 17: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1717

XSLT ExampleXSLT Example<?xml version="1.0"?><?xml version="1.0"?><!-- MessageMonitorCounts.xsl --><!-- MessageMonitorCounts.xsl --><!-- XSL stylesheet that works with IE 5.5 JR-Nov 14,2002 --><!-- XSL stylesheet that works with IE 5.5 JR-Nov 14,2002 -->

<!DOCTYPE standards [<!DOCTYPE standards [ <!ENTITY standard_prefix SYSTEM "standard_prefix.html"><!ENTITY standard_prefix SYSTEM "standard_prefix.html"> <!ENTITY standard_suffix SYSTEM "standard_suffix.html"><!ENTITY standard_suffix SYSTEM "standard_suffix.html">]>]>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html"/><xsl:output method="html"/>

<xsl:template match="SystemNm"><xsl:template match="SystemNm"> <option><option> <xsl:attribute name="value"><xsl:attribute name="value"> <xsl:apply-templates/><xsl:apply-templates/> <!-- xsl:value-of select="SystemNm"/ --><!-- xsl:value-of select="SystemNm"/ --> </xsl:attribute></xsl:attribute> <xsl:copy-of select="following-sibling::SystemDesc"/><xsl:copy-of select="following-sibling::SystemDesc"/> </option></option></xsl:template></xsl:template>

<xsl:template match="SystemDesc"><xsl:template match="SystemDesc"> <h2 align="center"><h2 align="center"> <xsl:apply-templates/><xsl:apply-templates/> </h2></h2></xsl:template></xsl:template>

</xsl:stylesheet></xsl:stylesheet>

Page 18: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1818

Component - JavaScriptComponent - JavaScript

Utilized within the XSL Stylesheets to Utilized within the XSL Stylesheets to build input to the Applicationbuild input to the Application

Enables common functions to be Enables common functions to be placed in the prefix headers and placed in the prefix headers and used by all stylesheet authorsused by all stylesheet authors

Provides ability to pass user input Provides ability to pass user input and modifications from HTML and modifications from HTML <form> statements back to <form> statements back to application application

Page 19: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 1919

JavaScript ExampleJavaScript Example<script language="JavaScript"><script language="JavaScript"> function SetApplicationData()function SetApplicationData() {{ document.main.Application_Data.value = document.main.Application_Data.value =

"<Transaction><TransactionNm>" + "<Transaction><TransactionNm>" + document.main.TransactionNm.value + "</TransactionNm><SystemNm>" document.main.TransactionNm.value + "</TransactionNm><SystemNm>"

++ document.main.SystemNm.value + "</SystemNm></Transaction>";document.main.SystemNm.value + "</SystemNm></Transaction>"; setFormAction("main");setFormAction("main"); document.main.submit();document.main.submit(); }}</script></script>

Example of Usage:Example of Usage:

<form name="main" action="dummy" method="POST"><form name="main" action="dummy" method="POST"><input type="submit" value="Go!" onClick="SetApplicationData()"/><input type="submit" value="Go!" onClick="SetApplicationData()"/></form></form>

Page 20: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2020

TPF ApplicationTPF Application Assembler Assembler

The first applications were developed in The first applications were developed in Assembly due to inexperience and lack of Assembly due to inexperience and lack of infrastructure to support ‘C’ developmentinfrastructure to support ‘C’ development

Parsing must be done manually via string Parsing must be done manually via string scanning techniques, which limits the scanning techniques, which limits the complexity of the XML inputcomplexity of the XML input

Likewise output XML generation is Likewise output XML generation is manually constructed by appending manually constructed by appending elements in a bufferelements in a buffer

Page 21: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2121

TPF ApplicationTPF Application Assembler Example Assembler Example

INPUT FORMAT IS: INPUT FORMAT IS: <Transaction> <Transaction> <TransactionNm>MessageMonitorCounts</TransactionNm> <TransactionNm>MessageMonitorCounts</TransactionNm> <SystemName>XXXX</SystemName> <SystemName>XXXX</SystemName> </Transaction> </Transaction> MACRO MACRO &LABEL APPEND &STRING,&REG &LABEL APPEND &STRING,&REG MVC 0(L'&STRING,&REG),&STRING MVC 0(L'&STRING,&REG),&STRING LA &REG,L'&STRING.(&REG) LA &REG,L'&STRING.(&REG) MEND MEND MACRO MACRO &LABEL PARSE &STRING,&REG &LABEL PARSE &STRING,&REG LA R15,200 LA R15,200 p1&sysndx ds 0h p1&sysndx ds 0h CLC 0(L'&STRING,&REG),&STRING CLC 0(L'&STRING,&REG),&STRING BE p2&sysndx BE p2&sysndx LA &REG,1(&REG) LA &REG,1(&REG) BCT R15,p1&sysndx BCT R15,p1&sysndx LA RG1,DefaultName LA RG1,DefaultName p2&sysndx ds 0h p2&sysndx ds 0h LA RG1,L'&STRING.(RG1) LA RG1,L'&STRING.(RG1) p3&sysndx ds 0h p3&sysndx ds 0h MEND MEND

Page 22: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2222

TPF ApplicationTPF Application Assembler Example Assembler Example

append xmlheader,r2 '<?xml version='1.0?>' append xmlheader,r2 '<?xml version='1.0?>' append xslheader,r2 '<?xml-stylesheet' start append xslheader,r2 '<?xml-stylesheet' start append thistransaction,r2 'MessageMonitorCounts' append thistransaction,r2 'MessageMonitorCounts' append xslheaderxsl,r2 end of stylesheet append xslheaderxsl,r2 end of stylesheet append transaction,r2 '<Transaction>' append transaction,r2 '<Transaction>' append transname,r2 '<TransactionName>' append transname,r2 '<TransactionName>' append thistransaction,r2 'MessageMonitorCounts' append thistransaction,r2 'MessageMonitorCounts' append endtransname,r2 '</TransactionName>' append endtransname,r2 '</TransactionName>'

parse systemname,r1 find system name parse systemname,r1 find system name append systemname,r2 '<SystemName>' append systemname,r2 '<SystemName>' append SYSTEMID,r2 System ID = XXXX append SYSTEMID,r2 System ID = XXXX append endsystemname,r2 '</SystemName>' append endsystemname,r2 '</SystemName>' append systemdesc,r2 '<SystemDescription>' append systemdesc,r2 '<SystemDescription>' append SYSTEMDESCRIPTION,r2 System Desc = 20 chars append SYSTEMDESCRIPTION,r2 System Desc = 20 chars append endsystemdesc,r2 '</SystemDescription>' append endsystemdesc,r2 '</SystemDescription>' append endtransaction,r2 </Transaction> append endtransaction,r2 </Transaction> backc , return to caller to reply backc , return to caller to reply

Page 23: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2323

TPF ApplicationTPF Application ‘C’ Language ‘C’ Language

Similar to Assembly language developmentSimilar to Assembly language development Application utilizes XML parser for extraction of Application utilizes XML parser for extraction of

inputinput Application generates XML output via series of Application generates XML output via series of

strcat() calls, or builds higher-level routine:strcat() calls, or builds higher-level routine:int addXmlElement(char* const xmlDataStream,int addXmlElement(char* const xmlDataStream, const char* const elementName,const char* const elementName, const char* const data)const char* const data){{ strcat(xmlDataStream, "<");strcat(xmlDataStream, "<"); strcat(xmlDataStream, elementName);strcat(xmlDataStream, elementName); strcat(xmlDataStream, ">");strcat(xmlDataStream, ">"); strcat(xmlDataStream, data);strcat(xmlDataStream, data); strcat(xmlDataStream, "</");strcat(xmlDataStream, "</"); strcat(xmlDataStream, elementName);strcat(xmlDataStream, elementName); strcat(xmlDataStream, ">");strcat(xmlDataStream, ">"); return 0;return 0;}}

Page 24: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2424

TPF ApplicationTPF Application ‘C’ Example ‘C’ Example

#include <sax/HandlerBase.hpp>#include <sax/HandlerBase.hpp>class AttributeList;class AttributeList;

class AuthorizerStatusHandler : public HandlerBaseclass AuthorizerStatusHandler : public HandlerBase{{public:public: AuthorizerStatusHandler();AuthorizerStatusHandler(); ~AuthorizerStatusHandler();~AuthorizerStatusHandler(); void startElement(const XMLCh* const name, AttributeList& attributes);void startElement(const XMLCh* const name, AttributeList& attributes); void endElement(const XMLCh* const name);void endElement(const XMLCh* const name); void characters(const XMLCh* const characters, const unsigned int length);void characters(const XMLCh* const characters, const unsigned int length); void resetDocument();void resetDocument(); const char* const getTransactionName() const;const char* const getTransactionName() const; const char* const getISOCardNumber() const;const char* const getISOCardNumber() const; const char* const getClassCode() const;const char* const getClassCode() const; const char* const getRetentionDays() const;const char* const getRetentionDays() const; const char* const getErrorMessage() const;const char* const getErrorMessage() const;private:private: char* _transactionName;char* _transactionName; char* _ISOCardNumber;char* _ISOCardNumber; char* _classCode;char* _classCode; char* _retentionDays;char* _retentionDays; char* _errorMessage;char* _errorMessage; char* _currentElement;char* _currentElement;};};

Page 25: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2525

XML Parser – XML4CXML Parser – XML4C

Callable from ‘C’ programs to parse Callable from ‘C’ programs to parse XML inputsXML inputs

Available with both DOM and SAX Available with both DOM and SAX modelsmodels

Available with DTD structure Available with DTD structure validationvalidation

Implemented as C++ ClassesImplemented as C++ Classes

Page 26: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2626

XML4C Parser XML4C Parser Activation for SAXActivation for SAX

#include <parsers/SAXParser.hpp>#include <parsers/SAXParser.hpp> #include <framework/MemBufInputSource.hpp>#include <framework/MemBufInputSource.hpp> #include <sax/AttributeList.hpp>#include <sax/AttributeList.hpp> trytry { XMLPlatformUtils::Initialize(); }{ XMLPlatformUtils::Initialize(); } catch (const SAXException& toCatch)catch (const SAXException& toCatch) {{ cerr << "Error during initialization! Message:\n"cerr << "Error during initialization! Message:\n" << StringTranslator(toCatch.getMessage()) << endl;<< StringTranslator(toCatch.getMessage()) << endl; }} // Create a SAX parser object.// Create a SAX parser object. SAXParser parser;SAXParser parser; parser.setDoValidation(doValidation);parser.setDoValidation(doValidation); // Create our SAX handler object and install it on the parser// Create our SAX handler object and install it on the parser AuthorizerStatusHandler handler;AuthorizerStatusHandler handler; parser.setDocumentHandler(&handler);parser.setDocumentHandler(&handler); parser.setErrorHandler(&handler);parser.setErrorHandler(&handler); // Create MemBufferInputSource from the buffer containing the XML// Create MemBufferInputSource from the buffer containing the XML MemBufInputSource* memBufIS = new MemBufInputSourceMemBufInputSource* memBufIS = new MemBufInputSource ( (const XMLByte*)gXML, strlen(gXML), gMemBufId, false );( (const XMLByte*)gXML, strlen(gXML), gMemBufId, false ); // Kick off the parse of the XML data stream.// Kick off the parse of the XML data stream. // Catch any exceptions that might propogate out of it.// Catch any exceptions that might propogate out of it. trytry { parser.parse(*memBufIS); }{ parser.parse(*memBufIS); } catch (const SAXLException& e)catch (const SAXLException& e) { cerr << "\nError during parsing memory stream:\n"{ cerr << "\nError during parsing memory stream:\n" << "Exception message is: \n"<< "Exception message is: \n" << StringTranslator(e.getMessage()) << "\n" << endl;<< StringTranslator(e.getMessage()) << "\n" << endl; }}

Page 27: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2727

XML4C Parser XML4C Parser Handlers for SAXHandlers for SAX

startElement(), endElement(), and characters() primary routinesstartElement(), endElement(), and characters() primary routinesvoid AuthorizerStatusHandler::startElement(const XMLCh* const name, AttributeList& attributes)void AuthorizerStatusHandler::startElement(const XMLCh* const name, AttributeList& attributes){ _currentElement = XMLString::transcode(name); }{ _currentElement = XMLString::transcode(name); }

void AuthorizerStatusHandler::endElement(const XMLCh* const name)void AuthorizerStatusHandler::endElement(const XMLCh* const name){{ if(_currentElement) { delete [] _currentElement; _currentElement = 0; }if(_currentElement) { delete [] _currentElement; _currentElement = 0; }}}

void AuthorizerStatusHandler::characters(const XMLCh* const characters, const unsigned int length)void AuthorizerStatusHandler::characters(const XMLCh* const characters, const unsigned int length){{ if(strcmp(_currentElement,"TransactionNm") == 0) {if(strcmp(_currentElement,"TransactionNm") == 0) { _transactionName = XMLString::transcode(characters);_transactionName = XMLString::transcode(characters); } else if(strcmp(_currentElement,"ISOCardNumber") == 0) {} else if(strcmp(_currentElement,"ISOCardNumber") == 0) { _ISOCardNumber = XMLString::transcode(characters);_ISOCardNumber = XMLString::transcode(characters); } else if(strcmp(_currentElement,"ClassCode") == 0) {} else if(strcmp(_currentElement,"ClassCode") == 0) { _classCode = XMLString::transcode(characters);_classCode = XMLString::transcode(characters); } else if(strcmp(_currentElement,"RetentionDays") == 0) {} else if(strcmp(_currentElement,"RetentionDays") == 0) { _retentionDays = XMLString::transcode(characters);_retentionDays = XMLString::transcode(characters); } else if(strcmp(_currentElement,"ErrorMessage") == 0) {} else if(strcmp(_currentElement,"ErrorMessage") == 0) { _errorMessage = XMLString::transcode(characters);_errorMessage = XMLString::transcode(characters); }}}}

Page 28: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2828

Component – Java (J2EE)Component – Java (J2EE)

Java J2EE 1.3 API class libraryJava J2EE 1.3 API class library Supported under WebSphereSupported under WebSphere Supports web and EJB containersSupports web and EJB containers Easily integrated to WebSphere MQEasily integrated to WebSphere MQ Expanded for “industrial strength” Expanded for “industrial strength”

applications applications Supported by IDEs such as WebSphere Supported by IDEs such as WebSphere

Application Developer (WSAD)Application Developer (WSAD)

Page 29: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 2929

Java (J2EE) ExampleJava (J2EE) Examplepublic class TransactionHandler implements RequestHandler, public class TransactionHandler implements RequestHandler,

PServicesStringConstantsPServicesStringConstants{{

private final String auditMethod = new String("processRequest");private final String auditMethod = new String("processRequest");private final String auditClass = new String("TransactionHandler");private final String auditClass = new String("TransactionHandler");private String getScreen = null;private String getScreen = null;

public String processRequest(HttpServletRequest public String processRequest(HttpServletRequest request,HttpServletResponse response)request,HttpServletResponse response) {{

HttpSession session = request.getSession(false);HttpSession session = request.getSession(false);if (session == null) if (session == null) {{

/*/* * Redirect user to login page if no session* Redirect user to login page if no session */*/return PServicesStringConstants.JSP_SESSION_INVALID;return PServicesStringConstants.JSP_SESSION_INVALID;

}}

Page 30: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3030

WebSphere WebSphere Application SeverApplication Sever

Application Server Application Server runs Linux operating runs Linux operating systemsystem

WebSphere 5.0 WebSphere 5.0 supports Java Virtual supports Java Virtual Machine (JVM) and Machine (JVM) and containerscontainers

Utilizes MQ Utilizes MQ connectivity to TPF connectivity to TPF HostHost

Database

MQSeries

JVM

HTML

ServletJava Server

Pages

Web Container

EJB

EJB

EJB Container

Application Server

Page 31: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3131

WebSphere MQWebSphere MQ Application Server Application Server

receives messages from receives messages from Web Server via HTTPWeb Server via HTTP

WAS forwards to WAS forwards to Application which calls Application which calls MQ for message deliveryMQ for message delivery

Application requests MQ Application requests MQ receipt of message via receipt of message via “Correlation ID” and “Correlation ID” and awaits response from awaits response from TPF ApplicationTPF Application

App returns response to App returns response to Web Server Web Server

Websphere

MQSeries TurboMQ

SenderChannel

ReceiverChannel

Middleware Server TPF

HTTPResponse

HTTPRequest

Page 32: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3232

Testing ApproachesTesting Approaches

Testing is performed in 3 distinct Testing is performed in 3 distinct phasesphases

First phase is static XML files with First phase is static XML files with generated XSLT on browsergenerated XSLT on browser

Second phase in via Apache HTTP Second phase in via Apache HTTP server running on local TPF test server running on local TPF test systemsystem

Final phase is via MQ connection to Final phase is via MQ connection to test WebSphere servertest WebSphere server

Page 33: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3333

Static Desktop TestingStatic Desktop Testing

Create XSL via text editorCreate XSL via text editor Other tools may be useful (XMLSPY, Other tools may be useful (XMLSPY,

WSAD, etc.)WSAD, etc.) Create static XML file with XSL referenceCreate static XML file with XSL reference<?xml-stylesheet type="text/xsl" href=“fileNameHere.xsl"?><?xml-stylesheet type="text/xsl" href=“fileNameHere.xsl"?> Open XML with Browser and view displayOpen XML with Browser and view display Verify design with Business Partner Verify design with Business Partner

before moving ahead to codingbefore moving ahead to coding

Page 34: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3434

Connection Testing Connection Testing Apache 1.3.27Apache 1.3.27

• Testing application on TPF system without middle server tier

• Upload necessary file system to TPF HFS (/usr/local/apache/htdocs) via FTP server

• ZINET ADD S-FTP PGM-CFTP P-TCP PORT-21 MODEL-NOWAIT USER-ROOT ACT-OPER MAXPROC-10• ZINET START S-FTP

Start Apache server• ZINET ADD S-APACHE PGM-CHTA MODEL-DAEMON USER-ROOT• ZINET START S-APACHE

Create compatible transaction router via CGI functionality

• ZFILE chmod 755 /usr/local/apache/cgi-bin/qzz2.cgi

Page 35: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3535

Integration Testing Integration Testing WebSphere and TPFWebSphere and TPF

Establish MQ connections between Establish MQ connections between TPF and the Linux/WebSphere serverTPF and the Linux/WebSphere server

Define XMIT queues to support larger Define XMIT queues to support larger messages necessary for XML (i.e. messages necessary for XML (i.e. 32K bytes)32K bytes)

Initiate transaction to server path Initiate transaction to server path and receive index.htmland receive index.html

Page 36: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3636

Example MakeoverExample MakeoverBefore and AfterBefore and After

Page 37: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3737

DemonstrationDemonstration

To demonstrate the system we can To demonstrate the system we can open some local sites: (Sorry Demos open some local sites: (Sorry Demos are not functional in this are not functional in this presentation)presentation)

WWCAS Presentation Services – LocalWWCAS Presentation Services – Local

WWCAS Programmer Contest ResultsWWCAS Programmer Contest Results

Page 38: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3838

Presentation ServicesPresentation Services

QuestionsQuestions??

Page 39: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 3939

Additional ReferencesAdditional References Apache (http://Apache (http://xml.apache.org/index.htmlxml.apache.org/index.html)) XML (http://www.w3.org/XML/)XML (http://www.w3.org/XML/) XML on TPF (http://www-306.ibm.com/software/htXML on TPF (http://www-306.ibm.com/software/ht

p/tpf/pubs/xml/xhome.htm)p/tpf/pubs/xml/xhome.htm) XML4C Parser (http://www-306.ibm.com/software/XML4C Parser (http://www-306.ibm.com/software/

htp/tpf/pubs/xml/xml4c/samples.html)htp/tpf/pubs/xml/xml4c/samples.html) Markup Languages (http://Markup Languages (http://

xml.coverpages.org/coreStandards.htmlxml.coverpages.org/coreStandards.html)) XSLT (http://XSLT (http://xml.coverpages.org/xsl.htmlxml.coverpages.org/xsl.html))

Page 40: Presentation Services at American Express A presentation for: TPG User Group May 17, 2004 by: by: John Rojewski john.rojewski@aexp.com

May, 2004May, 2004 American ExpressAmerican Express 4040

Presentation ServicesPresentation Services

Thank you for you time.Thank you for you time.

Please forward any comments and/or Please forward any comments and/or suggestions to:suggestions to:

[email protected]@aexp.com