create new tag
view all tags

Generating HTML from APPX

This section deals with different ways of getting APPX data into a format that can be displayed using a web browser. Several methods are discussed here. There are other obvious methods you can use, but these seem the most straightforward.

Basic Output from APPX

The most basic method of getting information out of APPX and into a Web Browser is just to dump an existing APPX report to a data file and add two lines to the start of the file. The first line contains special text and the second line MUST be blank:

Content-type: text/plain

When this is picked up by the server and sent to the browser, the browser will display the text of the report in a fixed-space font without any special formatting considerations. Not very attractive, but does it give a printed report to the browser to display.

Using APPX to Generate Real HTML

If you study the structure of the HTML language closely, you may notice that it follows a hierarchy very similar to the structure of an APPX output process family. It is broken down into many levels of nested sections. Some sections contain lists of child data. An APPX output process makes a nicely structured tool for building application/data sensitive web pages. Let's start with an example. Figure 1 shows a web page that was generated using an APPX output process family.

Figure 1: Sample Web Document

This page has a definite structure. There is a Page Heading section, some Body Text, a List of news articles, and a Page Footer. This format has a pretty direct relationship to an APPX process family. Let's now look at the HTML code behind the page. I have inserted lines into the HTML code to mark the APPX output process and frame that generated the section of the document. This document was generated using a two level output process family. The HTML code was literally typed onto the output images along with APPX data fields to fill in the variable data contained within the tags and text. A query was used to constrain the lower level APPX data records from the NEWS file to just current articles. So, as the NEWS file changes and article get outdated, they will automatically appear and drop off this page.

---------------[ APPX HOME PAGE      (PAGE-START) (100) ]---------------
  <TITLE>APPX Welcome Page</TITLE>
 <BODY BACKGROUND="grayback.jpg">
   <IMG SRC=/appx1.gif>
   <H1>APPX Software, Inc.</H1>
   <A HREF="/prodinfo.html"      ><IMG SRC=/bb-pi.jpg   BORDER=0></A>
   <A HREF="/migrate.html "      ><IMG SRC=/bb-sm.jpg   BORDER=0></A> 
   <A HREF="/certcons.html"      ><IMG SRC=/bb-cc.jpg   BORDER=0></A>
   <A HREF="/vars.html"          ><IMG SRC=/bb-vr.jpg   BORDER=0></A><BR>
   <A HREF="/newsarch.html"      ><IMG SRC=/bb-na.jpg   BORDER=0></A>
   <A HREF="/custsupp.html"      ><IMG SRC=/bb-cs.jpg   BORDER=0></A>
   <A HREF=""                    ><IMG SRC=/bb-fill.jpg BORDER=0></A>
   <A HREF="mailto:info@appx.com"><IMG SRC=/bb-cu.jpg   BORDER=0></A>
---------------[ APPX HOME PAGE      (RECORD    ) (100) ]---------------
Welcome to APPX Software! Our primary product is a multi-platform Rapid
Application Development environment and database specifically designed
to solve business problems.  Applications can be developed in a
fraction of the time required using other languages and can change and
evolve as rapidly as your business changes.  We also offer a suite of
business applications already developed using our 4GL, ready to
install and adjust to fit your specific business needs.
---------------[ APPX NEWS TITLES    (RECORD    ) (100) ]---------------
<IMG SRC=/Images/new-bang.gif  ALIGN=left><EM>( July 1996 )        </EM>
<b><i>powerQ</i></b> Release 2.0 is now available for download!  This
release includes many of the new features that you requested.  All
North American APPX customers that purchased a prior version of
<b><i>powerQ</i></b> may download the new release from our <a
href=/powerq-20.html> <b><i>powerQ</i></b> 2.0 </a> Web site free of
<BR CLEAR=left>
---------------[ APPX NEWS TITLES    (RECORD    ) (100) ]---------------
<IMG SRC=/x-31.gif             ALIGN=left><EM>( May 1996 )         </EM>
APPX Release 3.1 is now released!  All North American APPX customers with
a current support contract can download the release directly from our 
<A HREF="/rel31.html">APPX Release 3.1</A> web page.  This release 
includes a graphical client/server interface, expanded database support, 
and selected bug fixes.
<BR CLEAR=left>
---------------[ APPX NEWS TITLES    (RECORD    ) (100) ]---------------
<IMG SRC=/news3.gif            ALIGN=left><EM>( April 1996 )       </EM>
APPX announces APPX/Web Customer Support application.  In the first phase
of this project, we have made our internal support system available to
current certified consults using a Netscape interface.  Interested
certified consultants can contact 
<A HREF="mailto:tom@appx.com">Tom Jamerson</A> for access instructions and
<BR CLEAR=left>
---------------[ APPX HOME PAGE      (RECORD    ) (200) ]---------------
<EM>These Subjects included for Internet Subject Search: APPX, 
SPEED II, Relational Database, Wang, migration, Oracle, 
Sybase, ODBC, Access, Open Systems, Database
Independent, web enabled, Internet connectivity, 
Tom Software (formerly known as), Kennedy and Associates
(formerly known as) </EM>
---------------[ APPX HOME PAGE      (PAGE-END  ) (100) ]---------------
<img src=PowByAppx.jpg align=left>
For more information about APPX products please contact us at
<A HREF="mailto:info@appx.com">info@appx.com</A>
or call us at 1-800 TRY APPX (879-2779)

The primary output process is not PCF driven. The second (NEWS) process executes the frame to display the news heading once for each news article selected. The graphic and the date are field from the news file. The tags around them are literals typed on the output image. The text of the heading is contained in a text field in the news file. So, this part of the page is completely data-driven.

The APPX output process gives us a lot of control over custom document generation. We could have also used alternate images, and bypassed images completely if we wanted to hide certain sections based on some security or data-driven rules.

Another technique being used here is the suppression of intermediate page-breaks. It would be very ugly if APPX decided to do a page-break in the middle of our document. This would include another document header in the middle of our page. We blocked this by defining a special FORM in System Administration. This form has a form length of zero lines. This is a trigger to APPX that we want one continuous page with only One page heading and One page footer.

To use this process, we have it automatically run in the evening, copy the resulting file over to our web server directory, and change the filename to index.html from whatever the print file name was. This is a simple process and does not take any communication between APPX and the server.

-- JoeOrtagus - 2012-02-13

Topic revision: r1 - 2012-02-13 - JoeOrtagus
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback