Not many people know this, but I am a published comic book author. In 1997, I co-wrote a series for Caliber comics titled “Technopolis” with my good friend Adrie Van Viersen who is – to say the least – an exceptional artist. Adrie has since gone on to do a lot of work on some movies you’ve seen, for example, a little movie called “X-Men 2”.

 

I’m obsessed with the X-Men. Not in an unhealthy-I’ve-got-Wolverine-tattooed-on-my-neck sort of way, but back when I was an impressionable young lad in the late 70’s I’m proud to say that I purchased, read, re-read, lost, found, re-read, and then lost again some comic books that would be very expensive today. I’m not bitter though. Let’s just say when I’m browsing certain sections on eBay that my intestines spontaneously arrange themselves into a monkey knot and leave it at that.

 

Where am I going with this? In the X-Men comics, the X-Men travel through space and time by means of a mutant named Gateway. Gateway lives in the Australian desert and he generates a wormhole portal for the X-Men by swinging his bullroarer to rip apart the very threads that make up the fabric of the universe as we know it. Therefore, portals are in X-Men comics so they MUST be cool. Right?

 

If you’ve visited a major web site in the recent past, you’ve seen what are commonly referred to as portals. I won’t dwell on the subject of what a portal is, but go to Amazon.com or Yahoo.com and take a look. The basic idea is the “portal” page contains links to pages with related content – sort of like a table of contents.

 

We construct portals in the LonghornSDK to organize the massive amounts of information stored within. There are two types of portal pages: authored portal pages and dynamically generated portal pages. The authored pages are created by, you guessed it, authors – here’s an example of one. The dynamically generated pages are conjured up during our documentation build with no authoring interaction.

 

The process of creating the dynamic portal pages is interesting, and I’ll go into that later. For now, I’ll go over how the authored portal pages work. Let’s assume we’re building a website to showcase our favorite breakfast foods, and it consists of five xml pages (assume these pages will be transformed to HTML using XSLT).

 

<topic id=”capncrunch”>

            <title>Cap’n Crunch</title>

            <abstract>The Cap’n is the king of breakfast cereals. It’s crunchy and sweet. The best of both worlds.</abstract>

            <metadata>

                        <data name=”texture” value=”crunchy”/>

                        <data name=”sweetness” value=”high”/>

            </metadata>

            <content><!-- witty stuff goes here --></content>

</topic>

 

<topic id=”grapenuts”>

            <title>Grape Nuts</title>

            <abstract>It’s crunchy and tasty, and best of all – it’s good for you!</abstract>

            <metadata>

                        <data name=”texture” value=”crunchy”/>

                        <data name=”sweetness” value=”low”/>

                        <data name=”healthy” value=”yes”/>

            </metadata>

            <content><!-- witty stuff goes here --></content>

</topic>

 

<topic id=”oatmeal”>

            <title>Oatmeal</title>

            <abstract>It’s like your mouth is on vacation – in Scotland!</abstract>

            <metadata>

                        <data name=”texture” value=”soft”/>

                        <data name=”sweetness” value=”low”/>

                        <data name=”healthy” value=”yes”/>

            </metadata>

            <content><!-- witty stuff goes here --></content>

</topic>

 

<topic id=”poptarts”>

            <title>Pop Tarts</title>

            <abstract>It’s a cornucopia of tasty fillings surrounded by wonderful sweet pastry. It’s nature’s perfect food.</abstract>

            <metadata>

                        <data name=”texture” value=”soft”/>

                        <data name=”sweetness” value=”high”/>

            </metadata>

            <content><!-- witty stuff goes here --></content>

</topic>

 

<topic id=”granola”>

            <title>Granola</title>

            <abstract>A synonym for ‘hippie’ no more! High in fiber, crunchy, and sweet! It’s good for you, in theory at least.</abstract>

            <metadata>

                        <data name=”texture” value=”crunchy”/>

                        <data name=”sweetness” value=”high”/>

                        <data name=”healthy” value=”yes”/>

            </metadata>

            <content><!-- witty stuff goes here --></content>

</topic>

 

Now let’s move on to creating the main entry page for our portal. This will be the first page visitors to our web site will see.

 

<topic id=”main”>

            <title>Peter Taylor’s Cavalcade of Breakfast Treats</title>

            <metadata/>

            <abstract>Peter Taylor eats breakfast every day, so he should know what’s good.</abstract>

            <content>

                        <p>Like breakfast? Me too!</p>

                        <group>

                                    <p>Want something crunchy and sweet? How about these?</p>

                                    <query reference_id=”crunchy_and_sweet”/>

                        </group>

                        <group>

                                    <p>You like the sweet stuff, don’t you? Here it is.</p>

                                    <query reference_id =”sweet”/>

                        </group>

                        <group>

                                    <p>I want to be healthy, but I have no teeth.</p>

                                    <query reference_id =”healthy_and_soft”/>

                        </group>

            </content>

