Initial commit of pithos-macos.
authorMiltiadis Vasilakis <mvasilak@gmail.com>
Fri, 5 Aug 2011 18:11:31 +0000 (21:11 +0300)
committerMiltiadis Vasilakis <mvasilak@gmail.com>
Fri, 5 Aug 2011 18:11:31 +0000 (21:11 +0300)
The finder-like client can browse the contents of the 'pithos' and 'trash' containers of a pithos user, using asynchronous requests.

23 files changed:
.gitignore
Icons/01-refresh.png [new file with mode: 0644]
Icons/145-persondot.png [new file with mode: 0644]
Icons/container.png [new file with mode: 0644]
Icons/object.png [new file with mode: 0644]
Icons/subdir.png [new file with mode: 0644]
pithos-macos.xcodeproj/project.pbxproj
pithos-macos/ImageAndTextCell.h [new file with mode: 0644]
pithos-macos/ImageAndTextCell.m [new file with mode: 0644]
pithos-macos/PithosAccount.h
pithos-macos/PithosAccount.m
pithos-macos/PithosBrowserController.h
pithos-macos/PithosBrowserController.m
pithos-macos/PithosBrowserController.xib
pithos-macos/PithosContainer.h
pithos-macos/PithosContainer.m
pithos-macos/PithosEmpty.h [new file with mode: 0644]
pithos-macos/PithosEmpty.m [new file with mode: 0644]
pithos-macos/PithosNode.h
pithos-macos/PithosNode.m
pithos-macos/PithosObject.m
pithos-macos/PithosSubdir.h
pithos-macos/PithosSubdir.m

index 496ee2c..f8b8c05 100644 (file)
@@ -1 +1,9 @@
-.DS_Store
\ No newline at end of file
+.DS_Store
+build
+*xcodeproj/*mode*
+*xcodeproj/*pbxuser
+*xcodeproj/*per*
+*xcodeproj/project.xcworkspace
+*xcodeproj/xcuserdata
+*.pbxuser
+*.mode1v3
diff --git a/Icons/01-refresh.png b/Icons/01-refresh.png
new file mode 100644 (file)
index 0000000..5881938
Binary files /dev/null and b/Icons/01-refresh.png differ
diff --git a/Icons/145-persondot.png b/Icons/145-persondot.png
new file mode 100644 (file)
index 0000000..e740405
Binary files /dev/null and b/Icons/145-persondot.png differ
diff --git a/Icons/container.png b/Icons/container.png
new file mode 100644 (file)
index 0000000..dcf8dc4
Binary files /dev/null and b/Icons/container.png differ
diff --git a/Icons/object.png b/Icons/object.png
new file mode 100644 (file)
index 0000000..cdaef80
Binary files /dev/null and b/Icons/object.png differ
diff --git a/Icons/subdir.png b/Icons/subdir.png
new file mode 100644 (file)
index 0000000..96c5e0d
Binary files /dev/null and b/Icons/subdir.png differ
index 5d737cd..49b98df 100644 (file)
                610DD36713E6E69D00ED982F /* PithosContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 610DD36613E6E69D00ED982F /* PithosContainer.m */; };
                610DD37213E7059900ED982F /* PithosObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 610DD37113E7059900ED982F /* PithosObject.m */; };
                610DD37513E7064F00ED982F /* PithosSubdir.m in Sources */ = {isa = PBXBuildFile; fileRef = 610DD37413E7064F00ED982F /* PithosSubdir.m */; };
+               610DD46313E950E600ED982F /* 01-refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = 610DD46213E950E600ED982F /* 01-refresh.png */; };
+               610DD49D13EAE03400ED982F /* container.png in Resources */ = {isa = PBXBuildFile; fileRef = 610DD49A13EAE03300ED982F /* container.png */; };
+               610DD49E13EAE03400ED982F /* object.png in Resources */ = {isa = PBXBuildFile; fileRef = 610DD49B13EAE03300ED982F /* object.png */; };
+               610DD49F13EAE03400ED982F /* subdir.png in Resources */ = {isa = PBXBuildFile; fileRef = 610DD49C13EAE03400ED982F /* subdir.png */; };
+               611FFCAF13EBF0B900E43E18 /* PithosEmpty.m in Sources */ = {isa = PBXBuildFile; fileRef = 611FFCAE13EBF0B900E43E18 /* PithosEmpty.m */; };
+               611FFCB313EBF40900E43E18 /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 611FFCB213EBF40900E43E18 /* ImageAndTextCell.m */; };
+               61E99D9413EC348500E48DA5 /* 145-persondot.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E99D9313EC348500E48DA5 /* 145-persondot.png */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
                610DD37113E7059900ED982F /* PithosObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosObject.m; sourceTree = "<group>"; };
                610DD37313E7064E00ED982F /* PithosSubdir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosSubdir.h; sourceTree = "<group>"; };
                610DD37413E7064F00ED982F /* PithosSubdir.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosSubdir.m; sourceTree = "<group>"; };
+               610DD46213E950E600ED982F /* 01-refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "01-refresh.png"; sourceTree = "<group>"; };
+               610DD49A13EAE03300ED982F /* container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = container.png; sourceTree = "<group>"; };
+               610DD49B13EAE03300ED982F /* object.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = object.png; sourceTree = "<group>"; };
+               610DD49C13EAE03400ED982F /* subdir.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = subdir.png; sourceTree = "<group>"; };
+               611FFCAD13EBF0B800E43E18 /* PithosEmpty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosEmpty.h; sourceTree = "<group>"; };
+               611FFCAE13EBF0B900E43E18 /* PithosEmpty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosEmpty.m; sourceTree = "<group>"; };
+               611FFCB113EBF40900E43E18 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; };
+               611FFCB213EBF40900E43E18 /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; };
+               61E99D9313EC348500E48DA5 /* 145-persondot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "145-persondot.png"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                                610DD37113E7059900ED982F /* PithosObject.m */,
                                610DD37313E7064E00ED982F /* PithosSubdir.h */,
                                610DD37413E7064F00ED982F /* PithosSubdir.m */,
