An Object Database Web Implementation in Jasmine

Two Example HTML Weblink Templates


Note how Jasmine database objects are replaced in the HTML code using simple 2nd-tier (Weblink) tags. All Jasmine database access is done using Jasmine object database encapsulated methods on whatever object is currently active for a particular HTML page. Weblink can pass an Object-ID from one HTML template page to another.

The Products List HTML Template - a simple example

<!DO "defaultCF sabreCF">

<HTML>
<BODY>

	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
		<TR>
			<TD><IMG SRC="/Sabre/images/ca_logo1.gif" ALT="Computer Associates Logo" BORDER="0" WIDTH="140" HEIGHT="44"></TD>
			<TD><IMG SRC="/Sabre/images/productsOn.gif" ALT="Products" BORDER="0"></TD>
		</TR>
	</TABLE>

	<HR>

	<!VAR "Product set" PS>
	<!VAR "Product" P>
	<!VAR Boolean noProduct>
	<!DO "PS = Product.getProducts ()">
	<UL>
		<!FOREACH PS P>
			<!DO "noProduct = P.empty ()">
			<!IF "noProduct == FALSE">
				<LI><A HREF=/cgi-bin/odb-get.exe?WIT_template=displayProduct&WIT_oid=<!REPLACE P> TARGET="main"><!REPLACE P.name></A>
 			<!ELSE>
				<LI><!REPLACE P.name>
			<!/IF>
		<!/FOREACH>
	</UL>

	<HR>

</BODY>
</HTML>

The Products HTML Template - a more complex example

<!DO "defaultCF sabreCF">

<HTML>
<BODY>

	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
		<TR>
			<TD><IMG SRC="/Sabre/images/ca_logo1.gif" ALT="Computer Associates Logo" BORDER="0" WIDTH="140" HEIGHT="44"></TD>

			<TD VALIGN="center">
				<!VAR String S>
				<!DO "S = self.getManagementType ();">
				<!IF "S == \"Information Management\"">
					<IMG SRC="/Sabre/images/InformationManagement.gif" ALT=<!REPLACE S>>
				<!/IF>
				<!IF "S == \"Enterprise Management\"">
					<IMG SRC="/Sabre/images/EnterpriseManagement.gif" ALT=<!REPLACE S>>
				<!/IF>
			</TD>

			<!IF "self.logo != NIL">
				<TD><IMG SRC=<!MEDIA self.logo image/gif> ALT=<!REPLACE self.name> BORDER="0"></TD>
			<!ELSE>
				<TD ALIGN="center"><FONT COLOR="blue" FACE="arial" SIZE="4"><B><I><!REPLACE self.name></I></B></FONT></TD>
			<!/IF>
		</TR>
	</TABLE>

	<HR>

	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="5">
		<TR>
			<!IF "self.picture != NIL">
				<TD VALIGN="top"><IMG SRC=<!MEDIA self.picture image/gif> ALT=<!REPLACE self.name>></TD>
			<!/IF>
			<TD>
				<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="5">
					<TR><TD VALIGN="top"><FONT FACE="Arial" SIZE="2" COLOR="#00AA77"><B><I><!REPLACE self.caption>™</I></B></FONT></TD></TR>
					<TR><TD VALIGN="top"><P><FONT FACE="Arial" SIZE="2"><!REPLACE self.quote></FONT></P></TD></TR>
				</TABLE>
			</TD>
		</TR>
	</TABLE>

	<!IF "self.str != NIL">
		<HR>
		<!VAR "String set" SS>
		<!VAR String S>
		<!DO "SS = self.getText (self.str.bodyfile);">
		<!FOREACH SS S>
			<!REPLACE S><BR>
		<!/FOREACH>
	<!/IF>

	<!IF "self.version != \"\"">
		<HR>
		<B>Version : </B><I><!REPLACE self.version></I>
	<!/IF>

	<!VAR "Flavor" F>
	<!VAR "Division" I>
	<!VAR "Demo" E>
	<!VAR Boolean noFlavor>
	<!VAR Boolean noDivision>
	<!VAR String noDemo>
	<!VAR Boolean noFlavors>
	<!VAR Boolean noDivisions>
	<!VAR Boolean noDemos>
	<!DO "noFlavors = self.noFlavors ()">
	<!DO "noDivisions = self.noDivisions ()">
	<!DO "noDemos = self.noDemos ()">

	<!IF "noFlavors == FALSE or noDivisions == FALSE or noDemos == FALSE">

		<HR>

		<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="5">

			<TR VALIGN="top">
		
				<TD NOWRAP>
					<!IF "noFlavors == FALSE">
						<FONT COLOR="#00AA77" SIZE="4"><B><I>Flavor</I></B></FONT><BR>
						<UL>
							<!FOREACH self.flavors F>
								<!DO "noFlavor = F.empty ()">
								<!IF "noFlavor == FALSE">
									<LI><A HREF=/cgi-bin/odb-get.exe?WIT_template=displayProduct&WIT_oid=<!REPLACE F> TARGET="main"><!REPLACE F.name></A>
								<!ELSE>
									<LI><!REPLACE F.name>
								<!/IF>
							<!/FOREACH>
						</UL>
					<!/IF>
				</TD>
	
				<TD NOWRAP>
					<!IF "noDivisions == FALSE">
						<FONT COLOR="#00AA77" SIZE="4"><B><I>Division</I></B></FONT><BR>
						<UL>
							<!FOREACH self.divisions I>
								<!DO "noDivision = I.empty ()">
								<!IF "noDivision == FALSE">
									<LI><A HREF=/cgi-bin/odb-get.exe?WIT_template=displayDivision&WIT_oid=<!REPLACE self>&divisionName=<!REPLACE I.name STYLE="LITERAL"> TARGET="main"><<!REPLACE I.name></A>
								<!ELSE>
									<LI><!REPLACE I.name>
								<!/IF>
							<!/FOREACH>
						</UL>
					<!/IF>
				</TD>

				<TD NOWRAP>
					<!IF "noDemos == FALSE">
						<FONT COLOR="#00AA77" SIZE="4"><Bv<I>Demo</I></B></FONT><BR>
						<UL>
							<!FOREACH self.demos E>
								<!DO "noDemo = E.mediaType ()">
								<!IF "noDemo == \"Video\"">
									<LI><A HREF=/cgi-bin/odb-get.exe?WIT_template=displayVideo&WIT_oid=<!REPLACE E.video> TARGET="main"><!REPLACE E.video.name></A>
								<!ELSE>
									<!IF "noDemo == \"Audio\"">
										<LI><A HREF=/cgi-bin/odb-get.exe?WIT_template=displaySound&WIT_oid=<!REPLACE E.audio> TARGET="main"><!REPLACE E.audio.name></A>
									<!ELSE>
										<LI><!REPLACE E.name>
									<!/IF>
								<!/IF>
							<!/FOREACH>
						</UL>
					<!/IF>
				</TD>

			</TR>

		</TABLE>

	<!/IF>

	<HR>

</BODY>
</HTML>