Web Site
Developers

Dynamic Content - Introduction II

Rebooting the Series

This is my second attempt to write this introduction [1.]. My intent was to outline methods that took external inputs and converted them into content that would be inserted running web pages. However, my plans went astray. It seemed the mere mention of the word security subverted my intentions. This rewrite is aimed at regaining my balance.

Oddly, before this article is even placed on my site, the first, simplest example has been published. It is my intent to follow with the other more complex examples. However, one key step, i.e. storage of the inputs may not be easily resolved. Indeed, I expect a series of meandering missteps as I attempt to chose between alternatives. For instance, text files have the attraction of simplicity and the ability to be read and used directly. Nonetheless, my predilection for the database alternative will not be ignored. I fully expect both options to give me grief, since this is an engineering question where there are trade offs. That is, simplicity vs. structured content, please notice that at a certain volume density the advantage slips from one side to the other. Therefore, I say there is no best answer, the choice has to be made on what best fits a particular site at a particular time.

A New Beginning

A bit redundant section heading title, but it stresses these articles ignore the potentially distasteful aspects, e.g. the questions of the reliability and storage solutions for the inputs taken from the model form shown so many times previously. What's the harm of one more exposure? Skip by, if you have seen it too often:

  OpenSourceToday News Item/Article Input Screen

  Figure 1. News Item/Article Input HTML Form  

The point is, we start fresh taking data input into this form and examine methods that can take portions and insert them into web pages, on the fly. That is my vision and my direction in this series.

Implementation Methods

I wish to stress the existence of the form was designed to allow a trusted user to add content. It was not predicated upon automating every step of the process. The problem I was trying to solve was letting that user deposit articles onto our site when it was impossible for him to logon directly. If the scripts allowed storage and partial automation, that would have lessened my work load significantly. The latter was the original practical goal. However, in the series I show methods to script automated placement of content onto and within web pages as part of a thought experiment. My plan is to employ these techniques on other sites. That's my current focus.

Ordering Priority

Certain processes to be successful require that prerequisite steps. For example, all inputs should be stored while awaiting approval to process. This includes certain fields that might be empty. News items do not need any of the following: Key Words, Summary or File Name. Indeed, the very absence of these fields indicates the entry was meant to be a News Item.

The top priority when the processing begins is to store the Article with its html tags in a known location using the supplied file name using an appropriate path determined by the author and topic. An alternative storage location could be within a database where retrieval is accomplished using parameters comprised of author's name, file name and perhaps title. Once stored the links can be constructed. The more difficult to implement detailed listing in the central column of the Open Source Today home pages should be the next endeavor. To remind you of its appearance, here is a graphic of the page:

  Sample OpenSourceToday Article Listings

  Figure 2. Sample OpenSourceToday Article Listings  

First a variable has to be built from the proper publication date, the full name of the author, a linked version of the title all followed by the summary text. That is fed finally into the proper order into the text file that would be read as part of the home page template. Once that is in place, the linked title is added to the bottom of the list kept in the text file that is read to render the left hand column listing. That is the simplest step, but for an article it should be the last completed. However, as mentioned, that was the first article in this series to be published.

News items are not part of the home page. Moreover, they also do not require any long term storage, links, etc. However, they have their own little complexities. As a reminder, here is a graphic showing appearance of the central column [2.]:

  OpenSourceToday News Item Listings

  Figure 3. OpenSourceToday News Item Listings  

The content was comprised of quickly summarized, recent press releases put out by businesses that had some relation to open source products. This content aged rapidly, hence, there was no need for storage other than in the evolving text file that would read in the current few, most recent items. The most recent addition had to appear at the top, which could be automated and the too aged items would have been removed probably manually or reading the publication date within a html tag comment. Thus, though simpler in some respects the automation of this page would have been as difficult as the article listing on the home page.

While the task of determining longer term data storage should take precedence, it will be the harder task. I am certain that I will review at least two possible options of text file and database storage. A hybrid of both sharing the load with specific content being stored preferentially in one with the bulk in the other is not an impossibility. At this time the solution is my most nebulous task. I cannot predict the outcome, other than the options will be investigated.

Summary

I will no longer predict the exact order I will produce a series, let alone a single article [3.]. Even now I am still worrying about the security issues of the location of the action script being visible to all in the view source of a page containing a form. Particularly when I still do not possess answers that suffice to plug all potential holes. However, I will guess the likely sequence, if not its scheduled appearance.

That's my list, those are my intentions. However, as my previous experience has shown, despite my long list of article ideas other issues intrude changing my priorities for good and ill.

Corrections, suggested extension or comments write: H. Cohen.

     © Herschel Cohen, All Rights Reserved

Return B/ST Home or Dynamic Menu Page
____________________________________________________________________

    1.  Original Series Introduction appeared on LXer.com.  Return

    2.  The full News Item page is shown here.  Return

    3.  In the What's Next section, at the bottom, I made the  
        mistake of predicting next article.  Return
____________________________________________________________________