invalid command name "ns_adp_include"
    while executing
"ns_adp_include header.adp "
    invoked from within chunk: 2 of adp: /home/dvr/web/dvr/cmd/intro.adp

This book is about designing and coding Content Management Systems from scratch. It covers revisioning, permissions, workflow, and templates, and by the time you've reached the end, you should be able to write your own enterprise-strength CMS from the ground up, or at least have a better appreciation of the issues involved.

If you're in need of a CMS, the first question is "Should I buy one or write my own?" There are many CMS products on the market, each offering different features, some filling specific niches and some claiming to be general enough to solve anyone's CM problem. But this doesn't guarantee you'll find a product that fits your needs, and it's not always the case that starting with an existing CMS and modifying it to fit your needs will be faster than writing your own.

The core of the problem is the choice facing software companies selling CMSes. It's impossible to write a product that will work out-of-the-box for most people -- there is no CMS equivalent of Microsoft Word. Each CMS vendor decides what type of CMS product they're going to write.

The first option is to target a specific market niche. For example, a software company could team with a law firm and try to build the world's finest document management system for lawyers. The market would be relatively small (at least small compared to the entire CM market), but the needs of each law firm would be similar enough to make possible a product that satisfies most law firms' needs with little or no customization. The goal would be great out-of-the-box functionality -- they install it from a CD and it just works.

The second option is the toolkit approach -- the product doesn't do much out-of-box, but with customization can be made to do almost anything. If you choose one of these products, you need to budget time and resources for the customization phase, often paying consultants from the vendor to explain how it really works. If there isn't a good match between your needs and the product's base features, or if your needs are complicated, the amount of programmer time needed for customization might be measured in man-years.

With either type of CMS product, the quality of fit is determined partially by your IT infrastructure. If you have standardized on, for example, Unix, Oracle, and Java, it makes sense to rule out all Windows-based CMSes.

If you choose a toolkit-style product, you should be sure the CMS is written in a language known by your programmers, or one that can be learned easily. If your staff does all its programming in C, you should restrict your choices to products that have full C interfaces.

If you have existing products that need to integrate with the CMS, you want to know the two products can coexist peacefully. For example, if you want your CMS and ecommerce product to share the same user information, but they use different databases, you have a problem.

Writing a custom CMS has a few advantages:

Writing your own CMS isn't always the right choice, but if you understand the issues involved and have a firm grasp of your requirements, it's easier than most people assume.

About the code

The code samples use Oracle and PHP. PHP was picked because it's simple, highly readable, and has good performance. One of its virtues is its small size; if you're an experienced developer, you can pick it up in an afternoon. It lacks the heavy-duty features of languages like Java, but since the application built in these chapters has its logic encapsulated in the database, PHP's role is small -- mostly passing values to and from the database, and generating some HTML. PHP is well-suited for this.

If there's a prerequisite for this book, it would be a strong understanding of relational databases. The heart of this application is in the database -- the tables define what the system is capable of doing, and the views and stored procedures contain the system's rules.

invalid command name "ns_adp_include"
    while executing
"ns_adp_include footer.adp "
    invoked from within chunk: 3 of adp: /home/dvr/web/dvr/cmd/intro.adp