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

 
Developer Updates  
Free Website Content 
 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? 
Google.com  
ZOPE

DTML Basics (part 4)
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    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





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek