
ForceReference
Components User's Guide
73
Complete Database Query Example
A complete Database Query component tag may look as follows:
ForceReference
The ForceReference component creates a deployment dependency between a HTML, ASP,
JSP, or PHP page and a particular file. The purpose of this component is to ensure that any
changes made to this file will result in the deployment of the HTML, ASP, JSP, or PHP page,
regardless of the nature of the changes.
Typical usage of this component would be:
To force Collage to monitor references that cannot be monitored via $CMAsset (for
example, a page using ASP code to dynamically generate the path to a file).
<nexus:component classid="nexus/components/DBQuery"
code="$nexusComponents"
datasource="/System/Data%20Sources/Company%20Database.nds"
queryfile="/System/Data%20Sources/emp_positions.sql"
layout="/System/WebSite/emp_details.htm">
<nexus:prelog>
<table cellpadding="6" cellspacing="0" bordercolor="#688AA6"
border="2">
<tr>
<td>Name</td>
<td>Position</td>
</tr>
</nexus:prelog>
<nexus:next>
<tr /jointfilesconvert/339554/bgcolor="#E4E4E4">
<td><a href="$node.detailsurl">$node.column("Name")
</a></td>
<td><i>$node.column("Position")</i></td>
</tr>
<nexus:exit>
<nexus:next>
<tr /jointfilesconvert/339554/bgcolor="#D3D3D3">
<td><a href="$node.detailsurl">$node.column("Name")
</a></td>
<td><i>$node.column("Position")</i></td>
</tr>
<nexus:exit>
<nexus:prolog>
</table>
</nexus:prolog>
</nexus:component>
Accesses the data
source specified
in the comp db.nds
file, and passes the
query defined by the
emp_positions.sql
file
Displays the values of
the
Name
and
Position
Columns, in the query
set
Uses the emp_details.htm
layout file to generate
details pages for any
rows that are linked with
the $node.detailsurl
macros
Links the value of the Name
column for the row to a
details page
Commenti su questo manuale