From 0e1ac7c8da21e591ae3056f6f7801b6c03e0c9a3 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Mon, 07 Jul 2014 11:14:26 +0000
Subject: [PATCH] OPENDJ-1509 (CR-3963) The opendj-ldap-sdk is redundant and can be removed Remove the opendj-ldap-sdk project and update dependencies in all pom files and in the project documentation. * all pom.xml ** Removing reference to the opendj-ldap-sdk project and add dependencies to opendj-core and openj-grizzly * opendj-core/.../index.xml.vm ** Updating the opendj-core documentation with the opendj-ldap-sdk old documentation page * opendj-project site.xml chap-get-sdk.xml ** Updating project documentation menu and developer guide

---
 opendj-core/src/site/xdoc/index.xml.vm               |  110 ++++++++++++++++--
 opendj-ldap-sdk-examples/pom.xml                     |    8 +
 /dev/null                                            |  185 ------------------------------
 opendj-ldap-toolkit/src/main/assembly/descriptor.xml |    3 
 src/site/site.xml                                    |    2 
 src/main/docbkx/dev-guide/chap-get-sdk.xml           |   11 +
 pom.xml                                              |    1 
 opendj-virtual/pom.xml                               |    7 +
 8 files changed, 117 insertions(+), 210 deletions(-)

diff --git a/opendj-core/src/site/xdoc/index.xml.vm b/opendj-core/src/site/xdoc/index.xml.vm
index d9b6acb..7fcdc7a 100644
--- a/opendj-core/src/site/xdoc/index.xml.vm
+++ b/opendj-core/src/site/xdoc/index.xml.vm
@@ -26,25 +26,41 @@
 <document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
   <properties>
-    <title>About ${project.name}</title>
+    <title>About OpenDJ LDAP SDK</title>
     <author email="opendj-dev@forgerock.org">${project.organization.name}</author>
   </properties>
   <body>
-    <section name="About ${project.name}">
+    <section name="About OpenDJ LDAP SDK">
       <p>
-        ${project.description}
+        The OpenDJ LDAP SDK provides a set of modern, developer-friendly Java
+        APIs as part of the OpenDJ product suite. The product suite includes the
+        client SDK alongside command-line tools and sample code, a 100% pure
+        Java directory server, and more. You can use OpenDJ SDK to create client
+        applications for use with any server that complies with the,
+        <a href='http://tools.ietf.org/html/rfc4510'>RFC 4510: Lightweight Directory
+        Access Protocol (LDAP): Technical Specification Road Map</a>.
+      </p>
+      <p>
+        The OpenDJ LDAP SDK brings you easy-to-use connection management,
+        connection pooling, load balancing, and all the standard LDAP operations
+        to read and write directory entries. OpenDJ LDAP SDK also lets you build
+        applications with capabilities defined in additional draft and
+        experimental RFCs that are supported by modern LDAP servers.
       </p>
     </section>
-    <section name="Documentation for ${project.name}">
+    <section name="Documentation for OpenDJ SDK">
       <p>
         Javadoc for this module can be found <a href="apidocs/index.html">here</a>.
+        Read the <a href="../doc/dev-guide/index.html">developer guide</a> for
+        a deeper understanding of LDAP application development, as well as a
+        detailed over of LDAP itself.
       </p>
     </section>
-    <section name="Get ${project.name}">
+    <section name="Get the OpenDJ LDAP SDK">
       <p>
-        Start developing your applications by obtaining ${project.name}
-        using any of the following methods: 
-    </p>
+        You can start developing your LDAP applications now by obtaining the
+        OpenDJ LDAP SDK using any of the following methods: 
+      </p>
       <subsection name="Maven">
         <p>
           By far the simplest method is to develop your application using Maven
@@ -67,11 +83,29 @@
       &lt;enabled>false&lt;/enabled>
     &lt;/releases>
   &lt;/repository>
