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 2007/04/18 19:24:53 UTC
svn commit: r530095 - in
/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration:
dialogs/ editor/ model/
Author: pamarcelot
Date: Wed Apr 18 10:24:51 2007
New Revision: 530095
URL: http://svn.apache.org/viewvc?view=rev&rev=530095
Log:
Reorganized 'General Page'.
Added support for 'denormalizeOpAttrEnabled' and Binary Attributes.
Added:
directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/dialogs/BinaryAttributeDialog.java
Modified:
directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfiguration.java
directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java
directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationWriter.java
Added: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/dialogs/BinaryAttributeDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/dialogs/BinaryAttributeDialog.java?view=auto&rev=530095
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/dialogs/BinaryAttributeDialog.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/dialogs/BinaryAttributeDialog.java Wed Apr 18 10:24:51 2007
@@ -0,0 +1,158 @@
+/*
+ * 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.apacheds.configuration.dialogs;
+
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This class implements the Dialog for Binary Attribute.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class BinaryAttributeDialog extends Dialog
+{
+ /** The initial value */
+ private String initialValue;
+
+ /** The return value */
+ private String returnValue;
+
+ /** The dirty flag */
+ private boolean dirty = false;
+
+ // UI Fields
+ private Text attributeText;
+
+
+ /**
+ * Creates a new instance of AttributeValueDialog.
+ */
+ public BinaryAttributeDialog( String initialValue )
+ {
+ super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() );
+ this.initialValue = initialValue;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ protected void configureShell( Shell newShell )
+ {
+ super.configureShell( newShell );
+ newShell.setText( "Binary Attribute Dialog" );
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea( Composite parent )
+ {
+ Composite composite = new Composite( parent, SWT.NONE );
+ GridLayout layout = new GridLayout( 2, false );
+ composite.setLayout( layout );
+ composite.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) );
+
+ Label attributeLabel = new Label( composite, SWT.NONE );
+ attributeLabel.setText( "Attribute:" );
+
+ attributeText = new Text( composite, SWT.BORDER );
+ attributeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+ initFromInput();
+ addListeners();
+
+ return composite;
+ }
+
+
+ /**
+ * Initializes the UI from the input.
+ */
+ private void initFromInput()
+ {
+ attributeText.setText( ( initialValue == null ) ? "" : initialValue );
+ }
+
+
+ /**
+ * Adds listeners to the UI Fields.
+ */
+ private void addListeners()
+ {
+ attributeText.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ dirty = true;
+ }
+ } );
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed()
+ {
+ returnValue = attributeText.getText();
+
+ super.okPressed();
+ }
+
+
+ /**
+ * Gets the Attribute.
+ *
+ * @return
+ * the Attribute
+ */
+ public String getAttribute()
+ {
+ return returnValue;
+ }
+
+
+ /**
+ * Returns the dirty flag of the dialog.
+ *
+ * @return
+ * the dirty flag of the dialog
+ */
+ public boolean isDirty()
+ {
+ return dirty;
+ }
+}
Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java?view=diff&rev=530095&r1=530094&r2=530095
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/editor/GeneralPage.java Wed Apr 18 10:24:51 2007
@@ -20,12 +20,26 @@
package org.apache.directory.ldapstudio.apacheds.configuration.editor;
+import java.util.List;
+
+import org.apache.directory.ldapstudio.apacheds.configuration.dialogs.BinaryAttributeDialog;
import org.apache.directory.ldapstudio.apacheds.configuration.model.ServerConfiguration;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.layout.GridData;
@@ -33,6 +47,7 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
@@ -58,6 +73,9 @@
/** The Page Title */
private static final String TITLE = "General";
+ /** The Binary Attribute List */
+ private List<String> binaryAttributes;
+
// UI Fields
private Text portText;
private Combo authenticationCombo;
@@ -73,6 +91,11 @@
private Button enableNTPCheckbox;
private Button enableKerberosCheckbox;
private Button enableChangePasswordCheckbox;
+ private Button denormalizeOpAttrCheckbox;
+ private TableViewer binaryAttributesTableViewer;
+ private Button binaryAttributesAddButton;
+ private Button binaryAttributesEditButton;
+ private Button binaryAttributesDeleteButton;
/**
@@ -96,10 +119,13 @@
form.setText( "General" );
Composite parent = form.getBody();
- parent.setLayout( new TableWrapLayout() );
+ TableWrapLayout twl = new TableWrapLayout();
+ twl.numColumns = 2;
+ parent.setLayout( twl );
FormToolkit toolkit = managedForm.getToolkit();
createSettingsSection( parent, toolkit );
+ createBinaryAttributesSection( parent, toolkit );
createLimitsSection( parent, toolkit );
createOptionsSection( parent, toolkit );
@@ -213,7 +239,7 @@
section.setLayoutData( td );
Composite client = toolkit.createComposite( section );
toolkit.paintBordersFor( client );
- GridLayout glayout = new GridLayout( 4, false );
+ GridLayout glayout = new GridLayout( 2, false );
client.setLayout( glayout );
section.setClient( client );
@@ -299,7 +325,7 @@
section.setLayoutData( td );
Composite client = toolkit.createComposite( section );
toolkit.paintBordersFor( client );
- GridLayout glayout = new GridLayout( 2, true );
+ GridLayout glayout = new GridLayout();
client.setLayout( glayout );
section.setClient( client );
@@ -318,6 +344,59 @@
// Enable Change Password
enableChangePasswordCheckbox = toolkit.createButton( client, "Enable Change Password", SWT.CHECK );
enableChangePasswordCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+ // Denormalize Operational Attributes
+ denormalizeOpAttrCheckbox = toolkit.createButton( client, "Denormalize Operational Attributes", SWT.CHECK );
+ denormalizeOpAttrCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+ }
+
+
+ /**
+ * Creates the Options Section
+ *
+ * @param parent
+ * the parent composite
+ * @param toolkit
+ * the toolkit to use
+ */
+ private void createBinaryAttributesSection( Composite parent, FormToolkit toolkit )
+ {
+ // Creation of the section
+ Section section = toolkit.createSection( parent, Section.DESCRIPTION | Section.TITLE_BAR );
+ section.marginWidth = 4;
+ section.setText( "Binary Attributes" );
+ section
+ .setDescription( "Set attribute type names and OID's if you want an them to be handled as binary content." );
+ TableWrapData td = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
+ td.grabHorizontal = true;
+ section.setLayoutData( td );
+ Composite client = toolkit.createComposite( section );
+ toolkit.paintBordersFor( client );
+ GridLayout glayout = new GridLayout( 2, false );
+ client.setLayout( glayout );
+ section.setClient( client );
+
+ Table binaryAttributesTable = toolkit.createTable( client, SWT.NONE );
+ GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false, 1, 3 );
+ gd.heightHint = 103;
+ binaryAttributesTable.setLayoutData( gd );
+ binaryAttributesTableViewer = new TableViewer( binaryAttributesTable );
+ binaryAttributesTableViewer.setContentProvider( new ArrayContentProvider() );
+ binaryAttributesTableViewer.setLabelProvider( new LabelProvider() );
+
+ GridData buttonsGD = new GridData( SWT.FILL, SWT.BEGINNING, false, false );
+ buttonsGD.widthHint = IDialogConstants.BUTTON_WIDTH;
+
+ binaryAttributesAddButton = toolkit.createButton( client, "Add...", SWT.PUSH );
+ binaryAttributesAddButton.setLayoutData( buttonsGD );
+
+ binaryAttributesEditButton = toolkit.createButton( client, "Edit...", SWT.PUSH );
+ binaryAttributesEditButton.setEnabled( false );
+ binaryAttributesEditButton.setLayoutData( buttonsGD );
+
+ binaryAttributesDeleteButton = toolkit.createButton( client, "Delete", SWT.PUSH );
+ binaryAttributesDeleteButton.setEnabled( false );
+ binaryAttributesDeleteButton.setLayoutData( buttonsGD );
}
@@ -329,6 +408,9 @@
ServerConfiguration configuration = ( ( ServerConfigurationEditorInput ) getEditorInput() )
.getServerConfiguration();
+ binaryAttributes = configuration.getBinaryAttributes();
+ binaryAttributesTableViewer.setInput( binaryAttributes );
+
// Port
portText.setText( "" + configuration.getPort() );
@@ -372,6 +454,9 @@
// Enable Change Password
enableChangePasswordCheckbox.setSelection( configuration.isEnableChangePassword() );
+
+ // Denormalize Op Attr
+ denormalizeOpAttrCheckbox.setSelection( configuration.isDenormalizeOpAttr() );
}
@@ -380,109 +465,138 @@
*/
private void addListeners()
{
- portText.addModifyListener( new ModifyListener()
+ // The Modify Listener
+ ModifyListener modifyListener = new ModifyListener()
{
public void modifyText( ModifyEvent e )
{
setEditorDirty();
}
- } );
+ };
- authenticationCombo.addModifyListener( new ModifyListener()
+ // The Selection Listener
+ SelectionListener selectionListener = new SelectionAdapter()
{
- public void modifyText( ModifyEvent e )
+ public void widgetSelected( SelectionEvent e )
{
setEditorDirty();
}
- } );
+ };
- principalText.addModifyListener( new ModifyListener()
+ // The ISelectionChangedListener for the Binary Attributes Table
+ ISelectionChangedListener binaryAttributesTableViewerListener = new ISelectionChangedListener()
{
- public void modifyText( ModifyEvent e )
+ public void selectionChanged( SelectionChangedEvent event )
{
- setEditorDirty();
+ binaryAttributesEditButton.setEnabled( !event.getSelection().isEmpty() );
+ binaryAttributesDeleteButton.setEnabled( !event.getSelection().isEmpty() );
}
- } );
+ };
- passwordText.addModifyListener( new ModifyListener()
+ // The IDoubleClickListener for the Binary Attributes Table
+ IDoubleClickListener binaryAttributesTableViewerDoubleClickListener = new IDoubleClickListener()
{
- public void modifyText( ModifyEvent e )
+ public void doubleClick( DoubleClickEvent event )
{
- setEditorDirty();
+ editSelectedBinaryAttribute();
}
- } );
+ };
- allowAnonymousAccessCheckbox.addSelectionListener( new SelectionAdapter()
+ // The SelectionListener for the Binary Attributes Add Button
+ SelectionListener binaryAttributesAddButtonListener = new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
- setEditorDirty();
+ BinaryAttributeDialog dialog = new BinaryAttributeDialog( "" );
+ if ( Dialog.OK == dialog.open() && dialog.isDirty() )
+ {
+ String newAttribute = dialog.getAttribute();
+ if ( newAttribute != null && !"".equals( newAttribute )
+ && !binaryAttributes.contains( newAttribute ) )
+ {
+ binaryAttributes.add( newAttribute );
+
+ binaryAttributesTableViewer.refresh();
+ setEditorDirty();
+ }
+ }
}
- } );
+ };
- maxTimeLimitText.addModifyListener( new ModifyListener()
+ // The SelectionListener for the Binary Attributes Edit Button
+ SelectionListener binaryAttributesEditButtonListener = new SelectionAdapter()
{
- public void modifyText( ModifyEvent e )
+ public void widgetSelected( SelectionEvent e )
{
- setEditorDirty();
+ editSelectedBinaryAttribute();
}
- } );
+ };
- maxSizeLimitText.addModifyListener( new ModifyListener()
+ // The SelectionListener for the Binary Attributes Delete Button
+ SelectionListener binaryAttributesDeleteButtonListener = new SelectionAdapter()
{
- public void modifyText( ModifyEvent e )
+ public void widgetSelected( SelectionEvent e )
{
- setEditorDirty();
- }
- } );
+ StructuredSelection selection = ( StructuredSelection ) binaryAttributesTableViewer.getSelection();
+ if ( !selection.isEmpty() )
+ {
+ String attribute = ( String ) selection.getFirstElement();
+ binaryAttributes.remove( attribute );
- synchPeriodText.addModifyListener( new ModifyListener()
- {
- public void modifyText( ModifyEvent e )
- {
- setEditorDirty();
+ binaryAttributesTableViewer.refresh();
+ setEditorDirty();
+ }
}
- } );
+ };
- maxThreadsText.addModifyListener( new ModifyListener()
- {
- public void modifyText( ModifyEvent e )
- {
- setEditorDirty();
- }
- } );
+ portText.addModifyListener( modifyListener );
+ authenticationCombo.addModifyListener( modifyListener );
+ principalText.addModifyListener( modifyListener );
+ passwordText.addModifyListener( modifyListener );
+ allowAnonymousAccessCheckbox.addSelectionListener( selectionListener );
+ maxTimeLimitText.addModifyListener( modifyListener );
+ maxSizeLimitText.addModifyListener( modifyListener );
+ synchPeriodText.addModifyListener( modifyListener );
+ maxThreadsText.addModifyListener( modifyListener );
+ enableAccesControlCheckbox.addSelectionListener( selectionListener );
+ enableNTPCheckbox.addSelectionListener( selectionListener );
+ enableKerberosCheckbox.addSelectionListener( selectionListener );
+ enableChangePasswordCheckbox.addSelectionListener( selectionListener );
+ denormalizeOpAttrCheckbox.addSelectionListener( selectionListener );
+ binaryAttributesTableViewer.addSelectionChangedListener( binaryAttributesTableViewerListener );
+ binaryAttributesTableViewer.addDoubleClickListener( binaryAttributesTableViewerDoubleClickListener );
+ binaryAttributesAddButton.addSelectionListener( binaryAttributesAddButtonListener );
+ binaryAttributesEditButton.addSelectionListener( binaryAttributesEditButtonListener );
+ binaryAttributesDeleteButton.addSelectionListener( binaryAttributesDeleteButtonListener );
+ }
- enableAccesControlCheckbox.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent e )
- {
- setEditorDirty();
- }
- } );
- enableNTPCheckbox.addSelectionListener( new SelectionAdapter()
+ /**
+ * Opens a Binary Attribute Dialog with the selected Attribute Value Object in the
+ * Binary Attributes Table Viewer.
+ */
+ private void editSelectedBinaryAttribute()
+ {
+ StructuredSelection selection = ( StructuredSelection ) binaryAttributesTableViewer.getSelection();
+ if ( !selection.isEmpty() )
{
- public void widgetSelected( SelectionEvent e )
- {
- setEditorDirty();
- }
- } );
+ String oldAttribute = ( String ) selection.getFirstElement();
- enableKerberosCheckbox.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent e )
+ BinaryAttributeDialog dialog = new BinaryAttributeDialog( oldAttribute );
+ if ( Dialog.OK == dialog.open() && dialog.isDirty() )
{
- setEditorDirty();
- }
- } );
+ binaryAttributes.remove( oldAttribute );
- enableChangePasswordCheckbox.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent e )
- {
+ String newAttribute = dialog.getAttribute();
+ if ( newAttribute != null && !"".equals( newAttribute ) && !binaryAttributes.contains( newAttribute ) )
+ {
+ binaryAttributes.add( newAttribute );
+ }
+
+ binaryAttributesTableViewer.refresh();
setEditorDirty();
}
- } );
+ }
}
@@ -515,5 +629,6 @@
serverConfiguration.setEnableNTP( enableNTPCheckbox.getSelection() );
serverConfiguration.setEnableKerberos( enableKerberosCheckbox.getSelection() );
serverConfiguration.setEnableChangePassword( enableChangePasswordCheckbox.getSelection() );
+ serverConfiguration.setDenormalizeOpAttr( denormalizeOpAttrCheckbox.getSelection() );
}
}
Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfiguration.java?view=diff&rev=530095&r1=530094&r2=530095
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfiguration.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfiguration.java Wed Apr 18 10:24:51 2007
@@ -71,6 +71,12 @@
/** The flag for Enable Change Password */
private boolean enableChangePassword;
+ /** The flag for Denormalize Operational Attributes */
+ private boolean denormalizeOpAttr;
+
+ /** The Binary Attributes */
+ private List<String> binaryAttributes;
+
/** The Partitions */
private List<Partition> partitions;
@@ -89,6 +95,7 @@
partitions = new ArrayList<Partition>();
interceptors = new ArrayList<Interceptor>();
extendedOperations = new ArrayList<ExtendedOperation>();
+ binaryAttributes = new ArrayList<String>();
}
@@ -586,4 +593,88 @@
this.synchronizationPeriod = synchronizationPeriod;
}
+
+ /**
+ * Gets the Denormalize Operational Attributes flag.
+ *
+ * @return
+ * the Denormalize Operational Attributes flag
+ */
+ public boolean isDenormalizeOpAttr()
+ {
+ return denormalizeOpAttr;
+ }
+
+
+ /**
+ * Sets the Denormalize Operational Attributes flag.
+ *
+ * @param denormalizeOpAttr
+ * the new Denormalize Operational Attributes flag
+ */
+ public void setDenormalizeOpAttr( boolean denormalizeOpAttr )
+ {
+ this.denormalizeOpAttr = denormalizeOpAttr;
+ }
+
+
+ /**
+ * Gets the Binary Attributes List.
+ *
+ * @return
+ * the Binary Attributes List
+ */
+ public List<String> getBinaryAttributes()
+ {
+ return binaryAttributes;
+ }
+
+
+ /**
+ * Sets the Binary Attributes List.
+ *
+ * @param binaryAttributes
+ * the new value
+ */
+ public void setBinaryAttributes( List<String> binaryAttributes )
+ {
+ this.binaryAttributes = binaryAttributes;
+ }
+
+
+ /**
+ * Adds a Binary Attribute.
+ *
+ * @param binaryAttribute
+ * the Partition to add
+ * @return
+ * true (as per the general contract of the Collection.add method).
+ */
+ public boolean addBinaryAttribute( String binaryAttribute )
+ {
+ return binaryAttributes.add( binaryAttribute );
+ }
+
+
+ /**
+ * Removes a Binary Attribute.
+ *
+ * @param binaryAttribute
+ * the Binary Attribute to remove
+ * @return
+ * true if this list contained the specified element.
+ */
+ public boolean removeBinaryAttribute( String binaryAttribute )
+ {
+ return binaryAttributes.remove( binaryAttribute );
+ }
+
+
+ /**
+ * Removes all Binary Attributes.
+ */
+ public void clearBinaryAttributes()
+ {
+ binaryAttributes.clear();
+ }
}
Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java?view=diff&rev=530095&r1=530094&r2=530095
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationParser.java Wed Apr 18 10:24:51 2007
@@ -181,7 +181,17 @@
serverConfiguration.setPassword( password );
}
- // TODO Add Other Values...
+ // Binary Attributes
+ String binaryAttributes = readEnvironmentBeanProperty( "java.naming.ldap.attributes.binary", environmentBean );
+ if ( binaryAttributes != null )
+ {
+ String[] attributes = binaryAttributes.split( " " );
+
+ for( String attribute : attributes)
+ {
+ serverConfiguration.addBinaryAttribute( attribute );
+ }
+ }
}
@@ -303,6 +313,13 @@
if ( enableChangePassword != null )
{
serverConfiguration.setEnableChangePassword( parseBoolean( enableChangePassword ) );
+ }
+
+ // EnableChangePassword
+ String denormalizeOpAttrsEnabled = readBeanProperty( "denormalizeOpAttrsEnabled", configurationBean );
+ if ( denormalizeOpAttrsEnabled != null )
+ {
+ serverConfiguration.setDenormalizeOpAttr( parseBoolean( denormalizeOpAttrsEnabled ) );
}
// SystemPartition
Modified: directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationWriter.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationWriter.java?view=diff&rev=530095&r1=530094&r2=530095
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationWriter.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-apacheds-configuration/src/main/java/org/apache/directory/ldapstudio/apacheds/configuration/model/ServerConfigurationWriter.java Wed Apr 18 10:24:51 2007
@@ -128,6 +128,22 @@
propElement = propsElement.addElement( "prop" );
propElement.addAttribute( "key", "java.naming.security.credentials" );
propElement.setText( serverConfiguration.getPassword() );
+
+ // Key 'java.naming.ldap.attributes.binary'
+ if ( !serverConfiguration.getBinaryAttributes().isEmpty() )
+ {
+ propElement = propsElement.addElement( "prop" );
+ propElement.addAttribute( "key", "java.naming.ldap.attributes.binary" );
+ StringBuffer sb = new StringBuffer();
+ for ( String attribute : serverConfiguration.getBinaryAttributes() )
+ {
+ sb.append( attribute );
+ sb.append( " " );
+ }
+ String attributes = sb.toString();
+ propElement.setText( attributes.substring( 0, attributes.length() - 1 ) );
+ }
+
}
@@ -199,7 +215,7 @@
// DenormalizeOpAttrsEnabled
propertyElement = configurationBean.addElement( "property" );
propertyElement.addAttribute( "name", "denormalizeOpAttrsEnabled" );
- propertyElement.addAttribute( "value", "false" ); // TODO Add a UI Field for editing this value.
+ propertyElement.addAttribute( "value", "" + serverConfiguration.isDenormalizeOpAttr() );
// LdapPort
propertyElement = configurationBean.addElement( "property" );