directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1032968 - in /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor: KerberosServerPage.java LdapLdapsServersPage.java ServerConfigurationEditorPage.java
Date Tue, 09 Nov 2010 12:39:57 GMT
Author: pamarcelot
Date: Tue Nov  9 12:39:57 2010
New Revision: 1032968

URL: http://svn.apache.org/viewvc?rev=1032968&view=rev
Log:
Added an advanced section for the LDAP Server configuration and added a basic implementation
for the Kerberos server configuration

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java?rev=1032968&r1=1032967&r2=1032968&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
Tue Nov  9 12:39:57 2010
@@ -20,9 +20,17 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.editor.FormEditor;
 import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 
 /**
@@ -38,6 +46,14 @@ public class KerberosServerPage extends 
     /** The Page Title */
     private static final String TITLE = "Kerberos Server";
 
+    private Button enableKerberosCheckbox;
+
+    private Text kerberosPortText;
+
+    private Button enableChangePasswordCheckbox;
+
+    private Text changePasswordPortText;
+
 
     /**
      * Creates a new instance of GeneralPage.
@@ -56,5 +72,65 @@ public class KerberosServerPage extends 
      */
     protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
+        TableWrapLayout twl = new TableWrapLayout();
+        twl.numColumns = 2;
+        parent.setLayout( twl );
+
+        Composite leftComposite = toolkit.createComposite( parent );
+        leftComposite.setLayout( new GridLayout() );
+        TableWrapData leftCompositeTableWrapData = new TableWrapData( TableWrapData.FILL,
TableWrapData.TOP );
+        leftCompositeTableWrapData.grabHorizontal = true;
+        leftComposite.setLayoutData( leftCompositeTableWrapData );
+
+        Composite rightComposite = toolkit.createComposite( parent );
+        rightComposite.setLayout( new GridLayout() );
+        TableWrapData rightCompositeTableWrapData = new TableWrapData( TableWrapData.FILL,
TableWrapData.TOP );
+        rightCompositeTableWrapData.grabHorizontal = true;
+        rightComposite.setLayoutData( rightCompositeTableWrapData );
+
+        createKerberosServerSection( toolkit, leftComposite );
+
+        initUI();
+    }
+
+
+    private void createKerberosServerSection( FormToolkit toolkit, Composite parent )
+    {
+        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
+        section.setText( "Kerberos Server" );
+        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        Composite composite = toolkit.createComposite( section );
+        toolkit.paintBordersFor( composite );
+        GridLayout gridLayout = new GridLayout( 4, false );
+        gridLayout.marginHeight = gridLayout.marginWidth = 0;
+        composite.setLayout( gridLayout );
+        section.setClient( composite );
+
+        enableKerberosCheckbox = toolkit.createButton( composite, "Enable Kerberos Server",
SWT.CHECK );
+        enableKerberosCheckbox
+            .setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, gridLayout.numColumns,
1 ) );
+        toolkit.createLabel( composite, TABULATION );
+        toolkit.createLabel( composite, "Port:" );
+        kerberosPortText = createPortText( toolkit, composite );
+        createDefaultValueLabel( toolkit, composite, "60088" );
+
+        enableChangePasswordCheckbox = toolkit.createButton( composite, "Enable Kerberos
Change Password Server",
+            SWT.CHECK );
+        enableChangePasswordCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true,
false,
+            gridLayout.numColumns, 1 ) );
+        toolkit.createLabel( composite, TABULATION );
+        toolkit.createLabel( composite, "Port:" );
+        changePasswordPortText = createPortText( toolkit, composite );
+        createDefaultValueLabel( toolkit, composite, "60464" );
+    }
+
+
+    private void initUI()
+    {
+        enableKerberosCheckbox.setSelection( true );
+        kerberosPortText.setText( "60088" );
+
+        enableChangePasswordCheckbox.setSelection( true );
+        changePasswordPortText.setText( "60464" );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java?rev=1032968&r1=1032967&r2=1032968&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
Tue Nov  9 12:39:57 2010
@@ -55,6 +55,14 @@ public class LdapLdapsServersPage extend
     private Text ldapPortText;
     private Button enableLdapsCheckbox;
     private Text ldapsPortText;
+    private Text maxTimeLimitText;
+    private Text maxSizeLimitText;
+    private Button authMechSimpleCheckbox;
+    private Button authMechCramMd5Checkbox;
+    private Button authMechDigestMd5Checkbox;
+    private Button authMechGssapiCheckbox;
+    private Button authMechNtlmCheckbox;
+    private Button authMechGssSpnegoCheckbox;
     private CheckboxTableViewer supportedMechanismsTableViewer;
     private Button editSupportedMechanismButton;
     private Button selectAllSupportedMechanismsButton;
@@ -98,7 +106,8 @@ public class LdapLdapsServersPage extend
         rightComposite.setLayoutData( rightCompositeTableWrapData );
 
         createLdapServerSection( toolkit, leftComposite );
-        createLdapsServerSection( toolkit, leftComposite );
+        createLimitsSection( toolkit, leftComposite );
+        createAdvancedSection( toolkit, leftComposite );
         createSupportedAuthenticationMechanismsSection( toolkit, rightComposite );
         createSaslSettingsSection( toolkit, rightComposite );
 
@@ -109,7 +118,7 @@ public class LdapLdapsServersPage extend
     private void createLdapServerSection( FormToolkit toolkit, Composite parent )
     {
         Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-        section.setText( "LDAP Server" );
+        section.setText( "LDAP/LDAPS Servers" );
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
@@ -124,27 +133,78 @@ public class LdapLdapsServersPage extend
         toolkit.createLabel( composite, "Port:" );
         ldapPortText = createPortText( toolkit, composite );
         createDefaultValueLabel( toolkit, composite, "10389" );
+
+        enableLdapsCheckbox = toolkit.createButton( composite, "Enable LDAPS Server", SWT.CHECK
);
+        enableLdapsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
gridLayout.numColumns, 1 ) );
+        toolkit.createLabel( composite, TABULATION );
+        toolkit.createLabel( composite, "Port:" );
+        ldapsPortText = createPortText( toolkit, composite );
+        createDefaultValueLabel( toolkit, composite, "10636" );
     }
 
 