-&lt;/repositories>
-
-...
-
-&lt;dependencies>
+&lt;/repositories></source>
+        <p>
+          The following dependencies will load both the OpenDJ Core APIs and the
+          OpenDJ Grizzly network transport:
+        </p>
+        <source>&lt;dependencies>
+  &lt;dependency>
+    &lt;groupId>${project.groupId}&lt;/groupId>
+    &lt;artifactId>${project.artifactId}&lt;/artifactId>
+    &lt;version>${project.version}&lt;/version>
+  &lt;/dependency>
+  &lt;dependency>
+    &lt;groupId>${project.groupId}&lt;/groupId>
+    &lt;artifactId>opendj-grizzly&lt;/artifactId>
+    &lt;version>${project.version}&lt;/version>
+  &lt;/dependency>
+&lt;/dependencies></source>
+        <p>
+          In some use-cases, such as developing LDAP unit tests or embedded
+          LDAP applications, the network transport is not required, in which
+          case you can simply declare a dependency on the OpenDJ core APIs:
+        </p>
+        <source>&lt;dependencies>
   &lt;dependency>
     &lt;groupId>${project.groupId}&lt;/groupId>
     &lt;artifactId>${project.artifactId}&lt;/artifactId>
@@ -100,7 +134,55 @@
     </section>
     <section name="Getting started">
       <p>
-        Please refer to the <a href="../opendj-ldap-sdk">example</a> in the OpenDJ LDAP SDK page.
+        The following example shows how the OpenDJ SDK may be used to
+        connect to a Directory Server, authenticate, and then perform a
+        search. The search results are output as LDIF to the standard output:
+      </p>
+      <source>// Create an LDIF writer which will write the search results to stdout.
+final LDIFEntryWriter writer = new LDIFEntryWriter(System.out);
+Connection connection = null;
+try
+{
+  // Connect and bind to the server.
+  final LDAPConnectionFactory factory = new LDAPConnectionFactory("localhost", 1389);
+
+  connection = factory.getConnection();
+  connection.bind(userName, password);
+
+  // Read the entries and output them as LDIF.
+  final ConnectionEntryReader reader = connection.search(baseDN, scope, filter, attributes);
+  while (reader.hasNext())
+  {
+    if (reader.isEntry())
+    {
+      // Got an entry.
+      final SearchResultEntry entry = reader.readEntry();
+      writer.writeComment("Search result entry: " + entry.getName().toString());
+      writer.writeEntry(entry);
+    }
+    else
+    {
+      // Got a continuation reference.
+      final SearchResultReference ref = reader.readReference();
+      writer.writeComment("Search result reference: " + ref.getURIs().toString());
+    }
+  }
+  writer.flush();
+}
+catch (final Exception e)
+{
+  // Handle exceptions...
+  System.err.println(e.getMessage());
+}
+finally
+{
+  if (connection != null)
+  {
+    connection.close();
+  }
+}</source>
+      <p>
+        You can find more examples in the <a href="../opendj-ldap-sdk-examples/index.html">OpenDJ LDAP SDK Examples</a> module.
       </p>
     </section>
   </body>
diff --git a/opendj-ldap-sdk-examples/pom.xml b/opendj-ldap-sdk-examples/pom.xml
index e07a240..9fd8103 100644
--- a/opendj-ldap-sdk-examples/pom.xml
+++ b/opendj-ldap-sdk-examples/pom.xml
@@ -37,9 +37,13 @@
   <dependencies>
     <dependency>
       <groupId>org.forgerock.opendj</groupId>
-      <artifactId>opendj-ldap-sdk</artifactId>
+      <artifactId>opendj-core</artifactId>
       <version>${project.version}</version>
-      <type>pom</type>
+    </dependency>
+    <dependency>
+      <groupId>org.forgerock.opendj</groupId>
+      <artifactId>opendj-grizzly</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
diff --git a/opendj-ldap-sdk/pom.xml b/opendj-ldap-sdk/pom.xml
deleted file mode 100644
index 2c82336..0000000
--- a/opendj-ldap-sdk/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ! CDDL HEADER START
-  !
-  ! The contents of this file are subject to the terms of the
-  ! Common Development and Distribution License, Version 1.0 only
-  ! (the "License").  You may not use this file except in compliance
-  ! with the License.
-  !
-  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
-  ! or http://forgerock.org/license/CDDLv1.0.html.
-  ! See the License for the specific language governing permissions
-  ! and limitations under the License.
-  !
-  ! When distributing Covered Code, include this CDDL HEADER in each
-  ! file and include the License file at legal-notices/CDDLv1_0.txt.
-  ! If applicable, add the following below this CDDL HEADER, with the
-  ! fields enclosed by brackets "[]" replaced with your own identifying
-  ! information:
-  !      Portions Copyright [yyyy] [name of copyright owner]
-  !
-  ! CDDL HEADER END
-  !
-  !      Copyright 2011-2013 ForgeRock AS
-  !    
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <artifactId>opendj-project</artifactId>
-    <groupId>org.forgerock.opendj</groupId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>opendj-ldap-sdk</artifactId>
-  <name>OpenDJ SDK</name>
-  <description>
-    This group module provides a complete LDAP SDK for developing LDAP Directory
-    client and server applications. It includes both the core APIs and the
-    Grizzly based network transport.
-  </description>
-  <packaging>pom</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>org.forgerock.opendj</groupId>
-      <artifactId>opendj-core</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.forgerock.opendj</groupId>
-      <artifactId>opendj-grizzly</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-  <reporting>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-project-info-reports-plugin</artifactId>
-        <reportSets>
-          <reportSet>
-            <reports>
-              <report>dependencies</report>
-            </reports>
-          </reportSet>
-        </reportSets>
-      </plugin>
-    </plugins>
-  </reporting>
-</project>
diff --git a/opendj-ldap-sdk/src/site/xdoc/index.xml.vm b/opendj-ldap-sdk/src/site/xdoc/index.xml.vm
deleted file mode 100644
index 569699f..0000000
--- a/opendj-ldap-sdk/src/site/xdoc/index.xml.vm
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ! CCPL HEADER START
-  !
-  ! This work is licensed under the Creative Commons
-  ! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
-  ! To view a copy of this license, visit
-  ! http://creativecommons.org/licenses/by-nc-nd/3.0/
-  ! or send a letter to Creative Commons, 444 Castro Street,
-  ! Suite 900, Mountain View, California, 94041, USA.
-  !
-  ! You can also obtain a copy of the license at
-  ! trunk/opendj3/legal-notices/CC-BY-NC-ND.txt.
-  ! See the License for the specific language governing permissions
-  ! and limitations under the License.
-  !
-  ! If applicable, add the following below this CCPL HEADER, with the fields
-  ! enclosed by brackets "[]" replaced with your own identifying information:
-  !      Portions Copyright [yyyy] [name of copyright owner]
-  !
-  ! CCPL HEADER END
-  !
-  !      Copyright 2011-2013 ForgeRock AS
-  !    
--->
-<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
-  <properties>
-    <title>About OpenDJ LDAP SDK</title>
-    <author email="opendj-dev@forgerock.org">${project.organization.name}</author>
-  </properties>
-  <body>
-    <section name="About OpenDJ LDAP SDK">
-      <p>
-        The OpenDJ LDAP SDK provides a set of modern, developer-friendly Java
-        APIs as part of the OpenDJ product suite. The product suite includes the
-        client SDK alongside command-line tools and sample code, a 100% pure
-        Java directory server, and more. You can use OpenDJ SDK to create client
-        applications for use with any server that complies with the,
-        <a href='http://tools.ietf.org/html/rfc4510'>RFC 4510: Lightweight Directory
-        Access Protocol (LDAP): Technical Specification Road Map</a>.
-      </p>
-      <p>
-        The OpenDJ LDAP SDK brings you easy-to-use connection management,
-        connection pooling, load balancing, and all the standard LDAP operations
-        to read and write directory entries. OpenDJ LDAP SDK also lets you build
-        applications with capabilities defined in additional draft and
-        experimental RFCs that are supported by modern LDAP servers.
-      </p>
-    </section>
-    <section name="Documentation for ${project.name}">
-      <p>
-        Javadoc for this module can be found <a href="apidocs/index.html">here</a>.
-        Read the <a href="../doc/dev-guide/index.html">developer guide</a> for
-        a deeper understanding of LDAP application development, as well as a
-        detailed over of LDAP itself.
-      </p>
-    </section>
-    <section name="Get the OpenDJ LDAP SDK">
-      <p>
-        You can start developing your LDAP applications now by obtaining the
-        OpenDJ LDAP SDK using any of the following methods: 
-      </p>
-      <subsection name="Maven">
-        <p>
-          By far the simplest method is to develop your application using Maven
-          and add the following settings to your <b>pom.xml</b>:
-        </p>
-        <source>&lt;repositories>
-  &lt;repository>
-    &lt;id>forgerock-staging-repository&lt;/id>
-    &lt;name>ForgeRock Release Repository&lt;/name>
-    &lt;url>${mavenRepoReleases}&lt;/url>
-    &lt;snapshots>
-      &lt;enabled>false&lt;/enabled>
-    &lt;/snapshots>
-  &lt;/repository>
-  &lt;repository>
-    &lt;id>forgerock-snapshots-repository&lt;/id>
-    &lt;name>ForgeRock Snapshot Repository&lt;/name>
-    &lt;url>${mavenRepoSnapshots}&lt;/url>
-    &lt;releases>
-      &lt;enabled>false&lt;/enabled>
-    &lt;/releases>
-  &lt;/repository>
-&lt;/repositories></source>
-        <p>
-          The following dependency will load both the OpenDJ Core APIs and the
-          OpenDJ Grizzly network transport:
-        </p>
-        <source>&lt;dependencies>
-  &lt;dependency>
-    &lt;groupId>${project.groupId}&lt;/groupId>
-    &lt;artifactId>${project.artifactId}&lt;/artifactId>
-    &lt;version>${project.version}&lt;/version>
-    &lt;type>pom&lt;/type>
-  &lt;/dependency>
-&lt;/dependencies></source>
-        <p>
-          In some use-cases, such as developing LDAP unit tests or embedded
-          LDAP applications, the network transport is not required, in which
-          case you can simply declare a dependency on the OpenDJ core APIs:
-        </p>
-        <source>&lt;dependencies>
-  &lt;dependency>
-    &lt;groupId>${project.groupId}&lt;/groupId>
-    &lt;artifactId>opendj-core&lt;/artifactId>
-    &lt;version>${project.version}&lt;/version>
-  &lt;/dependency>
-&lt;/dependencies></source>
-      </subsection>
-      <subsection name="Download">
-        <p>
-          If you are not using Maven then you will need to download a pre-built
-          binary from the ForgeRock Maven repository, along with any compile
-          time <a href="dependencies.html">dependencies</a>:
-        </p>
-        <ul>
-          <li><a href="${mavenRepoReleases}/org/forgerock/opendj/opendj-core">Stable releases</a></li>
-          <li><a href="${mavenRepoSnapshots}/org/forgerock/opendj/opendj-core/${project.version}">Latest development snapshot</a></li>
-        </ul>
-      </subsection>
-      <subsection name="Build">
-        <p>
-          For the DIY enthusiasts you can build it yourself by checking out the
-          latest code using <a href="source-repository.html">Subversion</a>
-          and building it with Maven 3.
-        </p>
-      </subsection>
-    </section>
-    <section name="Getting started">
-      <p>
-        The following example shows how the OpenDJ SDK may be used to
-        connect to a Directory Server, authenticate, and then perform a
-        search. The search results are output as LDIF to the standard output:
-      </p>
-      <source>// Create an LDIF writer which will write the search results to stdout.
-final LDIFEntryWriter writer = new LDIFEntryWriter(System.out);
-Connection connection = null;
-try
-{
-  // Connect and bind to the server.
-  final LDAPConnectionFactory factory = new LDAPConnectionFactory("localhost", 1389);
-
-  connection = factory.getConnection();
-  connection.bind(userName, password);
-
-  // Read the entries and output them as LDIF.
-  final ConnectionEntryReader reader = connection.search(baseDN, scope, filter, attributes);
-  while (reader.hasNext())
-  {
-    if (reader.isEntry())
-    {
-      // Got an entry.
-      final SearchResultEntry entry = reader.readEntry();
-      writer.writeComment("Search result entry: " + entry.getName().toString());
-      writer.writeEntry(entry);
-    }
-    else
-    {
-      // Got a continuation reference.
-      final SearchResultReference ref = reader.readReference();
-      writer.writeComment("Search result reference: " + ref.getURIs().toString());
-    }
-  }
-  writer.flush();
-}
-catch (final Exception e)
-{
-  // Handle exceptions...
-  System.err.println(e.getMessage());
-}
-finally
-{
-  if (connection != null)
-  {
-    connection.close();
-  }
-}</source>
-      <p>
-        You can find more examples in the <a href="../opendj-ldap-sdk-examples/index.html">OpenDJ LDAP SDK Examples</a> module.
-      </p>
-    </section>
-  </body>
-</document>
diff --git a/opendj-ldap-toolkit/src/main/assembly/descriptor.xml b/opendj-ldap-toolkit/src/main/assembly/descriptor.xml
index 3c9d9d7..d75cdd3 100644
--- a/opendj-ldap-toolkit/src/main/assembly/descriptor.xml
+++ b/opendj-ldap-toolkit/src/main/assembly/descriptor.xml
@@ -93,9 +93,6 @@
       <outputDirectory>lib</outputDirectory>
       <directoryMode>0755</directoryMode>
       <fileMode>0644</fileMode>
-      <excludes>
-        <exclude>org.forgerock.opendj:opendj-ldap-sdk</exclude>
-      </excludes>
     </dependencySet>
   </dependencySets>
 </assembly>
diff --git a/opendj-virtual/pom.xml b/opendj-virtual/pom.xml
index 56e659f..9ba4059 100644
--- a/opendj-virtual/pom.xml
+++ b/opendj-virtual/pom.xml
@@ -35,7 +35,12 @@
     <dependencies>
         <dependency>
             <groupId>org.forgerock.opendj</groupId>
-            <artifactId>opendj-ldap-sdk</artifactId>
+            <artifactId>opendj-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.forgerock.opendj</groupId>
+            <artifactId>opendj-grizzly</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
diff --git a/pom.xml b/pom.xml
index 565f5f7..596b731 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,7 +94,6 @@
     <module>opendj-core</module>
     <module>opendj-grizzly</module>
     <module>opendj-config</module>
-    <module>opendj-ldap-sdk</module>
     <module>opendj-cli</module>
     <module>opendj-ldap-toolkit</module>
     <module>opendj-ldap-sdk-examples</module>
diff --git a/src/main/docbkx/dev-guide/chap-get-sdk.xml b/src/main/docbkx/dev-guide/chap-get-sdk.xml
index 4abe3ce..8d14c63 100644
--- a/src/main/docbkx/dev-guide/chap-get-sdk.xml
+++ b/src/main/docbkx/dev-guide/chap-get-sdk.xml
@@ -123,11 +123,16 @@
 &lt;dependencies&gt;
   &lt;dependency&gt;
     &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
