developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Developer Jobs

Be a Commerce Partner
Promotional Products
Home Improvement
Memory Upgrades
Promos and Premiums
Televisions
Disney World Tickets
Cell Phones
Promotional Pens
Corporate Gifts
Server Racks
Condos For Sale
Memory
Auto Insurance Quote
Online Shopping

 

Click Here
Related Article -
Modeling Content Types with Schemata
The Plone Content Management System
Developer News -
SaaS Tool Offers Custom Database Development    May 9, 2008
Microsoft’s Automated Agent: Can We Talk?    May 7, 2008
Borland Finally Sells CodeGear    May 7, 2008
Red Hat Heads For The JON 2.0    May 7, 2008
Free Tech Newsletter -

Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

Painting Web Applications
By Sean Kelly

Go to page: 1  2  3  Next  

One of the best features of the Plone Content Management System (CMS) is the fact that you can define content types easily by using the Archetypes schema language. With Archetypes, you list the attributes of a content type and it takes care of all the details of persisting objects to Plone's object database, displaying objects in a web page, and providing edit forms and validation for users to create and update objects. When such objects reflect the entities of a business process, you create a new web application using only the schema language. For more information on working with the Plone Content Management System see the first article in this series The Plone Content Management System

But, you can simplify things one step further by drawing a class diagram instead of using the schema language. You'll have a nearly full-fledged web application—writing zero lines of code.

Using UML

In the dark ages of object-oriented programming, developers could not communicate with each other because they were cursed and all spoke a different language—a different modeling language, that is. But, thanks to the Unified Modeling Language (UML), developers finally got a common diagramming lingua franca that enables them to share object oriented designs. Today, numerous tools let you draw UML diagrams and export those diagrams to code generation systems, metadata repositories, and more.

If you don't yet have a UML drawing tool, go ahead and download version 0.24 of ArgoUML. ArgoUML is free and open source software that works on Windows, Mac OS X, Linux, and a variety of other Java-capable platforms. The screen shots in this article all come from ArgoUML, so even you have another UML tool, you might want to use ArgoUML just to follow along.

You'll need one other tool: ArchGenXML. ArchGenXML is what bridges the UML model with Archetypes. For this article, you'll use version 1.5.2. Go ahead and install it, but keep that tool off to the side for right now. The first thing you need to do is prepare your class diagram. You're about to re-create the DVD catalog application from the last article, but this time by painting it instead of coding it.

Preparing Your Tool

When you first start ArgoUML, you'll be presented with a empty model with two diagrams ready to use: a class diagram and a use case diagram:

Ignore the use case diagram; you won't be using it. For now, click on the name of the model (untitledModel) on the left side and give it a proper name down in the "name" box in the "Properties" section that appears after you click it: DVDCollection.

Next, you'll need to set up definitions for tagged values. Tagged values are annotations you can apply to parts of your model. ArchGenXML looks for annotations that tell it how to generate certain parts of the Archetypes schema and class definitions. If you do a lot of modeling for Archetypes/Plone, you might even find it useful to create an otherwise empty model that has all the possible tagged value definitions already set up—thereby avoiding this tedious step in the future.

To add a new tag definition, make sure your model DVDCollection is selected in the left side, and the "Properties" section is showing at the bottom of the window. Click the "New Tag Definition" button, and then fill in its name. Click the "New Tag Definition" button again to create another one, and fill in its name. Repeat until you've entered tag definitions for all of the following tag names:

  • archetype_name
  • content_icon
  • index
  • multiValued
  • required
  • typeDescription
  • vocabulary
  • widget:description
  • widget:format
  • widget:label
  • widget

Painting Classes

In the last article, you defined—in code—a DVD class that represented a single DVD in your collection. Now, you'll paint that class. Click "Class Diagram 1" in the left-side of the window to make your one (and only) class diagram active. Now, click the "New Class" button in the toolbar:

Click anywhere on the canvas to place your new class. Down in the Properties section of the window, enter the name for the class: DVD. Provide some documentation that tells what the class represents, and then annotate that class with some tagged values.

Click the "Documentation" section. Here, you can fill in class-level details about the author and version number of the class (you can do this for the whole model as well). For now, just fill in a comment in the "Documentation" block, something like "A DVD represents a single DVD video in the collection." This text will appear in the tool-tip help when you finally generate the web application, so watch out for typos!

Next, click on the "Tagged Values" section. You'll now annotate the class using the some of the tag definitions you set up earlier. If you're using ArgoUML, the documentation you just entered has automatically appeared as one of your tagged values. You just need to add three more: content_icon to tell what icon to use on-screen to represent objects of the DVD type, archetype_name to specify the user-friendly name of the type, and typeDescription to provide an on-screen description of the type (similar to way the documentation is used to show a tool-tip for the type, and, in fact, should almost always be the same text).

To add a tagged value, click in the blank area under the "Tag" column. A menu will appear with your tag definitions; click to select one. Then, click to the right of that tag and enter the value as text. The following screen shot shows how the tagged values for the DVD class should be set up:

Go to page: 1  2  3  Next  

Previous article: Modeling Content Types with Schemata


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Architecture & Design Archives

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation
Learn about expanding business opportunities for the reseller channel. Visit IT Channel Planet.
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Whitepaper: Embeddable Content Platform for OEM's



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES