Extending Disco

Don't waste time and money building your own template processor, just because Disco doesn't have all the wish list of features that you want. Unlike most competing web drivers, Disco offers many different ways to extend the functionality of the core system:

This page is most concerned with the Disco Tag Extension method. All you will need to extend the functionality of Disco and create your own tags, is a freely downloadable Java development kit from Sun.com. However, we suggest using an integrated development environment (IDE) such as Visual Cafe from Symantic.

All existing disco tags are based on this extension model, so there is no limitation to the power. With an extended disco tag, you can:

  • Access tag parameters, optionally having processed any variables contained within them.
  • Optionally define an end tag andthus a content area.
  • Retrieve or ignore the raw content area of your tag.
  • Process the content area for variables and other tags, once or multiple times.
  • Nest your own tags, and recurse for other tags.
  • Define your own aliases for tags, and limit access to these at the configuration level.
  • Create new temporary or page variables.
  • Access configuration variables.
  • Access the HTTP request/response objects directly.
  • Share Java objects between tags. Allows communication between different tags on the same page.
  • Call your own classes and external modules to implement whatever you want. Not all tags need be generic.
  • Cancel page generation, returning your own complete output or redirect to a new url.

How do we do it. The simplist way is to show you. Here is the super secret source code for the disco Loop tag. Feel free to modify this code, and reconfigure Disco to use your new version.



Not too difficult, or hard to understand, we think you would agree. Any Java or C programmer should definitely understand whats going on there. And you don't have to worry about all the tricky parts of template processing. Just make your new tags and use them in your templates.

Click here for more detailed information

Win a free Disco license !

If you develop any interesting and useful tags, then please send them to us. If any of your tags are included with future Disco releases, then you will be entitled to one free Disco user license. Not to mention you will be helping build a more useful product for all the other Disco users out there.

 

Copyright © Reuben Jackson 2000