Subversion Repositories DevTools

Rev

Rev 1295 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1293 dpurdie 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2
<HTML
3
><HEAD
4
><TITLE
5
>Hacking</TITLE
6
><META
7
NAME="GENERATOR"
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9
REL="HOME"
10
TITLE="The Codestriker Guide"
11
HREF="book1.html"><LINK
12
REL="PREVIOUS"
13
TITLE="Metrics Report"
14
HREF="x692.html"><LINK
15
REL="NEXT"
16
TITLE="Database Schema"
17
HREF="x771.html"></HEAD
18
><BODY
19
CLASS="CHAPTER"
20
BGCOLOR="#FFFFFF"
21
TEXT="#000000"
22
LINK="#0000FF"
23
VLINK="#840084"
24
ALINK="#0000FF"
25
><DIV
26
CLASS="NAVHEADER"
27
><TABLE
28
SUMMARY="Header navigation table"
29
WIDTH="100%"
30
BORDER="0"
31
CELLPADDING="0"
32
CELLSPACING="0"
33
><TR
34
><TH
35
COLSPAN="3"
36
ALIGN="center"
37
>The Codestriker Guide: Version 1.9.3</TH
38
></TR
39
><TR
40
><TD
41
WIDTH="10%"
42
ALIGN="left"
43
VALIGN="bottom"
44
><A
45
HREF="x692.html"
46
ACCESSKEY="P"
47
>Prev</A
48
></TD
49
><TD
50
WIDTH="80%"
51
ALIGN="center"
52
VALIGN="bottom"
53
></TD
54
><TD
55
WIDTH="10%"
56
ALIGN="right"
57
VALIGN="bottom"
58
><A
59
HREF="x771.html"
60
ACCESSKEY="N"
61
>Next</A
62
></TD
63
></TR
64
></TABLE
65
><HR
66
ALIGN="LEFT"
67
WIDTH="100%"></DIV
68
><DIV
69
CLASS="CHAPTER"
70
><H1
71
><A
72
NAME="AEN705"
73
></A
74
>Chapter 4. Hacking</H1
75
><DIV
76
CLASS="TOC"
77
><DL
78
><DT
79
><B
80
>Table of Contents</B
81
></DT
82
><DT
83
>4.1. <A
84
HREF="c705.html#AEN707"
85
>Codestriker Layout</A
86
></DT
87
><DT
88
>4.2. <A
89
HREF="x771.html"
90
>Database Schema</A
91
></DT
92
><DT
93
>4.3. <A
94
HREF="x830.html"
95
>Code Style Guide</A
96
></DT
97
></DL
98
></DIV
99
><DIV
100
CLASS="SECT1"
101
><H1
102
CLASS="SECT1"
103
><A
104
NAME="AEN707"
105
>4.1. Codestriker Layout</A
106
></H1
107
><P
108
>        This chapter is for developers which wish to contribute to
109
	Codestriker, and want a quick birds-eye view as to how the
110
	code is structured.  The Codestriker modules are broken into
111
	the following sub-modules, which are located in
112
	<TT
113
CLASS="FILENAME"
114
>lib/Codestriker</TT
115
>:
116
	<P
117
></P
118
><DIV
119
CLASS="VARIABLELIST"
120
><DL
121
><DT
122
>Action</DT
123
><DD
124
><P
125
>	        Every action or gesture that can be performed on the
126
		Codestriker UI has an associated module for handling
127
		that action.  The name of the module indicates what
128
		action it is handling.
129
	      </P
130
></DD
131
><DT
132
>BugDB</DT
133
><DD
134
><P
135
>	        Support for updating bug tracking systems when topics
136
		are created or their state is changed against specific
137
		bug reports.  Currently, only Bugzilla is supported,
138
		but the API can support other bug-tracking systems.
139
	      </P
140
></DD
141
><DT
142
>DB</DT
143
><DD
144
><P
145
>	        A thin wrapper over the DBI interface, to
146
		create/remove database connections.  Each database
147
	    also has an associated module, to cater for subtle
148
	    differences between database systems.  Currently, there is
149
	    support for MySQL, PostgreSQL, ODBC (SQL Server) and Oracle.
150
	      </P
151
></DD
152
><DT
153
>FileParser</DT
154
><DD
155
><P
156
>	        These modules are responsible for parsing the input
157
		text when topics are created.  Currently, CVS
158
		unidiffs, PATCH unidiffs and Subversion diff files are
159
		supported.  The API for these parsers is simply to
160
		accept input text, and to return an array of delta
161
		objects, which describe source code changes made to a
162
		specific file on specific lines.  These delta objects
163
		are then used for rendering a topic, so that they are
164
		agnostic to which source control system they
165
		originated from.
166
	      </P
167
></DD
168
><DT
169
>Http</DT
170
><DD
171
><P
172
>	        This contains initial HTTP request processing, and
173
		support for generating an HTTP response, including the
174
		handling of cookies and compressed streams.  This
175
		sub-module also contains the all-important Render.pm
176
		module, which is the work-horse for generating the
177
		complex HTML from the topic deltas.
178
	      </P
