1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 <!ENTITY project SYSTEM "project.xml">
5 <document url="doccontrib.html">
9 Licensed to the Apache Software Foundation (ASF) under one or more
10 contributor license agreements. See the NOTICE file distributed with
11 this work for additional information regarding copyright ownership.
12 The ASF licenses this file to You under the Apache License, Version 2.0
13 (the "License"); you may not use this file except in compliance with
14 the License. You may obtain a copy of the License at
16 http://www.apache.org/licenses/LICENSE-2.0
18 Unless required by applicable law or agreed to in writing, software
19 distributed under the License is distributed on an "AS IS" BASIS,
20 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 See the License for the specific language governing permissions and
22 limitations under the License.
25 <title>How to Contribute to the Documentation</title>
26 <author email="rsowders@usgs.gov">Robert Sowders</author>
27 <date>$Date: 2010-03-15 16:27:18 +0100 (Mon, 15 Mar 2010) $</date>
30 <section name="Introduction">
32 This document describes how you can easily contribute to the
33 documentation. I'm going to try to make it easy for everyone to help out with
34 the documentation of Tomcat, more specifically the documentation for the
35 connectors. This is written from a windows user perspective as I believe they
36 will most benefit from it. For people using Unix it should be easy for them to
37 apply these steps. Just substitute Unix syntax where needed.
40 The documentation is produced using xml with xsl style sheets. This
41 effectivly seperates the content of the documents from the style, so all that
42 contributers need to worry about the content. It is much easier to use than
46 It's all really quite simple. Here is what you will need:
49 <b>A recent version of Ant</b>
52 <b>The source code for the connectors from subversion</b>
55 <b>Any ascii text editor</b>
60 <section name="Getting Started Step by Step">
62 After you get these tools they are simple to set up.
64 <subsection name="STEP 1. Get Ant">
66 Install <a href="http://ant.apache.org/">Ant</a>. The only advice I
67 have is to choose a simple installation path. Now set an environment variable
68 for ANT_HOME, and then add the location of the Ant/bin directory to your PATH
69 variable. Consult your Operating system documentation for information on how
70 to do this. When you are finished verify that you can run ant from the command
74 Ant is used to build the documentation, among other things, and it must be
75 able to see a file called <b>build.xml</b>. This file is located in the
76 <b>xdocs</b> directory. In the
77 <b>build.xml</b> file there is a target named <b>all</b> that will be used to build
81 <subsection name="STEP 2. Get the sources">
84 <a href="http://svn.apache.org/repos/asf/tomcat/jk/trunk/">tomcat-connectors</a>
85 from the subversion repository. If you'll
86 be editing from a windows platform you will need a windows subversion client. There
87 are several available. I like <a href="http://tortoisesvn.tigris.org/">turtoiseSVN</a>.
88 Unix users should install the subversion client of their choice,
89 if they don't already have one.
92 You are ready to download the sources now. Change directory to the
93 location where you want your repository to be. For simplicity we will call this
94 your <b>SVN_HOME</b>. Mine is located in C:\build.
97 Run the following command to <b>checkout</b> the sources for the first time.
98 You should only need to do this once.
101 <read>C:\build\>svn checkout http://svn.apache.org/repos/asf/tomcat/jk/trunk/
102 tomcat-connectors</read>
107 You should now be watching all the downloads come in. Now that you have
108 the sources on your machine the hard part is over. From now on, to update your
109 sources all you have to do is cd into any directory in your repository and run
110 the <b>svn update</b> command.
112 <note> To update your xdocs directory simply cd into the xdocs directory
114 <read>C:\build\tomcat-connectors\>cd xdocs</read>
115 <read>C:\build\tomcat-connectors\xdocs\>svn update</read>
119 <subsection name="STEP 3. Test your build environment">
121 Open a command prompt window and cd to the directory where you downloaded
122 the source. Now cd into the xdocs directory so that <b>Ant</b> can see the
123 <b>build.xml</b> file. Then from a command prompt, run the following:
126 <read>C:\build\tomcat-connectors>cd xdocs</read>
127 <read>C:\build\tomcat-connectors\xdocs>ant all</read>
132 You should see the ant compiler messages scrolling by rapidly and then stop
135 <read>[style] Transforming into C:\build\tomcat-connectors\build\docs\news\printer></read>
136 <read>[style] Processing C:\build\tomcat-connectors\xdocs\news\20041100.xml
138 <read>C:\build\tomcat-connectors\build\docs\news/20041100.html</read>
139 <read>[style] Loading stylesheet C:\build\tomcat-connectors\xdocs\style.xsl</read>
140 <read>[style] Processing C:\build\tomcat-connectors\xdocs\news\20050101.xml
142 <read>C:\build\tomcat-connectors\build\docs\news/20050101.html</read>
143 <read>[style] Processing C:\build\tomcat-connectors\xdocs\news\20060101.xml
145 <read>C:\build\tomcat-connectors\build\docs\news/20060101.html</read>
146 <read>[style] Transforming into C:\build\tomcat-connectors\build\docs></read>
147 <read>[style] Processing C:\build\tomcat-connectors\xdocs\index.xml
149 <read>C:\build\tomcat-connectors\build\docs\index.html</read>
150 <read>[style] Loading stylesheet C:\build\tomcat-connectors\xdocs\style.xsl</read>
152 <read>BUILD SUCCESSFUL</read>
153 <read>Total time: 10 seconds</read>
154 <read>C:\build\tomcat-connectors></read>
158 All the xml files present in the xdocs directory structure were transformed
159 to html and copied to the <b>SVN_HOME\tomcat-connectors\build\docs</b>
160 directory. Open one of the
161 html files in your browser and see how it looks.
164 <subsection name="STEP 4. The editing process.">
166 I find it easier to use two windows while doing my updates. One I call my
167 <b>build</b> window. I keep this one in the <b>SVN_HOME\tomcat-connectors\xdocs</b>
168 directory and I only run two commands in this window:
171 <note> First I run</note>
172 <read>ant clean</read>
173 <note> Then I run</note>
179 My second window I call my <b>edit</b> window and I keep that one in the
180 <b>SVN_HOME\tomcat-connectors\xdocs</b> directory where I'm doing my
181 edits, diffs and svn updates.
184 Before you start editing you should always update your local repository to
187 <note> You only need to update the xdocs directory</note>
188 <read>C:\build\tomcat-connectors>cd xdocs</read>
189 <read>C:\build\tomcat-connectors\xdocs></read>
190 <read>C:\build\tomcat-connectors\xdocs>svn update</read>
194 Now that your repository is up to date you can begin editing. Find
195 something in the documentation to edit. When you find something remember the
196 name of the file. In your <b>edit</b> window find and edit the xml source file
197 with the same name. After you are done return to the <b>build</b> window, and
198 in the <b>SVN_HOME\tomcat-connectors\xdocs</b> directory run:
201 <read>C:\build\tomcat-connectors\xdocs> ant clean</read>
206 This will delete all the previous html files and make the area ready for
207 updated material. Now to make fresh documents that incorporate your changes
211 <read>C:\build\tomcat-connectors\xdocs>ant all</read>
216 Use your browser to view the edits you just made, they will be in the
217 <b>SVN_HOME\tomcat-connectors\build\docs</b> sub-tree. If it looks
218 good and is ready to go,
219 all that is left to do is to create a patch and submit it.
222 <subsection name="STEP 5. Creating a patch and submitting it.">
224 From your <b>edit</b> window cd into the directory that contains the xml
225 file you are working on, and run the <b>svn update</b> command. For example,
226 to produce a diff of the index.xml file and call it patch.txt, you
227 would cd into the directory containing the index.xml file and:
229 <read>C:\build\tomcat-connectors\xdocs\>svn diff index.xml >
235 Now that you have your patch you are ready to send it in.
238 Patches to the documentation are handled just like a bug report. You
239 should submit your patches to <a
240 href="http://issues.apache.org/bugzilla/">http://issues.apache.org/bugzilla/</a>
241 and include a good one line subject. If this is your first time to use the
242 bug database then you should read <a
243 href="http://issues.apache.org/bugzilla/bugwritinghelp.html">http://issues.apach
244 e.org/bugzilla/bugwritinghelp.html.</a> You will need to create a user
245 account. At the web site paste your patch into the web form and don't forget
246 to describe what it is your patch is for. Sooner or later a someone with
247 commit privileges will review your suggestion.
251 <section name="Subversion Basics">
253 After you have checked out the sources the first time it is much easier to
254 use subversion. You can cd into any directory of the repository and run <b>svn
255 update</b> to get the latest sources for that directory. For editing
256 purposes you should always update your repository before you start editing to
260 You will need to run <b>svn diff</b> to generate patches for submission.
261 Again cd into the directory containing the file you are editing and run <b>svn
262 diff name_of_the_file_you_edited > patch.txt</b> to generate a patch for
266 Pay attention to the terminal window during the update.
269 Lines begining with a <b>A</b> indicate files that have been added.
272 Lines begining with a <b>D</b> indicate files that have been deleted.
275 Lines begining with a <b>U</b> mean the local copy was patched to update it
276 to the current version in the master repository.
279 Lines begining with a <b>G</b> mean your local copy is different from the
280 master copy, and the changes were successfully merged into your copy.
283 Lines begining with a <b>C</b> mean there was a conflict in merging the
284 changes and you need to review the file and merge the changes manually. Search
285 for >>>> and merge the changes.
288 Lines begining with a <b>?</b> indicate files that reside on your local
289 system which are not part of the repository. You will normally see this when
290 you are creating new files for submission.
294 <section name="Updating Web site">
296 Only Committers are able to update the web site (http://tomcat.apache.org/connectors-doc/).
299 <li>Connect to people.apache.org.</li>
301 <li>Copy the changed files to /www/tomcat.apache.org/connectors-doc/.</li>
302 <li>or use ant from a checkout tomcat/jk/trunk/xdocs repository:<br />
303 ant -Dbuild.dir=/www/tomcat.apache.org -Ddist.name=connectors-doc
305 <li>The changes need around 4 hours to be synced to tomcat.apache.org.</li>
309 <section name="Guides and Resources">
311 A little help to get you started if you need it
315 <a href="http://www.xml.org/xml/resources_focus_beginnerguide.shtml">XML
319 <a href="http://issues.apache.org/bugzilla/">Bugzilla</a>
322 <a href="http://issues.apache.org/bugwritinghelp.html">Bugzilla Bug
326 <a href="http://ant.apache.org/">Ant</a>
329 <a href="http://subversion.tigris.org/">Subversion Home</a>
332 <a href="http://svn.apache.org/repos/asf/tomcat/jk/trunk/xdocs/">JK Docs repository</a>