</topic>

 

In our “build tool”, let’s assume we have a database that contains all of our documents in such a way that we can run queries against them. I’ve created my very own query language below, but in our tools we actually use xpaths. However, in order to write xpaths you need to know something about the structure of the xml you’re writing an xpath against so let’s pretend that my query language is the BEST query language EVER and you don't actually need to know anything about the structure of the database. Let’s also assume that during our transform process our parser knows what to do when it encounters the <query> tag – which in this case is to go off and perform the query and return the results and copy some data. And hey! Why not use XML to store our queries?

 

<queries>

            <query id=”crunchy”>

                        <select>name=’texture’ value=’crunchy’</select>

                        <copy>/abstract</copy>

            </query>

 

            <query id=”sweet”>

                        <select>name=’sweetness’ value=’sweet’</select>

                        <copy>/abstract</copy>

            </query>

 

            <query id=”healthy_and_soft”>

                        <select>>(name=’texture’ value=’soft’) AND (name=’healthy’ value=’yes’)</select>

                        <copy>/abstract</copy>

            </query>

</queries>

 

Note that there are two parts to the query. First is the query itself, and it specifies the criteria for selecting a topic. Second is an operation, and for the sake of clarity I’m just throwing in a tag called <copy>. In reality the system is more robust and configurable than this, but I can talk more about that later. For now, all we need to care about is the fact that two things happen – the selecting of a topic based on its metadata and an operation to copy over information relevant for the portal page.

 

If we could grab a snapshot of this document as it was being parsed by the build process, we’d see it looked something like this:

 

<topic id=”main”>

            <title>Peter Taylor’s Cavalcade of Breakfast Treats</title>

            <metadata/>

            <abstract>Peter Taylor eats breakfast every day, so he should know what’s good.</abstract>

            <content>

                        <p>Like breakfast? Me too!</p>

                        <group>

                                    <p>Want something crunchy? How about these?</p>

<crosslink ref_id=”capncrunch”/>

                                    <crosslink ref_id=”grapenuts”/>

                        </group>

                        <group>

                                    <p>You like the sweet stuff, don’t you? Here it is.</p>

                                    <crosslink ref_id=”capncrunch”/>

                                    <crosslink ref_id=”poptarts”/>

                                    <crosslink ref_id=”granola”/>

                        </group>

                        <group>

                                    <p>I want to be healthy, but I have no teeth.</p>

                                    <crosslink ref_id=”oatmeal”/>

                        </group>

            </content>

</topic>

 

The next step is to actually look up the targets referenced in the crosslink tag in the database. In the queries it was specified that the abstracts should also be copied over into the final document. Add a dash of fancy presentation logic in the xslt and voila! The result is a page that looks something like this:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

 

<html>

<head>

            <title>Peter Taylor's Cavalcade of Breakfast Treats</title>

</head>

 

<body>

Like breakfast? Me too!

 

<ul>

            <p>Want something crunchy and sweet? How about these?</p>

            <li><A href="...link to capncrunch">Cap'n Crunch</A>: The Cap’n is the king of breakfast cereals. It’s crunchy and sweet. The best of both worlds.</li>

            <li><A href="...link to grapenuts">Grape Nuts</A>: It's crunchy and tasty, and best of all - it's good for you!</li>

</ul>

 

<ul>

            <p>You like the sweet stuff, don't you? Here it is.</p>

            <li><A href="...link to capncrunch">Cap'n Crunch</A>: The Cap’n is the king of breakfast cereals. It’s crunchy and sweet. The best of both worlds.</li>

            <li><A href="...link to poptarts">Pop Tarts</A>It's a cornucopia of tasty fillings surrounded by wonderful sweet pastry. It's nature's perfect food.</li>

            <li><A href="...link to granola">Granola</A>: A synonym for 'hippie' no more! High in fiber, crunchy, and sweet! It's good for you, in theory at least.</li>

</ul>

 

<ul>

            <p>I want to be healthy, but I have no teeth.</p>

            <li><A href="...link to oatmeal">Oatmeal</A>: It's like your mouth is on vacation - in Scotland!</li>

</ul>

</body>

</html>

 

So, no, building portal pages is not as complicated as building, say, CEREBRO. Only the mutant with the most powerful mind in the WHOLE WORLD is capable of that. However, hopefully you can see the utility of this. The actual content of the portal page has to be authored but the build tool worries about collecting up the links and inserting updated abstracts. Thus, all the authors need to concern themselves with is authoring their documents because they know the build process will pick up their changes and make sure they are represented on the main portal page.

 

This posting is provided "AS IS" with no warranties, and confers no rights.