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:
Adapted the recently added Ant compile.applet build target to copy the compiled classes directly to the classes directory in the Web directory tree. Added a new web.class.dir property file configuration to specify the location of the class directory. Finalised the FontSurveyApplet page with submission success and error pages and feedback forms for comments from testers. Invited first groups of font survey mailing list subscribers to test the new system.
Converted the generic font family sampler pages to use server side include files generated by the FontSurveyTemplate class. Corrected Linux Nimbus Roman Sans L sampler links to Nimbus Sans L.
Altered the SQL submission update trigger function to re-count font survey submissions only when the isvalid status changes, to avoid redundant processing. Added a sampleimage field to the font table as a more convenient reference location and populated the column from the redundant image table.
Technorati tags: Apache Ant, font survey, trigger.
Added an output type parameter to the FontSurveyTemplate class to differentiate between Soupermail template output, a new CSS font style option and (with no parameter) to generate a set of generic font family sampler tables. Refactored the file output features to reduce duplicate code and added new methods to quote font family names in CSS output where necessary and trim the file extension off sample image names for font sampler URL references.
Added a createFile(File) method to the AbstractPostgresApp class that checks whether a file already exists and creates it if necessary. The method returns true to signal success.
Technorati tags: font survey, template.
Added an array of Java system property fields to the FontSurveyApplet to include in test submissions: browser, browser.version, os.name, os.version, java.version and java.runtime.version. Added new methods addSystemParameters(PrintWriter), supported by a getProperty(String) method, and addFontsParameter(PrintWriter) to add those parameters to the POST submission. Re-arranged the getHost() method with a try/catch block for a SecurityException if the applet is loaded from a file system.
Introduced code to set the survey ID parameter based on the os.name property and removed the platform validation check from the submission handler script. Updated the survey email template to make a more compact format, include the new system property fields and loop through the font names to generate SQL insert statements. Also created a new file output template with standard SQL insert statements for the font survey.
Extracted hard-coded PostgreSQL database features from the FaqMenuGenerator to create a new AbstractPostgresApp superclass for database applications. Adapted FaqMenuGenerator to extend the new application class and created a new FontSurveyTemplate class to produce survey form submission templates from database contents. Created a Windows launch script to generate FontSurveyTemplate output.
Created a discount voucher facility for the Code Style premium content service page to offer a 25% price reduction. A simple voucher entry page and submission form enables customers to enter and verify their discount code.
Updated FaqMenuGenerator to change all FAQ boxout menus to .shtml file extensions to enable text ads to be included in output rather than hard coded. Changed the FAQ pages themselves to use server side include directives rather than the hard coded text ads.
Split the DOM1 visibility menus article into 3 parts with a new server side include file for the noscript menu headings. Secondary pages cover drop down menu accessibility and compatibility and drop down menu source code and review.
Condensed and re-worded the CSS font sampler and survey pages to standardise use of phrases "Web font", "font survey", "common fonts", "common Web fonts" and "font sampler". Updated Apache custom error page documents to standardise on "custom error", "error 400", "error 400 bad request", "400 bad request", "customise error pages" and equivalent variations for other error codes.
Added cross-links from the font family glossary to the relevant generic font family sampler pages to encourage further browsing through the section.
Technorati tags: system properties, PostgreSQL, premium content, text ads.
FontSurveyApplet refactor, 20th March 2007
Added a compile.applet target to the Ant build.xml file for the draft FontSurveyApplet. Re-factored the FontSurveyApplet to simplify the main init() method by creating separate methods addSurveyIdParameter(PrintWriter), addNameInput(Panel), addEmailInput(Panel), addCommentInput(Panel), addFontList(Panel) and addSubmitButton(Panel). Other supporting methods include getInputLabel(String), getHost(), addFontFamilyParameters(PrintWriter), addParameter(PrintWriter, String, TextComponent), addParameter(PrintWriter, String, String). Moved many method variables to be class variables and added JavaDoc comments throughout.
Checked in working draft Soupermail form configuration files FontSurveyApplet.cfg, FontSurveyAppletEmail.tpl and applet test page with HTML object markup.
Technorati tags: font survey, applet.
Cut down the content on the Code Style font sampler landing page and included links for the Web font FAQ. Removed the FAQ link from the general purpose font sampler menu. Also compacted the action points highlights on the home page, with the addition of a premium content service link. Re-styled the premium content subscription form to make it stand out more:
fieldset.Subscription {
color: #333;
background: #FFC 15px 0px;
border: double 3px #039;
}
fieldset.Subscription p {
font-family: arial,
helvetica,
tahoma,
"arial narrow",
sans-serif;
}
And added explicit padding and margin properties to work better with Firefox:
#Content fieldset p {
padding-top: 0.5em;
padding-bottom: 0.5em;
padding-left: 0.5em;
margin-right: 0;
margin-bottom: 0;
}
fieldset.Subscription {
margin-bottom: 2em;
}
Created a new server side include form for text ad enquiries based on the original general feedback form, so submissions can be handled separately and more specifically. Also moved details of text ad placement to a separate page to cut down the length of the main text ad service page and updated all links to it. Added text ad service links to all FAQ menu panels through the FaqMenuGenerator class.
Re-configured the FAQ help request form to include a mailing list subscription option, equivalent to the standard article update notification request.
Added a Google Analytics script to the standard Google text ad footer include file. Created a dedicated include file for the Google Analytics script, so it can easily be added to pages without the standard Google footer banner, and added analytics scripts to all Soupermail page templates to track outcomes. Also added the analytics script to the CodeStyleTemplate class for all font sampler pages and the EchoRequest servlet.
Technorati tags: fieldset, CSS, text ads, Google Analytics.
Created a new FAQ announcement page to list all FAQs published on a given day using a fairly complex Apache XSSI scheme to dynamically include HTML fragments produced by the FaqMenuGenerator class by date. The head section of the page has a series of conditional checks against the query string that set variables for the year, month and day. Further checks ensure there is a valid date and issue custom error messages if it is not valid, or does not match an existing include file. For example, FAQs published on 24 February 2007 includes a custom page heading, a hyperlinked question list and standard FAQ navigation.
Refactored the ServiceLogClientParser class to create a new method for getting a formatted heirarchical list of spam IP addresses from the IPMap class. The getHeirarchyList(MessageFormat, MessageFormat, threshold) method formats the output for the parent network IP address if the number of child nodes in the map exceeds the threshold. Also moved the countSiblings(String) and getParent(String) methods to the IPMap class.
Updated the ServiceLogClientParser getDenyList() method to use the new IPMap method and added a getSQLPurgeList() method to remove spam submissions from the font survey database. Also changed the getClientFilterList() method to use the external methods, and added a parameter to the main method to target a single output option: .htaccess, SQL script or web.xml formatting. Added a dynamic parameter reference to the Windows launch script for the log parser to produce the relevant output per request.
Added a set of purge statements to the start of the font survey validation script, to strip out spam submissions and notification requests. The purge statements are automatically generated by the new getSQLPurgeList() method of the ServiceLogClientParser class. Published the latest font survey results.
Re-organised the server side include (SSI) structure for local navigation panels so that all text ads are included from a single file. Added string constants to FaqMenuGenerator for each text ad, rather than line by line print statements.
Also corrected an oversight in the sampler-FontComparison.js Javascript, where it is used in the generic font family sampler pages. In this case, the script should not output the "check all boxes" option used for the survey pages.
Technorati tags: IP address, comment spam blocker.
Developed the working draft of the font survey applet further to get configuration details from HTML parameter elements and assemble font family data into an HTTP POST submission. The applet uses the getCodeBase() method to ensure submissions are sent to the host the applet was loaded from. All font names are passed through the java.util.URLEncoder encode(String, Locale) method as necessary.
Technorati tags: font survey, applet, getCodeBase().
Created a new ArchiveValidator.js script to check the selected month and year combination is available in the site log archive. The script uses fixed variables for the start month and year, and an editable endMonth variable that is declared in an inline script element immediately before the navigation form. The onsubmit script returns false if the date is not valid, so the form does not submit, and reports the problem through the alertTooEarly() and alertTooLate() functions. If the date is valid, the form submits to the AnchorPoints servlet to redirect to the specified page.
Also created several new FAQ sections for CSS problems, Java interface design, JDBC, Tomcat configuration, JSP tags & libraries and DOM menu customisation.
Created a first draft implementation of a font survey applet that gets a list of all font families installed on a client and initially lists them in a TextArea.
Technorati tags: Javascript, site log archive, form validation, navigation, FAQ.
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.