Zope
  Home arrow Zope arrow Form Processing With Zope
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

Form Processing With Zope
By: Team Melonfire, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 11
    2002-02-26


    Table of Contents:
  • Form Processing With Zope
  • Driving Under The Influence
  • Stringing Things Along
  • Running On Empty
  • In The Raw
  • You've Got Mail!
  • Endgame

  • 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


    Form Processing With Zope
    ( Page 1 of 7 )

    Ever wondered how to create and process HTML forms in the Zope environment? Relax. It's simpler than you think.The thing about Zope is, everyone wants to use it, but most people don't know where to start.

    Take, for example, something as simple as building a feedback form. For a PHP or Perl developer, this is a doddle, requiring no more than a couple hours of development time (OK, OK, a little more if it requires complex validation or processing). Building a feedback form in PHP or Perl is neither scary or intimidating; in fact, it's one of the most fundamental things a Web developer needs to know to consider himself even reasonably proficient in the language.

    Put that same PHP or Perl developer on a Zope-based platform, however, and the sweat will really start trickling. Zope's object-oriented approach to everything tends to confuse even the most versatile PHP or Perl programmer, and you can expect that one hour to telescope into a couple of days, as our fearless programmer struggles to master the intricacies of Zope objects, variables and methods.

    In case you ever find yourself in this situation, you're going to be glad you found this article. Over the next few pages, I'm going to give you a broad overview of the process of building and processing Zope forms, demonstrating how simple and painless the process really is.

    I'll be assuming that you know the basics of Zope - variables, and the like - and that you have a Zope 2.50 system up and running. {mospagebreak title=Making New Friends} We'll start with something simple, a form with three fields and a form processor that displays the data entered into the form.

    The first step is to create a couple of DTML Document objects (via the Zope Management Interface, usually available at http://your_zope_server:8080/your_folder/manage) to represent these two items. I've called them Form and FormProcessor respectively; feel free to name them whatever you want.

    First, let's look at the Form object:

    <dtml-var standard_html_header> <form action="FormProcessor" method="POST"> Species: <br> <input name="species"> <p> Home planet: <br> <input name="planet"> <p> Distance (light years) from Earth: <br> <input name="distance"> <p> <input type="Submit" value="Beam Me Up, Scotty"> </form> <dtml-var standard_html_footer>
    This isn't very hard to read, even if you've never worked with Zope before. It's a standard HTML form, with DTML statements embedded within it (much like a PHP script, which has PHP commands embedded within the markup).

    If you have some familiarity with Zope, you'll already know about the HTML header and footer objects; they are generic objects that can be used to place a standard header and footer on every page. Enclosed within these is a regular HTML form, albeit one which references another DTML Document when submitted. This DTML Document is named FormProcessor, and it's going to handle the task of processing the data entered into the form by the user.

    <form action="FormProcessor" method="POST"> ... </form>
    Here's what the form looks like:



     
     
    >>> More Zope Articles          >>> More By Team Melonfire, (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 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek