directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1508223 - in /directory/site/trunk/content/api/user-guide: 2.1-connection-disconnection.mdtext 2.3-searching.mdtext 2.4-adding.mdtext 2.5-deleting.mdtext
Date Mon, 29 Jul 2013 22:46:57 GMT
Author: elecharny
Date: Mon Jul 29 22:46:57 2013
New Revision: 1508223

URL: http://svn.apache.org/r1508223
Log:
Updated some pages

Modified:
    directory/site/trunk/content/api/user-guide/2.1-connection-disconnection.mdtext
    directory/site/trunk/content/api/user-guide/2.3-searching.mdtext
    directory/site/trunk/content/api/user-guide/2.4-adding.mdtext
    directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext

Modified: directory/site/trunk/content/api/user-guide/2.1-connection-disconnection.mdtext
URL: http://svn.apache.org/viewvc/directory/site/trunk/content/api/user-guide/2.1-connection-disconnection.mdtext?rev=1508223&r1=1508222&r2=1508223&view=diff
==============================================================================
--- directory/site/trunk/content/api/user-guide/2.1-connection-disconnection.mdtext (original)
+++ directory/site/trunk/content/api/user-guide/2.1-connection-disconnection.mdtext Mon Jul
29 22:46:57 2013
@@ -71,7 +71,7 @@ Once you don't need to use the connectio
     ...
     connection.close();
 
-## Using a pool of connection
+## Using a pool of connections
 
 Creating a connection is expensive. If you are to reuse a connection over and over, or if
you are writing an application that will need many LDAP conenctions, you may want to use a
pool of connections.
 

Modified: directory/site/trunk/content/api/user-guide/2.3-searching.mdtext
URL: http://svn.apache.org/viewvc/directory/site/trunk/content/api/user-guide/2.3-searching.mdtext?rev=1508223&r1=1508222&r2=1508223&view=diff
==============================================================================
--- directory/site/trunk/content/api/user-guide/2.3-searching.mdtext (original)
+++ directory/site/trunk/content/api/user-guide/2.3-searching.mdtext Mon Jul 29 22:46:57 2013
@@ -99,7 +99,60 @@ Here is the list of possible connectors 
 And here is the list of possible expression nodes, assuming that an expression node :
 
     * = Equality expression node : the selected entry matches the right part
-    * *= Presence expression node : tehentry has the Attribute on the left side
-    * >= Superior : the entry should be superior to the right part
-    * <=
-    * ~=
+    * =* Presence expression node : tehentry has the Attribute on the left side
+    * >= Superior expression node : the entry should be superior to the right part
+    * <= Inferior expression node : the entry should be superior to the right part
+    * = [start][*][middle][*][final] Substring expression nose : the entry should match a
usbstring
+
+>**Note:**  As of Apache DS 2.0, we don't support approx matches not extensible matches.
+
+## More complex searches
+
+Sometime, you way want to have more control on the search opetation, either on the parameters
you want to use, or on the results you get.
+
+A search can return something else than an entry. In fact, you can get three different kind
of response
+    
+    * When it's done, you will receive a SearchResultDone
+    * When the response is a reference to another entry, you will get a SearchResultReference
+    * In some cases, you may also receive an IntermediateResponse.
+
+You may also add a Control to the searchRequest, or request some specific AttributeType to
be returned. The parameter you can inject into a SearchRequest are the following :
+
+    * The base DN 
+    * The filter
+    * The Scope (one of OBJECT, ONELEVEL or SUBTREE)
+    * The size limit
+    * The time limit
+    * The list of attributes to return
+    * The alias dereferencing mode (one of DEREF_ALWAYS, DEREF_FINDING_BASE_OBJ, DEREF_IN_SEARCHING
or NEVER_DEREF_ALIASES)
+    * The TypesOnly flag (to get the AttributeTypes but no values)
+    * The controls
+
+In both case, you should fill a _SearchRequest_ message and send it to the server :
+
+    :::Java
+    // Create the SearchRequest object
+    SearchRequest req = new SearchRequestImpl();
+    req.setScope( SearchScope.SUBTREE );
+    req.addAttributes( "*" );
+    req.setTimeLimit( 0 );
+    req.setBase( new Dn( "ou=system" ) );
+    req.setFilter( "(cn=user1)" );
+
+    // Process the request
+    SearchCursor searchCursor = connection.search( req );
+
+    while ( searchCursor.next() )
+    {
+        Response response = searchCursor.get();
+
+        // process the SearchResultEntry
+        if ( response instanceof SearchResultEntry )
+        {
+            Entry resultEntry = ( ( SearchResultEntry ) response ).getEntry();
+            ...
+        }
+    }
+
+As we can see, the response is different : we get back a _SearchCursor_ instance, and we
have to check the response type before being able to process it.
+

Modified: directory/site/trunk/content/api/user-guide/2.4-adding.mdtext
URL: http://svn.apache.org/viewvc/directory/site/trunk/content/api/user-guide/2.4-adding.mdtext?rev=1508223&r1=1508222&r2=1508223&view=diff
==============================================================================
--- directory/site/trunk/content/api/user-guide/2.4-adding.mdtext (original)
+++ directory/site/trunk/content/api/user-guide/2.4-adding.mdtext Mon Jul 29 22:46:57 2013
@@ -27,7 +27,7 @@ Notice: Licensed to the Apache Software 
 Adding entries is one of the base operation a user can do on a **LDAP** server. Nevertheless,
