Subversion Repositories DevTools

Rev

Rev 1293 | Blame | 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
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Codestriker Guide"
HREF="book1.html"><LINK
REL="PREVIOUS"
TITLE="Metrics Report"
HREF="x692.html"><LINK
REL="NEXT"
TITLE="Database Schema"
HREF="x771.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Codestriker Guide: Version 1.9.3</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x692.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x771.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="AEN705"
></A
>Chapter 4. Hacking</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>4.1. <A
HREF="c705.html#AEN707"
>Codestriker Layout</A
></DT
><DT
>4.2. <A
HREF="x771.html"
>Database Schema</A
></DT
><DT
>4.3. <A
HREF="x830.html"
>Code Style Guide</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN707"
>4.1. Codestriker Layout</A
></H1
><P
>        This chapter is for developers which wish to contribute to
        Codestriker, and want a quick birds-eye view as to how the
        code is structured.  The Codestriker modules are broken into
        the following sub-modules, which are located in
        <TT
CLASS="FILENAME"
>lib/Codestriker</TT
>:
        <P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Action</DT
><DD
><P
>               Every action or gesture that can be performed on the
                Codestriker UI has an associated module for handling
                that action.  The name of the module indicates what
                action it is handling.
              </P
></DD
><DT
>BugDB</DT
><DD
><P
>               Support for updating bug tracking systems when topics
                are created or their state is changed against specific
                bug 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, to
                create/remove database connections.  Each database
            also has an associated module, to cater for subtle
            differences between database systems.  Currently, there is
            support for MySQL, PostgreSQL, ODBC (SQL Server) and Oracle.
              </P
></DD
><DT
>FileParser</DT
><DD
><P
>               These modules are responsible for parsing the input
                text when topics are created.  Currently, CVS
                unidiffs, PATCH unidiffs and Subversion diff files are
                supported.  The API for these parsers is simply to
                accept input text, and to return an array of delta
                objects, which describe source code changes made to a
                specific file on specific lines.  These delta objects
                are then used for rendering a topic, so that they are
                agnostic to which source control system they
                originated from.
              </P
></DD
><DT
>Http</DT
><DD
><P
>               This contains initial HTTP request processing, and
                support for generating an HTTP response, including the
                handling of cookies and compressed streams.  This
                sub-module also contains the all-important Render.pm
                module, which is the work-horse for generating the
                complex 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.  These
                objects include Topics, Comments, Files and Deltas.
                The Action classes eventually call these model objects
                when the persistent state of the system needs to be
                queried or modified.
              </P
></DD
><DT
>Repository</DT
><DD
><P
>               A number of objects implement the Repository API,
                which is used throughout the system.  Repositories
                currently supported include a local CVS repository, a
                remote CVS repository whose data is accessed by HTTP
                or the pserver protocol, and Subversion.  Future
                repositories can be easily added to this framework.
                The methods in the repository API include a way of
                retrieving the entire contents of a specified file and
                revision (which is used in the ViewFile action
                module), and the generation of a revision file log
                URL.
              </P
></DD
><DT
>TopicListener</DT
><DD
><P
>               This package contains a number of objects which are
            notified whenever a topic is changed, via a listener
            interface.  Functionality such as email notification,
            Bugzilla integration, topic history recording are
            implemented here as topic listeners.
              </P
></DD
></DL
></DIV
>
      </P
><P
>       In addition to the above modules, the following directories
        are of interest:
        <P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>bin</DT
><DD
><P
>               This contains the all-important
                <TT
CLASS="FILENAME"
>install.pl</TT
> script, which is
                used for initialising the system, and for performing
                upgrades.  This isn't the most pretty script in the
                world, partly for all of the old data-migration it has
                to do from old versions to the current version.  This
                directory also contains
                <TT
CLASS="FILENAME"
>SubmitCodeReview.pl</TT
> which is a
                way of generating code reviews from the command line.
              </P
></DD
><DT
>cgi-bin</DT
><DD
><P
>               This contains the codestriker.pl CGI script.  It reads
                the "action" parameter from the URL, and delegates the
                handling of the request to the appropriate action
                object.
              </P
></DD
><DT
>html</DT
><DD
><P
>               This contains the <TT
CLASS="FILENAME"
>codestriker.css</TT
>
                file.
              </P
></DD
><DT
>templates</DT
><DD
><P
>               Almost all of the HTML generated by Codestriker (apart
                from the actual code rendering) can be customised by
                the templates within this directory.  Each Action
                object typically has an associated template, where the
                view can be easily customized.  There is also a header
                and 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 Codestriker
                guide written in docbook, contained in the
                <TT
CLASS="FILENAME"
>codestriker.sgml</TT
>, with the
                <TT
CLASS="FILENAME"
>Makefile</TT
> for building the various
                forms of the documentation.
              </P
></DD
></DL
></DIV
>
      </P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x692.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x771.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Metrics Report</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Database Schema</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>