Interacting with an external program

 This is an advanced topic  for site bulders and the site administrator.

Background:

There are two ways to extend the Content Management System.  This explains the first: interacting with external programs (the second involves purpose built extensions using |.linkins:...| tag).  In general you will need to contact CyberStrategies technical support for some special back end code to work with what you produce although it is possible to use a program on a separate server.   There needs to be an agreement between the page builder and the back-end program designer as to what will the names and functions variables passed back and forth.   The system supports calling any external program and either returning to the calling page or a special designated page upon success.   Basically three elements are needed: a content page with an embedded web form, a purpose built external program that the form calls and a return page.  If the form  exists on several pages there should also be a hidden page which will be used to display errors and request the visitor correct them.

Information Flow

  • Visitor enters information in the embedded form and hits the "Submit" button (or its equivalent).
  • The purpose built program notes the calling page's address and process the information. 
    • If the form is filled out successfully the program will perform the desired action.  This may include setting a session cookie, effectively authorizing the visitor.  It will either then return to the calling page or a designated page (whose page ID is hard coded into the program).
    • If the form contains an error, the error(s) are described in a variable ErrorMessage as well as the information passed entered to either a designated page (again the page ID is hard coded into the program) or the calling page.  Note: only text strings can be passed back.  The ErrorMessage can contain any combination of letters, numbers and the following special characters: at sign, less than, greater than open/close square brackets, period, comma, parentheses, exclamation point, the dollar sign, forward slash, apostrophe, equal sign, question mark and minus sign.  Note: New lines are not allowed, but the HTML "break" is permitted. 

TOP↑

Tags

  • As is described elsewhere, there is a general class of tags in the form |.f: whatever.| which the system converts to html tags in the form of < whatever >
  • Assuming the external program is at "/cgi-bin/signin.pl"  then begin with ||.f:form method="post" action="/cgi-bin/signin.pl".|
  • If you want the send in your access code using the variable AccessCode then include |.f:Input Type="text" Name="AccessCode" value="|.passBack:AccessCode.|".|  As of this writing this is the only case where a tag can directly contain another tag.   Note: there can be multiple  |.passBack:whatever.| tags with either different "whatever"'s  However, there can be no embedded spaces in the name and by convention the value in the Name="..." should be the same as the corresponding passBack.
  • On the page that displays the error message and requests the visitor to correct their mistake either a  |.rtnTaget:Post.| or ?rtnTarget=|.rtnTarget:Get.| is required. The former generates a "hidden" form variable.   The GET form can be included in a |.f:form tag
  • Don't forget the Submit button and to end the form: |.f:Input type="Submit" value="Sign Me In".| and |.f:/form.|
  • Somewhere on the page you need to have a tag to display any errors |.ErrorMessage.|  This will be imbedded in a DIV with an ID='ErrorMessage'.
  • While there can be multiple forms embedded on the page there can be only on |.ErrorMessage.| tag.

Sample: The following sample takes whatever is entered and redisplays it as the Error message.

Enter Error Message

Called from

TOP↑

 

This background is for site bulders and the site administrator.