Rev 1295 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><TITLE>Hacking</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINKREL="HOME"TITLE="The Codestriker Guide"HREF="book1.html"><LINKREL="PREVIOUS"TITLE="Metrics Report"HREF="x692.html"><LINKREL="NEXT"TITLE="Database Schema"HREF="x771.html"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The Codestriker Guide: Version 1.9.3</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="x692.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="x771.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="AEN705"></A>Chapter 4. Hacking</H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT>4.1. <AHREF="c705.html#AEN707">Codestriker Layout</A></DT><DT>4.2. <AHREF="x771.html">Database Schema</A></DT><DT>4.3. <AHREF="x830.html">Code Style Guide</A></DT></DL></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN707">4.1. Codestriker Layout</A></H1><P> This chapter is for developers which wish to contribute toCodestriker, and want a quick birds-eye view as to how thecode is structured. The Codestriker modules are broken intothe following sub-modules, which are located in<TTCLASS="FILENAME">lib/Codestriker</TT>:<P></P><DIVCLASS="VARIABLELIST"><DL><DT>Action</DT><DD><P> Every action or gesture that can be performed on theCodestriker UI has an associated module for handlingthat action. The name of the module indicates whataction it is handling.</P></DD><DT>BugDB</DT><DD><P> Support for updating bug tracking systems when topicsare created or their state is changed against specificbug reports. Currently, only Bugzilla is supported,but the API can support other bug-tracking systems.</P></DD><DT>DB</DT><DD><P> A thin wrapper over the DBI interface, tocreate/remove database connections. Each databasealso has an associated module, to cater for subtledifferences between database systems. Currently, there issupport for MySQL, PostgreSQL, ODBC (SQL Server) and Oracle.</P></DD><DT>FileParser</DT><DD><P> These modules are responsible for parsing the inputtext when topics are created. Currently, CVSunidiffs, PATCH unidiffs and Subversion diff files aresupported. The API for these parsers is simply toaccept input text, and to return an array of deltaobjects, which describe source code changes made to aspecific file on specific lines. These delta objectsare then used for rendering a topic, so that they areagnostic to which source control system theyoriginated from.</P></DD><DT>Http</DT><DD><P> This contains initial HTTP request processing, andsupport for generating an HTTP response, including thehandling of cookies and compressed streams. Thissub-module also contains the all-important Render.pmmodule, which is the work-horse for generating thecomplex HTML from the topic deltas.</P></DD><DT>Model</DT><DD><P> This contains the persistent objects of the system,and the associated database operations on them. Theseobjects include Topics, Comments, Files and Deltas.The Action classes eventually call these model objectswhen the persistent state of the system needs to bequeried or modified.</P></DD><DT>Repository</DT><DD><P> A number of objects implement the Repository API,which is used throughout the system. Repositoriescurrently supported include a local CVS repository, aremote CVS repository whose data is accessed by HTTPor the pserver protocol, and Subversion. Futurerepositories can be easily added to this framework.The methods in the repository API include a way ofretrieving the entire contents of a specified file andrevision (which is used in the ViewFile actionmodule), and the generation of a revision file logURL.</P></DD><DT>TopicListener</DT><DD><P> This package contains a number of objects which arenotified whenever a topic is changed, via a listenerinterface. Functionality such as email notification,Bugzilla integration, topic history recording areimplemented here as topic listeners.</P></DD></DL></DIV></P><P> In addition to the above modules, the following directoriesare of interest:<P></P><DIVCLASS="VARIABLELIST"><DL><DT>bin</DT><DD><P> This contains the all-important<TTCLASS="FILENAME">install.pl</TT> script, which isused for initialising the system, and for performingupgrades. This isn't the most pretty script in theworld, partly for all of the old data-migration it hasto do from old versions to the current version. Thisdirectory also contains<TTCLASS="FILENAME">SubmitCodeReview.pl</TT> which is away of generating code reviews from the command line.</P></DD><DT>cgi-bin</DT><DD><P> This contains the codestriker.pl CGI script. It readsthe "action" parameter from the URL, and delegates thehandling of the request to the appropriate actionobject.</P></DD><DT>html</DT><DD><P> This contains the <TTCLASS="FILENAME">codestriker.css</TT>file.</P></DD><DT>templates</DT><DD><P> Almost all of the HTML generated by Codestriker (apartfrom the actual code rendering) can be customised bythe templates within this directory. Each Actionobject typically has an associated template, where theview can be easily customized. There is also a headerand footer template, which is included in every page,for site customization.</P></DD><DT>doc</DT><DD><P> This directory contains the source for the Codestrikerguide written in docbook, contained in the<TTCLASS="FILENAME">codestriker.sgml</TT>, with the<TTCLASS="FILENAME">Makefile</TT> for building the variousforms of the documentation.</P></DD></DL></DIV></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="x692.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="book1.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="x771.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Metrics Report</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"> </TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Database Schema</TD></TR></TABLE></DIV></BODY></HTML>