-    &lt;artifactId&gt;opendj-ldap-sdk&lt;/artifactId&gt;
+    &lt;artifactId&gt;opendj-core&lt;/artifactId&gt;
     &lt;version&gt;<?eval ${docTargetVersion}?>&lt;/version&gt;
-    &lt;type&gt;pom&lt;/type&gt;
   &lt;/dependency&gt;
-&lt;/dependencies&gt;</programlisting>
+  &lt;dependency&gt;
+    &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+    &lt;artifactId&gt;opendj-grizzly&lt;/artifactId&gt;
+    &lt;version&gt;<?eval ${docTargetVersion}?>&lt;/version&gt;
+  &lt;/dependency&gt;
+&lt;/dependencies&gt;
+	</programlisting>
    </step>
   </procedure>
 
diff --git a/src/site/site.xml b/src/site/site.xml
index 01babf0..c9a0905 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -62,7 +62,7 @@
   </menu>
 
   <menu name="OpenDJ LDAP SDK" inherit="top">
-    <item name="About" href="opendj-ldap-sdk" />
+    <item name="About" href="opendj-core" />
     <item name="Grizzly Integration" href="opendj-grizzly" />
     <item name="Examples" href="opendj-ldap-sdk-examples" />
     <item name="Toolkit" href="opendj-ldap-toolkit" />

--
Gitblit v1.10.0