directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1036955 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/
Date Fri, 19 Nov 2010 17:26:26 GMT
Author: pamarcelot
Date: Fri Nov 19 17:26:25 2010
New Revision: 1036955

URL: http://svn.apache.org/viewvc?rev=1036955&view=rev
Log:
Sharing the configuration across the various pages.
Binded the UI fields to their corresponding accessors in the beans.

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/OverviewPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.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=1036955&r1=1036954&r2=1036955&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
Fri Nov 19 17:26:25 2010
@@ -20,6 +20,10 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.apache.directory.server.config.beans.ChangePasswordServerBean;
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.server.config.beans.KdcServerBean;
+import org.apache.directory.server.config.beans.LdapServerBean;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -52,14 +56,19 @@ public class KerberosServerPage extends 
     private Text kerberosPortText;
     private Button enableChangePasswordCheckbox;
     private Text changePasswordPortText;
-
     private Text kdcPrincipalText;
-
     private Text primaryKdcRealmText;
-
     private Text kdcSearchBaseDnText;
-
     private Text encryptionTypesText;
+    private Button allowClockSkewButton;
+    private Button verifyBodyChecksumButton;
+    private Button allowEmptyAddressesButton;
+    private Button allowForwardableAddressesButton;
+    private Button requirePreAuthenticationByEncryptedTimeStampButton;
+    private Button allowPostdatedTicketsButtons;
+    private Button allowRenewableTicketsButton;
+    private Text maximumRenewableLifetimeText;
+    private Text maximumTicketLifetimeText;
 
 
     /**
@@ -68,7 +77,7 @@ public class KerberosServerPage extends 
      * @param editor
      *      the associated editor
      */
-    public KerberosServerPage( FormEditor editor )
+    public KerberosServerPage( ServerConfigurationEditor editor )
     {
         super( editor, ID, TITLE );
     }
@@ -205,39 +214,58 @@ public class KerberosServerPage extends 
         composite.setLayout( glayout );
         section.setClient( composite );
 
-        Button allowClockSkewButton = toolkit.createButton( composite, "Allow Clock Skew",
SWT.CHECK );
-        Button verifyBodyChecksumButton = toolkit.createButton( composite, "Verify Body Checksum",
SWT.CHECK );
+        allowClockSkewButton = toolkit.createButton( composite, "Allow Clock Skew", SWT.CHECK
);
+        verifyBodyChecksumButton = toolkit.createButton( composite, "Verify Body Checksum",
SWT.CHECK );
 
