You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2006/12/18 18:15:08 UTC

svn commit: r488345 [11/12] - in /directory/sandbox/pamarcelot/ldapstudio: ldapstudio-browser-core/ ldapstudio-browser-core/META-INF/ ldapstudio-browser-core/about_files/ ldapstudio-browser-core/lib/ ldapstudio-browser-core/src/ ldapstudio-browser-core...

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/URL.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/URL.java?view=auto&rev=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/URL.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/URL.java Mon Dec 18 09:15:00 2006
@@ -0,0 +1,537 @@
+/*
+ *  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. 
+ *  
+ */
+
+package org.apache.directory.ldapstudio.browser.core.model;
+
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+
+import org.apache.directory.ldapstudio.browser.core.BrowserCoreMessages;
+import org.apache.directory.ldapstudio.browser.core.utils.Utils;
+
+
+public class URL
+{
+
+    // ldap://host:port/dn?attributes?scope?filter?extensions
+    // ldap://localhost:389/ou=Testdata100,dc=seelmann,dc=muc
+
+    // ldapurl = scheme "://" [hostport] ["/" [dn ["?" [attributes] ["?"
+    // [scope] ["?" [filter] ["?" extensions]]]]]]
+    // scheme = "ldap"
+    // attributes = attrdesc *("," attrdesc)
+    // scope = "base" / "one" / "sub"
+    // dn = distinguishedName from Section 3 of [1]
+    // hostport = hostport from Section 5 of RFC 1738 [5]
+    // attrdesc = AttributeDescription from Section 4.1.5 of [2]
+    // filter = filter from Section 4 of [4]
+    // extensions = extension *("," extension)
+    // extension = ["!"] extype ["=" exvalue]
+    // extype = token / xtoken
+    // exvalue = LDAPString from section 4.1.2 of [2]
+    // token = oid from section 4.1 of [3]
+    // xtoken = ("X-" / "x-") token
+
+    private String protocol = null;
+
+    private String host = null;
+
+    private String port = null;
+
+    private String dn = null;
+
+    private String attributes = null;
+
+    private String scope = null;
+
+    private String filter = null;
+
+    private String extensions = null;
+
+
+    public URL( String url )
+    {
+        if ( url == null )
+        {
+            throw new IllegalArgumentException( BrowserCoreMessages.model__empty_url );
+        }
+
+        this.parseUrl( url );
+    }
+
+
+    public URL( IConnection connection, DN dn )
+    {
+        this( connection );
+
+        if ( dn == null )
+        {
+            throw new IllegalArgumentException( BrowserCoreMessages.model__empty_url );
+        }
+
+        this.dn = dn.toString();
+    }
+
+
+    public URL( IConnection connection )
+    {
+        if ( connection == null )
+        {
+            throw new IllegalArgumentException( BrowserCoreMessages.model__empty_url );
+        }
+
+        if ( connection.getEncryptionMethod() == IConnection.ENCYRPTION_LDAPS )
+        {
+            this.protocol = "ldaps";; //$NON-NLS-1$
+        }
+        else
+        {
+            this.protocol = "ldap"; //$NON-NLS-1$
+        }
+        this.host = connection.getHost();
+        this.port = Integer.toString( connection.getPort() );
+    }
+
+
+    public URL( ISearch search )
+    {
+        this( search.getConnection(), search.getSearchBase() );
+
+        if ( search == null )
+        {
+            throw new IllegalArgumentException( BrowserCoreMessages.model__empty_url );
+        }
+
+        this.attributes = Utils.arrayToString( search.getReturningAttributes() );
+        this.scope = search.getScope() == ISearch.SCOPE_SUBTREE ? "sub" : //$NON-NLS-1$
+            search.getScope() == ISearch.SCOPE_ONELEVEL ? "one" : //$NON-NLS-1$
+                "base"; //$NON-NLS-1$
+        this.filter = search.getFilter();
+    }
+
+
+    public boolean equals( Object o ) throws ClassCastException
+    {
+        if ( o instanceof URL )
+        {
+            return this.toString().equals( ( ( URL ) o ).toString() );
+        }
+        return false;
+    }
+
+
+    public int hashCode()
+    {
+        return this.toString().hashCode();
+    }
+
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        if ( hasProtocol() )
+            sb.append( protocol );
+
+        sb.append( "://" ); //$NON-NLS-1$
+
+        if ( hasHost() )
+            sb.append( host );
+        if ( hasPort() )
+            sb.append( ":" ).append( port ); //$NON-NLS-1$
+
+        if ( hasDn() || hasAttributes() || hasScope() || hasFilter() || hasExtensions() )
+            sb.append( "/" ); //$NON-NLS-1$
+        if ( hasDn() )
+            sb.append( dn );
+
+        if ( hasAttributes() || hasScope() || hasFilter() || hasExtensions() )
+            sb.append( "?" ); //$NON-NLS-1$
+        if ( hasAttributes() )
+            sb.append( attributes );
+
+        if ( hasScope() || hasFilter() || hasExtensions() )
+            sb.append( "?" ); //$NON-NLS-1$
+        if ( hasScope() )
+            sb.append( scope );
+
+        if ( hasFilter() || hasExtensions() )
+            sb.append( "?" ); //$NON-NLS-1$
+        if ( hasFilter() )
+            sb.append( filter );
+
+        if ( hasExtensions() )
+            sb.append( "?" ); //$NON-NLS-1$
+        if ( hasExtensions() )
+            sb.append( extensions );
+
+        return sb.toString();
+    }
+
+
+    private void parseUrl( String url )
+    {
+
+        try
+        {
+            url = URLDecoder.decode( url, "UTF-8" ); //$NON-NLS-1$
+
+            // protocol
+            String[] protocolAndRest = url.split( "://", 2 ); //$NON-NLS-1$
+            if ( protocolAndRest.length > 0 )
+            {
+                if ( "ldap".equals( protocolAndRest[0] ) || "ldaps".equals( protocolAndRest[0] ) ) { //$NON-NLS-1$ //$NON-NLS-2$
+                    this.protocol = protocolAndRest[0];
+                }
+            }
+            if ( protocolAndRest.length < 2 )
+            {
+                return;
+            }
+
+            // host and port
+            String[] hostportAndRest = protocolAndRest[1].split( "/", 2 ); //$NON-NLS-1$
+            if ( hostportAndRest.length > 0 )
+            {
+                String[] hostAndPort = hostportAndRest[0].split( ":", 2 ); //$NON-NLS-1$
+                if ( hostAndPort.length == 2 )
+                {
+                    this.host = hostAndPort[0];
+                    this.port = hostAndPort[1];
+                }
+                else if ( hostAndPort.length == 1 && hostAndPort[0].length() > 0 )
+                {
+                    this.host = hostAndPort[0];
+                    this.port = "389"; //$NON-NLS-1$
+                }
+            }
+            if ( hostportAndRest.length < 2 )
+            {
+                return;
+            }
+
+            // dn
+            String[] dnAndRest = hostportAndRest[1].split( "\\?", 2 ); //$NON-NLS-1$
+            if ( dnAndRest.length > 0 && dnAndRest[0].length() > 0 )
+            {
+                this.dn = dnAndRest[0];
+            }
+            if ( dnAndRest.length < 2 )
+            {
+                return;
+            }
+
+            // attributes
+            String[] attributesAndRest = dnAndRest[1].split( "\\?", 2 ); //$NON-NLS-1$
+            if ( attributesAndRest.length > 0 && attributesAndRest[0].length() > 0 )
+            {
+                this.attributes = attributesAndRest[0];
+            }
+            if ( attributesAndRest.length < 2 )
+            {
+                return;
+            }
+
+            // scope
+            String[] scopeAndRest = attributesAndRest[1].split( "\\?", 2 ); //$NON-NLS-1$
+            if ( scopeAndRest.length > 0 && scopeAndRest[0].length() > 0 )
+            {
+                this.scope = scopeAndRest[0];
+            }
+            if ( scopeAndRest.length < 2 )
+            {
+                return;
+            }
+
+            // filter
+            String[] filterAndRest = scopeAndRest[1].split( "\\?", 2 ); //$NON-NLS-1$
+            if ( filterAndRest.length > 0 && filterAndRest[0].length() > 0 )
+            {
+                this.filter = filterAndRest[0];
+            }
+            if ( filterAndRest.length < 2 )
+            {
+                return;
+            }
+
+            if ( filterAndRest[1].length() > 0 )
+            {
+                this.extensions = filterAndRest[0];
+            }
+
+        }
+        catch ( UnsupportedEncodingException e1 )
+        {
+        }
+
+    }
+
+
+    public static final void main( String[] args )
+    {
+        // String url = "ldap://";
+        // String url = "ldap://localhost";
+        // String url = "ldap://:389";
+        // String url = "ldap://localhost:389";
+        // String url = "ldap:///??one";
+        // String url = "ldap://localhost:389/cn=abc??sub";
+
+        // String url =
+        // "ldap://localhost:389/cn=abc?givenName,sn,mail?sub?(objectClass=*)?ext";
+
+        String url = "cn=abc"; //$NON-NLS-1$
+        String[] protocolAndRest = url.split( "\\?", 2 ); //$NON-NLS-1$
+        System.out.println( Arrays.asList( protocolAndRest ) );
+        System.out.println( protocolAndRest.length );
+    }
+
+
+    public boolean hasProtocol()
+    {
+        try
+        {
+            getProtocol();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public String getProtocol() throws NoSuchFieldException
+    {
+        if ( protocol == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_protocol );
+        }
+
+        return protocol;
+    }
+
+
+    public boolean hasHost()
+    {
+        try
+        {
+            getHost();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public String getHost() throws NoSuchFieldException
+    {
+        if ( host == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_host );
+        }
+
+        return host;
+    }
+
+
+    public boolean hasPort()
+    {
+        try
+        {
+            getPort();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public String getPort() throws NoSuchFieldException
+    {
+        try
+        {
+            int p = Integer.parseInt( port );
+            if ( p > 0 && p <= 65536 )
+            {
+                return port;
+            }
+            else
+            {
+                throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_port );
+            }
+        }
+        catch ( NumberFormatException e )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_port );
+        }
+    }
+
+
+    public boolean hasDn()
+    {
+        try
+        {
+            getDn();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public DN getDn() throws NoSuchFieldException
+    {
+        if ( dn == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_dn );
+        }
+
+        try
+        {
+            return new DN( dn );
+        }
+        catch ( NameException e )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_dn );
+        }
+    }
+
+
+    public boolean hasAttributes()
+    {
+        try
+        {
+            getAttributes();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public String[] getAttributes() throws NoSuchFieldException
+    {
+        if ( attributes == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_attributes );
+        }
+
+        return Utils.stringToArray( attributes );
+        // return attributes.split(",");
+    }
+
+
+    public boolean hasScope()
+    {
+        try
+        {
+            getScope();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public int getScope() throws NoSuchFieldException
+    {
+        if ( scope == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_scope );
+        }
+
+        if ( "base".equals( scope ) ) { //$NON-NLS-1$
+            return ISearch.SCOPE_OBJECT;
+        }
+        else if ( "one".equals( scope ) ) { //$NON-NLS-1$
+            return ISearch.SCOPE_ONELEVEL;
+        }
+        else if ( "sub".equals( scope ) ) { //$NON-NLS-1$
+            return ISearch.SCOPE_SUBTREE;
+        }
+        else
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_scope );
+        }
+    }
+
+
+    public boolean hasFilter()
+    {
+        try
+        {
+            getFilter();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public String getFilter() throws NoSuchFieldException
+    {
+        if ( filter == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_filter );
+        }
+
+        return filter;
+    }
+
+
+    public boolean hasExtensions()
+    {
+        try
+        {
+            getExtensions();
+            return true;
+        }
+        catch ( NoSuchFieldException e )
+        {
+            return false;
+        }
+    }
+
+
+    public String getExtensions() throws NoSuchFieldException
+    {
+        if ( extensions == null )
+        {
+            throw new NoSuchFieldException( BrowserCoreMessages.model__url_no_extensions );
+        }
+
+        return extensions;
+    }
+
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/ldap_oids.txt
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/ldap_oids.txt?view=auto&rev=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/ldap_oids.txt (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser-core/src/org/apache/directory/ldapstudio/browser/core/model/ldap_oids.txt Mon Dec 18 09:15:00 2006
@@ -0,0 +1,178 @@
+# If you find some reliable and more meaningful descriptions to this OIDS,
+# then please let the phpldapadmin development know so that this file can be
+# more descriptive.
+
+1.2.826.0.1.334810.2.3		"LDAP_CONTROL_VALUESRETURNFILTER"
+1.2.826.0.1.3344810.2.3		"Matched Values Control" "RFC 3876" "Describes a control for the LDAP v3 that is used to return a subset of attribute values from an entry. Specifically, only those values that match a 'values return' filter. Without support for this control, a client must retrieve all of an attribute's values and search for specific values locally."
+1.2.826.0.1050.11.1.1		"Read-Only LDAP Server"
+1.2.826.0.1050.11.2.1		"Read-Write LDAP Server"
+1.2.826.0.1050.11.3.1		"White Pages Application LDAP Server"
+1.2.826.0.1050.11.4.1		"Certificate Application LDAP Server"
+1.2.826.0.1050.11.5.1		"Single Sign On Application LDAP Server"
+1.2.840.113549.6.0.0		"Signed Operation"
+1.2.840.113549.6.0.1		"Demand Signed Result"
+1.2.840.113549.6.0.2		"Signed Result RFC 2649"
+1.2.840.113556.1.4.319		"Simple Paged Results Manipulation Control Extension" "RFC 2696" "This control extension allows a client to control the rate at which an LDAP server returns the results of an LDAP search operation. This control may be useful when the LDAP client has limited resources and may not be able to process the entire result set from a given LDAP query, or when the LDAP client is connected over a low-bandwidth connection."
+1.2.840.113556.1.4.417		"Show deleted control (Stateless)"
+1.2.840.113556.1.4.473		"LDAP Server Sort Result extesion"
+1.2.840.113556.1.4.474		"LDAP Server Sort Result extension response control"
+1.2.840.113556.1.4.521		"Cross-domain move control (Stateless)"
+1.2.840.113556.1.4.528		"Server search notification control (Forbidden)"
+1.2.840.113556.1.4.529		"Extended DN control (Stateless)"
+1.2.840.113556.1.4.616		"LDAP_CONTROL_REFERRALS"
+1.2.840.113556.1.4.619		"Lazy commit control (Stateless)"
+1.2.840.113556.1.4.800		"LDAP_CAP_ACTIVE_DIRECTORY_OID"
+1.2.840.113556.1.4.801		"Security descriptor flags control (Stateless)"
+1.2.840.113556.1.4.802		"Attribute Range Option"
+1.2.840.113556.1.4.803		"LDAP_MATCHING_RULE_BIT_AND"
+1.2.840.113556.1.4.804		"LDAP_MATCHING_RULE_BIT_OR"
+1.2.840.113556.1.4.805		"Tree Delete"
+1.2.840.113556.1.4.841		"Directory synchronization control (Stateless)"
+1.2.840.113556.1.4.906		"Microsoft Large Integer"
+1.2.840.113556.1.4.970		"Get stats control (Stateless)"
+1.2.840.113556.1.4.1302		"Microsoft OID used with DEN Attributes"
+1.2.840.113556.1.4.1338		"Verify name control (Stateless)"
+1.2.840.113556.1.4.1339		"LDAP_SERVER_DOMAIN_SCOPE_OID" "" "The LDAP_SERVER_DOMAIN_SCOPE_OID control is used to instruct the LDAP server not to generate any referrals when completing a request. This control also limits any search using it to a single naming context."
+1.2.840.113556.1.4.1340		"Search options control (Stateless)"
+1.2.840.113556.1.4.1413		"LDAP ease modify restrictions" "" "Allows an LDAP modify to work under less restrictive conditions. Without it, a delete will fail if an attribute does not exist, and an add will fail if an attribute already exists."
+1.2.840.113556.1.4.1504		"Attribute scoped query control (Stateless)"
+1.2.840.113556.1.4.1670		"LDAP_CAP_ACTIVE_DIRECTORY_V51_OID"
+1.2.840.113556.1.4.1781		"Fast concurrent bind extended operation (Forbidden)"
+1.2.840.113556.1.4.1791		"LDAP_CAP_ACTIVE_DIRECTORY_LDAP_INTEG_OID"
+1.2.840.113556.1.4.1852		"LDAP_SERVER_QUOTA_CONTROL_OID"
+1.3.6.1.1.7.1			"LCUP Sync Request Control. RFC 3928 control"
+1.3.6.1.1.7.2			"LCUP Sync Update Control. RFC 3928 control"
+1.3.6.1.1.7.3			"LCUP Sync Done Control. RFC 3928 control"
+1.3.6.1.1.8			"Cancel Operation. RFC 3909 extension"
+1.3.6.1.4.1.42.2.27.8.5.1	"passwordPolicyRequest"
+1.3.6.1.4.1.1466.101.119.1	"Dynamic Directory Services Refresh Request RFC2589"
+1.3.6.1.4.1.1466.20036		"LDAP_NOTICE_OF_DISCONNECTION"
+1.3.6.1.4.1.1466.20037		"Transport Layer Security Extension" "RFC 2830" "This operation provides for TLS establishment in an LDAP association and is defined in terms of an LDAP extended request."
+1.3.6.1.4.1.1466.29539.1	"LDAP_CONTROL_ATTR_SIZELIMIT"
+1.3.6.1.4.1.1466.29539.2	"LDAP_CONTROL_NO_COPY"
+1.3.6.1.4.1.1466.29539.3	"LDAP_CONTROL_PARTIAL_COPY"
+1.3.6.1.4.1.1466.29539.5	"LDAP_CONTROL_NO_CHAINING"
+1.3.6.1.4.1.1466.29539.7	"LDAP_CONTROL_ALIAS_ON_UPDATE"
+1.3.6.1.4.1.1466.29539.10	"LDAP_CONTROL_TRIGGER"
+1.3.6.1.4.1.1466.29539.12	"nsTransmittedControl"
+1.3.6.1.4.1.4203.1.5.1		"All Operational Attribute" "RFC 3673" "An LDAP extension which clients may use to request the return of all operational attributes."
+1.3.6.1.4.1.4203.1.5.2		"Requesting Attributes by Object Class" "draft-zeilenga-ldap-adlist-10.txt" "Extends LDAP to support a mechanism that LDAP clients may use to request the return of all attributes of an object class."
+1.3.6.1.4.1.4203.1.5.3		"LDAP Absolute True and False Filters" "draft-zeilenga-ldap-t-f-10.txt" "Implementations of this extension SHALL allow 'and' and 'or' choices with zero filter elements."
+1.3.6.1.4.1.4203.1.5.4		"Language Tags" "RFC 3866" "Supports storing attributes with language tag options in the DIT"
+1.3.6.1.4.1.4203.1.5.5		"Language Ranges" "RFC 3866" "Supports language range matching of attributes with language tag options stored in the DIT"
+1.3.6.1.4.1.4203.1.10.1		"Subentries in LDAP" "RFC 3672" "The subentries control MAY be sent with a searchRequest to control the visibility of entries and subentries which are within scope. Non-visible entries or subentries are not returned in response to the request."
+1.3.6.1.4.1.4203.1.10.2		"LDAP No-Op Control" "draft-zeilenga-ldap-noop-02.txt" "The No-Op control can be used to disable the normal effect of an operation. The control can be used to discover how a server might react to a particular update request without updating the directory."
+1.3.6.1.4.1.4203.1.11.1		"LDAP Password Modify Extended Operation" "RFC 3062" "An LDAP extended operation to allow modification of user passwords which is not dependent upon the form of the authentication identity nor the password storage mechanism used."
+1.3.6.1.4.1.4203.1.11.2		"LDAP Cancel Extended Operation"
+1.3.6.1.4.1.4203.1.11.3		"Who Am I? Extended Operation" "draft-zeilenga-ldap-authzid-10.txt" "This specification provides a mechanism for Lightweight Directory Access Protocol (LDAP) clients to obtain the authorization identity which the server has associated with the user or application entity."
+1.3.6.1.4.1.4203.666.5.1	"Subentries Control"
+1.3.6.1.4.1.4203.666.5.2	"NO OP Control"
+1.3.18.0.2.12.1			"The ACL credential controls provide a method to flow a subject's credentials associated with a bind."
+1.3.18.0.2.12.5			"tranExtOpInit"
+1.3.18.0.2.12.6			"tranExtOpInit"
+2.16.840.1.113531.18.2.1	"LDAP_C_SETOPTIONS_OID"
+2.16.840.1.113531.18.2.2	"LDAP_C_SETDONTUSECOPY_OID"
+2.16.840.1.113531.18.2.3	"LDAP_C_SETLOCALSCOPE_OID"
+2.16.840.1.113531.18.2.4	"Return operational attributes as well as user attributes"
+2.16.840.1.113531.18.2.5	"Return only subentries"
+2.16.840.1.113531.18.2.6	"LDAP_C_SETUSEALIAS_OID"
+2.16.840.1.113531.18.2.7	"LDAP_C_SETPREFERCHAIN_OID"
+2.16.840.1.113531.18.2.8	"LDAP_C_SETX500DN_OID"
+2.16.840.1.113531.18.2.9	"LDAP_C_SETCOPYSHALLDO_OID"
+2.16.840.1.113531.18.2.10	"LDAP_C_SETDONTMAPATTRS_OID"
+2.16.840.1.113531.18.2.11	"Return normal entries as well as sub-entries"
+2.16.840.1.113719.1.27.99.1	"Superior References"
+2.16.840.1.113719.1.27.100.1	"ndsToLdapResponse"
+2.16.840.1.113719.1.27.100.2	"ndsToLdapRequest"
+2.16.840.1.113719.1.27.100.3	"createNamingContextRequest"
+2.16.840.1.113719.1.27.100.4	"createNamingContextResponse"
+2.16.840.1.113719.1.27.100.5	"mergeNamingContextRequest"
+2.16.840.1.113719.1.27.100.6	"mergeNamingContextResponse"
+2.16.840.1.113719.1.27.100.7	"addReplicaRequest"
+2.16.840.1.113719.1.27.100.8	"addReplicaResponse"
+2.16.840.1.113719.1.27.100.9	"refreshLDAPServerRequest"
+2.16.840.1.113719.1.27.100.10	"refreshLDAPServerResponse"
+2.16.840.1.113719.1.27.100.11	"removeReplicaRequest"
+2.16.840.1.113719.1.27.100.12	"removeReplicaResponse"
+2.16.840.1.113719.1.27.100.13	"namingContextEntryCountRequest"
+2.16.840.1.113719.1.27.100.14	"namingContextEntryCountResponse"
+2.16.840.1.113719.1.27.100.15	"changeReplicaTypeRequest"
+2.16.840.1.113719.1.27.100.16	"changeReplicaTypeResponse"
+2.16.840.1.113719.1.27.100.17	"getReplicaInfoRequest"
+2.16.840.1.113719.1.27.100.18	"getReplicaInfoResponse"
+2.16.840.1.113719.1.27.100.19	"listReplicaRequest"
+2.16.840.1.113719.1.27.100.20	"listReplicaResponse"
+2.16.840.1.113719.1.27.100.21	"receiveAllUpdatesRequest"
+2.16.840.1.113719.1.27.100.22	"receiveAllUpdatesResponse"
+2.16.840.1.113719.1.27.100.23	"sendAllUpdatesRequest"
+2.16.840.1.113719.1.27.100.24	"sendAllUpdatesResponse"
+2.16.840.1.113719.1.27.100.25	"requestNamingContextSyncRequest"
+2.16.840.1.113719.1.27.100.26	"requestNamingContextSyncResponse"
+2.16.840.1.113719.1.27.100.27	"requestSchemaSyncRequest"
+2.16.840.1.113719.1.27.100.28	"requestSchemaSyncResponse"
+2.16.840.1.113719.1.27.100.29	"abortNamingContextOperationRequest"
+2.16.840.1.113719.1.27.100.30	"abortNamingContextOperationResponse"
+2.16.840.1.113719.1.27.100.31	"Get Bind DN Request"
+2.16.840.1.113719.1.27.100.32	"Get Bind DN Response"
+2.16.840.1.113719.1.27.100.33	"Get Effective Privileges Request"
+2.16.840.1.113719.1.27.100.34	"Get Effective Privileges Response"
+2.16.840.1.113719.1.27.100.35	"Set Replication Filter Request"
+2.16.840.1.113719.1.27.100.36	"Set Replication Filter Response"
+2.16.840.1.113719.1.27.100.37	"Get Replication Filter Request"
+2.16.840.1.113719.1.27.100.38	"Get Replication Filter Response"
+2.16.840.1.113719.1.27.100.39	"Create Orphan Partition Request"
+2.16.840.1.113719.1.27.100.40	"Create Orphan Partition Response"
+2.16.840.1.113719.1.27.100.41	"Remove Orphan Partition Request"
+2.16.840.1.113719.1.27.100.42	"Remove Orphan Partition Response"
+2.16.840.1.113719.1.27.100.43	"Trigger Backlinker Request"
+2.16.840.1.113719.1.27.100.44	"Trigger Backlinker Response"
+2.16.840.1.113719.1.27.100.47	"Trigger Janitor Request"
+2.16.840.1.113719.1.27.100.48	"Trigger Janitor Response"
+2.16.840.1.113719.1.27.100.49	"Trigger Limber Request"
+2.16.840.1.113719.1.27.100.50	"Trigger Limber Response"
+2.16.840.1.113719.1.27.100.51	"Trigger Skulker Request"
+2.16.840.1.113719.1.27.100.52	"Trigger Skulker Response"
+2.16.840.1.113719.1.27.100.53	"Trigger Schema Synch Request"
+2.16.840.1.113719.1.27.100.54	"Trigger Schema Synch Response"
+2.16.840.1.113719.1.27.100.55	"Trigger Partition Purge Request"
+2.16.840.1.113719.1.27.100.56	"Trigger Partition Purge Response"
+2.16.840.1.113719.1.27.100.79	"Monitor Events Request"
+2.16.840.1.113719.1.27.100.80	"Monitor Events Response"
+2.16.840.1.113719.1.27.100.81	"Event Notification"
+2.16.840.1.113719.1.27.101.1	"Duplicate Entry Request"
+2.16.840.1.113719.1.27.101.2	"DuplicateSearchResult"
+2.16.840.1.113719.1.27.101.3	"DuplicateEntryResponseDone"
+2.16.840.1.113719.1.27.101.5	"Simple Password"
+2.16.840.1.113719.1.27.101.6	"Forward Reference"
+2.16.840.1.113719.1.142.100.1	"startFramedProtocolRequest"
+2.16.840.1.113719.1.142.100.2	"startFramedProtocolResponse"
+2.16.840.1.113719.1.142.100.3	"ReplicationUpdate"
+2.16.840.1.113719.1.142.100.4	"endFramedProtocolRequest"
+2.16.840.1.113719.1.142.100.5	"endFramedProtocolResponse"
+2.16.840.1.113719.1.142.100.6	"lburpOperationRequest"
+2.16.840.1.113719.1.142.100.7	"lburpOperationResponse"
+2.16.840.1.113730.3.4		"Netscape LDAPv3 controls"
+2.16.840.1.113730.3.4.2		"ManageDsaIT Control" "RFC 3296" "The client may provide the ManageDsaIT control with an operation to indicate that the operation is intended to manage objects within the DSA (server) Information Tree. The control causes Directory-specific entries (DSEs), regardless of type, to be treated as normal entries allowing clients to interrogate and update these entries using LDAP operations."
+2.16.840.1.113730.3.4.3		"Persistent Search LDAPv3 control"
+2.16.840.1.113730.3.4.4		"Netscape Password Expired LDAPv3 control"
+2.16.840.1.113730.3.4.5		"Netscape Password Expiring LDAPv3 control"
+2.16.840.1.113730.3.4.6		"Netscape NT Synchronization Client LDAPv3 control"
+2.16.840.1.113730.3.4.7		"Entry Change Notification LDAPv3 control"
+2.16.840.1.113730.3.4.8		"Transaction ID Request Control"
+2.16.840.1.113730.3.4.9		"VLV Request LDAPv3 control"
+2.16.840.1.113730.3.4.10	"VLV Response LDAPv3 control"
+2.16.840.1.113730.3.4.11	"Transaction ID Response Control"
+2.16.840.1.113730.3.4.12	"Proxied Authorization (version 1) control"
+2.16.840.1.113730.3.4.13	"iPlanet Directory Server Replication Update Information Control"
+2.16.840.1.113730.3.4.14	"iPlanet Directory Server 'search on specific backend' control"
+2.16.840.1.113730.3.4.15	"Authentication Response Control"
+2.16.840.1.113730.3.4.16	"Authentication Request Control"
+2.16.840.1.113730.3.4.17	"Real Attributes Only Request Control"
+2.16.840.1.113730.3.4.18	"LDAP Proxied Authorization Control" "draft-weltman-ldapv3-proxy-06.txt" "The Proxied Authorization Control allows a client to request that an operation be processed under a provided authorization identity [AUTH] instead of as the current authorization identity associated with the connection. "
+2.16.840.1.113730.3.4.999	"iPlanet Replication Modrdn Extra Mods Control"
+2.16.840.1.113730.3.5.3		"iPlanet Start Replication Request Extended Operation"
+2.16.840.1.113730.3.5.4		"iPlanet Replication Response Extended Operation"
+2.16.840.1.113730.3.5.5		"iPlanet End Replication Request Extended Operation"
+2.16.840.1.113730.3.5.6		"iPlanet Replication Entry Request Extended Operation"
+2.16.840.1.113730.3.5.7		"iPlanet Bulk Import Start Extended Operation"
+2.16.840.1.113730.3.5.8		"iPlanet Bulk Import Finished Extended Operation"

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionNewAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionNewAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionNewAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionNewAction.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
 
 package org.apache.directory.ldapstudio.browser.controller.actions;
 
-
 import org.apache.directory.ldapstudio.browser.Activator;
 import org.apache.directory.ldapstudio.browser.model.Connection;
 import org.apache.directory.ldapstudio.browser.model.Connections;
@@ -34,64 +33,60 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
-
 /**
  * This class implements the Connection New Action
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ConnectionNewAction extends Action
-{
+public class ConnectionNewAction extends Action {
     private BrowserView view;
 
-
-    public ConnectionNewAction( BrowserView view, String text )
-    {
-        super( text );
-        setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION_NEW ) );
-        setToolTipText( "New connection" );
-        this.view = view;
+    public ConnectionNewAction(BrowserView view, String text) {
+	super(text);
+	setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(
+		Activator.PLUGIN_ID, ImageKeys.CONNECTION_NEW));
+	setToolTipText("New connection");
+	this.view = view;
     }
 
+    public void run() {
+	// Creating the new Connection
+	Connection newConnection = new Connection();
+
+	// Creating a new Connection Name with verification that a connection
+        // with
+	// the same name doesn't exist yet.
+	String newConnectionString = "New Connection";
+	String testString = newConnectionString;
+	Connections connections = Connections.getInstance();
+
+	int counter = 1;
+	while (!connections.isConnectionNameAvailable(testString)) {
+	    testString = newConnectionString + counter;
+	    counter++;
+	}
+	newConnection.setName(testString);
+
+	// Creating the Connection Wizard
+	ConnectionWizard wizard = new ConnectionWizard();
+	wizard.init(PlatformUI.getWorkbench(), StructuredSelection.EMPTY);
+	wizard.setType(ConnectionWizardType.NEW);
+
+	wizard.setConnection(newConnection);
+
+	// Instantiates the wizard container with the wizard and opens it
+	WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
+		.getActiveWorkbenchWindow().getShell(), wizard);
+	dialog.create();
+	int result = dialog.open();
+
+	// O is returned when "Finish" is clicked, 1 is returned when "Cancel"
+        // is clicked
+	if (result != 0) {
+	    return;
+	}
 
-    public void run()
-    {
-        // Creating the new Connection
-        Connection newConnection = new Connection();
-
-        // Creating a new Connection Name with verification that a connection with
-        // the same name doesn't exist yet.
-        String newConnectionString = "New Connection";
-        String testString = newConnectionString;
-        Connections connections = Connections.getInstance();
-
-        int counter = 1;
-        while ( !connections.isConnectionNameAvailable( testString ) )
-        {
-            testString = newConnectionString + counter;
-            counter++;
-        }
-        newConnection.setName( testString );
-
-        // Creating the Connection Wizard
-        ConnectionWizard wizard = new ConnectionWizard();
-        wizard.init( PlatformUI.getWorkbench(), StructuredSelection.EMPTY );
-        wizard.setType( ConnectionWizardType.NEW );
-
-        wizard.setConnection( newConnection );
-
-        // Instantiates the wizard container with the wizard and opens it
-        WizardDialog dialog = new WizardDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard );
-        dialog.create();
-        int result = dialog.open();
-
-        // O is returned when "Finish" is clicked, 1 is returned when "Cancel" is clicked
-        if ( result != 0 )
-        {
-            return;
-        }
-
-        // Adding the connection
-        Connections.getInstance().addConnection( newConnection );
+	// Adding the connection
+	Connections.getInstance().addConnection(newConnection);
     }
 }

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryDeleteAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryDeleteAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryDeleteAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryDeleteAction.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
 
 package org.apache.directory.ldapstudio.browser.controller.actions;
 
-
 import java.util.Iterator;
 import java.util.List;
 
@@ -41,125 +40,128 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
-
 /**
  * This class implements the Entry Delete Action
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryDeleteAction extends Action
-{
+public class EntryDeleteAction extends Action {
     private BrowserView view;
 
-
-    public EntryDeleteAction( BrowserView view, String text )
-    {
-        super( text );
-        setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.ENTRY_DELETE ) );
-        setToolTipText( "Delete entry" );
-        this.view = view;
+    public EntryDeleteAction(BrowserView view, String text) {
+	super(text);
+	setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(
+		Activator.PLUGIN_ID, ImageKeys.ENTRY_DELETE));
+	setToolTipText("Delete entry");
+	this.view = view;
     }
 
-
-    public void run()
-    {
-        boolean answer = MessageDialog.openConfirm( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-            "Confirm", "Are you sure you want to delete the selected entry, including its children?" );
-        if ( !answer )
-        {
-            // If the user clicks on the "Cancel" button, we return...
-            return;
-        }
-        
-        try
-        {
-            // Getting the selected items
-            StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
-            Iterator items = selection.iterator();
-
-            while ( items.hasNext() )
-            {
-                EntryWrapper entryWrapper = ( EntryWrapper ) items.next();
-
-                // Initialization of the DSML Engine and the DSML Response Parser
-                Dsmlv2Engine engine = entryWrapper.getDsmlv2Engine();
-                Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser();
-
-                String searchRequest = "<batchRequest>" + "   <searchRequest dn=\""
-                    + entryWrapper.getEntry().getObjectName().getNormName() + "\""
-                    + "          scope=\"wholeSubtree\" derefAliases=\"neverDerefAliases\">"
-                    + "     <filter><present name=\"objectclass\"></present></filter>" + "       <attributes>"
-                    + "         <attribute name=\"1.1\"/>" + "       </attributes>" + "    </searchRequest>"
-                    + "</batchRequest>";
-
-                // Executing the request and sending the result to the Response Parser
-                parser.setInput( engine.processDSML( searchRequest ) );
-                parser.parse();
-
-                LdapResponse ldapResponse = parser.getBatchResponse().getCurrentResponse();
-
-                if ( ldapResponse instanceof ErrorResponse )
-                {
-                    ErrorResponse errorResponse = ( ( ErrorResponse ) ldapResponse );
-
-                    // Displaying an error
-                    MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                        "Error !", "An error has ocurred.\n" + errorResponse.getMessage() );
-                    return;
-                }
-                else if ( ldapResponse instanceof SearchResponse )
-                {
-
-                    // Getting the Search Result Entry List containing our objects for the response
-                    SearchResponse searchResponse = ( ( SearchResponse ) ldapResponse );
-                    List<SearchResultEntry> sreList = searchResponse.getSearchResultEntryList();
-
-                    String deleteRequest = "<batchRequest>";
-                    for ( int i = sreList.size() - 1; i >= 0; i-- )
-                    {
-                        deleteRequest += "<delRequest dn=\"" + sreList.get( i ).getObjectName() + "\"/>\n";
-                    }
-                    deleteRequest += "</batchRequest>";
-
-                    // Executing the request and sending the result to the Response Parser
-                    parser.setInput( engine.processDSML( deleteRequest ) );
-                    parser.parse();
-
-                    ldapResponse = parser.getBatchResponse().getCurrentResponse();
-
-                    if ( ldapResponse instanceof ErrorResponse )
-                    {
-                        ErrorResponse errorResponse = ( ( ErrorResponse ) ldapResponse );
-
-                        // Displaying an error
-                        MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                            "Error !", "An error has ocurred.\n" + errorResponse.getMessage() );
-                        return;
-                    }
-                    else if ( ldapResponse instanceof DelResponse )
-                    {
-                        DelResponse delResponse = ( DelResponse ) ldapResponse;
-
-                        if ( delResponse.getLdapResult().getResultCode() == 0 )
-                        {
-                            view.getViewer().remove( entryWrapper );
-                        }
-                        else
-                        {
-                            // Displaying an error
-                            MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                                "Error !", "An error has ocurred.\n" + delResponse.getLdapResult().getErrorMessage() );
-                        }
-                    }
-                }
-            }
-        }
-        catch ( Exception e )
-        {
-            // Displaying an error
-            MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error !",
-                "An error has ocurred.\n" + e.getMessage() );
-            return;
-        }
+    public void run() {
+	boolean answer = MessageDialog
+		.openConfirm(PlatformUI.getWorkbench()
+			.getActiveWorkbenchWindow().getShell(), "Confirm",
+			"Are you sure you want to delete the selected entry, including its children?");
+	if (!answer) {
+	    // If the user clicks on the "Cancel" button, we return...
+	    return;
+	}
+
+	try {
+	    // Getting the selected items
+	    StructuredSelection selection = (StructuredSelection) view
+		    .getViewer().getSelection();
+	    Iterator items = selection.iterator();
+
+	    while (items.hasNext()) {
+		EntryWrapper entryWrapper = (EntryWrapper) items.next();
+
+		// Initialization of the DSML Engine and the DSML Response
+                // Parser
+		Dsmlv2Engine engine = entryWrapper.getDsmlv2Engine();
+		Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser();
+
+		String searchRequest = "<batchRequest>"
+			+ "   <searchRequest dn=\""
+			+ entryWrapper.getEntry().getObjectName().getNormName()
+			+ "\""
+			+ "          scope=\"wholeSubtree\" derefAliases=\"neverDerefAliases\">"
+			+ "     <filter><present name=\"objectclass\"></present></filter>"
+			+ "       <attributes>"
+			+ "         <attribute name=\"1.1\"/>"
+			+ "       </attributes>" + "    </searchRequest>"
+			+ "</batchRequest>";
+
+		// Executing the request and sending the result to the Response
+                // Parser
+		parser.setInput(engine.processDSML(searchRequest));
+		parser.parse();
+
+		LdapResponse ldapResponse = parser.getBatchResponse()
+			.getCurrentResponse();
+
+		if (ldapResponse instanceof ErrorResponse) {
+		    ErrorResponse errorResponse = ((ErrorResponse) ldapResponse);
+
+		    // Displaying an error
+		    MessageDialog.openError(PlatformUI.getWorkbench()
+			    .getActiveWorkbenchWindow().getShell(), "Error !",
+			    "An error has ocurred.\n"
+				    + errorResponse.getMessage());
+		    return;
+		} else if (ldapResponse instanceof SearchResponse) {
+
+		    // Getting the Search Result Entry List containing our
+                        // objects for the response
+		    SearchResponse searchResponse = ((SearchResponse) ldapResponse);
+		    List<SearchResultEntry> sreList = searchResponse
+			    .getSearchResultEntryList();
+
+		    String deleteRequest = "<batchRequest>";
+		    for (int i = sreList.size() - 1; i >= 0; i--) {
+			deleteRequest += "<delRequest dn=\""
+				+ sreList.get(i).getObjectName() + "\"/>\n";
+		    }
+		    deleteRequest += "</batchRequest>";
+
+		    // Executing the request and sending the result to the
+                        // Response Parser
+		    parser.setInput(engine.processDSML(deleteRequest));
+		    parser.parse();
+
+		    ldapResponse = parser.getBatchResponse()
+			    .getCurrentResponse();
+
+		    if (ldapResponse instanceof ErrorResponse) {
+			ErrorResponse errorResponse = ((ErrorResponse) ldapResponse);
+
+			// Displaying an error
+			MessageDialog.openError(PlatformUI.getWorkbench()
+				.getActiveWorkbenchWindow().getShell(),
+				"Error !", "An error has ocurred.\n"
+					+ errorResponse.getMessage());
+			return;
+		    } else if (ldapResponse instanceof DelResponse) {
+			DelResponse delResponse = (DelResponse) ldapResponse;
+
+			if (delResponse.getLdapResult().getResultCode() == 0) {
+			    view.getViewer().remove(entryWrapper);
+			} else {
+			    // Displaying an error
+			    MessageDialog.openError(PlatformUI.getWorkbench()
+				    .getActiveWorkbenchWindow().getShell(),
+				    "Error !", "An error has ocurred.\n"
+					    + delResponse.getLdapResult()
+						    .getErrorMessage());
+			}
+		    }
+		}
+	    }
+	} catch (Exception e) {
+	    // Displaying an error
+	    MessageDialog.openError(PlatformUI.getWorkbench()
+		    .getActiveWorkbenchWindow().getShell(), "Error !",
+		    "An error has ocurred.\n" + e.getMessage());
+	    return;
+	}
     }
 }

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryNewAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryNewAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryNewAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/EntryNewAction.java Mon Dec 18 09:15:00 2006
@@ -20,35 +20,29 @@
 
 package org.apache.directory.ldapstudio.browser.controller.actions;
 
-
 import org.apache.directory.ldapstudio.browser.Activator;
 import org.apache.directory.ldapstudio.browser.view.ImageKeys;
 import org.apache.directory.ldapstudio.browser.view.views.BrowserView;
 import org.eclipse.jface.action.Action;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
-
 /**
  * This class implements the Entry New Action
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryNewAction extends Action
-{
+public class EntryNewAction extends Action {
     private BrowserView view;
 
-
-    public EntryNewAction( BrowserView view, String text )
-    {
-        super( text );
-        setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.ENTRY_NEW ) );
-        setToolTipText( "New entry" );
-        this.view = view;
+    public EntryNewAction(BrowserView view, String text) {
+	super(text);
+	setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(
+		Activator.PLUGIN_ID, ImageKeys.ENTRY_NEW));
+	setToolTipText("New entry");
+	this.view = view;
     }
 
-
-    public void run()
-    {
-        System.out.println( "New entry" );
+    public void run() {
+	System.out.println("New entry");
     }
 }

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RefreshAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RefreshAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RefreshAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RefreshAction.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
 
 package org.apache.directory.ldapstudio.browser.controller.actions;
 
-
 import org.apache.directory.ldapstudio.browser.Activator;
 import org.apache.directory.ldapstudio.browser.view.ImageKeys;
 import org.apache.directory.ldapstudio.browser.view.views.AttributesView;
@@ -33,55 +32,49 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
-
 /**
  * This class implements the Refresh Action
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class RefreshAction extends Action
-{
+public class RefreshAction extends Action {
     private BrowserView view;
 
-
-    public RefreshAction( BrowserView view, String text )
-    {
-        super( text );
-        setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.REFRESH ) );
-        setToolTipText( "Refresh" );
-        this.view = view;
+    public RefreshAction(BrowserView view, String text) {
+	super(text);
+	setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(
+		Activator.PLUGIN_ID, ImageKeys.REFRESH));
+	setToolTipText("Refresh");
+	this.view = view;
     }
 
+    public void run() {
+	TreeViewer viewer = view.getViewer();
+
+	Object selection = ((TreeSelection) viewer.getSelection())
+		.getFirstElement();
+
+	boolean isExpanded = viewer.getExpandedState(selection);
 
-    public void run()
-    {
-        TreeViewer viewer = view.getViewer();
-
-        Object selection = ( ( TreeSelection ) viewer.getSelection() ).getFirstElement();
-
-        boolean isExpanded = viewer.getExpandedState( selection );
-
-        // Clearing the children of the selected node
-        if ( selection instanceof ConnectionWrapper )
-        {
-            ConnectionWrapper connectionWrapper = ( ConnectionWrapper ) selection;
-            connectionWrapper.clearChildren();
-            isExpanded = true;
-        }
-        else if ( selection instanceof EntryWrapper )
-        {
-            EntryWrapper entryWrapper = ( EntryWrapper ) selection;
-            entryWrapper.clearChildren();
-            entryWrapper.refreshAttributes();
-        }
-
-        // Refreshing the Browser View
-        viewer.refresh( selection );
-        viewer.setExpandedState( selection, isExpanded );
-
-        // Refreshing the Attributes View
-        AttributesView attributesView = ( AttributesView ) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-            .getActivePage().findView( AttributesView.ID );
-        attributesView.refresh();
+	// Clearing the children of the selected node
+	if (selection instanceof ConnectionWrapper) {
+	    ConnectionWrapper connectionWrapper = (ConnectionWrapper) selection;
+	    connectionWrapper.clearChildren();
+	    isExpanded = true;
+	} else if (selection instanceof EntryWrapper) {
+	    EntryWrapper entryWrapper = (EntryWrapper) selection;
+	    entryWrapper.clearChildren();
+	    entryWrapper.refreshAttributes();
+	}
+
+	// Refreshing the Browser View
+	viewer.refresh(selection);
+	viewer.setExpandedState(selection, isExpanded);
+
+	// Refreshing the Attributes View
+	AttributesView attributesView = (AttributesView) PlatformUI
+		.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+		.findView(AttributesView.ID);
+	attributesView.refresh();
     }
 }

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RenameAttributeAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RenameAttributeAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RenameAttributeAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/RenameAttributeAction.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
 
 package org.apache.directory.ldapstudio.browser.controller.actions;
 
-
 import org.apache.directory.ldapstudio.browser.view.views.AttributesView;
 import org.apache.directory.ldapstudio.browser.view.views.BrowserView;
 import org.apache.directory.ldapstudio.browser.view.views.wrappers.EntryWrapper;
@@ -44,234 +43,232 @@
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.PlatformUI;
 
-
 /**
  * This class implements the Rename Attribute Action.
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class RenameAttributeAction extends Action
-{
+public class RenameAttributeAction extends Action {
     private static final int COLUMN_TO_EDIT = 1;
+
     private AttributesView view;
+
     private Table table;
+
     private TableEditor tableEditor;
+
     private Text textEditor;
+
     // A flag to not update twice the server
     private boolean done = false;
 
-
     /**
-     * Creates a new instance of RenameAttributeAction.
-     *
-     * @param view the associated view
-     * @param text the string used as the text for the action
-     */
-    public RenameAttributeAction( AttributesView view, String text )
-    {
-        super( text );
-        this.view = view;
-//        this.table = view.getViewer().getTable();
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.action.Action#run()
-     */
-    public void run()
-    {
-        createEditor();
-        showEditor();
-    }
-
-
-    /**
-     * Creates the Editor cell and registers associated listeners
-     */
-    private void createEditor()
-    {
-//        // Creating the Table Editor
-//        tableEditor = new TableEditor( table );
-//        tableEditor.horizontalAlignment = SWT.LEFT;
-//        tableEditor.grabHorizontal = true;
-//        tableEditor.minimumWidth = 50;
-//
-//        // Creating the Text Widget that will be used by the user 
-//        // to enter the new value
-//        textEditor = new Text( view.getViewer().getTable(), SWT.NONE );
-//
-//        // Adding Traverse Listener used to handle event when the 'return'
-//        // or 'escape' key is pressed
-//        textEditor.addListener( SWT.Traverse, new Listener()
-//        {
-//            public void handleEvent( Event event )
-//            {
-//                // Workaround for bug 20214 due to extra traverse events
-//                switch ( event.detail )
-//                {
-//                    case SWT.TRAVERSE_ESCAPE: // Escape Key
-//                        // Do nothing in this case
-//                        disposeEditor();
-//                        event.doit = true;
-//                        event.detail = SWT.TRAVERSE_NONE;
-//                        break;
-//                    case SWT.TRAVERSE_RETURN: // Return Key
-//                        saveChangesAndDisposeEditor();
-//                        event.doit = true;
-//                        event.detail = SWT.TRAVERSE_NONE;
-//                        break;
-//                }
-//            }
-//        } );
-//
-//        // Adding Focus Listener used to handle event when the user
-//        // clicks on the elsewhere
-//        textEditor.addFocusListener( new FocusAdapter()
-//        {
-//            public void focusLost( FocusEvent fe )
-//            {
-//                if ( !done )
-//                {
-//                    saveChangesAndDisposeEditor();
-//                }
-//            }
-//        } );
-    }
-
-
-    /**
-     * Shows the editor
-     */
-    private void showEditor()
-    {
-//        tableEditor.setEditor( textEditor, view.getViewer().getTable().getSelection()[0], COLUMN_TO_EDIT );
-        textEditor.setText( getAttributeValue() );
-        textEditor.selectAll();
-        textEditor.setFocus();
-    }
-
-
-    /**
-     * Saves the changes made in the editor and disposes the editor
-     */
-    private void saveChangesAndDisposeEditor()
-    {
-        if ( !getAttributeValue().equals( textEditor.getText()) )
-        {
-            saveChanges();
-        }
-        disposeEditor();
-    }
-
-
-    /**
-     * Disposes the editor and refreshes the Atttributes View UI
-     */
-    private void disposeEditor()
-    {
-        textEditor.dispose();
-        textEditor = null;
-        tableEditor.setEditor( null, null, COLUMN_TO_EDIT );
-
-        // Resizing Columns and resetting the focus on the Table
-        view.resizeColumsToFit();
-//        view.getViewer().getTable().setFocus();
-    }
-
-
-    /**
-     * Gets the name of the selected attribute
-     * @return the name of the selected attribute
-     */
-    private String getAttributeName()
-    {
-//        TableItem item = view.getSelectedAttributeTableItem();
-//        return item.getText( 0 );
-        return "";
-    }
-
-
-    /**
-     * Gets the value of the selected attribute
-     * @return the value of the selected attribute
-     */
-    private String getAttributeValue()
-    {
-//        TableItem item = view.getSelectedAttributeTableItem();
-//        return item.getText( 1 );
-        return "";
-    }
-
-
-    /**
-     * Saves the changes made in the editor on the server
-     * @param newText
-     */
-    private void saveChanges()
-    {
-        try
-        {
-            // Getting the Browser View
-            BrowserView browserView = ( BrowserView ) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-                .getActivePage().findView( BrowserView.ID );
-
-            EntryWrapper entryWrapper = ( EntryWrapper ) ( ( TreeSelection ) browserView.getViewer().getSelection() )
-                .getFirstElement();
-            SearchResultEntry entry = entryWrapper.getEntry();
-
-            // Initialization of the DSML Engine and the DSML Response Parser
-            Dsmlv2Engine engine = entryWrapper.getDsmlv2Engine();
-            Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser();
-
-            String request = "<batchRequest>" + "   <modifyRequest dn=\""
-                + entry.getObjectName().getNormName().toString() + "\">" + "      <modification name=\""
-                + getAttributeName() + "\" operation=\"delete\">" + "         <value>" + getAttributeValue()
-                + "</value>" + "      </modification>" + "      <modification name=\"" + getAttributeName()
-                + "\" operation=\"add\">" + "         <value>" + textEditor.getText() + "</value>"
-                + "      </modification>" + "   </modifyRequest>" + "</batchRequest>";
-
-            parser.setInput( engine.processDSML( request ) );
-            parser.parse();
-
-            LdapResponse ldapResponse = parser.getBatchResponse().getCurrentResponse();
-
-            if ( ldapResponse instanceof ModifyResponse )
-            {
-                ModifyResponse modifyResponse = ( ModifyResponse ) ldapResponse;
-
-                if ( modifyResponse.getLdapResult().getResultCode() == 0 )
-                {
-                    entry.getPartialAttributeList().get( getAttributeName() ).remove( getAttributeValue() );
-                    entry.getPartialAttributeList().get( getAttributeName() ).add( textEditor.getText() );
-                    
-//                    TableItem item = view.getSelectedAttributeTableItem();
-//                    item.setText( 1, textEditor.getText() );
-//                    view.getViewer().refresh( item );
-                }
-                else
-                {
-                    done = true;
-                    // Displaying an error
-                    MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                        "Error !", "An error has ocurred.\n" + modifyResponse.getLdapResult().getErrorMessage() );
-                }
-            }
-            else if ( ldapResponse instanceof ErrorResponse )
-            {
-                ErrorResponse errorResponse = ( ErrorResponse ) ldapResponse;
-
-                done = true;
-                // Displaying an error
-                MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error !",
-                    "An error has ocurred.\n" + errorResponse.getMessage() );
-            }
-        }
-        catch ( Exception e )
-        {
-            done = true;
-            // Displaying an error
-            MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error !",
-                "An error has ocurred.\n" + e.getMessage() );
-        }
+         * Creates a new instance of RenameAttributeAction.
+         * 
+         * @param view
+         *                the associated view
+         * @param text
+         *                the string used as the text for the action
+         */
+    public RenameAttributeAction(AttributesView view, String text) {
+	super(text);
+	this.view = view;
+	// this.table = view.getViewer().getTable();
+    }
+
+    /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.jface.action.Action#run()
+         */
+    public void run() {
+	createEditor();
+	showEditor();
+    }
+
+    /**
+         * Creates the Editor cell and registers associated listeners
+         */
+    private void createEditor() {
+	// // Creating the Table Editor
+	// tableEditor = new TableEditor( table );
+	// tableEditor.horizontalAlignment = SWT.LEFT;
+	// tableEditor.grabHorizontal = true;
+	// tableEditor.minimumWidth = 50;
+	//
+	// // Creating the Text Widget that will be used by the user
+	// // to enter the new value
+	// textEditor = new Text( view.getViewer().getTable(), SWT.NONE );
+	//
+	// // Adding Traverse Listener used to handle event when the 'return'
+	// // or 'escape' key is pressed
+	// textEditor.addListener( SWT.Traverse, new Listener()
+	// {
+	// public void handleEvent( Event event )
+	// {
+	// // Workaround for bug 20214 due to extra traverse events
+	// switch ( event.detail )
+	// {
+	// case SWT.TRAVERSE_ESCAPE: // Escape Key
+	// // Do nothing in this case
+	// disposeEditor();
+	// event.doit = true;
+	// event.detail = SWT.TRAVERSE_NONE;
+	// break;
+	// case SWT.TRAVERSE_RETURN: // Return Key
+	// saveChangesAndDisposeEditor();
+	// event.doit = true;
+	// event.detail = SWT.TRAVERSE_NONE;
+	// break;
+	// }
+	// }
+	// } );
+	//
+	// // Adding Focus Listener used to handle event when the user
+	// // clicks on the elsewhere
+	// textEditor.addFocusListener( new FocusAdapter()
+	// {
+	// public void focusLost( FocusEvent fe )
+	// {
+	// if ( !done )
+	// {
+	// saveChangesAndDisposeEditor();
+	// }
+	// }
+	// } );
+    }
+
+    /**
+         * Shows the editor
+         */
+    private void showEditor() {
+	// tableEditor.setEditor( textEditor,
+        // view.getViewer().getTable().getSelection()[0], COLUMN_TO_EDIT );
+	textEditor.setText(getAttributeValue());
+	textEditor.selectAll();
+	textEditor.setFocus();
+    }
+
+    /**
+         * Saves the changes made in the editor and disposes the editor
+         */
+    private void saveChangesAndDisposeEditor() {
+	if (!getAttributeValue().equals(textEditor.getText())) {
+	    saveChanges();
+	}
+	disposeEditor();
+    }
+
+    /**
+         * Disposes the editor and refreshes the Atttributes View UI
+         */
+    private void disposeEditor() {
+	textEditor.dispose();
+	textEditor = null;
+	tableEditor.setEditor(null, null, COLUMN_TO_EDIT);
+
+	// Resizing Columns and resetting the focus on the Table
+	view.resizeColumsToFit();
+	// view.getViewer().getTable().setFocus();
+    }
+
+    /**
+         * Gets the name of the selected attribute
+         * 
+         * @return the name of the selected attribute
+         */
+    private String getAttributeName() {
+	// TableItem item = view.getSelectedAttributeTableItem();
+	// return item.getText( 0 );
+	return "";
+    }
+
+    /**
+         * Gets the value of the selected attribute
+         * 
+         * @return the value of the selected attribute
+         */
+    private String getAttributeValue() {
+	// TableItem item = view.getSelectedAttributeTableItem();
+	// return item.getText( 1 );
+	return "";
+    }
+
+    /**
+         * Saves the changes made in the editor on the server
+         * 
+         * @param newText
+         */
+    private void saveChanges() {
+	try {
+	    // Getting the Browser View
+	    BrowserView browserView = (BrowserView) PlatformUI.getWorkbench()
+		    .getActiveWorkbenchWindow().getActivePage().findView(
+			    BrowserView.ID);
+
+	    EntryWrapper entryWrapper = (EntryWrapper) ((TreeSelection) browserView
+		    .getViewer().getSelection()).getFirstElement();
+	    SearchResultEntry entry = entryWrapper.getEntry();
+
+	    // Initialization of the DSML Engine and the DSML Response
+                // Parser
+	    Dsmlv2Engine engine = entryWrapper.getDsmlv2Engine();
+	    Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser();
+
+	    String request = "<batchRequest>" + "   <modifyRequest dn=\""
+		    + entry.getObjectName().getNormName().toString() + "\">"
+		    + "      <modification name=\"" + getAttributeName()
+		    + "\" operation=\"delete\">" + "         <value>"
+		    + getAttributeValue() + "</value>"
+		    + "      </modification>" + "      <modification name=\""
+		    + getAttributeName() + "\" operation=\"add\">"
+		    + "         <value>" + textEditor.getText() + "</value>"
+		    + "      </modification>" + "   </modifyRequest>"
+		    + "</batchRequest>";
+
+	    parser.setInput(engine.processDSML(request));
+	    parser.parse();
+
+	    LdapResponse ldapResponse = parser.getBatchResponse()
+		    .getCurrentResponse();
+
+	    if (ldapResponse instanceof ModifyResponse) {
+		ModifyResponse modifyResponse = (ModifyResponse) ldapResponse;
+
+		if (modifyResponse.getLdapResult().getResultCode() == 0) {
+		    entry.getPartialAttributeList().get(getAttributeName())
+			    .remove(getAttributeValue());
+		    entry.getPartialAttributeList().get(getAttributeName())
+			    .add(textEditor.getText());
+
+		    // TableItem item =
+                        // view.getSelectedAttributeTableItem();
+		    // item.setText( 1, textEditor.getText() );
+		    // view.getViewer().refresh( item );
+		} else {
+		    done = true;
+		    // Displaying an error
+		    MessageDialog.openError(PlatformUI.getWorkbench()
+			    .getActiveWorkbenchWindow().getShell(), "Error !",
+			    "An error has ocurred.\n"
+				    + modifyResponse.getLdapResult()
+					    .getErrorMessage());
+		}
+	    } else if (ldapResponse instanceof ErrorResponse) {
+		ErrorResponse errorResponse = (ErrorResponse) ldapResponse;
+
+		done = true;
+		// Displaying an error
+		MessageDialog.openError(PlatformUI.getWorkbench()
+			.getActiveWorkbenchWindow().getShell(), "Error !",
+			"An error has ocurred.\n" + errorResponse.getMessage());
+	    }
+	} catch (Exception e) {
+	    done = true;
+	    // Displaying an error
+	    MessageDialog.openError(PlatformUI.getWorkbench()
+		    .getActiveWorkbenchWindow().getShell(), "Error !",
+		    "An error has ocurred.\n" + e.getMessage());
+	}
     }
 }

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/AbstractGrammar.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/AbstractGrammar.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/AbstractGrammar.java Mon Dec 18 09:15:00 2006
@@ -20,73 +20,62 @@
 
 package org.apache.directory.ldapstudio.browser.model;
 
