<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.    
-->
<document>

  <properties>
     <title>Source Code</title>
  </properties>

<body>

  <section name="Get Source Code">
    <subsection name="Anonymous Access">
      <p>The source can be checked out anonymously from SVN with the following command.</p>
      <p><code>$ svn checkout http://svn.apache.org/repos/asf/james/protocols/trunk james-protocols</code></p>
    </subsection>
    <subsection name="Developer Access">
      <p>Everyone can access the Subversion repository via HTTP, but Committers must checkout the Subversion repository via HTTPS.</p>
      <p><code>$ svn checkout https://svn.apache.org/repos/asf/james/protocols/trunk james-protocols</code></p>
    </subsection>
  </section>

  <section name="Build Source Code">
    <p>You can read a tutorial on how to build Apache James Server on <a href="http://james.apache.org/server/3/dev-build.html">http://james.apache.org/server/3/dev-build.html</a>.</p>
    <p>The SVN URLs and the project names must be adapted, but the requirements and process are the same and you can inspire
       from the build the Apache James IMAP libraries.</p>
  </section>

  <section name="Source Organization">
    <subsection name="Modules">
      <div style="float:left; margin=4px;">
        <img src="images/uml/org.apache.james.protocols-package.png"/>
      </div>
    </subsection>
    <div style="clear:both; float:none;"/>
    <subsection name="James Protocols API">
      <p><code>apache-james-protocols-api</code> contains the interfaces, exceptions and Constants needed by the other projects.</p>
    </subsection>
    <subsection name="James Protocols Implementation">
      <p><code>apache-james-protocols-impl</code> provides common services that can be used by any mail protocol.</p>
    </subsection>
    <subsection name="James Protocols SMTP">
      <p><code>apache-james-protocols-smtp</code> implements the SMTP protocols with <a href="http://james.apache.org/server/3/dev-extend-smtp-hook.html">hooks</a> for extensions.</p>
    </subsection>
  </section>

  <section name="IMAP4 Source Code">
    <subsection name="Modules">
      <div style="float:left; margin:4px;">
        <img src="images/uml/org.apache.james.imap-withtest-package.png"/>
      </div>
    </subsection>
    <div style="clear:both; float:none;"/>
    <subsection name="Apache James IMAP API">
      <p><code>apache-james-imap-api</code> contains the interfaces, exceptions and Constants needed by the other projects.</p>
      <p>The following diagram represents some key (not all) interfaces of the IMAP API project.</p>
<!--      Add an updated image... -->
<!--      <img src="images/uml/org.apache.james.imap.api.png"/>-->
    </subsection>
    <subsection name="Apache James IMAP Message">
      <p><code>apache-james-imap-message</code> allows to encode, decode and structure the IMAP requests and responses.</p>
      <p>It will provide among other the ImapRequestMessage and ImapResponseMessage implementation to be processed
         by the apache-james-imap-processor project.</p>
    </subsection>
    <subsection name="Apache James IMAP Processor">
      <p><code>apache-james-imap-processor</code> implements the Chain Of Responsibility design pattern.</p>
      <p>ImapRequestMessage and ImapResponder will be passed to the list of Processors that 
         will execute doProcess if applicable.</p>
    </subsection>
    <subsection name="Apache James Integeration Test">
      <p>A <a href="https://svn.apache.org/repos/asf/james/mailbox-integration-tester/trunk/">specific integration project</a> is 
      responsible to test the IMAP protocol in conjunction with the <a href="http://james.apache.org/mailbox">Apache James mailbox</a> components.</p>
    </subsection>
    
  </section>
    
</body>

</document>
