directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r873162 - in /websites/staging/directory/trunk/content: ./ api/user-guide/6.5-ava.html
Date Tue, 06 Aug 2013 11:21:34 GMT
Author: buildbot
Date: Tue Aug  6 11:21:34 2013
New Revision: 873162

Log:
Staging update by buildbot for directory

Modified:
    websites/staging/directory/trunk/content/   (props changed)
    websites/staging/directory/trunk/content/api/user-guide/6.5-ava.html

Propchange: websites/staging/directory/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Aug  6 11:21:34 2013
@@ -1 +1 @@
-1509223
+1510903

Modified: websites/staging/directory/trunk/content/api/user-guide/6.5-ava.html
==============================================================================
--- websites/staging/directory/trunk/content/api/user-guide/6.5-ava.html (original)
+++ websites/staging/directory/trunk/content/api/user-guide/6.5-ava.html Tue Aug  6 11:21:34
2013
@@ -17,7 +17,7 @@
 -->
 <html>
 	<head>
-		<title>AVA &mdash; Apache Directory</title>
+		<title>6.5 - Ava &mdash; Apache Directory</title>
 		
 	    <link href="./../../css/common.css" rel="stylesheet" type="text/css">
 	    <link href="./../../css/brown.css" rel="stylesheet" type="text/css">
@@ -130,17 +130,55 @@
         </div>
         <div class="nav_next">
         
-            <a href="6.6-csn.html">6.6 - Csn</a>
+            <a href="6.6-control.html">6.6 - Control</a>
 		
         </div>
         <div class="clearfix"></div>
     </div>
 
 
-<h1 id="65-ava">6.5 AVA</h1>
-<blockquote>
-<p><strong>Note:</strong> Contents for this page will be added soon...</p>
-</blockquote>
+<h1 id="65-ava">6.5 - Ava</h1>
+<p>An <em>Ava</em> is used to store an <em>Attribute</em> value
associated to an <em>AttributeType</em>. </p>
+<p>It describes a container holding an <em>AttributeType</em> associated
with a <em>Value</em> in a <em>Rdn</em>. An example would be :</p>
+<div class="codehilite"><pre><span class="n">dc</span><span class="o">=</span><span
class="n">example</span>
+</pre></div>
+
+
+<p>where 'dc' is the <em>AttributeType</em> and 'example' the associated
value.</p>
+<p>The value can be a binary or a String value, depending on the <em>AttributeType</em>.</p>
+<p>Again, we can create schema aware <em>Ava</em>, or just plain <em>Ava</em>.
Having a schema aware <em>Ava</em> allows further controls to be made o the value
we inject : its syntax will be checked against the <em>AttributeType</em> syntax.</p>
+<p>Most of the time, one will not have to create or manipulate an <em>Ava</em>,
as it's an internal element of a <em>Rdn</em>.</p>
+<p><em>AVA</em> is a final class, it can be schema aware. It's also a <em>Externalizable</em>
class.</p>
+<h2 id="usage">Usage</h2>
+<p>As for the *<em>Dn</em> and <em>Rdn</em> classes, we have
to hold two representation for the interned <em>AttributeType</em> and <em>Value</em>
: the User Provided form, and the normalized form. If the <em>AVA</em> is schema
aware, we will use the AttributeType's <em>Oid</em> as the normalized form for
the <em>AttributeType</em>, and the value will be normalized accordingly to the
equality matching rule the <em>AttributeType</em> defines, if any. Let's see some
examples.</p>
+<h3 id="schema-aware-ava">Schema Aware Ava</h3>
+<p>Here we will create an <em>AVA</em> and check that the user provided
values are preserved. The <em>getUpName()</em> and <em>getString()</em>
methods will give back this user provided form.</p>
+<div class="codehilite"><pre><span class="n">Ava</span> <span
class="n">atav</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">Ava</span><span class="o">(</span> <span class="n">schemaManager</span><span
class="o">,</span> <span class="s">&quot; CommonName &quot;</span><span
class="o">,</span> <span class="s">&quot; This is    a TEST &quot;</span>
<span class="o">);</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span
class="o">.</span><span class="na">println</span><span class="o">(</span>
<span class="s">&quot;toString     : &#39;&quot;</span> <span class="o">+</span>
<span class="n">atav</span><span class="o">.</span><span class="na">toString</span><span
class="o">()</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
<span class="o">);</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span
class="o">.</span><span class="na">println</span><span class="o">(</span>
<span class="s">&quot;Normalized   : &#39;&quot;</span> <span class="o">+</span>
<span class="n">atav</span><span class="o">.</span><span class="na">getNormName</span><span
class="o">()</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
<span class="o">);</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span
class="o">.</span><span class="na">println</span><span class="o">(</span>
<span class="s">&quot;UserProvided : &#39;&quot;</span> <span class="o">+</span>
<span class="n">atav</span><span class="o">.</span><span class="na">getUpName</span><span
class="o">()</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
<span class="o">);</span>
+</pre></div>
+
+
+<p>will produce :</p>
+<div class="codehilite"><pre><span class="n">ToString</span>    
<span class="o">:</span> <span class="err">&#39;</span> <span
class="n">CommonName</span> <span class="o">=</span> <span class="n">This</span>
<span class="n">is</span>    <span class="n">a</span> <span class="n">TEST</span>
<span class="err">&#39;</span>
+<span class="n">Normalized</span>   <span class="o">:</span> <span
class="err">&#39;</span><span class="mf">2.5</span><span class="o">.</span><span
class="mf">4.3</span><span class="o">=</span><span class="k">this</span>
<span class="n">is</span> <span class="n">a</span> <span class="n">test</span><span
class="err">&#39;</span>
+<span class="n">UserProvided</span> <span class="o">:</span> <span
class="err">&#39;</span> <span class="n">CommonName</span> <span
class="o">=</span> <span class="n">This</span> <span class="n">is</span>
   <span class="n">a</span> <span class="n">TEST</span> <span class="err">&#39;</span>
+</pre></div>
+
+
+<p>Note that the normalized value has transformed the <em>AttributeType</em>
and now uses its <em>Oid</em>, and the value has been lower cased and the superfluous
spaces have been removed, as dictated by the <em>CaseIgnoreMatch</em> <em>MatchingRule
(e)</em></p>
+<p><em>{+}Not Schema Aware{+}</em></p>
+<p>The biggest difference in this case is that the <em>AttributeType</em>
will not be replaced by its <em>Oid</em>, but instead by a lower cased form of
the provided ID. We also escape the leading and trailing spaces in the value.</p>
+<p>{code}
+public void testAvaSimpleNorm() throws LdapException
+{
+    Ava atav = new Ava( null, " CommonName ", " This is    a TEST " );
+    assertEquals( " CommonName = This is    a TEST ", atav.toString() );
+    assertEquals( "commonname=\ This is    a TEST\ ", atav.getNormName() );
+    assertEquals( " CommonName = This is    a TEST ", atav.getUpName() );
+}
+{code}</p>
 
 
     <div class="nav">
@@ -156,7 +194,7 @@
         </div>
         <div class="nav_next">
         
-            <a href="6.6-csn.html">6.6 - Csn</a>
+            <a href="6.6-control.html">6.6 - Control</a>
 		
         </div>
         <div class="clearfix"></div>



Mime
View raw message