+                               611FFCAD13EBF0B800E43E18 /* PithosEmpty.h */,
+                               611FFCAE13EBF0B900E43E18 /* PithosEmpty.m */,
+                               611FFCB113EBF40900E43E18 /* ImageAndTextCell.h */,
+                               611FFCB213EBF40900E43E18 /* ImageAndTextCell.m */,
                        );
                        path = "pithos-macos";
                        sourceTree = "<group>";
                610DD2FC13E6BB2000ED982F /* Supporting Files */ = {
                        isa = PBXGroup;
                        children = (
+                               610DD46113E950E500ED982F /* Icons */,
                                610DD2FD13E6BB2000ED982F /* pithos-macos-Info.plist */,
                                610DD2FE13E6BB2000ED982F /* InfoPlist.strings */,
                                610DD30113E6BB2000ED982F /* pithos-macos-Prefix.pch */,
                        path = "pithos-apple-common/asi-http-request-with-pithos/Classes/Pithos";
                        sourceTree = "<group>";
                };
+               610DD46113E950E500ED982F /* Icons */ = {
+                       isa = PBXGroup;
+                       children = (
+                               610DD46213E950E600ED982F /* 01-refresh.png */,
+                               61E99D9313EC348500E48DA5 /* 145-persondot.png */,
+                               610DD49A13EAE03300ED982F /* container.png */,
+                               610DD49B13EAE03300ED982F /* object.png */,
+                               610DD49C13EAE03400ED982F /* subdir.png */,
+                       );
+                       path = Icons;
+                       sourceTree = SOURCE_ROOT;
+               };
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
                                610DD30613E6BB2000ED982F /* Credits.rtf in Resources */,
                                610DD30C13E6BB2000ED982F /* MainMenu.xib in Resources */,
                                610DD35013E6C00E00ED982F /* PithosBrowserController.xib in Resources */,
+                               610DD46313E950E600ED982F /* 01-refresh.png in Resources */,
+                               610DD49D13EAE03400ED982F /* container.png in Resources */,
+                               610DD49E13EAE03400ED982F /* object.png in Resources */,
+                               610DD49F13EAE03400ED982F /* subdir.png in Resources */,
+                               61E99D9413EC348500E48DA5 /* 145-persondot.png in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                610DD36713E6E69D00ED982F /* PithosContainer.m in Sources */,
                                610DD37213E7059900ED982F /* PithosObject.m in Sources */,
                                610DD37513E7064F00ED982F /* PithosSubdir.m in Sources */,
+                               611FFCAF13EBF0B900E43E18 /* PithosEmpty.m in Sources */,
+                               611FFCB313EBF40900E43E18 /* ImageAndTextCell.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/pithos-macos/ImageAndTextCell.h b/pithos-macos/ImageAndTextCell.h
new file mode 100644 (file)
index 0000000..3c0d89c
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+     File: ImageAndTextCell.h 
+ Abstract: Subclass of NSTextFieldCell which can display text and an image simultaneously.
+  
+  Version: 1.1 
+  
+ Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple 
+ Inc. ("Apple") in consideration of your agreement to the following 
+ terms, and your use, installation, modification or redistribution of 
+ this Apple software constitutes acceptance of these terms.  If you do 
+ not agree with these terms, please do not use, install, modify or 
+ redistribute this Apple software. 
+  
+ In consideration of your agreement to abide by the following terms, and 
+ subject to these terms, Apple grants you a personal, non-exclusive 
+ license, under Apple's copyrights in this original Apple software (the 
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple 
+ Software, with or without modifications, in source and/or binary forms; 
+ provided that if you redistribute the Apple Software in its entirety and 
+ without modifications, you must retain this notice and the following 
+ text and disclaimers in all such redistributions of the Apple Software. 
+ Neither the name, trademarks, service marks or logos of Apple Inc. may 
+ be used to endorse or promote products derived from the Apple Software 
+ without specific prior written permission from Apple.  Except as 
+ expressly stated in this notice, no other rights or licenses, express or 
+ implied, are granted by Apple herein, including but not limited to any 
+ patent rights that may be infringed by your derivative works or by other 
+ works in which the Apple Software may be incorporated. 
+  
+ The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
+  
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
+ POSSIBILITY OF SUCH DAMAGE. 
+  
+ Copyright (C) 2010 Apple Inc. All Rights Reserved. 
+  
+ */
+
+#import <Cocoa/Cocoa.h>
+
+@interface ImageAndTextCell : NSTextFieldCell
+{
+@private
+       NSImage *image;
+}
+
+- (void)setImage:(NSImage *)anImage;
+- (NSImage *)image;
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
+- (NSSize)cellSize;
+
+@end
diff --git a/pithos-macos/ImageAndTextCell.m b/pithos-macos/ImageAndTextCell.m
new file mode 100644 (file)
index 0000000..c9b14a5
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+     File: ImageAndTextCell.m 
+ Abstract: Subclass of NSTextFieldCell which can display text and an image simultaneously.
+  
+  Version: 1.1 
+  
+ Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple 
+ Inc. ("Apple") in consideration of your agreement to the following 
+ terms, and your use, installation, modification or redistribution of 
+ this Apple software constitutes acceptance of these terms.  If you do 
+ not agree with these terms, please do not use, install, modify or 
+ redistribute this Apple software. 
+  
+ In consideration of your agreement to abide by the following terms, and 
+ subject to these terms, Apple grants you a personal, non-exclusive 
+ license, under Apple's copyrights in this original Apple software (the 
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple 
+ Software, with or without modifications, in source and/or binary forms; 
+ provided that if you redistribute the Apple Software in its entirety and 
+ without modifications, you must retain this notice and the following 
+ text and disclaimers in all such redistributions of the Apple Software. 
+ Neither the name, trademarks, service marks or logos of Apple Inc. may 
+ be used to endorse or promote products derived from the Apple Software 
+ without specific prior written permission from Apple.  Except as 
+ expressly stated in this notice, no other rights or licenses, express or 
+ implied, are granted by Apple herein, including but not limited to any 
+ patent rights that may be infringed by your derivative works or by other 
+ works in which the Apple Software may be incorporated. 
+  
+ The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
+  
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
+ POSSIBILITY OF SUCH DAMAGE. 
+  
+ Copyright (C) 2010 Apple Inc. All Rights Reserved. 
+  
+ */
+
+#import "ImageAndTextCell.h"
+//#import "BaseNode.h"
+
+@implementation ImageAndTextCell
+
+#define kIconImageSize         16.0
+
+#define kImageOriginXOffset 3
+#define kImageOriginYOffset 1
+
+#define kTextOriginXOffset     2
+#define kTextOriginYOffset     2
+#define kTextHeightAdjust      4
+
+// -------------------------------------------------------------------------------
+//     init:
+// -------------------------------------------------------------------------------
+- (id)init
+{
+       self = [super init];
+       
+       // we want a smaller font
+       [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+
+       return self;
+}
+
+// -------------------------------------------------------------------------------
+//     dealloc:
+// -------------------------------------------------------------------------------
+- (void)dealloc
+{
+    [image release];
+    image = nil;
+    [super dealloc];
+}
+
+// -------------------------------------------------------------------------------
+//     copyWithZone:zone
+// -------------------------------------------------------------------------------
+- (id)copyWithZone:(NSZone*)zone
+{
+    ImageAndTextCell *cell = (ImageAndTextCell*)[super copyWithZone:zone];
+    cell->image = [image retain];
+    return cell;
+}
+
+// -------------------------------------------------------------------------------
+//     setImage:anImage
+// -------------------------------------------------------------------------------
+- (void)setImage:(NSImage*)anImage
+{
+    if (anImage != image)
+       {
+        [image release];
+        image = [anImage retain];
+               [image setSize:NSMakeSize(kIconImageSize, kIconImageSize)];
+    }
+}
+
+// -------------------------------------------------------------------------------
+//     image:
+// -------------------------------------------------------------------------------
+- (NSImage*)image
+{
+    return image;
+}
+
+// -------------------------------------------------------------------------------
+//     isGroupCell:
+// -------------------------------------------------------------------------------
+- (BOOL)isGroupCell
+{
+    return ([self image] == nil && [[self title] length] > 0);
+}
+
+// -------------------------------------------------------------------------------
+//     titleRectForBounds:cellRect
+//
+//     Returns the proper bound for the cell's title while being edited
+// -------------------------------------------------------------------------------
+- (NSRect)titleRectForBounds:(NSRect)cellRect
+{      
+       // the cell has an image: draw the normal item cell
+       NSSize imageSize;
+       NSRect imageFrame;
+
+       imageSize = [image size];
+       NSDivideRect(cellRect, &imageFrame, &cellRect, 3 + imageSize.width, NSMinXEdge);
+
+       imageFrame.origin.x += kImageOriginXOffset;
+       imageFrame.origin.y -= kImageOriginYOffset;
+       imageFrame.size = imageSize;
+       
+       imageFrame.origin.y += ceil((cellRect.size.height - imageFrame.size.height) / 2);
+       
+       NSRect newFrame = cellRect;
+       newFrame.origin.x += kTextOriginXOffset;
+       newFrame.origin.y += kTextOriginYOffset;
+       newFrame.size.height -= kTextHeightAdjust;
+
+       return newFrame;
+}
+
+// -------------------------------------------------------------------------------
+//     editWithFrame:inView:editor:delegate:event
+// -------------------------------------------------------------------------------
+- (void)editWithFrame:(NSRect)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject event:(NSEvent*)theEvent
+{
+       NSRect textFrame = [self titleRectForBounds:aRect];
+       [super editWithFrame:textFrame inView:controlView editor:textObj delegate:anObject event:theEvent];
+}
+
+// -------------------------------------------------------------------------------
+//     selectWithFrame:inView:editor:delegate:event:start:length
+// -------------------------------------------------------------------------------
+- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
+{
+       NSRect textFrame = [self titleRectForBounds:aRect];
+       [super selectWithFrame:textFrame inView:controlView editor:textObj delegate:anObject start:selStart length:selLength];
+}
+
+// -------------------------------------------------------------------------------
+//     drawWithFrame:cellFrame:controlView:
+// -------------------------------------------------------------------------------
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
+{
+       if (image != nil)
+       {
+               // the cell has an image: draw the normal item cell
+               NSSize imageSize;
+        NSRect imageFrame;
+
+        imageSize = [image size];
+        NSDivideRect(cellFrame, &imageFrame, &cellFrame, 3 + imageSize.width, NSMinXEdge);
+        imageFrame.origin.x += kImageOriginXOffset;
+               imageFrame.origin.y -= kImageOriginYOffset;
+        imageFrame.size = imageSize;
+               
+        if ([controlView isFlipped])
+            imageFrame.origin.y += ceil((cellFrame.size.height + imageFrame.size.height) / 2);
+        else
+            imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2);
+               [image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver];
+
+               NSRect newFrame = cellFrame;
+               newFrame.origin.x += kTextOriginXOffset;
+               newFrame.origin.y += kTextOriginYOffset;
+               newFrame.size.height -= kTextHeightAdjust;
+               [super drawWithFrame:newFrame inView:controlView];
+    }
+       else
+       {
+               if ([self isGroupCell])
+               {
+                       // Center the text in the cellFrame, and call super to do thew ork of actually drawing. 
+                       CGFloat yOffset = floor((NSHeight(cellFrame) - [[self attributedStringValue] size].height) / 2.0);
+                       cellFrame.origin.y += yOffset;
+                       cellFrame.size.height -= (kTextOriginYOffset*yOffset);
+                       [super drawWithFrame:cellFrame inView:controlView];
+               }
+       }
+}
+
+// -------------------------------------------------------------------------------
+//     cellSize:
+// -------------------------------------------------------------------------------
+- (NSSize)cellSize
+{
+    NSSize cellSize = [super cellSize];
+    cellSize.width += (image ? [image size].width : 0) + 3;
+    return cellSize;
+}
+
+// -------------------------------------------------------------------------------
+//     hitTestForEvent:
+//
+//     In 10.5, we need you to implement this method for blocking drag and drop of a given cell.
+//     So NSCell hit testing will determine if a row can be dragged or not.
+//
+//     NSTableView calls this cell method when starting a drag, if the hit cell returns
+//     NSCellHitTrackableArea, the particular row will be tracked instead of dragged.
+//
+// -------------------------------------------------------------------------------
+//- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView
+//{
+//     NSInteger result = NSCellHitContentArea;
+//     
+//     NSOutlineView* hostingOutlineView = (NSOutlineView*)[self controlView];
+//     if (hostingOutlineView)
+//     {
+//             NSInteger selectedRow = [hostingOutlineView selectedRow];
+//             BaseNode* node = [[hostingOutlineView itemAtRow:selectedRow] representedObject];
+//
+//             if (![node isDraggable])        // is the node isDraggable (i.e. non-file system based objects)
+//                     result = NSCellHitTrackableArea;
+//     }
+//             
+//     return result;
+//}
+
+@end
+
index dafacf2..7300c8a 100644 (file)
 // interpreted as representing official policies, either expressed
 // or implied, of GRNET S.A.
 
-#import <Foundation/Foundation.h>
+#import "PithosNode.h"
 
-@interface PithosNode : NSObject {
-    NSArray *children;
-//    BOOL childrenDirty;
+@interface PithosAccount : PithosNode {
+    NSMutableArray *containers;
+    
+    BOOL refreshing;
 }
 
-@property(readonly) NSArray *children;
-
-//- (void)invalidateChildren;
-
 @end
index 0c4a01b..efe9bcb 100644 (file)
 // interpreted as representing official policies, either expressed
 // or implied, of GRNET S.A.
 
-#import "PithosNode.h"
+#import "PithosAccount.h"
+#import "PithosContainer.h"
+#import "ASIPithosAccountRequest.h"
+#import "ASIPithosContainer.h"
+#import "ASIDownloadCache.h"
 
-@implementation PithosNode
-@synthesize children;
+@implementation PithosAccount
 
 #pragma mark -
 #pragma mark Object Lifecycle
 
+- (id)init {
+    if ((self = [super init])) {
+        refreshing = NO;
+    }
+    return self;
+}
+
 - (void)dealloc {
-    [children release];
+    [containers release];
     [super dealloc];
 }
 
 #pragma mark -
+#pragma mark ASIHTTPRequestDelegate
+
+- (void)requestFinished:(ASIPithosAccountRequest *)accountRequest {
+    NSLog(@"URL: %@", [accountRequest url]);
+    NSLog(@"cached: %d", [accountRequest didUseCachedResponse]);
+    
+    NSArray *someContainers = [accountRequest containers];
+    if (containers == nil) {
+        containers = [[NSMutableArray alloc] initWithArray:someContainers];
+    } else {
+        [containers addObjectsFromArray:someContainers];
+    }
+    if ([someContainers count] < 10000) {
+        if (!accountRequest.didUseCachedResponse || ([containers count] != [someContainers count]) || !children) {
+            // Save new children
+            NSLog(@"using newChildren");
+            NSMutableArray *newChildren = [NSMutableArray array];
+            for (ASIPithosContainer *container in containers) {
+                PithosContainer *node = [[[PithosContainer alloc] initWithContainerName:container.name] autorelease];
+                if (children) {
+                    NSUInteger oldIndex = [children indexOfObject:node];
+                    if (oldIndex != NSNotFound)
+                        // Use the same pointer value, if possible
+                        node = [children objectAtIndex:oldIndex];
+                }
+                [newChildren addObject:node];
+            }
+            [children release];
+            children = [newChildren retain];
+        }
+        // Else cache was used and all results were fetched during this request, so previousChildren can be reused
+        [containers release];
+        containers = nil;
+        // XXX sort children based on preferences
+        refreshing = NO;
+        // Notify observers that children are updated
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosNodeChildrenUpdated" object:self];
+    } else {
+        // Do an additional request to fetch more objects
+        ASIPithosAccountRequest *newAccountRequest = [ASIPithosAccountRequest listContainersRequestWithLimit:0 
+                                                                                                      marker:[[someContainers lastObject] name] 
+                                                                                                      shared:NO 
+                                                                                                       until:nil];
+        newAccountRequest.delegate = self;
+        newAccountRequest.downloadCache = [ASIDownloadCache sharedCache];
+        [newAccountRequest startAsynchronous];
+    }
+}
+
+- (void)requestFailed:(ASIPithosAccountRequest *)accountRequest {
+    // XXX do something on error, cleanup
+    NSLog(@"error:%@", [accountRequest error]);
+    [containers release];
+    containers = nil;
+    childrenDirty = YES;
+    refreshing = NO;
+}
+
+#pragma mark -
 #pragma mark Properties
 
+- (NSString *)url {
+    if (url == nil) 
+        url = [[ASIPithosRequest storageURL] copy];
+    return url;
+}
+
 - (NSArray *)children {
-    if (children == nil) {
-        children = [[NSArray alloc] init];
+    if (childrenDirty) {
+        @synchronized (self) {
+            if (!refreshing) {
+                refreshing = YES;
+                childrenDirty = NO;
+                ASIPithosAccountRequest *accountRequest = [ASIPithosAccountRequest listContainersRequestWithLimit:0 
+                                                                                                           marker:nil 
+                                                                                                           shared:NO 
+                                                                                                            until:nil];
+                accountRequest.delegate = self;
+                accountRequest.downloadCache = [ASIDownloadCache sharedCache];
+                [accountRequest startAsynchronous];
+            }
+        }
     }
     return children;
 }
+
+- (NSString *)displayName {
+    if (displayName == nil) {
+        displayName = [[NSString alloc] initWithString:@"account"];
+    }
+    return displayName;
+}
+
+- (NSImage *)icon {
+    return nil;
+}
     
 @end
index d06d740..5616d93 100644 (file)
@@ -2,16 +2,62 @@
 //  PithosBrowserController.h
 //  pithos-macos
 //
-//  Created by Miltiadis Vasilakis on 01/08/11.
-//  Copyright 2011 koomasi. All rights reserved.
+// Copyright 2011 GRNET S.A. All rights reserved.
 //
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
 
 #import <Cocoa/Cocoa.h>
+@class PithosNode;
 
-
-@interface PithosBrowserController : NSWindowController {
-@private
+@interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate> {    
+    PithosNode *rootNode;
     
+    NSMutableArray *outlineViewDataSourceArray;
 }
 
+@property (nonatomic, retain) IBOutlet NSUserDefaultsController *userDefaultsController;
+
+@property (nonatomic, retain) NSMutableArray *outlineViewDataSourceArray;
+
+@property (nonatomic, retain) IBOutlet NSSplitView *splitView;
+@property (nonatomic, retain) IBOutlet NSOutlineView *outlineView;
+@property (nonatomic, retain) IBOutlet NSBrowser *browser;
+
+@property (nonatomic, retain) IBOutlet NSPanel *authenticationPanel;
+
+- (IBAction)refresh:(id)sender;
+
+- (IBAction)authenticationSelect:(id)sender;
+- (IBAction)authenticationDone:(id)sender;
+- (IBAction)authenticationCancel:(id)sender;
+
 @end
index 4363dee..a4a4918 100644 (file)
-//
+    //
 //  PithosBrowserController.m
 //  pithos-macos
 //
-//  Created by Miltiadis Vasilakis on 01/08/11.
-//  Copyright 2011 koomasi. All rights reserved.
+// Copyright 2011 GRNET S.A. All rights reserved.
 //
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
 
 #import "PithosBrowserController.h"
+#import "ASIPithosRequest.h"
+#import "PithosAccount.h"
+#import "PithosContainer.h"
+#import "PithosEmpty.h"
+#import "ImageAndTextCell.h"
 
+@interface PithosBrowserCell : NSBrowserCell {}
+@end
 
-@implementation PithosBrowserController
+@implementation PithosBrowserCell
 
-- (id)initWithWindow:(NSWindow *)window
-{
-    self = [super initWithWindow:window];
-    if (self) {
-        // Initialization code here.
+- (void)setObjectValue:(id)object {
+    if ([object isKindOfClass:[PithosNode class]]) {
+        PithosNode *node = (PithosNode *)object;
+        [self setStringValue:node.displayName];
+        [self setImage:node.icon];
+        // All cells are set as leafs because a branchingImage is already set!
+        // Maybe this cell is already inside an NSBrowserCell
+        [self setLeaf:YES];
+    } else {
+        [super setObjectValue:object];
     }
-    
-    return self;
 }
 
-- (void)dealloc
-{
+@end
+
+@interface PithosOutlineViewCell : ImageAndTextCell {}
+@end
+
+@implementation PithosOutlineViewCell
+
+- (void)setObjectValue:(id)object {
+    if ([object isKindOfClass:[PithosNode class]]) {
+        PithosNode *node = (PithosNode *)object;
+        [self setStringValue:node.displayName];
+        [self setImage:node.icon];
+        [self setEditable:NO];
+    } else {
+        [super setObjectValue:object];
+    }
+}
+
+@end
+
+@interface PithosBrowserController (Private) {}
+- (void)authenticate;
+- (void)resetContainers;
+@end
+
+@implementation PithosBrowserController
+@synthesize userDefaultsController, outlineViewDataSourceArray, splitView, outlineView, browser, authenticationPanel;
+
+#pragma mark -
+#pragma Object Lifecycle
+
+- (id)init {
+    return [super initWithWindowNibName:@"PithosBrowserController"];
+}
+
+- (void)dealloc {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    [outlineViewDataSourceArray release];
+    [rootNode release];
+    [authenticationPanel release];
+    [browser release];
+    [splitView release];
+    [outlineView release];
+    [userDefaultsController release];
     [super dealloc];
 }
 
-- (void)windowDidLoad
-{
-    [super windowDidLoad];
+- (void)awakeFromNib {
+    [browser setCellClass:[PithosBrowserCell class]];
+}
+
+- (void)resetContainers {
+    rootNode = nil;
+    [browser loadColumnZero];
+    self.outlineViewDataSourceArray = nil;
+    
+    // Create the outlineView tree
+       NSTreeNode *treeNode = [NSTreeNode treeNodeWithRepresentedObject:
+                            [[[PithosEmpty alloc] initWithDisplayName:@"CONTAINERS" icon:nil] autorelease]];
+       [[treeNode mutableChildNodes] addObject:
+     [NSTreeNode treeNodeWithRepresentedObject:
+      [[[PithosContainer alloc] initWithContainerName:@"pithos"] autorelease]]];
+       [[treeNode mutableChildNodes] addObject:
+     [NSTreeNode treeNodeWithRepresentedObject:
+      [[[PithosContainer alloc] initWithContainerName:@"trash"] autorelease]]];
     
-    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+    self.outlineViewDataSourceArray = [NSMutableArray arrayWithObject:treeNode];
+    
+       // Expand the folder outline view
+    [outlineView expandItem:nil expandChildren:YES];
+       [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
 }
 
-@end
+- (void)windowDidLoad {
+//    [userDefaultsController setAppliesImmediately:NO];
+    
+    [[[outlineView tableColumns] objectAtIndex:0] setDataCell:[[[PithosOutlineViewCell alloc] init] autorelease]];
+    
+    // Register for updates
+    [[NSNotificationCenter defaultCenter] addObserver:self 
+                                             selector:@selector(pithosNodeChildrenUpdated:) 
+                                                 name:@"PithosNodeChildrenUpdated" 
+                                               object:nil];
+
+    [self authenticate];
+}
+
+#pragma mark -
+#pragma Observers
+
+- (void)pithosNodeChildrenUpdated:(NSNotification *)notification {
+    if ([[browser parentForItemsInColumn:[browser lastColumn]] isEqualTo:[notification object]]) 
+        [browser reloadColumn:[browser lastColumn]];
+}
+
+#pragma mark -
+#pragma Actions
+
+- (IBAction)refresh:(id)sender {
+    [[browser parentForItemsInColumn:[browser lastColumn]] invalidateChildren];
+    [browser reloadColumn:[browser lastColumn]];
+}
+
+#pragma mark -
+#pragma Authentication
+
+- (void)authenticate {
+    NSString *authURL = [[userDefaultsController values] valueForKey:@"authURL"];
+    NSString *username = [[userDefaultsController values] valueForKey:@"username"];
+    NSString *apiKey = [[userDefaultsController values] valueForKey:@"apiKey"];
+    NSString *storageURL = [[userDefaultsController values] valueForKey:@"storageURL"];
+    NSString *authToken = [[userDefaultsController values] valueForKey:@"authToken"];
+
+    NSLog(@"Authentication - authURL:%@, username:%@, apiKey:%@, storageURL:%@, authToken:%@", authURL, username, apiKey, storageURL, authToken);
+    if (storageURL && authToken) {
+        [ASIPithosRequest setStorageURL:storageURL];
+        [ASIPithosRequest setAuthToken:authToken];
+        [self resetContainers];
+    } else if (authURL && username && apiKey) {
+        [ASIPithosRequest setAuthURL:authURL];
+        [ASIPithosRequest setUsername:username];
+        [ASIPithosRequest setApiKey:apiKey];        
+        NSError *error = [ASIPithosRequest authenticate];
+        if (error) {
+            // XXX Do something on error.
+            NSLog(@"error:%@", error);
+        } else {
+            [[userDefaultsController values] setValue:[ASIPithosRequest storageURL] forKey:@"storageURL"];
+            [[userDefaultsController values] setValue:[ASIPithosRequest authToken] forKey:@"authToken"];
+            [userDefaultsController save:nil];
+        }
+        [self resetContainers];
+    } else {
+        [self authenticationSelect:nil];
+    }
+}
+
+- (IBAction)authenticationSelect:(id)sender {
+       [self.window makeFirstResponder:nil];
+    
+       [NSApp beginSheet:authenticationPanel
+          modalForWindow:self.window
+        modalDelegate:self
+          didEndSelector:NULL
+                 contextInfo:nil];
+}
+
+- (IBAction)authenticationDone:(id)sender {
+       [NSApp endSheet:authenticationPanel];
+       [authenticationPanel orderOut:self];
+    [userDefaultsController save:sender];
+    [self authenticate];
+}
+
+- (IBAction)authenticationCancel:(id)sender {
+       [NSApp endSheet:authenticationPanel];
+       [authenticationPanel orderOut:self];
+    [userDefaultsController revert:sender];
+}
+
+#pragma mark -
+#pragma NSBrowserDelegate
+
+- (id)rootItemForBrowser:(NSBrowser *)browser {
+    return rootNode;    
+}
+
+- (NSInteger)browser:(NSBrowser *)browser numberOfChildrenOfItem:(id)item {
+    PithosNode *node = (PithosNode *)item;
+    return node.children.count;
+}
+
+- (id)browser:(NSBrowser *)browser child:(NSInteger)index ofItem:(id)item {
+    PithosNode *node = (PithosNode *)item;
+    return [node.children objectAtIndex:index];
+}
+
+- (BOOL)browser:(NSBrowser *)browser isLeafItem:(id)item {
+    PithosNode *node = (PithosNode *)item;
+    return node.isLeafItem;
+}
+
+- (id)browser:(NSBrowser *)browser objectValueForItem:(id)item {
+    PithosNode *node = (PithosNode *)item;
+    return node;
+}
+
+#pragma mark -
+#pragma NSSplitViewDelegate
+
+- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex {
+    return 100;
+}
+
+- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex {
+    return 260;
+}
+
+#pragma mark -
+#pragma mark NSOutlineViewDelegate
+
+- (BOOL)outlineView:outlineView shouldSelectItem:(id)item {
+    return ([[item representedObject] isLeaf]);
+}
+
+- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item {
+       return (![[item representedObject] isLeaf]);
+}
+
+- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
+    PithosNode *node = [[[outlineView itemAtRow:[outlineView selectedRow]] representedObject] representedObject];
+    if (node) {
+        rootNode = node;
+        [browser loadColumnZero];
+    }
+}
+
+@end
\ No newline at end of file
index ab8f702..52b1fbc 100644 (file)
@@ -2,7 +2,7 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
        <data>
                <int key="IBDocument.SystemTarget">1060</int>
-               <string key="IBDocument.SystemVersion">10K540</string>
+               <string key="IBDocument.SystemVersion">10K549</string>
                <string key="IBDocument.InterfaceBuilderVersion">1306</string>
                <string key="IBDocument.AppKitVersion">1038.36</string>
                <string key="IBDocument.HIToolboxVersion">461.00</string>
                </object>
                <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <string>NSBrowser</string>
+                       <string>NSToolbarItem</string>
+                       <string>NSButton</string>
+                       <string>NSToolbarFlexibleSpaceItem</string>
+                       <string>NSCustomObject</string>
+                       <string>NSSplitView</string>
+                       <string>NSCustomView</string>
+                       <string>NSTextField</string>
+                       <string>NSToolbarSeparatorItem</string>
                        <string>NSWindowTemplate</string>
+                       <string>NSTextFieldCell</string>
+                       <string>NSTreeController</string>
+                       <string>NSButtonCell</string>
+                       <string>NSTableColumn</string>
+                       <string>NSBrowser</string>
+                       <string>NSToolbarSpaceItem</string>
+                       <string>NSOutlineView</string>
                        <string>NSView</string>
-                       <string>NSCustomObject</string>
+                       <string>NSToolbar</string>
+                       <string>NSScrollView</string>
+                       <string>NSBox</string>
+                       <string>NSUserDefaultsController</string>
+                       <string>NSScroller</string>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
                        <object class="NSWindowTemplate" id="1005">
                                <int key="NSWindowStyleMask">15</int>
                                <int key="NSWindowBacking">2</int>
-                               <string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
+                               <string key="NSWindowRect">{{196, 240}, {690, 400}}</string>
                                <int key="NSWTFlags">544735232</int>
                                <string key="NSWindowTitle">Window</string>
                                <string key="NSWindowClass">NSWindow</string>
-                               <nil key="NSViewClass"/>
+                               <object class="NSToolbar" key="NSViewClass" id="70997002">
+                                       <object class="NSMutableString" key="NSToolbarIdentifier">
+                                               <characters key="NS.bytes">8F4D01A2-CACB-4847-B3B2-6671142E2EC0</characters>
+                                       </object>
+                                       <nil key="NSToolbarDelegate"/>
+                                       <bool key="NSToolbarPrefersToBeShown">YES</bool>
+                                       <bool key="NSToolbarShowsBaselineSeparator">YES</bool>
+                                       <bool key="NSToolbarAllowsUserCustomization">YES</bool>
+                                       <bool key="NSToolbarAutosavesConfiguration">NO</bool>
+                                       <int key="NSToolbarDisplayMode">2</int>
+                                       <int key="NSToolbarSizeMode">2</int>
+                                       <object class="NSMutableDictionary" key="NSToolbarIBIdentifiedItems">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>55EBF526-FB96-46D8-A7E3-8EB4E16D14CB</string>
+                                                       <string>88207686-56C6-4FA8-A8EF-EDD562943A36</string>
+                                                       <string>NSToolbarCustomizeToolbarItem</string>
+                                                       <string>NSToolbarFlexibleSpaceItem</string>
+                                                       <string>NSToolbarSeparatorItem</string>
+                                                       <string>NSToolbarSpaceItem</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="NSToolbarItem" id="817791921">
+                                                               <object class="NSMutableString" key="NSToolbarItemIdentifier">
+                                                                       <characters key="NS.bytes">55EBF526-FB96-46D8-A7E3-8EB4E16D14CB</characters>
+                                                               </object>
+                                                               <string key="NSToolbarItemLabel">Authentication</string>
+                                                               <string key="NSToolbarItemPaletteLabel">Authorization</string>
+                                                               <nil key="NSToolbarItemToolTip"/>
+                                                               <object class="NSButton" key="NSToolbarItemView" id="336305760">
+                                                                       <reference key="NSNextResponder"/>
+                                                                       <int key="NSvFlags">268</int>
+                                                                       <string key="NSFrame">{{23, 14}, {36, 25}}</string>
+                                                                       <reference key="NSSuperview"/>
+                                                                       <reference key="NSWindow"/>
+                                                                       <reference key="NSNextKeyView"/>
+                                                                       <bool key="NSEnabled">YES</bool>
+                                                                       <object class="NSButtonCell" key="NSCell" id="661833551">
+                                                                               <int key="NSCellFlags">67239424</int>
+                                                                               <int key="NSCellFlags2">134217728</int>
+                                                                               <string key="NSContents"/>
+                                                                               <object class="NSFont" key="NSSupport" id="957255455">
+                                                                                       <string key="NSName">LucidaGrande</string>
+                                                                                       <double key="NSSize">13</double>
+                                                                                       <int key="NSfFlags">1044</int>
+                                                                               </object>
+                                                                               <reference key="NSControlView" ref="336305760"/>
+                                                                               <int key="NSButtonFlags">-2033434369</int>
+                                                                               <int key="NSButtonFlags2">163</int>
+                                                                               <object class="NSCustomResource" key="NSNormalImage" id="741590339">
+                                                                                       <string key="NSClassName">NSImage</string>
+                                                                                       <string key="NSResourceName">145-persondot</string>
+                                                                               </object>
+                                                                               <string key="NSAlternateContents"/>
+                                                                               <string key="NSKeyEquivalent"/>
+                                                                               <int key="NSPeriodicDelay">400</int>
+                                                                               <int key="NSPeriodicInterval">75</int>
+                                                                       </object>
+                                                               </object>
+                                                               <reference key="NSToolbarItemImage" ref="741590339"/>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <nil key="NSToolbarItemAction"/>
+                                                               <string key="NSToolbarItemMinSize">{36, 25}</string>
+                                                               <string key="NSToolbarItemMaxSize">{36, 25}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">0</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                       </object>
+                                                       <object class="NSToolbarItem" id="172967697">
+                                                               <object class="NSMutableString" key="NSToolbarItemIdentifier">
+                                                                       <characters key="NS.bytes">88207686-56C6-4FA8-A8EF-EDD562943A36</characters>
+                                                               </object>
+                                                               <string key="NSToolbarItemLabel">Refresh</string>
+                                                               <string key="NSToolbarItemPaletteLabel">Refresh</string>
+                                                               <nil key="NSToolbarItemToolTip"/>
+                                                               <object class="NSButton" key="NSToolbarItemView" id="105603186">
+                                                                       <reference key="NSNextResponder"/>
+                                                                       <int key="NSvFlags">268</int>
+                                                                       <string key="NSFrame">{{6, 14}, {36, 25}}</string>
+                                                                       <reference key="NSSuperview"/>
+                                                                       <reference key="NSWindow"/>
+                                                                       <reference key="NSNextKeyView"/>
+                                                                       <bool key="NSEnabled">YES</bool>
+                                                                       <object class="NSButtonCell" key="NSCell" id="669515004">
+                                                                               <int key="NSCellFlags">67239424</int>
+                                                                               <int key="NSCellFlags2">134217728</int>
+                                                                               <string key="NSContents"/>
+                                                                               <reference key="NSSupport" ref="957255455"/>
+                                                                               <reference key="NSControlView" ref="105603186"/>
+                                                                               <int key="NSButtonFlags">-2033434369</int>
+                                                                               <int key="NSButtonFlags2">163</int>
+                                                                               <object class="NSCustomResource" key="NSNormalImage" id="627862745">
+                                                                                       <string key="NSClassName">NSImage</string>
+                                                                                       <string key="NSResourceName">01-refresh</string>
+                                                                               </object>
+                                                                               <string key="NSAlternateContents"/>
+                                                                               <string key="NSKeyEquivalent"/>
+                                                                               <int key="NSPeriodicDelay">400</int>
+                                                                               <int key="NSPeriodicInterval">75</int>
+                                                                       </object>
+                                                               </object>
+                                                               <reference key="NSToolbarItemImage" ref="627862745"/>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <nil key="NSToolbarItemAction"/>
+                                                               <string key="NSToolbarItemMinSize">{36, 25}</string>
+                                                               <string key="NSToolbarItemMaxSize">{36, 25}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">0</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                       </object>
+                                                       <object class="NSToolbarItem" id="254657743">
+                                                               <string key="NSToolbarItemIdentifier">NSToolbarCustomizeToolbarItem</string>
+                                                               <string key="NSToolbarItemLabel">Customize</string>
+                                                               <string key="NSToolbarItemPaletteLabel">Customize</string>
+                                                               <string key="NSToolbarItemToolTip">Customize Toolbar</string>
+                                                               <nil key="NSToolbarItemView"/>
+                                                               <object class="NSCustomResource" key="NSToolbarItemImage">
+                                                                       <string key="NSClassName">NSImage</string>
+                                                                       <string key="NSResourceName">NSToolbarCustomizeToolbarItemImage</string>
+                                                               </object>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <string key="NSToolbarItemAction">runToolbarCustomizationPalette:</string>
+                                                               <string key="NSToolbarItemMinSize">{0, 0}</string>
+                                                               <string key="NSToolbarItemMaxSize">{0, 0}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">-1</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                       </object>
+                                                       <object class="NSToolbarFlexibleSpaceItem" id="877012613">
+                                                               <string key="NSToolbarItemIdentifier">NSToolbarFlexibleSpaceItem</string>
+                                                               <string key="NSToolbarItemLabel"/>
+                                                               <string key="NSToolbarItemPaletteLabel">Flexible Space</string>
+                                                               <nil key="NSToolbarItemToolTip"/>
+                                                               <nil key="NSToolbarItemView"/>
+                                                               <nil key="NSToolbarItemImage"/>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <nil key="NSToolbarItemAction"/>
+                                                               <string key="NSToolbarItemMinSize">{1, 5}</string>
+                                                               <string key="NSToolbarItemMaxSize">{20000, 32}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">-1</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                               <object class="NSMenuItem" key="NSToolbarItemMenuFormRepresentation">
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <object class="NSCustomResource" key="NSOnImage" id="904339852">
+                                                                               <string key="NSClassName">NSImage</string>
+                                                                               <string key="NSResourceName">NSMenuCheckmark</string>
+                                                                       </object>
+                                                                       <object class="NSCustomResource" key="NSMixedImage" id="430620698">
+                                                                               <string key="NSClassName">NSImage</string>
+                                                                               <string key="NSResourceName">NSMenuMixedState</string>
+                                                                       </object>
+                                                               </object>
+                                                       </object>
+                                                       <object class="NSToolbarSeparatorItem" id="584835008">
+                                                               <string key="NSToolbarItemIdentifier">NSToolbarSeparatorItem</string>
+                                                               <string key="NSToolbarItemLabel"/>
+                                                               <string key="NSToolbarItemPaletteLabel">Separator</string>
+                                                               <nil key="NSToolbarItemToolTip"/>
+                                                               <nil key="NSToolbarItemView"/>
+                                                               <nil key="NSToolbarItemImage"/>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <nil key="NSToolbarItemAction"/>
+                                                               <string key="NSToolbarItemMinSize">{12, 5}</string>
+                                                               <string key="NSToolbarItemMaxSize">{12, 1000}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">-1</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                               <object class="NSMenuItem" key="NSToolbarItemMenuFormRepresentation">
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="904339852"/>
+                                                                       <reference key="NSMixedImage" ref="430620698"/>
+                                                               </object>
+                                                       </object>
+                                                       <object class="NSToolbarSpaceItem" id="617154997">
+                                                               <string key="NSToolbarItemIdentifier">NSToolbarSpaceItem</string>
+                                                               <string key="NSToolbarItemLabel"/>
+                                                               <string key="NSToolbarItemPaletteLabel">Space</string>
+                                                               <nil key="NSToolbarItemToolTip"/>
+                                                               <nil key="NSToolbarItemView"/>
+                                                               <nil key="NSToolbarItemImage"/>
+                                                               <nil key="NSToolbarItemTarget"/>
+                                                               <nil key="NSToolbarItemAction"/>
+                                                               <string key="NSToolbarItemMinSize">{32, 5}</string>
+                                                               <string key="NSToolbarItemMaxSize">{32, 32}</string>
+                                                               <bool key="NSToolbarItemEnabled">YES</bool>
+                                                               <bool key="NSToolbarItemAutovalidates">YES</bool>
+                                                               <int key="NSToolbarItemTag">-1</int>
+                                                               <bool key="NSToolbarIsUserRemovable">YES</bool>
+                                                               <int key="NSToolbarItemVisibilityPriority">0</int>
+                                                               <object class="NSMenuItem" key="NSToolbarItemMenuFormRepresentation">
+                                                                       <bool key="NSIsDisabled">YES</bool>
+                                                                       <bool key="NSIsSeparator">YES</bool>
+                                                                       <string key="NSTitle"/>
+                                                                       <string key="NSKeyEquiv"/>
+                                                                       <int key="NSKeyEquivModMask">1048576</int>
+                                                                       <int key="NSMnemonicLoc">2147483647</int>
+                                                                       <reference key="NSOnImage" ref="904339852"/>
+                                                                       <reference key="NSMixedImage" ref="430620698"/>
+                                                               </object>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableArray" key="NSToolbarIBAllowedItems">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <reference ref="172967697"/>
+                                               <reference ref="584835008"/>
+                                               <reference ref="617154997"/>
+                                               <reference ref="877012613"/>
+                                               <reference ref="254657743"/>
+                                               <reference ref="817791921"/>
+                                       </object>
+                                       <object class="NSMutableArray" key="NSToolbarIBDefaultItems">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <reference ref="172967697"/>
+                                               <reference ref="877012613"/>
+                                               <reference ref="817791921"/>
+                                       </object>
+                                       <object class="NSMutableArray" key="NSToolbarIBSelectableItems">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                       </object>
+                               </object>
+                               <string key="NSWindowContentMinSize">{320, 240}</string>
                                <object class="NSView" key="NSWindowView" id="1006">
                                        <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                        <object class="NSMutableArray" key="NSSubviews">
                                                <bool key="EncodedWithXMLCoder">YES</bool>
-                                               <object class="NSBrowser" id="259981942">
+                                               <object class="NSSplitView" id="374340452">
                                                        <reference key="NSNextResponder" ref="1006"/>
                                                        <int key="NSvFlags">274</int>
-                                                       <string key="NSFrame">{{20, 20}, {440, 250}}</string>
+                                                       <object class="NSMutableArray" key="NSSubviews">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <object class="NSCustomView" id="581795577">
+                                                                       <reference key="NSNextResponder" ref="374340452"/>
+                                                                       <int key="NSvFlags">256</int>
+                                                                       <object class="NSMutableArray" key="NSSubviews">
+                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                               <object class="NSScrollView" id="197496877">
+                                                                                       <reference key="NSNextResponder" ref="581795577"/>
+                                                                                       <int key="NSvFlags">274</int>
+                                                                                       <object class="NSMutableArray" key="NSSubviews">
+                                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                               <object class="NSClipView" id="843429105">
+                                                                                                       <reference key="NSNextResponder" ref="197496877"/>
+                                                                                                       <int key="NSvFlags">2304</int>
+                                                                                                       <object class="NSMutableArray" key="NSSubviews">
+                                                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                               <object class="NSOutlineView" id="392693553">
+                                                                                                                       <reference key="NSNextResponder" ref="843429105"/>
+                                                                                                                       <int key="NSvFlags">4352</int>
+                                                                                                                       <string key="NSFrameSize">{180, 400}</string>
+                                                                                                                       <reference key="NSSuperview" ref="843429105"/>
+                                                                                                                       <reference key="NSWindow"/>
+                                                                                                                       <reference key="NSNextKeyView" ref="624286523"/>
+                                                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                                                       <object class="_NSCornerView" key="NSCornerView">
+                                                                                                                               <nil key="NSNextResponder"/>
+                                                                                                                               <int key="NSvFlags">-2147483392</int>
+                                                                                                                               <string key="NSFrame">{{224, 0}, {16, 17}}</string>
+                                                                                                                       </object>
+                                                                                                                       <object class="NSMutableArray" key="NSTableColumns">
+                                                                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                                               <object class="NSTableColumn" id="612034888">
+                                                                                                                                       <double key="NSWidth">177</double>
+                                                                                                                                       <double key="NSMinWidth">16</double>
+                                                                                                                                       <double key="NSMaxWidth">1000</double>
+                                                                                                                                       <object class="NSTableHeaderCell" key="NSHeaderCell">
+                                                                                                                                               <int key="NSCellFlags">75628096</int>
+                                                                                                                                               <int key="NSCellFlags2">2048</int>
+                                                                                                                                               <string key="NSContents"/>
+                                                                                                                                               <object class="NSFont" key="NSSupport">
+                                                                                                                                                       <string key="NSName">LucidaGrande</string>
+                                                                                                                                                       <double key="NSSize">11</double>
+                                                                                                                                                       <int key="NSfFlags">3100</int>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSColor" key="NSBackgroundColor">
+                                                                                                                                                       <int key="NSColorSpace">3</int>
+                                                                                                                                                       <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSColor" key="NSTextColor">
+                                                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                                                       <string key="NSColorName">headerTextColor</string>
+                                                                                                                                                       <object class="NSColor" key="NSColor" id="916883122">
+                                                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                                                               <bytes key="NSWhite">MAA</bytes>
+                                                                                                                                                       </object>
+                                                                                                                                               </object>
+                                                                                                                                       </object>
+                                                                                                                                       <object class="NSTextFieldCell" key="NSDataCell" id="262895342">
+                                                                                                                                               <int key="NSCellFlags">337772096</int>
+                                                                                                                                               <int key="NSCellFlags2">2048</int>
+                                                                                                                                               <string key="NSContents">Text Cell</string>
+                                                                                                                                               <reference key="NSSupport" ref="957255455"/>
+                                                                                                                                               <reference key="NSControlView" ref="392693553"/>
+                                                                                                                                               <object class="NSColor" key="NSBackgroundColor" id="592883226">
+                                                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                                                       <string key="NSColorName">controlBackgroundColor</string>
+                                                                                                                                                       <object class="NSColor" key="NSColor" id="891120609">
+                                                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                                                               <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+                                                                                                                                                       </object>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSColor" key="NSTextColor" id="75086281">
+                                                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                                                       <string key="NSColorName">controlTextColor</string>
+                                                                                                                                                       <reference key="NSColor" ref="916883122"/>
+                                                                                                                                               </object>
+                                                                                                                                       </object>
+                                                                                                                                       <int key="NSResizingMask">1</int>
+                                                                                                                                       <bool key="NSIsResizeable">YES</bool>
+                                                                                                                                       <reference key="NSTableView" ref="392693553"/>
+                                                                                                                               </object>
+                                                                                                                       </object>
+                                                                                                                       <double key="NSIntercellSpacingWidth">3</double>
+                                                                                                                       <double key="NSIntercellSpacingHeight">0.0</double>
+                                                                                                                       <object class="NSColor" key="NSBackgroundColor">
+                                                                                                                               <int key="NSColorSpace">6</int>
+                                                                                                                               <string key="NSCatalogName">System</string>
+                                                                                                                               <string key="NSColorName">_sourceListBackgroundColor</string>
+                                                                                                                               <object class="NSColor" key="NSColor">
+                                                                                                                                       <int key="NSColorSpace">1</int>
+                                                                                                                                       <bytes key="NSRGB">MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA</bytes>
+                                                                                                                               </object>
+                                                                                                                       </object>
+                                                                                                                       <object class="NSColor" key="NSGridColor">
+                                                                                                                               <int key="NSColorSpace">6</int>
+                                                                                                                               <string key="NSCatalogName">System</string>
+                                                                                                                               <string key="NSColorName">gridColor</string>
+                                                                                                                               <object class="NSColor" key="NSColor">
+                                                                                                                                       <int key="NSColorSpace">3</int>
+                                                                                                                                       <bytes key="NSWhite">MC41AA</bytes>
+                                                                                                                               </object>
+                                                                                                                       </object>
+                                                                                                                       <double key="NSRowHeight">20</double>
+                                                                                                                       <int key="NSTvFlags">-767557632</int>
+                                                                                                                       <reference key="NSDelegate"/>
+                                                                                                                       <reference key="NSDataSource"/>
+                                                                                                                       <int key="NSColumnAutoresizingStyle">4</int>
+                                                                                                                       <int key="NSDraggingSourceMaskForLocal">15</int>
+                                                                                                                       <int key="NSDraggingSourceMaskForNonLocal">0</int>
+                                                                                                                       <bool key="NSAllowsTypeSelect">YES</bool>
+                                                                                                                       <int key="NSTableViewSelectionHighlightStyle">1</int>
+                                                                                                                       <int key="NSTableViewDraggingDestinationStyle">1</int>
+                                                                                                                       <float key="NSOutlineViewIndentationPerLevelKey">14</float>
+                                                                                                               </object>
+                                                                                                       </object>
+                                                                                                       <string key="NSFrameSize">{180, 400}</string>
+                                                                                                       <reference key="NSSuperview" ref="197496877"/>
+                                                                                                       <reference key="NSWindow"/>
+                                                                                                       <reference key="NSNextKeyView" ref="392693553"/>
+                                                                                                       <reference key="NSDocView" ref="392693553"/>
+                                                                                                       <reference key="NSBGColor" ref="592883226"/>
+                                                                                                       <int key="NScvFlags">4</int>
+                                                                                               </object>
+                                                                                               <object class="NSScroller" id="624286523">
+                                                                                                       <reference key="NSNextResponder" ref="197496877"/>
+                                                                                                       <int key="NSvFlags">-2147483392</int>
+                                                                                                       <string key="NSFrame">{{224, 17}, {15, 102}}</string>
+                                                                                                       <reference key="NSSuperview" ref="197496877"/>
+                                                                                                       <reference key="NSWindow"/>
+                                                                                                       <reference key="NSNextKeyView" ref="987905504"/>
+                                                                                                       <reference key="NSTarget" ref="197496877"/>
+                                                                                                       <string key="NSAction">_doScroller:</string>
+                                                                                                       <double key="NSPercent">0.99750623441396513</double>
+                                                                                               </object>
+                                                                                               <object class="NSScroller" id="205521010">
+                                                                                                       <reference key="NSNextResponder" ref="197496877"/>
+                                                                                                       <int key="NSvFlags">-2147483392</int>
+                                                                                                       <string key="NSFrame">{{-100, -100}, {144, 15}}</string>
+                                                                                                       <reference key="NSSuperview" ref="197496877"/>
+                                                                                                       <reference key="NSWindow"/>
+                                                                                                       <reference key="NSNextKeyView" ref="843429105"/>
+                                                                                                       <int key="NSsFlags">1</int>
+                                                                                                       <reference key="NSTarget" ref="197496877"/>
+                                                                                                       <string key="NSAction">_doScroller:</string>
+                                                                                                       <double key="NSPercent">0.97959183673469385</double>
+                                                                                               </object>
+                                                                                       </object>
+                                                                                       <string key="NSFrameSize">{180, 400}</string>
+                                                                                       <reference key="NSSuperview" ref="581795577"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="205521010"/>
+                                                                                       <int key="NSsFlags">528</int>
+                                                                                       <reference key="NSVScroller" ref="624286523"/>
+                                                                                       <reference key="NSHScroller" ref="205521010"/>
+                                                                                       <reference key="NSContentView" ref="843429105"/>
+                                                                                       <bytes key="NSScrollAmts">QSAAAEEgAABBoAAAQaAAAA</bytes>
+                                                                               </object>
+                                                                       </object>
+                                                                       <string key="NSFrameSize">{180, 400}</string>
+                                                                       <reference key="NSSuperview" ref="374340452"/>
+                                                                       <reference key="NSWindow"/>
+                                                                       <reference key="NSNextKeyView" ref="197496877"/>
+                                                                       <string key="NSClassName">NSView</string>
+                                                               </object>
+                                                               <object class="NSCustomView" id="987905504">
+                                                                       <reference key="NSNextResponder" ref="374340452"/>
+                                                                       <int key="NSvFlags">256</int>
+                                                                       <object class="NSMutableArray" key="NSSubviews">
+                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                               <object class="NSBrowser" id="259981942">
+                                                                                       <reference key="NSNextResponder" ref="987905504"/>
+                                                                                       <int key="NSvFlags">4370</int>
+                                                                                       <string key="NSFrameSize">{509, 422}</string>
+                                                                                       <reference key="NSSuperview" ref="987905504"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView"/>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSBrowserCell" key="NSCellPrototype">
+                                                                                               <int key="NSCellFlags">67239488</int>
+                                                                                               <int key="NSCellFlags2">2048</int>
+                                                                                               <string type="base64-UTF8" key="NSContents">IA</string>
+                                                                                               <object class="NSFont" key="NSSupport">
+                                                                                                       <string key="NSName">LucidaGrande</string>
+                                                                                                       <double key="NSSize">12</double>
+                                                                                                       <int key="NSfFlags">16</int>
+                                                                                               </object>
+                                                                                       </object>
+                                                                                       <string key="NSPathSeparator">/</string>
+                                                                                       <int key="NSMinColumnWidth">100</int>
+                                                                                       <int key="NSNumberOfVisibleColumns">3</int>
+                                                                                       <int key="NSColumnResizingType">2</int>
+                                                                                       <double key="NSPreferedColumnWidth">170</double>
+                                                                                       <bool key="NSAllowsTypeSelect">YES</bool>
+                                                                                       <int key="NSBrFlags">469843968</int>
+                                                                                       <double key="NSBrowserRowHeight">17</double>
+                                                                               </object>
+                                                                       </object>
+                                                                       <string key="NSFrame">{{181, 0}, {509, 400}}</string>
+                                                                       <reference key="NSSuperview" ref="374340452"/>
+                                                                       <reference key="NSWindow"/>
+                                                                       <reference key="NSNextKeyView" ref="259981942"/>
+                                                                       <string key="NSClassName">NSView</string>
+                                                               </object>
+                                                       </object>
+                                                       <string key="NSFrameSize">{690, 400}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
                                                        <reference key="NSWindow"/>
-                                                       <reference key="NSNextKeyView"/>
+                                                       <reference key="NSNextKeyView" ref="581795577"/>
+                                                       <bool key="NSIsVertical">YES</bool>
+                                                       <int key="NSDividerStyle">2</int>
+                                               </object>
+                                       </object>
+                                       <string key="NSFrame">{{7, 11}, {690, 400}}</string>
+                                       <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
+                                       <reference key="NSNextKeyView" ref="374340452"/>
+                               </object>
+                               <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
+                               <string key="NSMinSize">{320, 292}</string>
+                               <string key="NSMaxSize">{1e+13, 1e+13}</string>
+                       </object>
+                       <object class="NSUserDefaultsController" id="505454360">
+                               <bool key="NSSharedInstance">YES</bool>
+                       </object>
+                       <object class="NSWindowTemplate" id="909661358">
+                               <int key="NSWindowStyleMask">73</int>
+                               <int key="NSWindowBacking">2</int>
+                               <string key="NSWindowRect">{{169, 105}, {400, 209}}</string>
+                               <int key="NSWTFlags">-1267203072</int>
+                               <string key="NSWindowTitle">Authentication</string>
+                               <string key="NSWindowClass">NSPanel</string>
+                               <nil key="NSViewClass"/>
+                               <string key="NSWindowContentMinSize">{320, 209}</string>
+                               <object class="NSView" key="NSWindowView" id="645528012">
+                                       <reference key="NSNextResponder"/>
+                                       <int key="NSvFlags">256</int>
+                                       <object class="NSMutableArray" key="NSSubviews">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSTextField" id="44425851">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">267</int>
+                                                       <string key="NSFrame">{{201, 171}, {188, 22}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="566695904"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="676773767">
+                                                               <int key="NSCellFlags">-1804468671</int>
+                                                               <int key="NSCellFlags2">272630784</int>
+                                                               <string key="NSContents"/>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="44425851"/>
+                                                               <bool key="NSDrawsBackground">YES</bool>
+                                                               <object class="NSColor" key="NSBackgroundColor" id="114914064">
+                                                                       <int key="NSColorSpace">6</int>
+                                                                       <string key="NSCatalogName">System</string>
+                                                                       <string key="NSColorName">textBackgroundColor</string>
+                                                                       <object class="NSColor" key="NSColor">
+                                                                               <int key="NSColorSpace">3</int>
+                                                                               <bytes key="NSWhite">MQA</bytes>
+                                                                       </object>
+                                                               </object>
+                                                               <object class="NSColor" key="NSTextColor" id="1030733536">
+                                                                       <int key="NSColorSpace">6</int>
+                                                                       <string key="NSCatalogName">System</string>
+                                                                       <string key="NSColorName">textColor</string>
+                                                                       <reference key="NSColor" ref="916883122"/>
+                                                               </object>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="378776445">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">267</int>
+                                                       <string key="NSFrame">{{201, 144}, {188, 22}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="353279760"/>
                                                        <bool key="NSEnabled">YES</bool>
-                                                       <object class="NSBrowserCell" key="NSCellPrototype">
-                                                               <int key="NSCellFlags">67239488</int>
-                                                               <int key="NSCellFlags2">2048</int>
-                                                               <string type="base64-UTF8" key="NSContents">IA</string>
-                                                               <object class="NSFont" key="NSSupport">
-                                                                       <string key="NSName">LucidaGrande</string>
-                                                                       <double key="NSSize">12</double>
-                                                                       <int key="NSfFlags">16</int>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="420821865">
+                                                               <int key="NSCellFlags">-1804468671</int>
+                                                               <int key="NSCellFlags2">272630784</int>
+                                                               <string key="NSContents"/>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="378776445"/>
+                                                               <bool key="NSDrawsBackground">YES</bool>
+                                                               <reference key="NSBackgroundColor" ref="114914064"/>
+                                                               <reference key="NSTextColor" ref="1030733536"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="439428156">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">267</int>
+                                                       <string key="NSFrame">{{201, 117}, {188, 22}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="479715099"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="171009795">
+                                                               <int key="NSCellFlags">-1804468671</int>
+                                                               <int key="NSCellFlags2">272630784</int>
+                                                               <string key="NSContents"/>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="439428156"/>
+                                                               <bool key="NSDrawsBackground">YES</bool>
+                                                               <reference key="NSBackgroundColor" ref="114914064"/>
+                                                               <reference key="NSTextColor" ref="1030733536"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="178498602">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">270</int>
+                                                       <string key="NSFrame">{{10, 174}, {188, 17}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="44425851"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="176070199">
+                                                               <int key="NSCellFlags">68288064</int>
+                                                               <int key="NSCellFlags2">71304192</int>
+                                                               <string key="NSContents">Authentication URL:</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="178498602"/>
+                                                               <object class="NSColor" key="NSBackgroundColor" id="155317598">
+                                                                       <int key="NSColorSpace">6</int>
+                                                                       <string key="NSCatalogName">System</string>
+                                                                       <string key="NSColorName">controlColor</string>
+                                                                       <reference key="NSColor" ref="891120609"/>
                                                                </object>
+                                                               <reference key="NSTextColor" ref="75086281"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="566695904">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">270</int>
+                                                       <string key="NSFrame">{{10, 147}, {188, 17}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="378776445"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="578763183">
+                                                               <int key="NSCellFlags">68288064</int>
+                                                               <int key="NSCellFlags2">71304192</int>
+                                                               <string key="NSContents">Username:</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="566695904"/>
+                                                               <reference key="NSBackgroundColor" ref="155317598"/>
+                                                               <reference key="NSTextColor" ref="75086281"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="1071997738">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">267</int>
+                                                       <string key="NSFrame">{{200, 67}, {188, 22}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="153397654"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="502497633">
+                                                               <int key="NSCellFlags">-1804468671</int>
+                                                               <int key="NSCellFlags2">272630784</int>
+                                                               <string key="NSContents"/>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="1071997738"/>
+                                                               <bool key="NSDrawsBackground">YES</bool>
+                                                               <reference key="NSBackgroundColor" ref="114914064"/>
+                                                               <reference key="NSTextColor" ref="1030733536"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="163672380">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">267</int>
+                                                       <string key="NSFrame">{{200, 40}, {188, 22}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="862737677"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="914100041">
+                                                               <int key="NSCellFlags">-1804468671</int>
+                                                               <int key="NSCellFlags2">272630784</int>
+                                                               <string key="NSContents"/>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="163672380"/>
+                                                               <bool key="NSDrawsBackground">YES</bool>
+                                                               <reference key="NSBackgroundColor" ref="114914064"/>
+                                                               <reference key="NSTextColor" ref="1030733536"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="682506304">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">270</int>
+                                                       <string key="NSFrame">{{9, 70}, {188, 17}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="1071997738"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="710980917">
+                                                               <int key="NSCellFlags">68288064</int>
+                                                               <int key="NSCellFlags2">71304192</int>
+                                                               <string key="NSContents">Storage URL:</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="682506304"/>
+                                                               <reference key="NSBackgroundColor" ref="155317598"/>
+                                                               <reference key="NSTextColor" ref="75086281"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="153397654">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">270</int>
+                                                       <string key="NSFrame">{{9, 43}, {188, 17}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="163672380"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="546922485">
+                                                               <int key="NSCellFlags">68288064</int>
+                                                               <int key="NSCellFlags2">71304192</int>
+                                                               <string key="NSContents">Authentication Token:</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="153397654"/>
+                                                               <reference key="NSBackgroundColor" ref="155317598"/>
+                                                               <reference key="NSTextColor" ref="75086281"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="353279760">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">270</int>
+                                                       <string key="NSFrame">{{10, 120}, {188, 17}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="439428156"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="268573029">
+                                                               <int key="NSCellFlags">68288064</int>
+                                                               <int key="NSCellFlags2">71304192</int>
+                                                               <string key="NSContents">API Key:</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="353279760"/>
+                                                               <reference key="NSBackgroundColor" ref="155317598"/>
+                                                               <reference key="NSTextColor" ref="75086281"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSTextField" id="499977140">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">269</int>
+                                                       <string key="NSFrame">{{191, 96}, {18, 17}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="658501629"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="144286012">
+                                                               <int key="NSCellFlags">68288064</int>
+                                                               <int key="NSCellFlags2">71304192</int>
+                                                               <string key="NSContents">or</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="499977140"/>
+                                                               <reference key="NSBackgroundColor" ref="155317598"/>
+                                                               <reference key="NSTextColor" ref="75086281"/>
+                                                       </object>
+                                               </object>
+                                               <object class="NSBox" id="479715099">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">14</int>
+                                                       <string key="NSFrame">{{13, 101}, {175, 5}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="499977140"/>
+                                                       <string key="NSOffsets">{0, 0}</string>
+                                                       <object class="NSTextFieldCell" key="NSTitleCell">
+                                                               <int key="NSCellFlags">67239424</int>
+                                                               <int key="NSCellFlags2">0</int>
+                                                               <string key="NSContents">Box</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSBackgroundColor" ref="114914064"/>
+                                                               <object class="NSColor" key="NSTextColor">
+                                                                       <int key="NSColorSpace">3</int>
+                                                                       <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSBorderType">3</int>
+                                                       <int key="NSBoxType">2</int>
+                                                       <int key="NSTitlePosition">0</int>
+                                                       <bool key="NSTransparent">NO</bool>
+                                               </object>
+                                               <object class="NSBox" id="658501629">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">11</int>
+                                                       <string key="NSFrame">{{215, 101}, {174, 5}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="682506304"/>
+                                                       <string key="NSOffsets">{0, 0}</string>
+                                                       <object class="NSTextFieldCell" key="NSTitleCell">
+                                                               <int key="NSCellFlags">67239424</int>
+                                                               <int key="NSCellFlags2">0</int>
+                                                               <string key="NSContents">Box</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSBackgroundColor" ref="114914064"/>
+                                                               <object class="NSColor" key="NSTextColor">
+                                                                       <int key="NSColorSpace">3</int>
+                                                                       <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSBorderType">3</int>
+                                                       <int key="NSBoxType">2</int>
+                                                       <int key="NSTitlePosition">0</int>
+                                                       <bool key="NSTransparent">NO</bool>
+                                               </object>
+                                               <object class="NSButton" id="1012315616">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">289</int>
+                                                       <string key="NSFrame">{{299, 4}, {96, 32}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSButtonCell" key="NSCell" id="193635979">
+                                                               <int key="NSCellFlags">67239424</int>
+                                                               <int key="NSCellFlags2">134217728</int>
+                                                               <string key="NSContents">Done</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="1012315616"/>
+                                                               <int key="NSButtonFlags">-2038284033</int>
+                                                               <int key="NSButtonFlags2">129</int>
+                                                               <string key="NSAlternateContents"/>
+                                                               <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
+                                                               <int key="NSPeriodicDelay">200</int>
+                                                               <int key="NSPeriodicInterval">25</int>
+                                                       </object>
+                                               </object>
+                                               <object class="NSButton" id="862737677">
+                                                       <reference key="NSNextResponder" ref="645528012"/>
+                                                       <int key="NSvFlags">292</int>
+                                                       <string key="NSFrame">{{6, 4}, {96, 32}}</string>
+                                                       <reference key="NSSuperview" ref="645528012"/>
+                                                       <reference key="NSNextKeyView" ref="1012315616"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSButtonCell" key="NSCell" id="16013539">
+                                                               <int key="NSCellFlags">67239424</int>
+                                                               <int key="NSCellFlags2">134217728</int>
+                                                               <string key="NSContents">Cancel</string>
+                                                               <reference key="NSSupport" ref="957255455"/>
+                                                               <reference key="NSControlView" ref="862737677"/>
+                                                               <int key="NSButtonFlags">-2038284033</int>
+                                                               <int key="NSButtonFlags2">129</int>
+                                                               <string key="NSAlternateContents"/>
+                                                               <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
+                                                               <int key="NSPeriodicDelay">200</int>
+                                                               <int key="NSPeriodicInterval">25</int>
                                                        </object>
-                                                       <string key="NSPathSeparator">/</string>
-                                                       <int key="NSMinColumnWidth">100</int>
-                                                       <int key="NSNumberOfVisibleColumns">3</int>
-                                                       <int key="NSColumnResizingType">2</int>
-                                                       <double key="NSPreferedColumnWidth">170</double>
-                                                       <bool key="NSAllowsTypeSelect">YES</bool>
-                                                       <int key="NSBrFlags">-1677639680</int>
-                                                       <double key="NSBrowserRowHeight">17</double>
                                                </object>
                                        </object>
-                                       <string key="NSFrame">{{7, 11}, {480, 270}}</string>
+                                       <string key="NSFrame">{{7, 11}, {400, 209}}</string>
                                        <reference key="NSSuperview"/>
-                                       <reference key="NSWindow"/>
-                                       <reference key="NSNextKeyView" ref="259981942"/>
+                                       <reference key="NSNextKeyView" ref="178498602"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
+                               <string key="NSMinSize">{320, 231}</string>
                                <string key="NSMaxSize">{1e+13, 1e+13}</string>
                        </object>
+                       <object class="NSTreeController" id="995272659">
+                               <object class="NSMutableArray" key="NSDeclaredKeys">
+                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                       <string>representedObject.displayName</string>
+                                       <string>representedObject</string>
+                               </object>
+                               <string key="NSObjectClassName">PithosNode</string>
+                               <object class="_NSManagedProxy" key="_NSManagedProxy"/>
+                               <bool key="NSAvoidsEmptySelection">YES</bool>
+                               <bool key="NSPreservesSelection">YES</bool>
+                               <bool key="NSSelectsInsertedObjects">YES</bool>
+                               <string key="NSTreeContentChildrenKey">childNodes</string>
+                               <string key="NSTreeContentLeafKey">isLeaf</string>
+                       </object>
                </object>
                <object class="IBObjectContainer" key="IBDocument.Objects">
                        <object class="NSMutableArray" key="connectionRecords">
                                        </object>
                                        <int key="connectionID">6</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">refresh:</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="172967697"/>
+                                       </object>
+                                       <int key="connectionID">21</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="374340452"/>
+                                               <reference key="destination" ref="1001"/>
+                                       </object>
+                                       <int key="connectionID">25</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">splitView</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="374340452"/>
+                                       </object>
+                                       <int key="connectionID">26</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="392693553"/>
+                                               <reference key="destination" ref="1001"/>
+                                       </object>
+                                       <int key="connectionID">36</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">outlineView</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="392693553"/>
+                                       </object>
+                                       <int key="connectionID">37</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">contentArray: outlineViewDataSourceArray</string>
+                                               <reference key="source" ref="995272659"/>
+                                               <reference key="destination" ref="1001"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="995272659"/>
+                                                       <reference key="NSDestination" ref="1001"/>
+                                                       <string key="NSLabel">contentArray: outlineViewDataSourceArray</string>
+                                                       <string key="NSBinding">contentArray</string>
+                                                       <string key="NSKeyPath">outlineViewDataSourceArray</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">42</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: arrangedObjects.representedObject</string>
+                                               <reference key="source" ref="612034888"/>
+                                               <reference key="destination" ref="995272659"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="612034888"/>
+                                                       <reference key="NSDestination" ref="995272659"/>
+                                                       <string key="NSLabel">value: arrangedObjects.representedObject</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">arrangedObjects.representedObject</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <string key="NS.key.0">NSConditionallySetsEditable</string>
+                                                               <boolean value="YES" key="NS.object.0"/>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">46</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: values.username</string>
+                                               <reference key="source" ref="378776445"/>
+                                               <reference key="destination" ref="505454360"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="378776445"/>
+                                                       <reference key="NSDestination" ref="505454360"/>
+                                                       <string key="NSLabel">value: values.username</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">values.username</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">102</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: values.apiKey</string>
+                                               <reference key="source" ref="439428156"/>
+                                               <reference key="destination" ref="505454360"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="439428156"/>
+                                                       <reference key="NSDestination" ref="505454360"/>
+                                                       <string key="NSLabel">value: values.apiKey</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">values.apiKey</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">104</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: values.storageURL</string>
+                                               <reference key="source" ref="1071997738"/>
+                                               <reference key="destination" ref="505454360"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="1071997738"/>
+                                                       <reference key="NSDestination" ref="505454360"/>
+                                                       <string key="NSLabel">value: values.storageURL</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">values.storageURL</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">107</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: values.authToken</string>
+                                               <reference key="source" ref="163672380"/>
+                                               <reference key="destination" ref="505454360"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="163672380"/>
+                                                       <reference key="NSDestination" ref="505454360"/>
+                                                       <string key="NSLabel">value: values.authToken</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">values.authToken</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">111</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">userDefaultsController</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="505454360"/>
+                                       </object>
+                                       <int key="connectionID">120</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: values.authURL</string>
+                                               <reference key="source" ref="44425851"/>
+                                               <reference key="destination" ref="505454360"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="44425851"/>
+                                                       <reference key="NSDestination" ref="505454360"/>
+                                                       <string key="NSLabel">value: values.authURL</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">values.authURL</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <string key="NS.key.0">NSValidatesImmediately</string>
+                                                               <boolean value="YES" key="NS.object.0"/>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">121</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">authenticationPanel</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="909661358"/>
+                                       </object>
+                                       <int key="connectionID">122</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">authenticationCancel:</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="862737677"/>
+                                       </object>
+                                       <int key="connectionID">123</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">authenticationDone:</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="1012315616"/>
+                                       </object>
+                                       <int key="connectionID">124</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">authenticationSelect:</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="817791921"/>
+                                       </object>
+                                       <int key="connectionID">125</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <reference ref="1006"/>
+                                                       <reference ref="70997002"/>
                                                </object>
                                                <reference key="parent" ref="0"/>
                                        </object>
                                                <reference key="object" ref="1006"/>
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="259981942"/>
+                                                       <reference ref="374340452"/>
+                                               </object>
+                                               <reference key="parent" ref="1005"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">8</int>
+                                               <reference key="object" ref="70997002"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="584835008"/>
+                                                       <reference ref="617154997"/>
+                                                       <reference ref="877012613"/>
+                                                       <reference ref="254657743"/>
+                                                       <reference ref="172967697"/>
+                                                       <reference ref="817791921"/>
                                                </object>
                                                <reference key="parent" ref="1005"/>
                                        </object>
                                        <object class="IBObjectRecord">
+                                               <int key="objectID">11</int>
+                                               <reference key="object" ref="584835008"/>
+                                               <reference key="parent" ref="70997002"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">13</int>
+                                               <reference key="object" ref="617154997"/>
+                                               <reference key="parent" ref="70997002"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">14</int>
+                                               <reference key="object" ref="877012613"/>
+                                               <reference key="parent" ref="70997002"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">15</int>
+                                               <reference key="object" ref="254657743"/>
+                                               <reference key="parent" ref="70997002"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">20</int>
+                                               <reference key="object" ref="172967697"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="105603186"/>
+                                               </object>
+                                               <reference key="parent" ref="70997002"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">18</int>
+                                               <reference key="object" ref="105603186"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="669515004"/>
+                                               </object>
+                                               <reference key="parent" ref="172967697"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">19</int>
+                                               <reference key="object" ref="669515004"/>
+                                               <reference key="parent" ref="105603186"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">22</int>
+                                               <reference key="object" ref="374340452"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="581795577"/>
+                                                       <reference ref="987905504"/>
+                                               </object>
+                                               <reference key="parent" ref="1006"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">24</int>
+                                               <reference key="object" ref="987905504"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="259981942"/>
+                                               </object>
+                                               <reference key="parent" ref="374340452"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">23</int>
+                                               <reference key="object" ref="581795577"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="197496877"/>
+                                               </object>
+                                               <reference key="parent" ref="374340452"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
                                                <int key="objectID">3</int>
                                                <reference key="object" ref="259981942"/>
-                                               <reference key="parent" ref="1006"/>
+                                               <reference key="parent" ref="987905504"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">27</int>
+                                               <reference key="object" ref="197496877"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="624286523"/>
+                                                       <reference ref="205521010"/>
+                                                       <reference ref="392693553"/>
+                                               </object>
+                                               <reference key="parent" ref="581795577"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">28</int>
+                                               <reference key="object" ref="624286523"/>
+                                               <reference key="parent" ref="197496877"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">30</int>
+                                               <reference key="object" ref="205521010"/>
+                                               <reference key="parent" ref="197496877"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">31</int>
+                                               <reference key="object" ref="392693553"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="612034888"/>
+                                               </object>
+                                               <reference key="parent" ref="197496877"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">32</int>
+                                               <reference key="object" ref="612034888"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="262895342"/>
+                                               </object>
+                                               <reference key="parent" ref="392693553"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">35</int>
+                                               <reference key="object" ref="262895342"/>
+                                               <reference key="parent" ref="612034888"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">38</int>
+                                               <reference key="object" ref="995272659"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">39</int>
+                                               <reference key="object" ref="505454360"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">47</int>
+                                               <reference key="object" ref="909661358"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="645528012"/>
+                                               </object>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">48</int>
+                                               <reference key="object" ref="645528012"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="178498602"/>
+                                                       <reference ref="44425851"/>
+                                                       <reference ref="378776445"/>
+                                                       <reference ref="566695904"/>
+                                                       <reference ref="439428156"/>
+                                                       <reference ref="353279760"/>
+                                                       <reference ref="479715099"/>
+                                                       <reference ref="499977140"/>
+                                                       <reference ref="658501629"/>
+                                                       <reference ref="1071997738"/>
+                                                       <reference ref="163672380"/>
+                                                       <reference ref="682506304"/>
+                                                       <reference ref="153397654"/>
+                                                       <reference ref="1012315616"/>
+                                                       <reference ref="862737677"/>
+                                               </object>
+                                               <reference key="parent" ref="909661358"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">49</int>
+                                               <reference key="object" ref="44425851"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="676773767"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">50</int>
+                                               <reference key="object" ref="676773767"/>
+                                               <reference key="parent" ref="44425851"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">51</int>
+                                               <reference key="object" ref="178498602"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="176070199"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">52</int>
+                                               <reference key="object" ref="176070199"/>
+                                               <reference key="parent" ref="178498602"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">57</int>
+                                               <reference key="object" ref="479715099"/>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">62</int>
+                                               <reference key="object" ref="566695904"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="578763183"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">63</int>
+                                               <reference key="object" ref="578763183"/>
+                                               <reference key="parent" ref="566695904"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">64</int>
+                                               <reference key="object" ref="378776445"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="420821865"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">65</int>
+                                               <reference key="object" ref="420821865"/>
+                                               <reference key="parent" ref="378776445"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">66</int>
+                                               <reference key="object" ref="439428156"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="171009795"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">67</int>
+                                               <reference key="object" ref="171009795"/>
+                                               <reference key="parent" ref="439428156"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">68</int>
+                                               <reference key="object" ref="353279760"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="268573029"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">69</int>
+                                               <reference key="object" ref="268573029"/>
+                                               <reference key="parent" ref="353279760"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">70</int>
+                                               <reference key="object" ref="499977140"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="144286012"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">71</int>
+                                               <reference key="object" ref="144286012"/>
+                                               <reference key="parent" ref="499977140"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">73</int>
+                                               <reference key="object" ref="658501629"/>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">82</int>
+                                               <reference key="object" ref="1071997738"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="502497633"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">83</int>
+                                               <reference key="object" ref="163672380"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="914100041"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">84</int>
+                                               <reference key="object" ref="682506304"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="710980917"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">85</int>
+                                               <reference key="object" ref="153397654"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="546922485"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">86</int>
+                                               <reference key="object" ref="546922485"/>
+                                               <reference key="parent" ref="153397654"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">87</int>
+                                               <reference key="object" ref="710980917"/>
+                                               <reference key="parent" ref="682506304"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">88</int>
+                                               <reference key="object" ref="914100041"/>
+                                               <reference key="parent" ref="163672380"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">89</int>
+                                               <reference key="object" ref="502497633"/>
+                                               <reference key="parent" ref="1071997738"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">91</int>
+                                               <reference key="object" ref="1012315616"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="193635979"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">92</int>
+                                               <reference key="object" ref="193635979"/>
+                                               <reference key="parent" ref="1012315616"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">93</int>
+                                               <reference key="object" ref="862737677"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="16013539"/>
+                                               </object>
+                                               <reference key="parent" ref="645528012"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">94</int>
+                                               <reference key="object" ref="16013539"/>
+                                               <reference key="parent" ref="862737677"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">113</int>
+                                               <reference key="object" ref="817791921"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="336305760"/>
+                                               </object>
+                                               <reference key="parent" ref="70997002"/>
+                                               <string key="objectName">Toolbar Item - Authentication</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">114</int>
+                                               <reference key="object" ref="336305760"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="661833551"/>
+                                               </object>
+                                               <reference key="parent" ref="817791921"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">115</int>
+                                               <reference key="object" ref="661833551"/>
+                                               <reference key="parent" ref="336305760"/>
                                        </object>
                                </object>
                        </object>
                                        <string>1.NSWindowTemplate.visibleAtLaunch</string>
                                        <string>1.WindowOrigin</string>
                                        <string>1.editorWindowContentRectSynchronizationRect</string>
+                                       <string>11.IBPluginDependency</string>
+                                       <string>114.IBPluginDependency</string>
+                                       <string>115.IBPluginDependency</string>
+                                       <string>13.IBPluginDependency</string>
+                                       <string>14.IBPluginDependency</string>
+                                       <string>15.IBPluginDependency</string>
+                                       <string>18.IBPluginDependency</string>
+                                       <string>19.IBPluginDependency</string>
                                        <string>2.IBPluginDependency</string>
+                                       <string>22.IBPluginDependency</string>
+                                       <string>23.IBPluginDependency</string>
+                                       <string>24.IBPluginDependency</string>
+                                       <string>27.IBPluginDependency</string>
+                                       <string>28.IBPluginDependency</string>
                                        <string>3.IBPluginDependency</string>
+                                       <string>30.IBPluginDependency</string>
+                                       <string>31.IBPluginDependency</string>
+                                       <string>38.IBPluginDependency</string>
+                                       <string>47.IBPluginDependency</string>
+                                       <string>47.NSWindowTemplate.visibleAtLaunch</string>
+                                       <string>48.IBPluginDependency</string>
+                                       <string>49.IBPluginDependency</string>
+                                       <string>50.IBPluginDependency</string>
+                                       <string>51.IBPluginDependency</string>
+                                       <string>52.IBPluginDependency</string>
+                                       <string>57.IBPluginDependency</string>
+                                       <string>62.IBPluginDependency</string>
+                                       <string>63.IBPluginDependency</string>
+                                       <string>64.IBPluginDependency</string>
+                                       <string>65.IBPluginDependency</string>
+                                       <string>66.IBPluginDependency</string>
+                                       <string>67.IBPluginDependency</string>
+                                       <string>68.IBPluginDependency</string>
+                                       <string>69.IBPluginDependency</string>
+                                       <string>70.IBPluginDependency</string>
+                                       <string>71.IBPluginDependency</string>
+                                       <string>73.IBPluginDependency</string>
+                                       <string>8.IBPluginDependency</string>
+                                       <string>82.IBPluginDependency</string>
+                                       <string>83.IBPluginDependency</string>
+                                       <string>84.IBPluginDependency</string>
+                                       <string>85.IBPluginDependency</string>
+                                       <string>86.IBPluginDependency</string>
+                                       <string>87.IBPluginDependency</string>
+                                       <string>88.IBPluginDependency</string>
+                                       <string>89.IBPluginDependency</string>
+                                       <string>91.IBPluginDependency</string>
+                                       <string>92.IBPluginDependency</string>
+                                       <string>93.IBPluginDependency</string>
+                                       <string>94.IBPluginDependency</string>
                                </object>
                                <object class="NSMutableArray" key="dict.values">
                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                        <string>{{357, 418}, {480, 270}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <boolean value="NO"/>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="unlocalizedProperties">
                                <reference key="dict.values" ref="0"/>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">6</int>
+                       <int key="maxID">126</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
                                <object class="IBPartialClassDescription">
                                        <string key="className">PithosBrowserController</string>
                                        <string key="superclassName">NSWindowController</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationCancel:</string>
+                                                       <string>authenticationDone:</string>
+                                                       <string>authenticationSelect:</string>
+                                                       <string>refresh:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationCancel:</string>
+                                                       <string>authenticationDone:</string>
+                                                       <string>authenticationSelect:</string>
+                                                       <string>refresh:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">authenticationCancel:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">authenticationDone:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">authenticationSelect:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">refresh:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
                                        <object class="NSMutableDictionary" key="outlets">
-                                               <string key="NS.key.0">browser</string>
-                                               <string key="NS.object.0">NSBrowser</string>
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationPanel</string>
+                                                       <string>browser</string>
+                                                       <string>outlineView</string>
+                                                       <string>splitView</string>
+                                                       <string>userDefaultsController</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSPanel</string>
+                                                       <string>NSBrowser</string>
+                                                       <string>NSOutlineView</string>
+                                                       <string>NSSplitView</string>
+                                                       <string>NSUserDefaultsController</string>
+                                               </object>
                                        </object>
                                        <object class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <string key="NS.key.0">browser</string>
-                                               <object class="IBToOneOutletInfo" key="NS.object.0">
-                                                       <string key="name">browser</string>
-                                                       <string key="candidateClassName">NSBrowser</string>
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationPanel</string>
+                                                       <string>browser</string>
+                                                       <string>outlineView</string>
+                                                       <string>splitView</string>
+                                                       <string>userDefaultsController</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">authenticationPanel</string>
+                                                               <string key="candidateClassName">NSPanel</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">browser</string>
+                                                               <string key="candidateClassName">NSBrowser</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">outlineView</string>
+                                                               <string key="candidateClassName">NSOutlineView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">splitView</string>
+                                                               <string key="candidateClassName">NSSplitView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">userDefaultsController</string>
+                                                               <string key="candidateClassName">NSUserDefaultsController</string>
+                                                       </object>
                                                </object>
                                        </object>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">
                </object>
                <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
                <int key="IBDocument.defaultPropertyAccessControl">3</int>
+               <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+                       <bool key="EncodedWithXMLCoder">YES</bool>
+                       <object class="NSArray" key="dict.sortedKeys">
+                               <bool key="EncodedWithXMLCoder">YES</bool>
+                               <string>01-refresh</string>
+                               <string>145-persondot</string>
+                               <string>NSMenuCheckmark</string>
+                               <string>NSMenuMixedState</string>
+                               <string>NSToolbarCustomizeToolbarItemImage</string>
+                       </object>
+                       <object class="NSMutableArray" key="dict.values">
+                               <bool key="EncodedWithXMLCoder">YES</bool>
+                               <string>{24, 26}</string>
+                               <string>{24, 26}</string>
+                               <string>{9, 8}</string>
+                               <string>{7, 2}</string>
+                               <string>{32, 32}</string>
+                       </object>
+               </object>
        </data>
 </archive>
index f18ebb2..fc63d4e 100644 (file)
     NSString *containerName;
     
     NSMutableArray *objects;
+    
+    BOOL refreshing;
+    
+    NSString *prefix;
 }
 
 @property(readonly) NSString *containerName;
index 181ff04..bd5b621 100644 (file)
 #import "PithosSubdir.h"
 #import "ASIPithosContainerRequest.h"
 #import "ASIPithosObject.h"
+#import "ASIDownloadCache.h"
+
+static NSImage *icon = nil;
 
 @implementation PithosContainer
 @synthesize containerName;
 
++ (void)initialize {
+       if (self == [PithosContainer class])
+        icon = [[NSImage imageNamed:@"container"] retain];
+}
+
 #pragma mark -
 #pragma mark Object Lifecycle
 
 - (id)initWithContainerName:(NSString *)aContainerName {
     if ((self = [super init])) {
         containerName = [aContainerName copy];
+        refreshing = NO;
+        prefix = nil;
     }
     return self;
 }
 
 - (void)dealloc {
+    [prefix release];
     [objects release];
     [containerName release];
     [super dealloc];
 #pragma mark ASIHTTPRequestDelegate
 
 - (void)requestFinished:(ASIPithosContainerRequest *)containerRequest {
+    NSLog(@"URL: %@", [containerRequest url]);
+    NSLog(@"cached: %d", [containerRequest didUseCachedResponse]);
+
     NSArray *someObjects = [containerRequest objects];
     if (objects == nil) {
         objects = [[NSMutableArray alloc] initWithArray:someObjects];
     } else {
         [objects addObjectsFromArray:someObjects];
-    }    
+    }
     if ([someObjects count] < 10000) {
-        // Save new children
-        NSMutableArray *newChildren = [NSMutableArray array];
-        for (ASIPithosObject *object in objects) {
-            if (object.subdir) {
-                PithosSubdir *node = [[[PithosSubdir alloc] initWithContainerName:containerName subdirName:object.name] autorelease];
-                // XXX reuse pointers
-                [newChildren addObject:node];                
-            } else {
-                PithosObject *node = [[[PithosObject alloc] initWithContainerName:containerName objectName:object.name] autorelease];
-                // XXX reuse pointers
-                [newChildren addObject:node];                                
+        if (!containerRequest.didUseCachedResponse || ([objects count] != [someObjects count]) || !children) {
+            // Save new children
+            NSLog(@"using newChildren");
+            NSMutableArray *newChildren = [NSMutableArray array];
+            for (ASIPithosObject *object in objects) {
+                if (object.subdir) {
+                    PithosSubdir *node = [[[PithosSubdir alloc] initWithContainerName:containerName subdirName:object.name] autorelease];
+                    if (children) {
+                        NSUInteger oldIndex = [children indexOfObject:node];
+                        if (oldIndex != NSNotFound)
+                            // Use the same pointer value, if possible
+                            node = [children objectAtIndex:oldIndex];
+                    }
+                    [newChildren addObject:node];                
+                } else {
+                    PithosObject *node = [[[PithosObject alloc] initWithContainerName:containerName objectName:object.name] autorelease];
+                    if (children) {
+                        NSUInteger oldIndex = [children indexOfObject:node];
+                        if (oldIndex != NSNotFound)
+                            // Use the same pointer value, if possible
+                            node = [children objectAtIndex:oldIndex];
+                    }
+                    [newChildren addObject:node];                                
+                }
             }
+            [children release];
+            children = [newChildren retain];
         }
+        // Else cache was used and all results were fetched during this request, so previousChildren can be reused
         [objects release];
-        [children release];
-        childrenDirty = NO;
+        objects = nil;
         // XXX sort then based on preferences
-        children = [newChildren retain];
+        refreshing = NO;
         // Notify observers that children are updated
         [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosNodeChildrenUpdated" object:self];
     } else {
         ASIPithosContainerRequest *newContainerRequest = [ASIPithosContainerRequest listObjectsRequestWithContainerName:containerName 
                                                                                                                   limit:0 
                                                                                                                  marker:[[someObjects lastObject] name] 
-                                                                                                                 prefix:nil 
+                                                                                                                 prefix:prefix 
                                                                                                               delimiter:@"/" 
                                                                                                                    path:nil 
                                                                                                                    meta:nil 
                                                                                                                  shared:NO 
                                                                                                                   until:nil];
         newContainerRequest.delegate = self;
+        newContainerRequest.downloadCache = [ASIDownloadCache sharedCache];
         [newContainerRequest startAsynchronous];
     }
 }
 
 - (void)requestFailed:(ASIPithosContainerRequest *)containerRequest {
     // XXX do something on error, cleanup
+    NSLog(@"error:%@", [containerRequest error]);
     [objects release];
+    objects = nil;
+    childrenDirty = YES;
+    refreshing = NO;
 }
 
 #pragma mark -
 #pragma mark Properties
 
+- (NSString *)url {
+    if (url == nil) 
+        url = [[NSString alloc] initWithFormat:@"%@/%@", [ASIPithosRequest storageURL], containerName];
+    return url;
+}
+
 - (NSArray *)children {
-    if (children == nil || childrenDirty) {
-        // XXX maybe keep old children?
-        children =  [[NSArray alloc] init];
-        ASIPithosContainerRequest *containerRequest = [ASIPithosContainerRequest listObjectsRequestWithContainerName:containerName 
-                                                                                                               limit:0 
-                                                                                                              marker:nil 
-                                                                                                              prefix:nil 
-                                                                                                           delimiter:@"/" 
-                                                                                                                path:nil 
-                                                                                                                meta:nil 
-                                                                                                              shared:NO 
-                                                                                                               until:nil];
-        containerRequest.delegate = self;
-        [containerRequest startAsynchronous];
+    if (childrenDirty) {
+        @synchronized (self) {
+            if (!refreshing) {
+                refreshing = YES;
+                childrenDirty = NO;
+                ASIPithosContainerRequest *containerRequest = [ASIPithosContainerRequest listObjectsRequestWithContainerName:containerName 
+                                                                                                                       limit:0 
+                                                                                                                      marker:nil 
+                                                                                                                      prefix:prefix 
+                                                                                                                   delimiter:@"/" 
+                                                                                                                        path:nil 
+                                                                                                                        meta:nil 
+                                                                                                                      shared:NO 
+                                                                                                                       until:nil];
+                containerRequest.delegate = self;
+                containerRequest.downloadCache = [ASIDownloadCache sharedCache];
+                [containerRequest startAsynchronous];
+            }
+        }
     }
-    
     return children;
 }
 
     return [[containerName copy] autorelease];
 }
 
+- (NSImage *)icon {
+    return icon;
+}
+
 @end
diff --git a/pithos-macos/PithosEmpty.h b/pithos-macos/PithosEmpty.h
new file mode 100644 (file)
index 0000000..87e8a31
--- /dev/null
@@ -0,0 +1,46 @@
+//
+//  PithosEmpty.h
+//  pithos-macos
+//
+// Copyright 2011 GRNET S.A. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
+
+#import "PithosNode.h"
+
+@interface PithosEmpty : PithosNode {
+    NSImage *icon;
+}
+
+- (id)initWithDisplayName:(NSString *)aDisplayName icon:(NSImage *)anIcon;
+
+@end
diff --git a/pithos-macos/PithosEmpty.m b/pithos-macos/PithosEmpty.m
new file mode 100644 (file)
index 0000000..24e9546
--- /dev/null
@@ -0,0 +1,79 @@
+//
+//  PithosEmpty.m
+//  pithos-macos
+//
+// Copyright 2011 GRNET S.A. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
+
+#import "PithosEmpty.h"
+
+@implementation PithosEmpty
+
+#pragma mark -
+#pragma mark Object Lifecycle
+
+- (id)initWithDisplayName:(NSString *)aDisplayName icon:(NSImage *)anIcon {
+    if ((self = [super init])) {
+        displayName = [aDisplayName copy];
+        icon = [anIcon retain];
+        
+        isLeafItem = YES;
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [icon release];
+    [super dealloc];
+}
+
+#pragma mark -
+#pragma mark Properties
+
+- (NSString *)url {
+    return nil;
+}
+
+- (NSArray *)children {
+    return nil;
+}
+
+- (NSString *)displayName {
+    return [[displayName copy] autorelease];
+}
+
+- (NSImage *)icon {
+    return icon;
+}
+
+@end
index bf5c5c6..d39fc5f 100644 (file)
@@ -2,16 +2,56 @@
 //  PithosNode.h
 //  pithos-macos
 //
-//  Created by Miltiadis Vasilakis on 01/08/11.
-//  Copyright 2011 koomasi. All rights reserved.
+// Copyright 2011 GRNET S.A. All rights reserved.
 //
-
-#import <Foundation/Foundation.h>
-
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
 
 @interface PithosNode : NSObject {
-@private
+    NSString *url;    
+    
+    NSMutableArray *children;
+    BOOL childrenDirty;
+    NSMutableArray *previousChildren;
     
+    NSString *displayName;
+    BOOL isLeafItem;
 }
 
+@property(readonly) NSString *url;
+@property(readonly) NSArray *children;
+@property(readonly) NSString *displayName;
+@property(readonly) BOOL isLeafItem;
+@property(readonly) NSImage *icon;
+
+- (void)invalidateChildren;
+
 @end
index e409af5..875fbb8 100644 (file)
@@ -2,28 +2,80 @@
 //  PithosNode.m
 //  pithos-macos
 //
-//  Created by Miltiadis Vasilakis on 01/08/11.
-//  Copyright 2011 koomasi. All rights reserved.
+// Copyright 2011 GRNET S.A. All rights reserved.
 //
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
 
 #import "PithosNode.h"
 
-
 @implementation PithosNode
+@dynamic url, children, displayName, icon;
+@synthesize isLeafItem;
+
+#pragma mark -
+#pragma mark Object Lifecycle
 
-- (id)init
-{
-    self = [super init];
-    if (self) {
-        // Initialization code here.
+- (id)init {
+    if ((self == [super init])) {
+        childrenDirty = YES;
+        isLeafItem = NO;
     }
-    
     return self;
 }
 
-- (void)dealloc
-{
+- (void)dealloc {
+    [displayName release];
+    [previousChildren release];
+    [children release];
+    [url release];
     [super dealloc];
 }
 
-@end
+- (BOOL)isEqual:(id)anObject {
+    if ([anObject isKindOfClass:[self class]]) {
+        return [((PithosNode *)anObject).url isEqual:self.url];
+    }
+    return NO;
+}
+
+- (NSUInteger)hash {
+    return self.url.hash;
+}
+
+- (void)invalidateChildren {
+    childrenDirty = YES;
+    for (PithosNode *child in children) {
+        [child invalidateChildren];
+    }
+}
+
+@end
\ No newline at end of file
index b6d0574..de2d874 100644 (file)
 // or implied, of GRNET S.A.
 
 #import "PithosObject.h"
+#import "ASIPithosRequest.h"
+
+static NSImage *icon = nil;
 
 @implementation PithosObject
 @synthesize containerName, objectName;
 
++ (void)initialize {
+       if (self == [PithosObject class])
+        icon = [[NSImage imageNamed:@"object"] retain];
+}
+
 #pragma mark -
 #pragma mark Object Lifecycle
 
@@ -53,7 +61,6 @@
 }
 
 - (void)dealloc {
-    [displayName release];
     [objectName release];
     [containerName release];
     [super dealloc];
 #pragma mark -
 #pragma mark Properties
 
+- (NSString *)url {
+    if (url == nil) 
+        url = [[NSString alloc] initWithFormat:@"object %@/%@/%@", [ASIPithosRequest storageURL], containerName, objectName];
+    return url;
+}
+
 - (NSArray *)children {
     return nil;
 }
@@ -76,4 +89,8 @@
     return [[displayName copy] autorelease];
 }
 
+- (NSImage *)icon {
+    return icon;
+}
+
 @end
index 05b234f..226c9d1 100644 (file)
 // interpreted as representing official policies, either expressed
 // or implied, of GRNET S.A.
 
-#import "PithosNode.h"
+#import "PithosContainer.h"
 
-@interface PithosSubdir : PithosNode {
-    NSString *containerName;
+@interface PithosSubdir : PithosContainer {
     NSString *subdirName;
-    
-    NSMutableArray *objects;
 }
 
-@property(readonly) NSString *containerName;
 @property(readonly) NSString *subdirName;
 
 - (id)initWithContainerName:(NSString *)aContainerName subdirName:(NSString *)aSubdirName;
index eb085c8..01c78d9 100644 (file)
 // or implied, of GRNET S.A.
 
 #import "PithosSubdir.h"
-#import "PithosObject.h"
-#import "ASIPithosContainerRequest.h"
-#import "ASIPithosObject.h"
+#import "ASIPithosRequest.h"
+
+static NSImage *icon = nil;
 
 @implementation PithosSubdir
-@synthesize containerName, subdirName;
+@synthesize subdirName;
+
++ (void)initialize {
+       if (self == [PithosSubdir class])
+        icon = [[NSImage imageNamed:@"subdir"] retain];
+}
 
 #pragma mark -
 #pragma mark Object Lifecycle
     if ((self = [super init])) {
         containerName = [aContainerName copy];
         subdirName = [aSubdirName copy];
+        refreshing = NO;
+        prefix = [[subdirName substringToIndex:([subdirName length] - 1)] retain];
     }
     return self;
 }
 - (void)dealloc {
-    [objects release];
-    [displayName release];
     [subdirName release];
-    [containerName release];
     [super dealloc];
 }
 
 #pragma mark -
-#pragma mark ASIHTTPRequestDelegate
-
-- (void)requestFinished:(ASIPithosContainerRequest *)containerRequest {
-    NSArray *someObjects = [containerRequest objects];
-    if (objects == nil) {
-        objects = [[NSMutableArray alloc] initWithArray:someObjects];
-    } else {
-        [objects addObjectsFromArray:someObjects];
-    }    
-    if ([someObjects count] < 10000) {
-        // Save new children
-        NSMutableArray *newChildren = [NSMutableArray array];
-        for (ASIPithosObject *object in objects) {
-            if (object.subdir) {
-                PithosSubdir *node = [[[PithosSubdir alloc] initWithContainerName:containerName subdirName:object.name] autorelease];
-                // XXX reuse pointers
-                [newChildren addObject:node];                
-            } else {
-                PithosObject *node = [[[PithosObject alloc] initWithContainerName:containerName objectName:object.name] autorelease];
-                // XXX reuse pointers
-                [newChildren addObject:node];                                
-            }
-        }
-        [objects release];
-        [children release];
-        childrenDirty = NO;
-        // XXX sort then based on preferences
-        children = [newChildren retain];
-        // Notify observers that children are updated
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosNodeChildrenUpdated" object:self];
-    } else {
-        // Do an additional request to fetch more objects
-        ASIPithosContainerRequest *newContainerRequest = [ASIPithosContainerRequest listObjectsRequestWithContainerName:containerName 
-                                                                                                                  limit:0 
-                                                                                                                 marker:[[someObjects lastObject] name] 
-                                                                                                                 prefix:[subdirName substringToIndex:([subdirName length] - 1)] 
-                                                                                                              delimiter:@"/" 
-                                                                                                                   path:nil 
-                                                                                                                   meta:nil 
-                                                                                                                 shared:NO 
-                                                                                                                  until:nil];
-        newContainerRequest.delegate = self;
-        [newContainerRequest startAsynchronous];
-    }
-}
-
-- (void)requestFailed:(ASIPithosContainerRequest *)containerRequest {
-    // XXX do something on error, cleanup
-    [objects release];
-}
-
-#pragma mark -
 #pragma mark Properties
 
-- (NSArray *)children {
-    if (children == nil || childrenDirty) {
-        // XXX maybe keep old children?
-        children =  [[NSArray alloc] init];
-        ASIPithosContainerRequest *containerRequest = [ASIPithosContainerRequest listObjectsRequestWithContainerName:containerName 
-                                                                                                               limit:0 
-                                                                                                              marker:nil 
-                                                                                                              prefix:[subdirName substringToIndex:([subdirName length] - 1)] 
-                                                                                                           delimiter:@"/" 
-                                                                                                                path:nil 
-                                                                                                                meta:nil 
-                                                                                                              shared:NO 
-                                                                                                               until:nil];
-        containerRequest.delegate = self;
-        [containerRequest startAsynchronous];
-    }
-    
-    return children;
+- (NSString *)url {
+    if (url == nil) 
+        url = [[NSString alloc] initWithFormat:@"subdir %@/%@/%@", [ASIPithosRequest storageURL], containerName, subdirName];
+    return url;
 }
 
 - (NSString *)displayName {