-    private void createLdapsServerSection( FormToolkit toolkit, Composite parent )
+    /**
+     * Creates the Limits Section
+     *
+     * @param toolkit
+     *      the toolkit to use
+     * @param parent
+     *      the parent composite
+     */
+    private void createLimitsSection( FormToolkit toolkit, Composite parent )
     {
+        // Creation of the section
         Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-        section.setText( "LDAPS Server" );
+        section.setText( "Limits" );
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
-        GridLayout gridLayout = new GridLayout( 4, false );
-        gridLayout.marginHeight = gridLayout.marginWidth = 0;
-        composite.setLayout( gridLayout );
+        GridLayout glayout = new GridLayout( 2, false );
+        composite.setLayout( glayout );
         section.setClient( composite );
 
-        enableLdapsCheckbox = toolkit.createButton( composite, "Enable LDAPS Server", SWT.CHECK
);
-        enableLdapsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false,
gridLayout.numColumns, 1 ) );
-        toolkit.createLabel( composite, TABULATION );
-        toolkit.createLabel( composite, "Port:" );
-        ldapsPortText = createPortText( toolkit, composite );
-        createDefaultValueLabel( toolkit, composite, "10636" );
+        // Max. Time Limit
+        toolkit.createLabel( composite, "Max Time Limit (ms):" );
+        maxTimeLimitText = createIntegerText( toolkit, composite );
+        maxTimeLimitText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Max. Size Limit
+        toolkit.createLabel( composite, "Max Size Limit (entries):" );
+        maxSizeLimitText = createIntegerText( toolkit, composite );
+        maxSizeLimitText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+    }
+
+
+    /**
+     * Creates the Advanced Section
+     *
+     * @param toolkit
+     *      the toolkit to use
+     * @param parent
+     *      the parent composite
+     */
+    private void createAdvancedSection( FormToolkit toolkit, Composite parent )
+    {
+        // Creation of the section
+        Section section = toolkit.createSection( parent, Section.TITLE_BAR | Section.TWISTIE
| Section.COMPACT );
+        section.setText( "Advanced" );
+        section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        Composite composite = toolkit.createComposite( section );
+        toolkit.paintBordersFor( composite );
+        GridLayout glayout = new GridLayout( 3, false );
+        composite.setLayout( glayout );
+        section.setClient( composite );
+
+        Button enableTlsCheckbox = toolkit.createButton( composite, "Enable TLS", SWT.CHECK
);
+        enableTlsCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3,
1 ) );
+
+        Button enableServerSidePasswordHashingCheckbox = toolkit.createButton( composite,
"Enable sever-side password hashing",
+            SWT.CHECK );
+        enableServerSidePasswordHashingCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE,
true, false, 3, 1 ) );
+        toolkit.createLabel( composite, "Hashing Method:" );
+        Text hashingMethodText = toolkit.createText( composite, "" );
+        hashingMethodText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false )
);
+        createDefaultValueLabel( toolkit, composite, "SSHA" );
     }
 
 
@@ -164,32 +224,39 @@ public class LdapLdapsServersPage extend
         section.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite composite = toolkit.createComposite( section );
         toolkit.paintBordersFor( composite );
-        GridLayout glayout = new GridLayout( 2, false );
+        GridLayout glayout = new GridLayout( 3, true );
         composite.setLayout( glayout );
         section.setClient( composite );
 
