directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r537156 - in /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main: java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/ resources/org/apache/directory/ldapstudio/browser/ui/ resources/org/apache/directory/ldapstudio/bro...
Date Fri, 11 May 2007 10:20:14 GMT
Author: szoerner
Date: Fri May 11 03:20:08 2007
New Revision: 537156

URL: http://svn.apache.org/viewvc?view=rev&rev=537156
Log:
DIRSTUDIO-99: Display both OID value and description. 
Uses a new resource BundleBundle, which is filled sparsely filled as a start.  

Added:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/OIDDescriptions.properties
Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java?view=diff&rev=537156&r1=537155&r2=537156
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java
Fri May 11 03:20:08 2007
@@ -24,6 +24,8 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
 
 import org.apache.directory.ldapstudio.browser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.ldapstudio.browser.common.widgets.entryeditor.EntryEditorWidgetTableMetadata;
@@ -33,7 +35,6 @@
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
 import org.apache.directory.ldapstudio.browser.core.model.IRootDSE;
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
-
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -75,6 +76,21 @@
 
     private TabItem rawTab;
 
+    public static ResourceBundle oidDescriptions = null;
+    // Load RessourceBundle with OID descriptions
+    static
+    {
+        try
+        {
+            oidDescriptions = ResourceBundle
+                .getBundle( "org.apache.directory.ldapstudio.browser.ui.dialogs.properties.OIDDescriptions"
);
+        }
+        catch ( Exception e )
+        {
+            e.printStackTrace();
+        }
+    }
+
 
     public RootDSEPropertyPage()
     {
@@ -148,7 +164,9 @@
         controlsViewer.setLabelProvider( new LabelProvider() );
         if ( connection != null && connection.getRootDSE() != null )
         {
-            controlsViewer.setInput( ( ( RootDSE ) connection.getRootDSE() ).getSupportedControls()
);
+            String[] supportedControls = ( ( RootDSE ) connection.getRootDSE() ).getSupportedControls();
+            addDescritionsToOIDs( supportedControls );
+            controlsViewer.setInput( supportedControls );
         }
         this.controlsTab = new TabItem( this.tabFolder, SWT.NONE );
         this.controlsTab.setText( "Controls" );
@@ -164,7 +182,9 @@
         extensionViewer.setLabelProvider( new LabelProvider() );
         if ( connection != null && connection.getRootDSE() != null )
         {
-            extensionViewer.setInput( ( ( RootDSE ) connection.getRootDSE() ).getSupportedExtensions()
);
+            String[] supportedExtensions = ( ( RootDSE ) connection.getRootDSE() ).getSupportedExtensions();
+            addDescritionsToOIDs( supportedExtensions );
+            extensionViewer.setInput( supportedExtensions );
         }
         this.extensionsTab = new TabItem( this.tabFolder, SWT.NONE );
         this.extensionsTab.setText( "Extensions" );
@@ -180,7 +200,9 @@
         featureViewer.setLabelProvider( new LabelProvider() );
         if ( connection != null && connection.getRootDSE() != null )
         {
-            featureViewer.setInput( ( ( RootDSE ) connection.getRootDSE() ).getSupportedFeatures()
);
+            String[] supportedFeatures = ( ( RootDSE ) connection.getRootDSE() ).getSupportedFeatures();
+            addDescritionsToOIDs( supportedFeatures );
+            featureViewer.setInput( supportedFeatures );
         }
         this.featuresTab = new TabItem( this.tabFolder, SWT.NONE );
         this.featuresTab.setText( "Features" );
@@ -409,6 +431,30 @@
         }
 
         return result;
+    }
+
+
+    /**
+     * Add descriptions to OIDs, if known. uses the form "OID (description)". The array content
is modified by this method.  
+     * 
+     * @param oids 
+     */
+    private void addDescritionsToOIDs( String[] oids )
+    {
+        if ( oidDescriptions != null )
+        {
+            for ( int i = 0; i < oids.length; ++i )
+            {
+                try
+                {
+                    String description = oidDescriptions.getString( oids[i] );
+                    oids[i] = oids[i] + " (" + description + ")";
+                }
+                catch ( MissingResourceException ignored )
+                {
+                }
+            }
+        }
     }
 
 

Added: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/OIDDescriptions.properties
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/OIDDescriptions.properties?view=auto&rev=537156
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/OIDDescriptions.properties
(added)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/resources/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/OIDDescriptions.properties
Fri May 11 03:20:08 2007
@@ -0,0 +1,12 @@
+# Extended operation according to RFC 2830 (Lightweight Directory Access Protocol (LDAPv3):
Extension for Transport Layer Security)
+1.3.6.1.4.1.1466.20037=Start TLS
+
+# Controls according to RFC 2891 (LDAP Control Extension for Server Side Sorting of Search
Results)
+1.2.840.113556.1.4.473=Server Side Sorting request control
+1.2.840.113556.1.4.474=Server Side Sorting response control
+
+# Feature according to RFC 3673 (Lightweight Directory Access Protocol version 3 (LDAPv3):
All Operational Attributes)
+1.3.6.1.4.1.4203.1.5.1=All Operational Attributes
+
+# Extended operation according to RFC 4532 (Lightweight Directory Access Protocol (LDAP)
"Who am I?" Operation)
+1.3.6.1.4.1.4203.1.11.3=Who am I?



Mime
View raw message