179
></DD
180
><DT
181
>Model</DT
182
><DD
183
><P
184
>	        This contains the persistent objects of the system,
185
		and the associated database operations on them.  These
186
		objects include Topics, Comments, Files and Deltas.
187
		The Action classes eventually call these model objects
188
		when the persistent state of the system needs to be
189
		queried or modified.
190
	      </P
191
></DD
192
><DT
193
>Repository</DT
194
><DD
195
><P
196
>	        A number of objects implement the Repository API,
197
		which is used throughout the system.  Repositories
198
		currently supported include a local CVS repository, a
199
		remote CVS repository whose data is accessed by HTTP
200
		or the pserver protocol, and Subversion.  Future
201
		repositories can be easily added to this framework.
202
		The methods in the repository API include a way of
203
		retrieving the entire contents of a specified file and
204
		revision (which is used in the ViewFile action
205
		module), and the generation of a revision file log
206
		URL.
207
	      </P
208
></DD
209
><DT
210
>TopicListener</DT
211
><DD
212
><P
213
>	        This package contains a number of objects which are
214
	    notified whenever a topic is changed, via a listener
215
	    interface.  Functionality such as email notification,
216
	    Bugzilla integration, topic history recording are
217
	    implemented here as topic listeners.
218
	      </P
219
></DD
220
></DL
221
></DIV
222
>
223
      </P
224
><P
225
>	In addition to the above modules, the following directories
226
	are of interest:
227
	<P
228
></P
229
><DIV
230
CLASS="VARIABLELIST"
231
><DL
232
><DT
233
>bin</DT
234
><DD
235
><P
236
>	        This contains the all-important
237
		<TT
238
CLASS="FILENAME"
239
>install.pl</TT
240
> script, which is
241
		used for initialising the system, and for performing
242
		upgrades.  This isn't the most pretty script in the
243
		world, partly for all of the old data-migration it has
244
		to do from old versions to the current version.  This
245
		directory also contains
246
		<TT
247
CLASS="FILENAME"
248
>SubmitCodeReview.pl</TT
249
> which is a
250
		way of generating code reviews from the command line.
251
	      </P
252
></DD
253
><DT
254
>cgi-bin</DT
255
><DD
256
><P
257
>	        This contains the codestriker.pl CGI script.  It reads
258
		the "action" parameter from the URL, and delegates the
259
		handling of the request to the appropriate action
260
		object.
261
	      </P
262
></DD
263
><DT
264
>html</DT
265
><DD
266
><P
267
>	        This contains the <TT
268
CLASS="FILENAME"
269
>codestriker.css</TT
270
>
271
	        file.
272
	      </P
273
></DD
274
><DT
275
>templates</DT
276
><DD
277
><P
278
>	        Almost all of the HTML generated by Codestriker (apart
279
	        from the actual code rendering) can be customised by
280
	        the templates within this directory.  Each Action
281
	        object typically has an associated template, where the
282
	        view can be easily customized.  There is also a header
283
	        and footer template, which is included in every page,
284
	        for site customization.
285
	      </P
286
></DD
287
><DT
288
>doc</DT
289
><DD
290
><P
291
>	        This directory contains the source for the Codestriker
292
	        guide written in docbook, contained in the
293
	        <TT
294
CLASS="FILENAME"
295
>codestriker.sgml</TT
296
>, with the
297
	        <TT
298
CLASS="FILENAME"
299
>Makefile</TT
300
> for building the various
301
	        forms of the documentation.
302
	      </P
303
></DD
304
></DL
305
></DIV
306
>
307
      </P
308
></DIV
309
></DIV
310
><DIV
311
CLASS="NAVFOOTER"
312
><HR
313
ALIGN="LEFT"
314
WIDTH="100%"><TABLE
315
SUMMARY="Footer navigation table"
316
WIDTH="100%"
317
BORDER="0"
318
CELLPADDING="0"
319
CELLSPACING="0"
320
><TR
321
><TD
322
WIDTH="33%"
323
ALIGN="left"
324
VALIGN="top"
325
><A
326
HREF="x692.html"
327
ACCESSKEY="P"
328
>Prev</A
329
></TD
330
><TD
331
WIDTH="34%"
332
ALIGN="center"
333
VALIGN="top"
334
><A
335
HREF="book1.html"
336
ACCESSKEY="H"
337
>Home</A
338
></TD
339
><TD
340
WIDTH="33%"
341
ALIGN="right"
342
VALIGN="top"
343
><A
344
HREF="x771.html"
345
ACCESSKEY="N"
346
>Next</A
347
></TD
348
></TR
349
><TR
350
><TD
351
WIDTH="33%"
352
ALIGN="left"
353
VALIGN="top"
354
>Metrics Report</TD
355
><TD
356
WIDTH="34%"
357
ALIGN="center"
358
VALIGN="top"
359
>&nbsp;</TD
360
><TD
361
WIDTH="33%"
362
ALIGN="right"
363
VALIGN="top"
364
>Database Schema</TD
365
></TR
366
></TABLE
367
></DIV
368
></BODY
369
></HTML
370
>