+        authMechSimpleCheckbox = toolkit.createButton( composite, "Simple", SWT.CHECK );
+        authMechCramMd5Checkbox = toolkit.createButton( composite, "CRAM-MD5", SWT.CHECK
);
+        authMechDigestMd5Checkbox = toolkit.createButton( composite, "DIGEST-MD5", SWT.CHECK
);
+        authMechGssapiCheckbox = toolkit.createButton( composite, "GSSAPI", SWT.CHECK );
+        authMechNtlmCheckbox = toolkit.createButton( composite, "NTLM", SWT.CHECK );
+        authMechGssSpnegoCheckbox = toolkit.createButton( composite, "GSS_SPNEGO", SWT.CHECK
);
+
         // Supported Authentication Mechanisms Table
-        Table supportedMechanismsTable = toolkit.createTable( composite, SWT.CHECK );
-        GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false, 1, 3 );
-        gd.heightHint = 110;
-        supportedMechanismsTable.setLayoutData( gd );
-        supportedMechanismsTableViewer = new CheckboxTableViewer( supportedMechanismsTable
);
-        supportedMechanismsTableViewer.setContentProvider( new ArrayContentProvider() );
-        supportedMechanismsTableViewer.setInput( new String[]
-            { "Simple", "CRAM-MD5", "DIGEST-MD5", "GSSAPI", "NTLM", "GSS_SPNEGO" } );
-
-        // Edit Button
-        editSupportedMechanismButton = toolkit.createButton( composite, "Edit", SWT.PUSH
);
-        editSupportedMechanismButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING,
false, false ) );
-        editSupportedMechanismButton.setEnabled( false );
-
-        // Select All Button
-        selectAllSupportedMechanismsButton = toolkit.createButton( composite, "Select All",
SWT.PUSH );
-        selectAllSupportedMechanismsButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING,
false, false ) );
-
-        // Deselect All Button
-        deselectAllSupportedMechanismsButton = toolkit.createButton( composite, "Deselect
All", SWT.PUSH );
-        deselectAllSupportedMechanismsButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING,
false, false ) );
+        //        Table supportedMechanismsTable = toolkit.createTable( composite, SWT.CHECK
);
+        //        GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false, 1, 3 );
+        //        gd.heightHint = 110;
+        //        supportedMechanismsTable.setLayoutData( gd );
+        //        supportedMechanismsTableViewer = new CheckboxTableViewer( supportedMechanismsTable
);
+        //        supportedMechanismsTableViewer.setContentProvider( new ArrayContentProvider()
);
+        //        supportedMechanismsTableViewer.setInput( new String[]
+        //            { "Simple", "CRAM-MD5", "DIGEST-MD5", "GSSAPI", "NTLM", "GSS_SPNEGO"
} );
+        //
+        //        // Edit Button
+        //        editSupportedMechanismButton = toolkit.createButton( composite, "Edit",
SWT.PUSH );
+        //        editSupportedMechanismButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING,
false, false ) );
+        //        editSupportedMechanismButton.setEnabled( false );
+        //
+        //        // Select All Button
+        //        selectAllSupportedMechanismsButton = toolkit.createButton( composite, "Select
All", SWT.PUSH );
+        //        selectAllSupportedMechanismsButton.setLayoutData( new GridData( SWT.FILL,
SWT.BEGINNING, false, false ) );
+        //
+        //        // Deselect All Button
+        //        deselectAllSupportedMechanismsButton = toolkit.createButton( composite,
"Deselect All", SWT.PUSH );
+        //        deselectAllSupportedMechanismsButton.setLayoutData( new GridData( SWT.FILL,
SWT.BEGINNING, false, false ) );
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java?rev=1032968&r1=1032967&r2=1032968&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
Tue Nov  9 12:39:57 2010
@@ -123,6 +123,37 @@ public abstract class ServerConfiguratio
     }
 
 
+    /**
+     * Creates a Text that can be used to enter an integer.
+     *
+     * @param toolkit
+     *      the toolkit
+     * @param parent
+     *      the parent
+     * @return
+     *      a Text that can be used to enter a port number
+     */
+    protected Text createIntegerText( FormToolkit toolkit, Composite parent )
+    {
+        Text integerText = toolkit.createText( parent, "" ); //$NON-NLS-1$
+        GridData gd = new GridData( SWT.NONE, SWT.NONE, false, false );
+        gd.widthHint = 42;
+        integerText.setLayoutData( gd );
+        integerText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+
+        return integerText;
+    }
+
+
     protected Label createDefaultValueLabel( FormToolkit toolkit, Composite parent, String
text )
     {
         Label label = toolkit.createLabel( parent, NLS.bind( "(Default: {0})", text ) );



Mime
View raw message