directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r609403 - in /directory/studio/trunk: studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/ studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ studi...
Date Sun, 06 Jan 2008 21:07:19 GMT
Author: seelmann
Date: Sun Jan  6 13:07:18 2008
New Revision: 609403

URL: http://svn.apache.org/viewvc?rev=609403&view=rev
Log:
Fix for DIRSTUDIO-139

Modified:
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetContentProvider.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AttributeInfo.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetContentProvider.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetContentProvider.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetContentProvider.java
Sun Jan  6 13:07:18 2008
@@ -130,10 +130,12 @@
         {
             IEntry entry = ( IEntry ) inputElement;
 
-            if ( !entry.isAttributesInitialized() && entry.isDirectoryEntry() )
+            boolean soa = BrowserCommonActivator.getDefault().getPreferenceStore().getBoolean(
+                BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_SHOW_OPERATIONAL_ATTRIBUTES
);
+            boolean oai = entry.isOperationalAttributesInitialized();
+            boolean ai = entry.isAttributesInitialized(); 
+            if ( ( !ai || ( !oai && soa ) ) && entry.isDirectoryEntry() )
             {
-                boolean soa = BrowserCommonActivator.getDefault().getPreferenceStore().getBoolean(
-                    BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_SHOW_OPERATIONAL_ATTRIBUTES
);
                 InitializeAttributesJob job = new InitializeAttributesJob( new IEntry[]
                     { entry }, soa );
                 job.execute();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
Sun Jan  6 13:07:18 2008
@@ -184,11 +184,6 @@
             raSet.addAll( Arrays.asList( attributeTypeDescriptionNames ) );
             raSet.add( ISearch.ALL_OPERATIONAL_ATTRIBUTES );
         }
-//        if ( entry instanceof RootDSE )
-//        {
-//            raSet.add( ISearch.ALL_USER_ATTRIBUTES );
-//            raSet.add( ISearch.ALL_OPERATIONAL_ATTRIBUTES );
-//        }
         if ( entry.isReferral() )
         {
             raSet.add( IAttribute.REFERRAL_ATTRIBUTE );
@@ -196,6 +191,8 @@
         returningAttributes = ( String[] ) raSet.toArray( new String[raSet.size()] );
 
         initializeAttributes( entry, returningAttributes, monitor );
+
+        entry.setOperationalAttributesInitialized( initOperationalAttributes );
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
Sun Jan  6 13:07:18 2008
@@ -129,7 +129,7 @@
 
 
     /**
-     * Sets a flag wheter this entry is an alias entry.
+     * Sets a flag whether this entry is an alias entry.
      * 
      * This method is called during a search if the initialization
      * of the alias flag is requested. 
@@ -140,7 +140,7 @@
 
 
     /**
-     * Indicates wheter this entry is a referral entry.
+     * Indicates whether this entry is a referral entry.
      * 
      * An entry is a referral entry if it has the objectClass 'referral'.
      * 
@@ -153,7 +153,7 @@
 
 
     /**
-     * Sets a flag wheter this entry is a referral entry.
+     * Sets a flag whether this entry is a referral entry.
      * 
      * This method is called during a search if the initialization
      * fo the referral hint is requested. 
@@ -164,7 +164,7 @@
 
 
     /**
-     * Indicates wheter this entry is a subentry.
+     * Indicates whether this entry is a subentry.
      * 
      * An entry is a subentry if it has the objectClass 'subentry'.
      * 
@@ -177,7 +177,7 @@
 
 
     /**
-     * Sets a flag wheter this entry is a subentry.
+     * Sets a flag whether this entry is a subentry.
      * 
      * This method is called during a search if the initialization
      * fo the subentry is requested. 
@@ -204,7 +204,7 @@
 
 
     /**
-     * Indicates wheater this entry's attributes are initialized.
+     * Indicates whether this entry's attributes are initialized.
      * 
      * True means that the entry's attributes are completely initialized
      * and getAttributes() will return all attributes.
@@ -219,7 +219,7 @@
 
 
     /**
-     * Sets a flag wheter this entry's attributes are initialized.
+     * Sets a flag whether this entry's attributes are initialized.
      * 
      * @param b the attributes initialized flag
      */
@@ -227,6 +227,30 @@
 
 
     /**
+     * Indicates whether this entry's operational attributes are initialized.
+     * 
+     * True means that the entry's operational attributes are completely 
+     * initialized and getAttributes() will return all operational attributes 
+     * (additionally to the non-operational attributes).
+     * 
+     * False means that the operational attributes are not or only partially
+     * initialized. The getAttributes() method will return none
+     * or only a part of the entry's operational attributes.  
+     * 
+     * @return true if this entry's attributes are initialized
+     */
+    public abstract boolean isOperationalAttributesInitialized();
+    
+    
+    /**
+     * Sets a flag whether this entry's operational attributes are initialized.
+     * 
+     * @param b the operational attributes initialized flag
+     */
+    public abstract void setOperationalAttributesInitialized( boolean b );
+    
+    
+    /**
      * Gets the attributes of the entry.
      * 
      * If isAttributesInitialized() returns false the returned attributes 
@@ -268,7 +292,7 @@
 
 
     /**
-     * Indicates wheater the entry's children are initialized.
+     * Indicates whether the entry's children are initialized.
      * 
      * True means that the entry's children are completely initialized
      * and getChildren() will return all children.
@@ -283,7 +307,7 @@
 
 
     /**
-     * Sets a flag wheter this entry's children are initialized..
+     * Sets a flag whether this entry's children are initialized..
      * 
      * @param b the children initialized flag
      */
@@ -299,7 +323,7 @@
 
 
     /**
-     * Sets a hint wheter this entry has children.
+     * Sets a hint whether this entry has children.
      * 
      * @param b the has children hint
      */
@@ -326,7 +350,7 @@
 
 
     /**
-     * Indicates wheather this entry has more children than
+     * Indicates whether this entry has more children than
      * getChildrenCount() returns. This occurs if the count or time limit
      * was exceeded while fetching children.
      * 
@@ -336,7 +360,7 @@
 
 
     /**
-     * Sets a flag wheter this entry more children.
+     * Sets a flag whether this entry more children.
      * 
      * @param b the has more children flag
      */
@@ -344,7 +368,7 @@
 
 
     /**
-     * Indicates wheather this entry has a parent entry. Each entry except
+     * Indicates whether this entry has a parent entry. Each entry except
      * the root DSE and the base entries should have a parent entry.
      * 
      * @return true if the entry has a parent entry.

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
Sun Jan  6 13:07:18 2008
@@ -452,6 +452,35 @@
     /**
      * {@inheritDoc}
      */
+    public boolean isOperationalAttributesInitialized()
+    {
+        AttributeInfo ai = getBrowserConnectionImpl().getAttributeInfo( this );
+        return ai != null && ai.operationalAttributesInitialized;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void setOperationalAttributesInitialized( boolean b )
+    {
+        AttributeInfo ai = getBrowserConnectionImpl().getAttributeInfo( this );
+        if ( ai == null && b )
+        {
+            ai = new AttributeInfo();
+            getBrowserConnectionImpl().setAttributeInfo( this, ai );
+        }
+        
+        if ( ai != null )
+        {
+            ai.operationalAttributesInitialized = b;
+        }
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
     public IAttribute[] getAttributes()
     {
         AttributeInfo ai = getBrowserConnectionImpl().getAttributeInfo( this );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AttributeInfo.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AttributeInfo.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AttributeInfo.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AttributeInfo.java
Sun Jan  6 13:07:18 2008
@@ -43,6 +43,9 @@
     /** The attributes initialized flag. */
     protected volatile boolean attributesInitialized = false;
 
+    /** The operational attributes initialized flag. */
+    protected volatile boolean operationalAttributesInitialized = false;
+    
     /** The attribute map. */
     protected volatile Map<String, IAttribute> attributeMap = new LinkedHashMap<String,
IAttribute>();
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
Sun Jan  6 13:07:18 2008
@@ -193,6 +193,26 @@
     /**
      * {@inheritDoc}
      */
+    public boolean isOperationalAttributesInitialized()
+    {
+        if ( getDelegate() != null )
+        {
+            return getDelegate().isOperationalAttributesInitialized();
+        }
+        else if ( entryDoesNotExist )
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
     public boolean isChildrenInitialized()
     {
         if ( getDelegate() != null )
@@ -516,6 +536,39 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    public void setOperationalAttributesInitialized( boolean b )
+    {
+        if ( !b )
+        {
+            if ( getDelegate() != null )
+            {
+                getDelegate().setOperationalAttributesInitialized( b );
+            }
+            setDelegate( null );
+            entryDoesNotExist = false;
+        }
+        else
+        {
+            if ( getDelegate() == null )
+            {
+                setDelegate( getBrowserConnection().getEntryFromCache( dn ) );
+                if ( getDelegate() == null )
+                {
+                    // entry doesn't exist!
+                    entryDoesNotExist = true;
+                }
+            }
+            if ( getDelegate() != null )
+            {
+                getDelegate().setOperationalAttributesInitialized( b );
+            }
+        }
+    }
+    
+    
     /**
      * {@inheritDoc}
      */

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java?rev=609403&r1=609402&r2=609403&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
Sun Jan  6 13:07:18 2008
@@ -325,6 +325,15 @@
 
 
     /**
+     * This implementation always returns true.
+     */
+    public boolean isOperationalAttributesInitialized()
+    {
+        return true;
+    }
+    
+    
+    /**
      * {@inheritDoc}
      */
     public boolean isConsistent()
@@ -427,6 +436,14 @@
     }
 
 
+    /**
+     * This implementation does nothing.
+     */
+    public void setOperationalAttributesInitialized( boolean b )
+    {
+    }
+    
+    
     /**
      * This implementation does nothing.
      */



Mime
View raw message