such an operation implies a lot of checks, and frequently the user gets some weird error messages.
We will see how we can add an entry using the **LDAP API**, and then analyze the different
error cases we can face.
 
 ## Adding an entry
-We will first see the easiest way to add an entry into the server, assuming that the entry
is correct. In order to add an entry, you only have to provide the place where this entry
will be stored (its **[Dn]()**) and the list of its **[Attributes]()**.
+We will first see the easiest way to add an entry into the server, assuming that the entry
is correct. In order to add an entry, you only have to provide the place where this entry
will be stored (its _Dn_) and the list of its _Attributes_.
 
 Here is two examples where we inject the entry using **LDIF** :
 
@@ -79,7 +79,7 @@ Down the line, what is important is that
 
 We can also create the **[Entry](6.12-entry.html)** in a different way, which will be exposed
in the following paragraphs.
 
-## Sending an **[AddRequest]()**
+## Sending an _AddRequest_
 
 Sometimes, we want more control. We can ask the server to add an entry by sending an **[AddRequest]()**,
which allows you to send a **[Control]()** at the same time.
 
@@ -145,17 +145,17 @@ Some may want to add an entry, but will 
 
 Successfully adding an entry assume that the entry is correct, ie that the attributes and
the value are compatible with the schema. There are many things checked by the server. Here
is a list of constraints that you should respect in order to get your entry injected:
 
-* The entry must have at least one **Structural** **[ObjectClass]()**
-* If the entry has more than one **Structural** **[ObjectClass]()**, then they must be hierarchically
related
-* The *[DIRAPI:ObjectClass]es* define the list of allowed **Structural** **[AttributeTypes]()**
that can be used (**MAY** and **MUST**)
+* The entry must have at least one **Structural** _ObjectClass_
+* If the entry has more than one **Structural** _ObjectClass_, then they must be hierarchically
related
+* The _ObjectClasses_ define the list of allowed **Structural** _AttributeTypes_ that can
be used (**MAY** and **MUST**)
 * All the **MUST** **[AttributeTypes]()** must be present
-* Each added value must follow the **[DIRAPI:AttributeType]** **[Syntax]()**
-* If the **[DIRAPI:AttributeType]** is single valued, then you can't add more than one value
-* The entry's **[Dn]()** must have a parent
+* Each added value must follow the _AttributeType_ _Syntax_
+* If the _AttributeType_ is single valued, then you can't add more than one value
+* The entry's _Dn_ must have a parent
 * You are not allowed as a user to inject operational attributes, unless they have the **USER-MODIFICATION**
flag set to true.
 
 
-There are also some other constraints, depending on the server, if it implements **[NameForms]()**,
**[DITStructureRules]()** or *[DITContentRules]()**.
+There are also some other constraints, depending on the server, if it implements _NameForms_,
_DITStructureRules_ or _DITContentRules_.
 
 One other reason your entry can be rejected is that you don't have enough privilege to add
it. You have to check that the server configuration allows you to add an entry where you want
to add it.
 
@@ -169,4 +169,4 @@ In any other case, the server will simpl
 
 Usually, if you get an error while adding an entry, the message might be pretty tedious.
Most of the cases it's because either your entry already exists, or because your entry has
some schema violation.
 
-The **[LdapResult]()** in the response will give you a clue about what going on.
\ No newline at end of file
+The _LdapResult_ in the response will give you a clue about what going on.
\ No newline at end of file

Modified: directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext
URL: http://svn.apache.org/viewvc/directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext?rev=1508223&r1=1508222&r2=1508223&view=diff
==============================================================================
--- directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext (original)
+++ directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext Mon Jul 29 22:46:57 2013
@@ -24,11 +24,11 @@ Notice: Licensed to the Apache Software 
 
 # 2.5 - Deleting entries
 
-Deleting an entry is really easy. It's just a matter to know its **[Dn]()**. There is one
important thing to understand though : if this entry has some children, it won't be deleted.
+Deleting an entry is really easy. It's just a matter to know its _DN_. There is one important
thing to understand though : if this entry has some children, it won't be deleted.
 
 ## Simple entry deletion
 
-We can ask the deletion by providing the entry's **[Dn]()**, like what is done in the following
example :
+We can ask the deletion by providing the entry's _DN_, like what is done in the following
example :
 
     :::Java
     @Test
@@ -81,7 +81,7 @@ Usually, you can't delete an entry and a
 
 ## Sending a DeleteRequest with a control
 
-It's also possible to associate a **[Control]** with the delete request. In order to do that,
you have to create a **[DelRequest]()** instance. In the following example, we will add the
Delete Tree control (this make this call equivalent to the _deleteTree()_ method).
+It's also possible to associate a **[Control]** with the delete request. In order to do that,
you have to create a _DelRequest_ instance. In the following example, we will add the Delete
Tree control (this make this call equivalent to the _deleteTree()_ method).
 
     :::Java
     @Test



Mime
View raw message