-        Button allowEmptyAddressesButton = toolkit.createButton( composite, "Allow Empty
Addresses", SWT.CHECK );
-        Button allowForwardableAddressesButton = toolkit.createButton( composite, "Allow
Forwardable Addresses",
+        allowEmptyAddressesButton = toolkit.createButton( composite, "Allow Empty Addresses",
SWT.CHECK );
+        allowForwardableAddressesButton = toolkit.createButton( composite, "Allow Forwardable
Addresses",
             SWT.CHECK );
 
-        Button requirePreAuthenticationByEncryptedTimeStampButton = toolkit.createButton(
composite,
+        requirePreAuthenticationByEncryptedTimeStampButton = toolkit.createButton( composite,
             "Require Pre-Authentication By Encrypted TimeStamp", SWT.CHECK );
-        Button allowPostdatedTicketsButtons = toolkit.createButton( composite, "Allow Postdated
Tickets", SWT.CHECK );
+        allowPostdatedTicketsButtons = toolkit.createButton( composite, "Allow Postdated
Tickets", SWT.CHECK );
 
-        Button allowRenewableTicketsButton = toolkit.createButton( composite, "Allow Renewable
Tickets", SWT.CHECK );
+        allowRenewableTicketsButton = toolkit.createButton( composite, "Allow Renewable Tickets",
SWT.CHECK );
         toolkit.createLabel( composite, "" );
 
         Composite maximumRenewableLifetimeComposite = toolkit.createComposite( composite
);
         maximumRenewableLifetimeComposite.setLayout( new GridLayout( 2, false ) );
         toolkit.createLabel( maximumRenewableLifetimeComposite, "Maximum Renewable Lifetime:"
);
-        Text maximumRenewableLifetimeText = createIntegerText( toolkit, maximumRenewableLifetimeComposite
);
+        maximumRenewableLifetimeText = createIntegerText( toolkit, maximumRenewableLifetimeComposite
);
 
         Composite maximumTicketLifetimeComposite = toolkit.createComposite( composite );
         maximumTicketLifetimeComposite.setLayout( new GridLayout( 2, false ) );
         toolkit.createLabel( maximumTicketLifetimeComposite, "Maximum Ticket Lifetime:" );
-        Text maximumTicketLifetimeText = createIntegerText( toolkit, maximumTicketLifetimeComposite
);
+        maximumTicketLifetimeText = createIntegerText( toolkit, maximumTicketLifetimeComposite
);
 
     }
 
 
     private void initUI()
     {
-        enableKerberosCheckbox.setSelection( true );
-        kerberosPortText.setText( "60088" );
+        ConfigBean configBean = getConfigBean();
 
-        enableChangePasswordCheckbox.setSelection( true );
-        changePasswordPortText.setText( "60464" );
+        KdcServerBean kdcServerBean = configBean.getDirectoryServiceBean().getKdcServerBean();
+        ChangePasswordServerBean changePasswordServerBean = configBean.getDirectoryServiceBean()
+            .getChangePasswordServerBean();
+
+        enableKerberosCheckbox.setSelection( kdcServerBean.isEnabled() );
+        kerberosPortText.setText( "" + kdcServerBean.getTransports()[0].getSystemPort() );
+
+        enableChangePasswordCheckbox.setSelection( changePasswordServerBean.isEnabled() );
+        changePasswordPortText.setText( "" + changePasswordServerBean.getTransports()[0].getSystemPort()
);
+
+        kdcPrincipalText.setText( kdcServerBean.getKrbKdcPrincipal().toString() );
+        kdcSearchBaseDnText.setText( kdcServerBean.getSearchBaseDn().toString() );
+        encryptionTypesText.setText( kdcServerBean.getKrbEncryptionTypes().toString() );
+
+        verifyBodyChecksumButton.setSelection( kdcServerBean.isKrbBodyChecksumVerified()
);
+        allowEmptyAddressesButton.setSelection( kdcServerBean.isKrbEmptyAddressesAllowed()
);
+        allowForwardableAddressesButton.setSelection( kdcServerBean.isKrbForwardableAllowed()
);
+        requirePreAuthenticationByEncryptedTimeStampButton.setSelection( kdcServerBean.isKrbPaEncTimestampRequired()
);
+        allowPostdatedTicketsButtons.setSelection( kdcServerBean.isKrbPostdatedAllowed()
);
+        allowRenewableTicketsButton.setSelection( kdcServerBean.isKrbRenewableAllowed() );
+        maximumRenewableLifetimeText.setText( kdcServerBean.getKrbMaximumRenewableLifetime()
+ "" );
+        maximumTicketLifetimeText.setText( kdcServerBean.getKrbMaximumTicketLifetime() +
"" );
     }
 }

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=1036955&r1=1036954&r2=1036955&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
Fri Nov 19 17:26:25 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.server.config.beans.LdapServerBean;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
 import org.eclipse.swt.SWT;
@@ -79,7 +81,7 @@ public class LdapLdapsServersPage extend
      * @param editor
      *      the associated editor
      */
-    public LdapLdapsServersPage( FormEditor editor )
+    public LdapLdapsServersPage( ServerConfigurationEditor editor )
     {
         super( editor, ID, TITLE );
     }
@@ -311,14 +313,18 @@ public class LdapLdapsServersPage extend
 
     private void initUI()
     {
-        enableLdapCheckbox.setSelection( true );
-        ldapPortText.setText( "10389" );
+        ConfigBean configBean = getConfigBean();
+
+        LdapServerBean ldapServerBean = configBean.getDirectoryServiceBean().getLdapServerBean();
+
+        enableLdapCheckbox.setSelection( ldapServerBean.isEnabled() );
+        ldapPortText.setText( ldapServerBean.getTransports()[0].getSystemPort() + "" );
 
         enableLdapsCheckbox.setSelection( true );
         ldapsPortText.setText( "10636" );
 
-        saslHostText.setText( "ldap.example.com" );
-        saslPrincipalText.setText( "ldap/ldap.example.com@EXAMPLE.COM" );
-        saslSearchBaseDnText.setText( "ou=users,dc=example,dc=com" );
+        saslHostText.setText( ldapServerBean.getLdapServerSaslHost() );
+        saslPrincipalText.setText( ldapServerBean.getLdapServerSaslPrincipal() );
+        saslSearchBaseDnText.setText( ldapServerBean.getSearchBaseDn().toString() );
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.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/OverviewPage.java?rev=1036955&r1=1036954&r2=1036955&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
Fri Nov 19 17:26:25 2010
@@ -23,6 +23,11 @@ package org.apache.directory.studio.apac
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.config.beans.ChangePasswordServerBean;
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.server.config.beans.DirectoryServiceBean;
+import org.apache.directory.server.config.beans.KdcServerBean;
+import org.apache.directory.server.config.beans.LdapServerBean;
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
 import org.eclipse.jface.viewers.ArrayContentProvider;
@@ -37,7 +42,6 @@ import org.eclipse.swt.widgets.Composite
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
 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.Hyperlink;
 import org.eclipse.ui.forms.widgets.Section;
@@ -83,7 +87,7 @@ public class OverviewPage extends Server
      * @param editor
      *      the associated editor
      */
-    public OverviewPage( FormEditor editor )
+    public OverviewPage( ServerConfigurationEditor editor )
     {
         super( editor, ID, TITLE );
     }
@@ -254,23 +258,34 @@ public class OverviewPage extends Server
 
     private void initUI()
     {
-        enableLdapCheckbox.setSelection( true );
-        ldapPortText.setText( "10389" );
+        ConfigBean configBean = getConfigBean();
+
+        DirectoryServiceBean directoryServiceBean = configBean.getDirectoryServiceBean();
+
+        LdapServerBean ldapServerBean = directoryServiceBean.getLdapServerBean();
+        KdcServerBean kdcServerBean = directoryServiceBean.getKdcServerBean();
+        ChangePasswordServerBean changePasswordServerBean = directoryServiceBean.getChangePasswordServerBean();
+
+        enableLdapCheckbox.setSelection( ldapServerBean.isEnabled() );
+        ldapPortText.setText( ldapServerBean.getTransports()[0].getSystemPort() + "" );
 
         enableLdapsCheckbox.setSelection( true );
         ldapsPortText.setText( "10636" );
 
-        enableKerberosCheckbox.setSelection( true );
-        kerberosPortText.setText( "60088" );
+        enableKerberosCheckbox.setSelection( kdcServerBean.isEnabled() );
+        kerberosPortText.setText( "" + kdcServerBean.getTransports()[0].getSystemPort() );
 
-        enableChangePasswordCheckbox.setSelection( true );
-        changePasswordPortText.setText( "60464" );
+        enableChangePasswordCheckbox.setSelection( changePasswordServerBean.isEnabled() );
+        changePasswordPortText.setText( "" + changePasswordServerBean.getTransports()[0].getSystemPort()
);
 
         partitionsLabel.setText( "There are 2 partitions defined:" );
         List<String> partitionsList = new ArrayList<String>();
         partitionsList.add( "dc=example,dc=com (id=example)" );
         partitionsList.add( "ou=system (id=system)" );
         partitionsTableViewer.setInput( partitionsList.toArray() );
+
+        allowAnonymousAccessCheckbox.setSelection( directoryServiceBean.isDsAllowAnonymousAccess()
);
+        enableAccesControlCheckbox.setSelection( directoryServiceBean.isDsAccessControlEnabled()
);
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.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/PartitionsPage.java?rev=1036955&r1=1036954&r2=1036955&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
Fri Nov 19 17:26:25 2010
@@ -45,7 +45,7 @@ public class PartitionsPage extends Serv
      * @param editor
      *      the associated editor
      */
-    public PartitionsPage( FormEditor editor )
+    public PartitionsPage( ServerConfigurationEditor editor )
     {
         super( editor, ID, TITLE );
     }

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=1036955&r1=1036954&r2=1036955&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
Fri Nov 19 17:26:25 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.studio.apacheds.configuration.v2.editor;
 
 
+import org.apache.directory.server.config.beans.ConfigBean;
 import org.apache.directory.studio.apacheds.configuration.v2.actions.EditorAddPageAction;
 import org.apache.directory.studio.apacheds.configuration.v2.actions.EditorExportConfigurationAction;
 import org.apache.directory.studio.apacheds.configuration.v2.actions.EditorImportConfigurationAction;
@@ -59,13 +60,31 @@ public abstract class ServerConfiguratio
      * @param editor
      *      the associated editor
      */
-    public ServerConfigurationEditorPage( FormEditor editor, String id, String title )
+    public ServerConfigurationEditorPage( ServerConfigurationEditor editor, String id, String
title )
     {
         super( editor, id, title );
     }
 
 
     /**
+     * TODO getConfigBean.
+     *
+     * @return
+     */
+    public ConfigBean getConfigBean()
+    {
+        FormEditor editor = getEditor();
+
+        if ( editor instanceof ServerConfigurationEditor )
+        {
+            return ( ( ServerConfigurationEditor ) editor ).getConfigBean();
+        }
+
+        return null;
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     protected void createFormContent( IManagedForm managedForm )



Mime
View raw message