-
 import java.util.HashMap;
 
-
 /**
  * The abstract IGrammar which is the Mother of all the grammars. It contains
  * the transitions table.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractGrammar implements IGrammar
-{
+public abstract class AbstractGrammar implements IGrammar {
 
     /**
-     * Table of transitions. It's a two dimension array, the first dimension
-     * indice the states, the second dimension indices the Tag value, so it is
-     * 256 wide.
-     */
+         * Table of transitions. It's a two dimension array, the first dimension
+         * indice the states, the second dimension indices the Tag value, so it
+         * is 256 wide.
+         */
     protected HashMap<Tag, GrammarTransition>[] transitions;
 
     /** The grammar name */
     protected String name;
 
-
-    public AbstractGrammar()
-    {
+    public AbstractGrammar() {
 
     }
 
-
     // ~ Methods
     // ------------------------------------------------------------------------------------
 
     /**
-     * Return the grammar's name
-     * 
-     * @return The grammar name
-     */
-    public String getName()
-    {
-        return name;
+         * Return the grammar's name
+         * 
+         * @return The grammar name
+         */
+    public String getName() {
+	return name;
     }
 
-
     /**
-     * Set the grammar's name
-     * 
-     * @param name
-     *            DOCUMENT ME!
-     */
-    public void setName( String name )
-    {
-        this.name = name;
+         * Set the grammar's name
+         * 
+         * @param name
+         *                DOCUMENT ME!
+         */
+    public void setName(String name) {
+	this.name = name;
     }
 
-
     /**
-     * Get the transition associated with the state and tag
-     * 
-     * @param state
-     *            The current state
-     * @param tag
-     *            The current tag
-     * @return A valid transition if any, or null.
-     */
-    public GrammarTransition getTransition( int state, Tag tag )
-    {
-        return transitions[state].get( tag );
+         * Get the transition associated with the state and tag
+         * 
+         * @param state
+         *                The current state
+         * @param tag
+         *                The current tag
+         * @return A valid transition if any, or null.
+         */
+    public GrammarTransition getTransition(int state, Tag tag) {
+	return transitions[state].get(tag);
     }
 }

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connection.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connection.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connection.java Mon Dec 18 09:15:00 2006
@@ -20,354 +20,349 @@
 
 package org.apache.directory.ldapstudio.browser.model;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-
 /**
  * This class represents a LDAP Connection used in the preferences
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class Connection implements Comparable<Connection>
-{
+public class Connection implements Comparable<Connection> {
     private String name;
+
     private String host = "localhost";
+
     private int port = 389;
+
     private LdapDN baseDN;
+
     private boolean anonymousBind = true;
+
     private LdapDN userDN;
+
     private boolean appendBaseDNtoUserDNWithBaseDN = false;
+
     private String password;
 
     /** The Listeners List */
     private List<ConnectionListener> listeners;
 
-
     /**
-     * Default Constructor 
-     */
-    public Connection()
-    {
-        listeners = new ArrayList<ConnectionListener>();
+         * Default Constructor
+         */
+    public Connection() {
+	listeners = new ArrayList<ConnectionListener>();
     }
 
-
     /**
-     * Constructor for a Connection
-     * @param name the Name of the connection
-     * @param host the Host
-     * @param port the Port
-     * @param baseDN the Base DN
-     * @param anonymousBind the value of the Anonymous Bind flag
-     * @param userDN the User DN
-     * @param appendBaseDNtoUserDNWithBaseDN the value of the appendBaseDNtoUserDNWithBaseDN flag
-     * @param password the Password
-     */
-    public Connection( String name, String host, int port, LdapDN baseDN, boolean anonymousBind, LdapDN userDN,
-        boolean appendBaseDNtoUserDNWithBaseDN, String password )
-    {
-        this.name = name;
-        this.host = host;
-        this.port = port;
-        this.baseDN = baseDN;
-        this.anonymousBind = anonymousBind;
-        this.userDN = userDN;
-        this.appendBaseDNtoUserDNWithBaseDN = appendBaseDNtoUserDNWithBaseDN;
-        this.password = password;
+         * Constructor for a Connection
+         * 
+         * @param name
+         *                the Name of the connection
+         * @param host
+         *                the Host
+         * @param port
+         *                the Port
+         * @param baseDN
+         *                the Base DN
+         * @param anonymousBind
+         *                the value of the Anonymous Bind flag
+         * @param userDN
+         *                the User DN
+         * @param appendBaseDNtoUserDNWithBaseDN
+         *                the value of the appendBaseDNtoUserDNWithBaseDN flag
+         * @param password
+         *                the Password
+         */
+    public Connection(String name, String host, int port, LdapDN baseDN,
+	    boolean anonymousBind, LdapDN userDN,
+	    boolean appendBaseDNtoUserDNWithBaseDN, String password) {
+	this.name = name;
+	this.host = host;
+	this.port = port;
+	this.baseDN = baseDN;
+	this.anonymousBind = anonymousBind;
+	this.userDN = userDN;
+	this.appendBaseDNtoUserDNWithBaseDN = appendBaseDNtoUserDNWithBaseDN;
+	this.password = password;
     }
 
-
     /**
-     * Get the Anonymous Bind Flag
-     * @return the anonymousBind
-     */
-    public boolean isAnonymousBind()
-    {
-        return anonymousBind;
+         * Get the Anonymous Bind Flag
+         * 
+         * @return the anonymousBind
+         */
+    public boolean isAnonymousBind() {
+	return anonymousBind;
     }
 
-
     /**
-     * Set the Anonymous Bind flag
-     * @param anonymousBind the anonymousBind to set
-     */
-    public void setAnonymousBind( boolean anonymousBind )
-    {
-        this.anonymousBind = anonymousBind;
+         * Set the Anonymous Bind flag
+         * 
+         * @param anonymousBind
+         *                the anonymousBind to set
+         */
+    public void setAnonymousBind(boolean anonymousBind) {
+	this.anonymousBind = anonymousBind;
     }
 
-
     /**
-     * Get the Base DN
-     * @return the BaseDN
-     */
-    public LdapDN getBaseDN()
-    {
-        return baseDN;
+         * Get the Base DN
+         * 
+         * @return the BaseDN
+         */
+    public LdapDN getBaseDN() {
+	return baseDN;
     }
 
-
     /**
-     * Set the BaseDN
-     * @param baseDN the BaseDN to set
-     */
-    public void setBaseDN( LdapDN baseDN )
-    {
-        this.baseDN = baseDN;
+         * Set the BaseDN
+         * 
+         * @param baseDN
+         *                the BaseDN to set
+         */
+    public void setBaseDN(LdapDN baseDN) {
+	this.baseDN = baseDN;
     }
 
-
     /**
-     * Get the Host
-     * @return the Host
-     */
-    public String getHost()
-    {
-        return host;
+         * Get the Host
+         * 
+         * @return the Host
+         */
+    public String getHost() {
+	return host;
     }
 
-
     /**
-     * Set the Host
-     * @param host the Host to set
-     */
-    public void setHost( String host )
-    {
-        this.host = host;
+         * Set the Host
+         * 
+         * @param host
+         *                the Host to set
+         */
+    public void setHost(String host) {
+	this.host = host;
     }
 
-
     /**
-     * Get the Name of the connection
-     * @return the Name
-     */
-    public String getName()
-    {
-        return name;
+         * Get the Name of the connection
+         * 
+         * @return the Name
+         */
+    public String getName() {
+	return name;
     }
 
-
     /**
-     * Set the Name of the connection
-     * @param name the Name to set
-     */
-    public void setName( String name )
-    {
-        this.name = name;
+         * Set the Name of the connection
+         * 
+         * @param name
+         *                the Name to set
+         */
+    public void setName(String name) {
+	this.name = name;
     }
 
-
     /**
-     * Get the Password
-     * @return the Password
-     */
-    public String getPassword()
-    {
-        return password;
+         * Get the Password
+         * 
+         * @return the Password
+         */
+    public String getPassword() {
+	return password;
     }
 
-
     /**
-     * Set the Password
-     * @param password the Password to set
-     */
-    public void setPassword( String password )
-    {
-        this.password = password;
+         * Set the Password
+         * 
+         * @param password
+         *                the Password to set
+         */
+    public void setPassword(String password) {
+	this.password = password;
     }
 
-
     /**
-     * Get the Port
-     * @return the Port
-     */
-    public int getPort()
-    {
-        return port;
+         * Get the Port
+         * 
+         * @return the Port
+         */
+    public int getPort() {
+	return port;
     }
 
-
     /**
-     * Set the Port
-     * @param port the Port to set
-     */
-    public void setPort( int port )
-    {
-        this.port = port;
+         * Set the Port
+         * 
+         * @param port
+         *                the Port to set
+         */
+    public void setPort(int port) {
+	this.port = port;
     }
 
-
     /**
-     * Get the User DN
-     * @return the User DN
-     */
-    public LdapDN getUserDN()
-    {
-        return userDN;
+         * Get the User DN
+         * 
+         * @return the User DN
+         */
+    public LdapDN getUserDN() {
+	return userDN;
     }
 
-
     /**
-     * Set the User DN
-     * @param userDN the User DN to set
-     */
-    public void setUserDN( LdapDN userDN )
-    {
-        this.userDN = userDN;
+         * Set the User DN
+         * 
+         * @param userDN
+         *                the User DN to set
+         */
+    public void setUserDN(LdapDN userDN) {
+	this.userDN = userDN;
     }
 
-
     /**
-     * Get the appendBaseDNtoUserDNWithBaseDN Flag
-     * @return the appendBaseDNtoUserDNWithBaseDN Flag
-     */
-    public boolean isAppendBaseDNtoUserDNWithBaseDN()
-    {
-        return appendBaseDNtoUserDNWithBaseDN;
+         * Get the appendBaseDNtoUserDNWithBaseDN Flag
+         * 
+         * @return the appendBaseDNtoUserDNWithBaseDN Flag
+         */
+    public boolean isAppendBaseDNtoUserDNWithBaseDN() {
+	return appendBaseDNtoUserDNWithBaseDN;
     }
 
-
     /**
-     * Sets appendBaseDNtoUserDNWithBaseDN Flag
-     * @param appendBaseDNtoUserDNWithBaseDN the appendBaseDNtoUserDNWithBaseDN Flag
-     */
-    public void setAppendBaseDNtoUserDNWithBaseDN( boolean appendBaseDNtoUserDNWithBaseDN )
-    {
-        this.appendBaseDNtoUserDNWithBaseDN = appendBaseDNtoUserDNWithBaseDN;
+         * Sets appendBaseDNtoUserDNWithBaseDN Flag
+         * 
+         * @param appendBaseDNtoUserDNWithBaseDN
+         *                the appendBaseDNtoUserDNWithBaseDN Flag
+         */
+    public void setAppendBaseDNtoUserDNWithBaseDN(
+	    boolean appendBaseDNtoUserDNWithBaseDN) {
+	this.appendBaseDNtoUserDNWithBaseDN = appendBaseDNtoUserDNWithBaseDN;
     }
 
-
     /**
-     * Converts a Connection into XML Format
-     * @return the corresponding XML String
-     */
-    public String toXml()
-    {
-        StringBuffer sb = new StringBuffer();
+         * Converts a Connection into XML Format
+         * 
+         * @return the corresponding XML String
+         */
+    public String toXml() {
+	StringBuffer sb = new StringBuffer();
 
-        sb.append( "<connection>" );
-        sb.append( "<name>" + ( ( "".equals( name ) ) ? "null" : name ) + "</name>" );
-        sb.append( "<host>" + ( ( "".equals( host ) ) ? "null" : host ) + "</host>" );
-        sb.append( "<port>" + ( ( "".equals( port ) ) ? "null" : port ) + "</port>" );
-        sb
-            .append( "<baseDN>" + ( ( "".equals( baseDN.getNormName() ) ) ? "null" : baseDN.getNormName() )
-                + "</baseDN>" );
-        sb.append( "<anonymousBind>" + anonymousBind + "</anonymousBind>" );
-        sb
-            .append( "<userDN>" + ( ( "".equals( userDN.getNormName() ) ) ? "null" : userDN.getNormName() )
-                + "</userDN>" );
-        sb.append( "<appendBaseDNtoUserDNWithBaseDN>" + appendBaseDNtoUserDNWithBaseDN
-            + "</appendBaseDNtoUserDNWithBaseDN>" );
-        sb.append( "<password>" + ( ( "".equals( password ) ) ? "null" : password ) + "</password>" );
-        sb.append( "</connection>" );
+	sb.append("<connection>");
+	sb.append("<name>" + (("".equals(name)) ? "null" : name) + "</name>");
+	sb.append("<host>" + (("".equals(host)) ? "null" : host) + "</host>");
+	sb.append("<port>" + (("".equals(port)) ? "null" : port) + "</port>");
+	sb.append("<baseDN>"
+		+ (("".equals(baseDN.getNormName())) ? "null" : baseDN
+			.getNormName()) + "</baseDN>");
+	sb.append("<anonymousBind>" + anonymousBind + "</anonymousBind>");
+	sb.append("<userDN>"
+		+ (("".equals(userDN.getNormName())) ? "null" : userDN
+			.getNormName()) + "</userDN>");
+	sb.append("<appendBaseDNtoUserDNWithBaseDN>"
+		+ appendBaseDNtoUserDNWithBaseDN
+		+ "</appendBaseDNtoUserDNWithBaseDN>");
+	sb.append("<password>" + (("".equals(password)) ? "null" : password)
+		+ "</password>");
+	sb.append("</connection>");
 
-        return sb.toString();
+	return sb.toString();
     }
 
-
     /**
-     * Checks if the connection is valid to connect
-     * @return true if the connection is valid to connect
-     */
-    public boolean validToConnect()
-    {
-        // Host
-        if ( ( host == null ) || ( "".equals( host ) ) )
-        {
-            return false;
-        }
-        // Port
-        if ( ( port <= 0 ) || ( port > 65535 ) )
-        {
-            return false;
-        }
-        return true;
+         * Checks if the connection is valid to connect
+         * 
+         * @return true if the connection is valid to connect
+         */
+    public boolean validToConnect() {
+	// Host
+	if ((host == null) || ("".equals(host))) {
+	    return false;
+	}
+	// Port
+	if ((port <= 0) || (port > 65535)) {
+	    return false;
+	}
+	return true;
     }
 
-
     /**
-     * @see java.lang.Object#toString()
-     */
+         * @see java.lang.Object#toString()
+         */
     @Override
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "[" );
-        sb.append( "name=\"" + name );
-        sb.append( "\" | " );
-        sb.append( "host=\"" + host );
-        sb.append( "\" | " );
-        sb.append( "port=\"" + port );
-        sb.append( "\" | " );
-        sb.append( "baseDN=\"" + baseDN.getNormName() );
-        sb.append( "\" | " );
-        sb.append( "anonymousBind=\"" + anonymousBind );
-        sb.append( "\" | " );
-        sb.append( "userDN=\"" + userDN.getNormName() );
-        sb.append( "\" | " );
-        sb.append( "appendBaseDNtoUserDNWithBaseDN=\"" + appendBaseDNtoUserDNWithBaseDN );
-        sb.append( "\" | " );
-        sb.append( "password=\"" + password );
-        sb.append( "\"]" );
+    public String toString() {
+	StringBuffer sb = new StringBuffer();
 
-        return sb.toString();
-    }
-
-
-    /* (non-Javadoc)
-     * @see java.lang.Comparable#compareTo(java.lang.Object)
-     */
-    public int compareTo( Connection o )
-    {
-        Connection otherWrapper = ( Connection ) o;
-        return getName().compareToIgnoreCase( otherWrapper.getName() );
-    }
-
-
-    /**
-     * Adds a listener for the Connections modifications
-     * @param listener the listener to add
-     * @return true (as per the general contract of Collection.add).
-     */
-    public boolean addListener( ConnectionListener listener )
-    {
-        return listeners.add( listener );
-    }
-
-
-    /**
-     * Removes a listener for the Connections modifications
-     * @param listener the listener to remove
-     * @return true if the list contained the specified element.
-     */
-    public boolean removeListener( ConnectionListener listener )
-    {
-        return listeners.remove( listener );
-    }
-
-
-    /**
-     * Notifies all the listeners that the Connection has changed
-     */
-    private void notifyChanged()
-    {
-        for ( ConnectionListener listener : listeners )
-        {
-            listener.connectionChanged( this );
-        }
-    }
-
-
-    /**
-     * Notifies all the listeners that the Connection has changed
-     */
-    public void notifyListeners()
-    {
-        notifyChanged();
+	sb.append("[");
+	sb.append("name=\"" + name);
+	sb.append("\" | ");
+	sb.append("host=\"" + host);
+	sb.append("\" | ");
+	sb.append("port=\"" + port);
+	sb.append("\" | ");
+	sb.append("baseDN=\"" + baseDN.getNormName());
+	sb.append("\" | ");
+	sb.append("anonymousBind=\"" + anonymousBind);
+	sb.append("\" | ");
+	sb.append("userDN=\"" + userDN.getNormName());
+	sb.append("\" | ");
+	sb.append("appendBaseDNtoUserDNWithBaseDN=\""
+		+ appendBaseDNtoUserDNWithBaseDN);
+	sb.append("\" | ");
+	sb.append("password=\"" + password);
+	sb.append("\"]");
+
+	return sb.toString();
+    }
+
+    /*
+         * (non-Javadoc)
+         * 
+         * @see java.lang.Comparable#compareTo(java.lang.Object)
+         */
+    public int compareTo(Connection o) {
+	Connection otherWrapper = (Connection) o;
+	return getName().compareToIgnoreCase(otherWrapper.getName());
+    }
+
+    /**
+         * Adds a listener for the Connections modifications
+         * 
+         * @param listener
+         *                the listener to add
+         * @return true (as per the general contract of Collection.add).
+         */
+    public boolean addListener(ConnectionListener listener) {
+	return listeners.add(listener);
+    }
+
+    /**
+         * Removes a listener for the Connections modifications
+         * 
+         * @param listener
+         *                the listener to remove
+         * @return true if the list contained the specified element.
+         */
+    public boolean removeListener(ConnectionListener listener) {
+	return listeners.remove(listener);
+    }
+
+    /**
+         * Notifies all the listeners that the Connection has changed
+         */
+    private void notifyChanged() {
+	for (ConnectionListener listener : listeners) {
+	    listener.connectionChanged(this);
+	}
+    }
+
+    /**
+         * Notifies all the listeners that the Connection has changed
+         */
+    public void notifyListeners() {
+	notifyChanged();
     }
 }