Zope
  Home arrow Zope arrow Page 7 - DTML Basics (part 4)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Rational Software Development Conference
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ZOPE

DTML Basics (part 4)
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2002-07-17

    Table of Contents:
  • DTML Basics (part 4)
  • With Or Without You
  • A Polite Request
  • Let Me In
  • Climbing A Tree
  • The Real Thing
  • Call Of The Wild
  • The Writing On The Wall
  • Endzone

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    DTML Basics (part 4) - Call Of The Wild
    (Page 7 of 9 )

    DTML also offers a way to call other DTML methods from within your code, via the <dtml-call> construct. This comes in particularly handy when you want to invoke a method, but aren't really all that concerned about displaying the results of that method to the user - SQL queries are a prime example of this.

    Consider the following example, which demonstrates:

    <dtml-var standard_html_header> <dtml-call addMovieToCollection> <h1>Movie <dtml-var name> has been added to your DVD collection!</h1> <p><a href="listMovieCollection">List Movies in your Collection</a></p> <p><a href="addMovieForm">Add Movies</a></p> <dtml-var standard_html_footer>
    In this case, I've called the addMovieToCollection() Z-SQL method. This method adds a record to the table containing my DVD collection. However, since I don't really need to worry about the return value, I can use the <dtml-call> tag to invoke the Z-SQL method.

    Note also that I am not explicitly passing any parameters to the Z-SQL method. In this scenario, Zope take cares of extracting the required data from the REQUEST namespace and passing the parameters to the invoked method automatically. Isn't that neat?

    There is a caveat, though - invoke the same method in an expression, and your workload increases. Why? Because now it's up to you to pass the parameters to the method explicitly.

    More Zope Articles
    More By Harish Kamath, (c) Melonfire


     

       

    ZOPE ARTICLES

    - Creating Zope Products
    - Plone Content Types With Archetypes
    - Flat User Management in Zope
    - Creating Basic Zope Applications
    - Getting started with Zope for Linux and Sola...
    - ZPT Basics (part 4)
    - ZPT Basics (part 3)
    - ZPT Basics (part 2)
    - ZPT Basics (part 1)
    - Exception Handling In DTML
    - DTML Basics (part 4)
    - DTML Basics (part 3)
    - DTML Basics (part 2)
    - DTML Basics (part 1)
    - Using Zope With Apache

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway