internet solutions
 

 
Home

     Internet Solutions
          About DELECis
          Products
               PReP
                    Demonstration
                    Manual
               Scheduler
               Build-2-Order
               Gateway
               Online Stores
          Contact

     Hardware Guide

     Company Information

     Download

PReP Manual
    This manual describes the basics of PReP and all the existing PreP tags. An extended manual explaining the tags for the online store is located in "Online Stores / ABACUS Store / Manual"
     Index
     Overview

          About

    Documents on the WorldWideWeb are frequently changed an so is their style. Some Webmasters feel a strong need for a tool that allows you to easily change layout features on a whole WebSite, eg change the template and have do all changes necessary on all pages. Also, CGI Programming leads most of the time to a 'not so good' result, as programmers do put the HTML code for the page into their CGI-Sourcecode. This leads to an unstructured, hard to understand, program and you have to care about two syntaxes. A change in the design forces a recompile of the CGI-Script.
    There are a few ways to face this problem, such as the Microsoft ASP. But the ASP generates every single page at ever request again. This means an additional and heavy server load.

    PReP has been designed to face some of this issues. It exists as a CGI-Application and an executable file for Windows95 and WindowsNT.
    Most of the DELEC (is) software components for the WorldWideWeb are built on the PRePCore, the basic PReP Environment.

    Future plans are a Java integration of the PRePCore. This would make PReP more dynamically flexible and would allow to distrivute the PRePCore more easily.

          Current State
    Currently, PReP is used in the following DELEC products:

    • DOC - DELEC Online Catalog
    • NewsFlash - a tool to spice up your website
    • Build2Order - easy environment to put a build to order application on the Internet
    • Toys -

    All Programs mentioned before are built on the PRePCore, a library of C++ classes that handle the main functionality of PReP and are extended by a set of classes specific to the application itself such as connection to a database.
    DOC uses as a store for all the pages and the layout of the pages. It controls the appearance and puts together the pages derived from PReP Tags.
    NewsFlash and Build2Order use PReP as a preprocessor for the pages and integrate the functionality fully into extended tags. This makes it easier to design the pages, while DOC is a more strict design.

          Basic Introduction
    The document you are reading has been created with PReP. The following links point to the same document but with another design or in another language with the same design.
    • design 1 index.e.prep style.prep
    • design 1 index.d.prep style.prep
    • design 2 index.e.prep style2.prep
    • design 2 index.d.prep style2.prep

          Commandline Execution
    The following commandline syntax is used to execute PReP in a shell:
    prep input1 [input2 [... [inputN]]] output
    
    where input1..inputN is a prep file containing tags and the output file is the target file.

    Preprocessing starts w4ith the tag.

          Input Files
    There are two sections in an input file. The first section is the list of all include files integrated into this file and the second section contains all the tags. I first describe the tags as the include files are less important.
          Tags
    A tag is what PReP is all about. Every line in a PReP document that starts with a * (star) defines a new tag. The characters following the star are used to identify a tag. Useing curley brackets '' within a text of a tag forces PReP to insert the appropriate tag. An example:
    	*__TEMPLATE__
    	{HEADER}
    	{MAIN}
    	{FOOTER}
    
    	*HEADER
    		this is the header
    
    	*MAIN
    		this is the main part of the document
    
    	*FOOTER
    		this is the footer
    
    
    When the above PReP file is compiled the following output will result:
    		this is the header
    		this is the main part of the document
    		this is the footer
    
          Arguments
    PReP allows to pass arguments with a tag call. The format is defined as follows:

    ''

    The arguments are passed as PReP tag themself and may be used within the tag again. The names are ARG1..ARGn.

    	*__TEMPLATE__
    	{HEADER::{AUTHOR}}
    	{MAIN}
    	{FOOTER}
    
    	*HEADER
    		this is the header and the document has been created by {ARG1}.
    		We would get the same result by useign the AUTHOR tag directly.
    		{AUTHOR}
    
    	*MAIN
    		this is the main part of the document
    
    	*FOOTER
    		this is the footer
    
    	*AUTHOR
    		rr
    
    
    the result after compilation would be:
    		this is the header and the document has been created by RR.
    		We would get the same result by useign the AUTHOR tag directly.
    		RR
    		this is the main part of the document
    		this is the footer
    
          Tag overwriting
    PReP files may contain several tags with the same name. The tag that is defined latest will be used. This is very useful with include files.
          Include Files
    PReP is able to include a set of files before compiling the actual PReP file. This allows to define a global design for all pages on the server and then write just a main tag that contains the information on the page. When used as a CGI application the include files are extended to handle user levels. This allows to provide different designs and functionality on the server according to a user level. All lines starting with a # (pound) sign as the first character on the line are treated as path and filenames to an include file.

    Example:

    	#w:\toys\style.prep
    
    Note: No whitespaces are allowed before the pound sign.
          Comments
    Comments start with a double @ sign everywhere in the text. All text on the line after this sign is not displayed in the final output. Example
    @ @ this is a document test 
    @ @ it has been added to provide info to blabla.
    
     Tags

          DEF

    Syntax {DEF::tagNAME::textNEW}
    Description Defines an existing tag with a new value.
    tagNAME The name of the tag. No curly brackets. Case sensitive.
    textNEW The new value you want to assign to the tag.
    Example *DEBUG
    true
    (some other stuff)
    {DEF::DEBUG::false}
          EXEC
    Syntax {EXEC::textCOMMAND_LINE::textFILE::textSUCCESS::textFAILURE}
    Description The EXEC tag executes a program on the machine where the webserver is located.
    textCOMMAND_LINE The name of the program you want to execute. Include all arguments to pass to the executable. Use "%1" for the file name you create with the FILE parameter.
    textFILE This is the tag used to create a file. All prep tags are allowed. This file is just temporary.
    textSUCCESS This tag is called if the execution if the program has been successful.
    textFAILURE If the program called by EXEC can not be executed this tag will be used to form output.
    Example Assume you have a program to send emails called "mail" and the parameters for "mail" are formed as follows:
    mail -p"message_as_textfile,recipient_address,mailserver,subject,sender"
    The PReP code should look as follows:
    {EXEC::{MAIL}::{MESSAGE}::Mail sent::Mail failed}
    *MAIL
    mail -p"%1,sales@delec.com,mail.delec.com,Online order,Steve@hotmail.com"
    *MESSAGE
    Hi, this is my order for a Compaq Proliant 7000. Sincerely, Steve
    {Myorder}
          IF
    Syntax {IF::tagNAME::textVALUE::textTHEN[::textELSE]}
    Description Checks whether or not a case occurred.
    tagNAME The name of the tag you want to compare with a value.
    textVALUE The value you compare the tag with.
    textTHEN The text or tag you want to call if TAG is equal to VALUE.
    textELSE This is called if the case does not occur. Optional, you can drop this argument.
    Example *SHOWMSG
    yes
    {IF::SHOWMSG::yes::{INFO}}
    *INFO
    Show this information.
    Output Show this information.
          IFDEF
    Syntax {IFDEF::tagNAME::textTHEN[::textELSE]}
    Description Checks whether or not a tag is defined.
    tagNAME The name of the tag you want to check.
    textTHEN The text or tag you want to call if TAG exists.
    textELSE This is called if the tag is not defined. Optional, you can drop this argument.
    Example *DEBUG
    {IFDEF::DEBUG::{INFO}::Not debugging}
    *INFO
    We are debugging
    Output We are debugging
          DATE
    Syntax {DATE}
    Description Prints the actual date.
    Example Last modification: {DATE}
    Output Last modification: June 19, 1998

[top of page] [home] [doc] [search] [comments]
this is a page built and maintained with PReP
last build: June 19, 1998 author: rg