----- Original Message -----
From: "Peter M. Jansson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 2:52 PM
Subject: Re: [AOLSERVER] adp parsers and aolserver 4.0
> Grrr. I'm doing exactly those kinds of things. Here's an example:
>
> In adp_recall.tcl:
>
> ns_register_adptag "dnr_remember" "/dnr_remember" dnr_adp_remember
> proc dnr_adp_remember {input tagset} {
> global _dnr_adp_memory
> set tagname [ns_set iget $tagset name]
> if {[string length $tagname]} {
> set _dnr_adp_memory($tagname) $input
> return ""
> } else {
> return $input
> }
> }
> proc dnr_adp_recall {name} {
> global _dnr_adp_memory
> if [info exists _dnr_adp_memory($name)] {
> set parsecommand [list ns_adp_parse -string -local]
> lappend parsecommand $_dnr_adp_memory($name)
> ns_puts -nonewline [uplevel $parsecommand]
> } else {
> ns_log Error "[ns_adp_argv 0]: Unable to recall adp
> fragment \"$name\""
> }
> }
>
> Then, I can do things like this, which is a conditional without an
> include, and which is WYSIWYG-friendly:
>
> <dnr_remember name="login_failure">
> We were unable to complete your login. Please try again.
> </dnr_remember>
> <% if $login_failure { dnr_adp_recall login_failure } %>
>
> Or this, which is repeated content:
>
> <p>Nameservers:
> <dnr_remember name="nameserver">
> <br>
> <a href="host.adp?host=<%=[dnr_host
> host_fqdn $ns]%>"><%=[dnr_host host_fqdn $ns]%></a>
> </dnr_remember>
> <dnr_remember name="address">
> <br>
> <%=$address%>
> </dnr_remember>
> <%
> foreach ns [lsort -command dnr_host_compare_by_fqdn $ns_ids] {
> dnr_adp_recall nameserver
> foreach address [lsort $host_addrs($ns)] {
> dnr_adp_recall address
> }
> }
> %>
>
>
> On Mon, 20 Jan 2003, Patrick Spence wrote:
>
> > Except the parser writing would happen once, whereas the HTML coding is
an
> > ongoing thing... :)
>
> Not sure what your point was here.
If it takes some work once to elimitate some work many times, why not do
that work once and save all that extra work later on?
> > Dreamweaver has some really nice dynamic application
> > extensions that make work like this to be fast and easy to work with.
>
> Yes, my approach doesn't have dreamweaver extensions to support it (yet),
> but...
:) neither does mine in TCL, thats why I am using PHP.
> > This doesn't really lend itself to prepare the variable and display it
> > later...
>
> I think this method lends itself to dynamic work just fine. Try it before
> you DOA it.
Oh I will give it a shot.. :) just have to see what I can work with.. I
intend to try (I stress try here) to make a tcl/aolserver extension for
Dreamweaver just so I have that option if I don't want to use PHP on a
project.