The Code Style site has evolved by gradual refinement and accumulation of features and content. This review is part of a fully backdated site log and archive that sheds light on when, why and how particular features were implemented.
This log is sometimes updated several times per week, sometimes with a long overdue backlog of items. Many log entries refer to the Code Style Java package that delivers the servlet services and utilities used to manage this site.
Subscribe to the news feed for this log:
Created a new draft FeedExtractionFilter class for the Metacentric Web Feed Generator. The filter is a SAX XMLFilter type that is triggered by XML processing instructions in the source. The filter controls the parse events that are passed to the parent XMLReader.
<?metacentric extract?>
head element to activate the filter and suppress normal body element events.
<?metacentric start?>
body element to open the filter gate and pass parse events to the underlying XMLReader. Only activated if the filter is actively suppressing events.
<?metacentric stop?>
body element after a start instruction to close the filter gate and suppress normal body element events. Has no effect if the gate is already closed.
The filter also includes controls to ensure properly paired and balanced end element events. Any number of start and stop instructions can be applied in the correct order to exclude source content. If there is no final stop instruction, the filter gate is closed at the last appropriate point to ensure the XML model is well formed.
Also introduced a set of feed interfaces and first draft implementation classes to experiment with a new feed processing scheme. The Channel and Item types model a simple generic feed. An HtmlContentParser test class loads source files and parses them with an HtmlContentParser. The first draft parser emulates the current paragraph links conversion pattern in plain text.
Installed and reviewed the Code Style Java code base with Lint4J, which highlights potentially problematic program structures. It's like PMD and Checkstyle, which also checks JavaDoc comments. Lint4J found a couple of cases in MeasuredInputStream where finally blocks threw a secondary IOException when closing the stream. The solution was not to use a try/catch block at all.
Lint4J also found various other potential problems with redundant final modifiers, System.currentTimeMillis() calls in synchronized blocks and an unnecessary System.exit() in the main method of SpaceCodec. Found several other classes where synchronization locks were held on different objects and corrected these.
Updated the font survey results and created a couple of simple PSFTP scripts for downloading the font survey submissions and uploading the results.
SiteMap with namespace support, 17th May 2006
Refactored the SiteMap class to divide the node-processing code into separate methods with more limited scope to expand the public interface of the class. Created a new getBaseUrl() method and replaced all internal field references. Added getRootSection(), getHomeDocument() and getRightsDocument() methods to access specific nodes. Also added processTargetNode, processParentNode() for metadata handling, with renderHomeMetadata() and renderRightsMetadata() methods for rendering the XHTML to a Writer output stream.
Adapted the getLinkElement() and getMetaElement() of SiteMap to take a namespace argument to override the implicit XHTML namespace.
Added a getRootNode method to the AbstractXMLObject to support the getRootSection() method of subclass SiteMap
Created a first draft SiteMetadataGenerator class to produce a set of server side include files for a SiteMap.
Introduced a set of Swing labelled input field classes to the Code Style Java project for use with the draft FAQ editor application. Each instance extends JPanel with adapter code for their respective inputs and have a bold label alongside the input element.
Created a simple FaqNode interface with a toString() method, so that FAQ types can be used to label JTree nodes. Extended Section, Category and Question interfaces from FaqNode and implemented toString() in FaqSection, FaqCategory and FaqQuestion.
Updated the FaqDataEditor class to load the FAQ data structure from the database and represent it in a scrolling JTree for selection. Initially builds the FAQ structure using factory methods, then iterates through the hierarchy to create JTree nodes.
The JTree is set so that the root node is not visible, but the root handles for the data nodes are visible. Also added minimal implementations of the TreeSelectionListener and TreeModelListener interfaces with diagnostic output to System.out.
Added isCategory and isSection methods to the FaqNode interface to simplify data retrieval from JTree nodes. Also added minimal HTML markup to the nodes' toString() methods so that HTML in the data is rendered in the JTree interface, as above.
Archived site log entries since November 2005 and created a retrospective contents index for the year. Also added a rule to the CSStdLiveryStrict.css style sheet to reduce line-height for superscript elements, so standard line spacing is maintained.
#Content p sup {
line-height: 1em;
}
These backdated pages record detailed changes to the Code Style Web site since July 2000, when development first got underway. Some pages may refer to documents or features that have since changed or are no longer part of the site, but the archive is checked to ensure there are no dead links.
For a summary overview, see the annotated site log contents.