Add initial support for user catalog
authorMiltiadis Vasilakis <mvasilak@gmail.com>
Sun, 17 Feb 2013 12:41:28 +0000 (14:41 +0200)
committerMiltiadis Vasilakis <mvasilak@gmail.com>
Mon, 18 Feb 2013 23:13:12 +0000 (01:13 +0200)
Keep user catalog for each account. Show displayname in preferences after authentication. Minor improvements.

12 files changed:
pithos-apple-common
pithos-macos.xcodeproj/project.pbxproj
pithos-macos/PithosAccount.h
pithos-macos/PithosAccount.m
pithos-macos/PithosBrowserController.m
pithos-macos/PithosPreferencesController.h
pithos-macos/PithosPreferencesController.m
pithos-macos/PithosPreferencesController.xib
pithos-macos/PithosSubdirNode.m
pithos-macos/PithosSyncDaemon.m
pithos-macos/PithosUtilities.h
pithos-macos/PithosUtilities.m

index 153edb5..3ebe988 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 153edb5ed8ef1b9f03e638c926a5b8206f4df93a
+Subproject commit 3ebe98842729659a562c43de70431bb773381d3c
index 57f80bb..a2d02d9 100644 (file)
                61C65ADF1428C578002597C2 /* CountTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C65ADE1428C578002597C2 /* CountTransformer.m */; };
                61C65AE31428D41C002597C2 /* PolicyVersioningTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C65AE21428D41C002597C2 /* PolicyVersioningTransformer.m */; };
                61C65AE6142918DD002597C2 /* PithosObjectNodeInfoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C65AE5142918DD002597C2 /* PithosObjectNodeInfoController.m */; };
+               61D83D9F16D03B1900A1F059 /* NSObject+SBJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D8716D03B1900A1F059 /* NSObject+SBJson.m */; };
+               61D83DA016D03B1900A1F059 /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D8A16D03B1900A1F059 /* SBJsonParser.m */; };
+               61D83DA116D03B1900A1F059 /* SBJsonStreamParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D8C16D03B1900A1F059 /* SBJsonStreamParser.m */; };
+               61D83DA216D03B1900A1F059 /* SBJsonStreamParserAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D8E16D03B1900A1F059 /* SBJsonStreamParserAccumulator.m */; };
+               61D83DA316D03B1900A1F059 /* SBJsonStreamParserAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9016D03B1900A1F059 /* SBJsonStreamParserAdapter.m */; };
+               61D83DA416D03B1900A1F059 /* SBJsonStreamParserState.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9216D03B1900A1F059 /* SBJsonStreamParserState.m */; };
+               61D83DA516D03B1900A1F059 /* SBJsonStreamWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9416D03B1900A1F059 /* SBJsonStreamWriter.m */; };
+               61D83DA616D03B1900A1F059 /* SBJsonStreamWriterAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9616D03B1900A1F059 /* SBJsonStreamWriterAccumulator.m */; };
+               61D83DA716D03B1900A1F059 /* SBJsonStreamWriterState.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9816D03B1900A1F059 /* SBJsonStreamWriterState.m */; };
+               61D83DA816D03B1900A1F059 /* SBJsonTokeniser.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9A16D03B1900A1F059 /* SBJsonTokeniser.m */; };
+               61D83DA916D03B1900A1F059 /* SBJsonUTF8Stream.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9C16D03B1900A1F059 /* SBJsonUTF8Stream.m */; };
+               61D83DAA16D03B1900A1F059 /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D83D9E16D03B1900A1F059 /* SBJsonWriter.m */; };
                61F040F31448547000A0C788 /* FileMD5Hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 61F040F11448547000A0C788 /* FileMD5Hash.c */; };
                61F04132144DB97200A0C788 /* PithosLocalObjectState.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F040EE144757B500A0C788 /* PithosLocalObjectState.m */; };
                61F04133144DB97600A0C788 /* PithosSyncDaemon.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F040EA144724F500A0C788 /* PithosSyncDaemon.m */; };
                61C65AE21428D41C002597C2 /* PolicyVersioningTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PolicyVersioningTransformer.m; path = "pithos-macos/PolicyVersioningTransformer.m"; sourceTree = "<group>"; };
                61C65AE4142918DC002597C2 /* PithosObjectNodeInfoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosObjectNodeInfoController.h; sourceTree = "<group>"; };
                61C65AE5142918DD002597C2 /* PithosObjectNodeInfoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosObjectNodeInfoController.m; sourceTree = "<group>"; };
+               61D83D8616D03B1900A1F059 /* NSObject+SBJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+SBJson.h"; path = "pithos-apple-common/json-framework-3.2.0/Classes/NSObject+SBJson.h"; sourceTree = "<group>"; };
+               61D83D8716D03B1900A1F059 /* NSObject+SBJson.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+SBJson.m"; path = "pithos-apple-common/json-framework-3.2.0/Classes/NSObject+SBJson.m"; sourceTree = "<group>"; };
+               61D83D8816D03B1900A1F059 /* SBJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJson.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJson.h"; sourceTree = "<group>"; };
+               61D83D8916D03B1900A1F059 /* SBJsonParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonParser.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonParser.h"; sourceTree = "<group>"; };
+               61D83D8A16D03B1900A1F059 /* SBJsonParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonParser.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonParser.m"; sourceTree = "<group>"; };
+               61D83D8B16D03B1900A1F059 /* SBJsonStreamParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParser.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParser.h"; sourceTree = "<group>"; };
+               61D83D8C16D03B1900A1F059 /* SBJsonStreamParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParser.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParser.m"; sourceTree = "<group>"; };
+               61D83D8D16D03B1900A1F059 /* SBJsonStreamParserAccumulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParserAccumulator.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParserAccumulator.h"; sourceTree = "<group>"; };
+               61D83D8E16D03B1900A1F059 /* SBJsonStreamParserAccumulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParserAccumulator.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParserAccumulator.m"; sourceTree = "<group>"; };
+               61D83D8F16D03B1900A1F059 /* SBJsonStreamParserAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParserAdapter.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParserAdapter.h"; sourceTree = "<group>"; };
+               61D83D9016D03B1900A1F059 /* SBJsonStreamParserAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParserAdapter.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParserAdapter.m"; sourceTree = "<group>"; };
+               61D83D9116D03B1900A1F059 /* SBJsonStreamParserState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamParserState.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParserState.h"; sourceTree = "<group>"; };
+               61D83D9216D03B1900A1F059 /* SBJsonStreamParserState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamParserState.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamParserState.m"; sourceTree = "<group>"; };
+               61D83D9316D03B1900A1F059 /* SBJsonStreamWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamWriter.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamWriter.h"; sourceTree = "<group>"; };
+               61D83D9416D03B1900A1F059 /* SBJsonStreamWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamWriter.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamWriter.m"; sourceTree = "<group>"; };
+               61D83D9516D03B1900A1F059 /* SBJsonStreamWriterAccumulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamWriterAccumulator.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamWriterAccumulator.h"; sourceTree = "<group>"; };
+               61D83D9616D03B1900A1F059 /* SBJsonStreamWriterAccumulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamWriterAccumulator.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamWriterAccumulator.m"; sourceTree = "<group>"; };
+               61D83D9716D03B1900A1F059 /* SBJsonStreamWriterState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonStreamWriterState.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamWriterState.h"; sourceTree = "<group>"; };
+               61D83D9816D03B1900A1F059 /* SBJsonStreamWriterState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonStreamWriterState.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonStreamWriterState.m"; sourceTree = "<group>"; };
+               61D83D9916D03B1900A1F059 /* SBJsonTokeniser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonTokeniser.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonTokeniser.h"; sourceTree = "<group>"; };
+               61D83D9A16D03B1900A1F059 /* SBJsonTokeniser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonTokeniser.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonTokeniser.m"; sourceTree = "<group>"; };
+               61D83D9B16D03B1900A1F059 /* SBJsonUTF8Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonUTF8Stream.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonUTF8Stream.h"; sourceTree = "<group>"; };
+               61D83D9C16D03B1900A1F059 /* SBJsonUTF8Stream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonUTF8Stream.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonUTF8Stream.m"; sourceTree = "<group>"; };
+               61D83D9D16D03B1900A1F059 /* SBJsonWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBJsonWriter.h; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonWriter.h"; sourceTree = "<group>"; };
+               61D83D9E16D03B1900A1F059 /* SBJsonWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBJsonWriter.m; path = "pithos-apple-common/json-framework-3.2.0/Classes/SBJsonWriter.m"; sourceTree = "<group>"; };
                61F040E9144724F500A0C788 /* PithosSyncDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosSyncDaemon.h; sourceTree = "<group>"; };
                61F040EA144724F500A0C788 /* PithosSyncDaemon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosSyncDaemon.m; sourceTree = "<group>"; };
                61F040ED144757B500A0C788 /* PithosLocalObjectState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosLocalObjectState.h; sourceTree = "<group>"; };
                                610DD31A13E6BD4200ED982F /* asi-http-request */,
                                E26038991500091D00DAC6EB /* InspectorKit Framework */,
                                610DD2FB13E6BB2000ED982F /* pithos-macos */,
+                               61D83D8416D03AA800A1F059 /* JSON Framework */,
                                610DD2F413E6BB2000ED982F /* Frameworks */,
                                610DD2F213E6BB2000ED982F /* Products */,
                        );
                        name = "Value Transformers";
                        sourceTree = "<group>";
                };
+               61D83D8416D03AA800A1F059 /* JSON Framework */ = {
+                       isa = PBXGroup;
+                       children = (
+                               61D83D8616D03B1900A1F059 /* NSObject+SBJson.h */,
+                               61D83D8716D03B1900A1F059 /* NSObject+SBJson.m */,
+                               61D83D8816D03B1900A1F059 /* SBJson.h */,
+                               61D83D8916D03B1900A1F059 /* SBJsonParser.h */,
+                               61D83D8A16D03B1900A1F059 /* SBJsonParser.m */,
+                               61D83D8B16D03B1900A1F059 /* SBJsonStreamParser.h */,
+                               61D83D8C16D03B1900A1F059 /* SBJsonStreamParser.m */,
+                               61D83D8D16D03B1900A1F059 /* SBJsonStreamParserAccumulator.h */,
+                               61D83D8E16D03B1900A1F059 /* SBJsonStreamParserAccumulator.m */,
+                               61D83D8F16D03B1900A1F059 /* SBJsonStreamParserAdapter.h */,
+                               61D83D9016D03B1900A1F059 /* SBJsonStreamParserAdapter.m */,
+                               61D83D9116D03B1900A1F059 /* SBJsonStreamParserState.h */,
+                               61D83D9216D03B1900A1F059 /* SBJsonStreamParserState.m */,
+                               61D83D9316D03B1900A1F059 /* SBJsonStreamWriter.h */,
+                               61D83D9416D03B1900A1F059 /* SBJsonStreamWriter.m */,
+                               61D83D9516D03B1900A1F059 /* SBJsonStreamWriterAccumulator.h */,
+                               61D83D9616D03B1900A1F059 /* SBJsonStreamWriterAccumulator.m */,
+                               61D83D9716D03B1900A1F059 /* SBJsonStreamWriterState.h */,
+                               61D83D9816D03B1900A1F059 /* SBJsonStreamWriterState.m */,
+                               61D83D9916D03B1900A1F059 /* SBJsonTokeniser.h */,
+                               61D83D9A16D03B1900A1F059 /* SBJsonTokeniser.m */,
+                               61D83D9B16D03B1900A1F059 /* SBJsonUTF8Stream.h */,
+                               61D83D9C16D03B1900A1F059 /* SBJsonUTF8Stream.m */,
+                               61D83D9D16D03B1900A1F059 /* SBJsonWriter.h */,
+                               61D83D9E16D03B1900A1F059 /* SBJsonWriter.m */,
+                       );
+                       name = "JSON Framework";
+                       sourceTree = "<group>";
+               };
                61F040E51447217100A0C788 /* PithosSyncDaemon */ = {
                        isa = PBXGroup;
                        children = (
                                E26038AA150009E400DAC6EB /* InspectorPaneHead.m in Sources */,
                                E26038AB150009E400DAC6EB /* NSBezierPath+StrokeExtensions.m in Sources */,
                                E26038AC150009E400DAC6EB /* NSWindow+Geometry.m in Sources */,
+                               61D83D9F16D03B1900A1F059 /* NSObject+SBJson.m in Sources */,
+                               61D83DA016D03B1900A1F059 /* SBJsonParser.m in Sources */,
+                               61D83DA116D03B1900A1F059 /* SBJsonStreamParser.m in Sources */,
+                               61D83DA216D03B1900A1F059 /* SBJsonStreamParserAccumulator.m in Sources */,
+                               61D83DA316D03B1900A1F059 /* SBJsonStreamParserAdapter.m in Sources */,
+                               61D83DA416D03B1900A1F059 /* SBJsonStreamParserState.m in Sources */,
+                               61D83DA516D03B1900A1F059 /* SBJsonStreamWriter.m in Sources */,
+                               61D83DA616D03B1900A1F059 /* SBJsonStreamWriterAccumulator.m in Sources */,
+                               61D83DA716D03B1900A1F059 /* SBJsonStreamWriterState.m in Sources */,
+                               61D83DA816D03B1900A1F059 /* SBJsonTokeniser.m in Sources */,
+                               61D83DA916D03B1900A1F059 /* SBJsonUTF8Stream.m in Sources */,
+                               61D83DAA16D03B1900A1F059 /* SBJsonWriter.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 0055211..9a4e188 100644 (file)
@@ -38,6 +38,7 @@
 #import <Foundation/Foundation.h>
 @class PithosSyncDaemon;
 @class ASIPithos;
+@class ASIPithosRequest;
 @class PithosAccountNode;
 @class PithosSharingAccountsNode;
 
@@ -64,6 +65,9 @@
     // Appended to serverURL to get publicURLPrefix, default nil
     // Can be overriden by setting directly publicURLPrefix
     NSString *publicResource;
+    // Appended to serverURL to get userCatalogURL, default "user_catalogs"
+    // Can be overriden by setting directly userCatalogURL
+    NSString *userCatalogResource;
 
     NSString *authUser;
     NSString *authToken;
@@ -71,6 +75,8 @@
     NSString *authURL;
     NSString *publicURLPrefix;
     NSString *loginURLPrefix;
+    NSString *userCatalogURL;
+    NSMutableDictionary *userCatalog;
     
     ASIPithos *pithos;
     PithosAccountNode *accountNode;
 @property (nonatomic, strong) PithosSyncDaemon *syncDaemon;
 
 @property (nonatomic, strong) NSString *serverURL;
-@property (strong) NSString *versionResource;
-@property (strong) NSString *loginResource;
+@property (nonatomic, strong) NSString *versionResource;
+@property (nonatomic, strong) NSString *loginResource;
 @property (strong) NSString *publicResource;
+@property (nonatomic, strong) NSString *userCatalogResource;
 
 @property (nonatomic, strong) NSString *authUser;
 @property (nonatomic, strong) NSString *authToken;
 @property (nonatomic, strong) NSString *authURL;
 @property (nonatomic, strong) NSString *publicURLPrefix;
 @property (nonatomic, strong) NSString *loginURLPrefix;
+@property (nonatomic, strong) NSString *userCatalogURL;
+@property (nonatomic, strong) NSMutableDictionary *userCatalog;
 
 @property (strong, readonly) ASIPithos *pithos;
 @property (readonly) PithosAccountNode *accountNode;
                syncDirectoryPath:(NSString *)aSyncDirectoryPath 
           syncAccountsDictionary:(NSMutableDictionary *)aSyncAccountsDictionary 
                   syncSkipHidden:(BOOL)aSyncSkipHidden;
+- (ASIPithosRequest *)updateUserCatalogForForDisplaynames:(NSArray *)displaynames UUIDs:(NSArray *)UUIDs;
+- (NSString *)displaynameForUUID:(NSString *)UUID safe:(BOOL)safe;
+- (NSString *)displaynameForUUID:(NSString *)UUID;
 
 @end
index b271ce0..8b0894a 100644 (file)
@@ -41,6 +41,7 @@
 #import "ASIPithosRequest.h"
 #import "PithosAccountNode.h"
 #import "PithosSharingAccountsNode.h"
+#import "PithosUtilities.h"
 #import "pithos_macosAppDelegate.h"
 
 @interface PithosAccount (Internal)
@@ -50,8 +51,8 @@
 @implementation PithosAccount
 @synthesize uniqueName, active, name;
 @synthesize syncActive, syncDirectoryPath, syncAccountsDictionary, syncSkipHidden, syncLastCompleted, syncDaemon;
-@synthesize serverURL, versionResource, loginResource, publicResource;
-@synthesize authUser, authToken, storageURLPrefix, authURL, loginURLPrefix, publicURLPrefix;
+@synthesize serverURL, versionResource, loginResource, publicResource, userCatalogResource;
+@synthesize authUser, authToken, storageURLPrefix, authURL, loginURLPrefix, publicURLPrefix, userCatalogURL, userCatalog;
 @synthesize pithos, accountNode, sharingAccountsNode;
 
 #pragma mark -
     PithosAccount *pithosAccount = [[self alloc] init];
     pithosAccount.uniqueName = [NSString stringWithFormat:@"pithosAccount-%f", [NSDate timeIntervalSinceReferenceDate]];
     pithosAccount.syncSkipHidden = YES;
-    pithosAccount.versionResource = @"v1";
-    pithosAccount.loginResource = @"login";
     return pithosAccount;
 }
 
 
 - (NSString *)description {
-    return [NSString stringWithFormat:@"uniqueName: %@, active: %d, name: %@, syncActive: %d, syncDirectoryPath: %@, syncAccountsDictionary: %@, syncSkipHidden: %d, syncLastCompleted: %@, serverURL: %@, versionResource: %@, loginResource: %@, publicResource: %@, authUser: %@, authToken: %@, storageURLPrefix: %@, authURL: %@, loginURLPrefix: %@, publicURLPrefix: %@", 
-            uniqueName, active, name, syncActive, syncDirectoryPath, syncAccountsDictionary, syncSkipHidden, syncLastCompleted, serverURL, versionResource, loginResource, publicResource, authUser, authToken, storageURLPrefix, authURL, loginURLPrefix, publicURLPrefix];
+    return [NSString stringWithFormat:@"uniqueName: %@, active: %d, name: %@, syncActive: %d, syncDirectoryPath: %@, syncAccountsDictionary: %@, syncSkipHidden: %d, syncLastCompleted: %@, serverURL: %@, versionResource: %@, loginResource: %@, publicResource: %@, userCatalogResource: %@, authUser: %@, authToken: %@, storageURLPrefix: %@, authURL: %@, loginURLPrefix: %@, publicURLPrefix: %@, userCatalogResource: %@",
+            uniqueName, active, name, syncActive, syncDirectoryPath, syncAccountsDictionary, syncSkipHidden, syncLastCompleted, serverURL, versionResource, loginResource, publicResource, userCatalogResource, authUser, authToken, storageURLPrefix, authURL, loginURLPrefix, publicURLPrefix, userCatalogResource];
 }
 
 #pragma mark -
 - (NSMutableDictionary *)syncAccountsDictionary {
     if (!syncAccountsDictionary) {
         syncAccountsDictionary = [NSMutableDictionary dictionaryWithObject:[NSMutableDictionary dictionaryWithObject:[NSMutableSet set] 
-                                                                                                               forKey:@"pithos"] 
-                                                                     forKey:@""];
+                                                                                                              forKey:@"pithos"]
+                                                                    forKey:@""];
     }        
     return syncAccountsDictionary;
 }
     }
 }
 
+- (NSString *)versionResource {
+    if (!versionResource) {
+        versionResource = @"v1";
+    }
+    return versionResource;
+}
+
+- (NSString *)loginResource {
+    if (!loginResource) {
+        loginResource = @"login";
+    }
+    return loginResource;
+}
+
+- (NSString *)userCatalogResource {
+    if (!userCatalogResource) {
+        userCatalogResource = @"user_catalogs";
+    }
+    return userCatalogResource;
+}
+
 - (void)setAuthUser:(NSString *)anAuthUser {
     if ([anAuthUser length] && ![anAuthUser isEqualToString:authUser]) {
         authUser = anAuthUser;
 
 - (NSString *)storageURLPrefix {
     if (![self urlIsValid:storageURLPrefix]) {
-        if (versionResource)
-            storageURLPrefix = [self.serverURL stringByAppendingFormat:@"/%@", versionResource];
-        else
-            storageURLPrefix = [self.serverURL copy];
+        storageURLPrefix = [self.serverURL stringByAppendingFormat:@"/%@", self.versionResource];
     }
     return storageURLPrefix;
 }
 
 - (NSString *)authURL {
     if (![self urlIsValid:authURL]) {
-        if (versionResource)
-            authURL = [self.serverURL stringByAppendingFormat:@"/%@", versionResource];
-        else
-            authURL = [self.serverURL copy];
+        authURL = [self.serverURL stringByAppendingFormat:@"/%@", self.versionResource];
     }
     return authURL;
 }
 
 - (NSString *)loginURLPrefix {
     if (![self urlIsValid:loginURLPrefix]) {
-        if (loginResource)
-            loginURLPrefix = [self.serverURL stringByAppendingFormat:@"/%@", loginResource];
-        else
-            loginURLPrefix = [self.serverURL copy];
+        loginURLPrefix = [self.serverURL stringByAppendingFormat:@"/%@", self.loginResource];
     }
     return loginURLPrefix;
 }
     }
 }
 
+- (NSString *)userCatalogURL {
+    if (![self urlIsValid:userCatalogURL]) {
+        userCatalogURL = [self.serverURL stringByAppendingFormat:@"/%@", self.userCatalogResource];
+    }
+    return userCatalogURL;
+}
+
+- (void)setUserCatalogURL:(NSString *)aUserCatalogURL {
+    if (![self.userCatalogURL isEqualToString:aUserCatalogURL] && [self urlIsValid:aUserCatalogURL]) {
+        userCatalogURL = aUserCatalogURL;
+    }
+}
+
+- (NSMutableDictionary *)userCatalog {
+    if (!userCatalog) {
+        userCatalog = [NSMutableDictionary dictionary];
+    }
+    return userCatalog;
+}
+
 - (ASIPithos *)pithos {
     @synchronized(self) {
         if (!pithos || updatePithos) {
             pithos.storageURLPrefix = self.storageURLPrefix;
             pithos.authURL = self.authURL;
             pithos.publicURLPrefix = self.publicURLPrefix;
+            pithos.userCatalogURL = self.userCatalogURL;
             updatePithos = NO;
         }
     }
         }
         if (sharingAccountsNode && self.sharingAccountsNode.children) {
         }
+        
+        [self updateUserCatalogForForDisplaynames:nil UUIDs:[NSArray arrayWithObject:authUser]];
     }
 }
 
     }    
 }
 
+- (ASIPithosRequest *)updateUserCatalogForForDisplaynames:(NSArray *)displaynames UUIDs:(NSArray *)UUIDs {
+    ASIPithosRequest *userCatalogRequest = [ASIPithosRequest userCatalogRequestWithPithos:self.pithos
+                                                                             displaynames:displaynames
+                                                                                    UUIDs:UUIDs];
+    [PithosUtilities startAndWaitForRequest:userCatalogRequest];
+    if (userCatalogRequest.error || ((userCatalogRequest.responseStatusCode != 200) && (userCatalogRequest.responseStatusCode != 404))) {
+        // Don't show alert on 404, since it can be a pre-UUID server.
+        [PithosUtilities httpRequestErrorAlertWithRequest:userCatalogRequest];
+    } else if (userCatalogRequest.responseStatusCode == 200) {
+        NSDictionary *catalogs = [userCatalogRequest catalogs];
+        NSDictionary *displaynameCatalog = [catalogs objectForKey:@"displayname_catalog"];
+        for (NSString *displayname in displaynameCatalog) {
+            [self.userCatalog setObject:displayname forKey:[displaynameCatalog objectForKey:displayname]];
+        }
+        if (UUIDs) {
+            NSDictionary *UUIDCatalog = [catalogs objectForKey:@"uuid_catalog"];
+            for (NSString *UUID in UUIDs) {
+                NSString *displayname = [UUIDCatalog objectForKey:UUID];
+                if (displayname) {
+                    [self.userCatalog setObject:displayname forKey:UUID];
+                } else {
+                    [self.userCatalog removeObjectForKey:UUID];
+                }
+            }
+        }
+    }
+    return userCatalogRequest;
+}
+
+- (NSString *)displaynameForUUID:(NSString *)UUID safe:(BOOL)safe {
+    NSString *displayName = [userCatalog objectForKey:UUID];
+    if (safe && !displayName) {
+        return UUID;
+    } else {
+        return displayName;
+    }
+}
+
+- (NSString *)displaynameForUUID:(NSString *)UUID {
+    return [self displaynameForUUID:UUID safe:NO];
+}
+
 #pragma mark -
 #pragma mark NSCoding
 
         self.versionResource = [decoder decodeObjectForKey:@"versionResource"];
         self.loginResource = [decoder decodeObjectForKey:@"loginResource"];
         self.publicResource = [decoder decodeObjectForKey:@"publicResource"];
+        self.userCatalogResource = [decoder decodeObjectForKey:@"userCatalogResource"];
         
         self.authUser = [decoder decodeObjectForKey:@"authUser"];
         self.authToken = [decoder decodeObjectForKey:@"authToken"];
         self.authURL = [decoder decodeObjectForKey:@"authURL"];
         self.publicURLPrefix = [decoder decodeObjectForKey:@"publicURLPrefix"];
         self.loginURLPrefix = [decoder decodeObjectForKey:@"loginURLPrefix"];
+        self.userCatalogURL = [decoder decodeObjectForKey:@"userCatalogURL"];
+        self.userCatalog = [decoder decodeObjectForKey:@"userCatalog"];
         
         if (![authUser length] || ![authToken length] || ![self.storageURLPrefix length])
             self.active = NO;
     [encoder encodeObject:versionResource forKey:@"versionResource"];
     [encoder encodeObject:publicResource forKey:@"publicResource"];
     [encoder encodeObject:loginResource forKey:@"loginResource"];
+    [encoder encodeObject:loginResource forKey:@"userCatalogResource"];
     
     [encoder encodeObject:authUser forKey:@"authUser"];
     [encoder encodeObject:authToken forKey:@"authToken"];
     [encoder encodeObject:authURL forKey:@"authURL"];
     [encoder encodeObject:publicURLPrefix forKey:@"publicURLPrefix"];
     [encoder encodeObject:loginURLPrefix forKey:@"loginURLPrefix"];
+    [encoder encodeObject:userCatalogURL forKey:@"userCatalogURL"];
+    [encoder encodeObject:userCatalog forKey:@"userCatalog"];
 }
 
 @end
index b743a9c..d753e9f 100644 (file)
         // Create pithos node
         ASIPithosContainerRequest *containerRequest = [ASIPithosContainerRequest createOrUpdateContainerRequestWithPithos:pithos 
                                                                                                             containerName:@"pithos"];
-        ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-        [networkQueue go];
-        [networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:containerRequest]] waitUntilFinished:YES];
+        [PithosUtilities startAndWaitForRequest:containerRequest];
         if ([containerRequest error]) {
             [PithosUtilities httpRequestErrorAlertWithRequest:containerRequest];
         } else {
         // Create trash node
         ASIPithosContainerRequest *containerRequest = [ASIPithosContainerRequest createOrUpdateContainerRequestWithPithos:pithos 
                                                                                                             containerName:@"trash"];
-        ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-        [networkQueue go];
-        [networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:containerRequest]] waitUntilFinished:YES];
+        [PithosUtilities startAndWaitForRequest:containerRequest];
         if ([containerRequest error]) {
             [PithosUtilities httpRequestErrorAlertWithRequest:containerRequest];
         } else {
@@ -1050,9 +1046,7 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
     if ((destinationNode.pithosContainer.blockHash == nil) || (destinationNode.pithosContainer.blockSize == 0)) {
         ASIPithosContainerRequest *containerRequest = [ASIPithosContainerRequest containerMetadataRequestWithPithos:pithos 
                                                                                                       containerName:containerName];
-        ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-        [networkQueue go];
-        [networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:containerRequest]] waitUntilFinished:YES];
+        [PithosUtilities startAndWaitForRequest:containerRequest];
         if ([containerRequest error]) {
             [PithosUtilities httpRequestErrorAlertWithRequest:containerRequest];
             return NO;
index 2584e7e..bccb69f 100644 (file)
@@ -49,6 +49,7 @@
     NSString *serverURL;
     NSString *authUser;
     NSString *authToken;
+    NSString *displayname;
     BOOL manual;
     BOOL loginEnable;
     BOOL loginCancelEnable;
@@ -76,6 +77,7 @@
 @property (nonatomic, copy) NSString *serverURL;
 @property (nonatomic, copy) NSString *authUser;
 @property (nonatomic, copy) NSString *authToken;
+@property (nonatomic, copy) NSString *displayname;
 @property (nonatomic, assign) BOOL manual;
 @property (nonatomic, assign) BOOL loginEnable;
 @property (nonatomic, assign) BOOL loginCancelEnable;
index 566be69..eb86c16 100644 (file)
@@ -69,7 +69,7 @@
 @synthesize selectedPithosAccount;
 @synthesize accountsArrayController;
 @synthesize accountRemoveEnable;
-@synthesize serverURL, authUser, authToken, manual, loginEnable, loginCancelEnable;
+@synthesize serverURL, authUser, authToken, displayname, manual, loginEnable, loginCancelEnable;
 @synthesize syncActive, syncSkipHidden, syncDirectoryPath, syncAccountsDictionary, syncApplyEnable, syncCancelEnable, 
             syncAccountsOutlineView, syncAccountsRootFilesNodes;
 @synthesize groupsDictionaryController, selectedGroupMembersDictionaryController;
 - (void)setAuthUser:(NSString *)anAuthUser {
     authUser = [anAuthUser copy];
     [self updateLogin];
+    self.displayname = [self.selectedPithosAccount displaynameForUUID:authUser safe:NO];
 }
 
 - (void)setAuthToken:(NSString *)anAuthToken {
     } else {
         [selectedPithosAccount authenticateWithServerURL:serverURL authUser:authUser authToken:authToken];
         self.manual = NO;
+        self.displayname = [selectedPithosAccount displaynameForUUID:authUser safe:NO];
         pithos_macosAppDelegate *delegate = (pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate];
         [delegate savePithosAccounts:self];
         if (!delegate.activated) {
index 71fe70a..a68cecc 100644 (file)
@@ -2,36 +2,36 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
        <data>
                <int key="IBDocument.SystemTarget">1070</int>
-               <string key="IBDocument.SystemVersion">11D50b</string>
-               <string key="IBDocument.InterfaceBuilderVersion">2182</string>
-               <string key="IBDocument.AppKitVersion">1138.32</string>
-               <string key="IBDocument.HIToolboxVersion">568.00</string>
+               <string key="IBDocument.SystemVersion">11G63</string>
+               <string key="IBDocument.InterfaceBuilderVersion">2843</string>
+               <string key="IBDocument.AppKitVersion">1138.51</string>
+               <string key="IBDocument.HIToolboxVersion">569.00</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                       <string key="NS.object.0">2182</string>
+                       <string key="NS.object.0">2843</string>
                </object>
                <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <string>NSTabView</string>
-                       <string>NSButton</string>
-                       <string>NSCustomObject</string>
                        <string>NSArrayController</string>
-                       <string>NSTableView</string>
-                       <string>NSTextField</string>
-                       <string>NSWindowTemplate</string>
-                       <string>NSTextFieldCell</string>
-                       <string>NSButtonCell</string>
-                       <string>NSTableColumn</string>
                        <string>NSBox</string>
-                       <string>NSView</string>
-                       <string>NSOutlineView</string>
+                       <string>NSButton</string>
+                       <string>NSButtonCell</string>
+                       <string>NSCustomObject</string>
                        <string>NSDictionaryController</string>
-                       <string>NSScrollView</string>
-                       <string>NSTabViewItem</string>
+                       <string>NSOutlineView</string>
+                       <string>NSPathCell</string>
                        <string>NSPathControl</string>
+                       <string>NSScrollView</string>
                        <string>NSScroller</string>
+                       <string>NSTabView</string>
+                       <string>NSTabViewItem</string>
+                       <string>NSTableColumn</string>
                        <string>NSTableHeaderView</string>
-                       <string>NSPathCell</string>
+                       <string>NSTableView</string>
+                       <string>NSTextField</string>
+                       <string>NSTextFieldCell</string>
+                       <string>NSView</string>
+                       <string>NSWindowTemplate</string>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
@@ -82,6 +82,7 @@
                                                                                        <int key="NSvFlags">256</int>
                                                                                        <string key="NSFrameSize">{118, 215}</string>
                                                                                        <reference key="NSSuperview" ref="475745140"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="366650902"/>
                                                                                        <string key="NSReuseIdentifierKey">_NS:1828</string>
                                                                                        <bool key="NSEnabled">YES</bool>
@@ -90,6 +91,7 @@
                                                                                                <int key="NSvFlags">256</int>
                                                                                                <string key="NSFrameSize">{118, 17}</string>
                                                                                                <reference key="NSSuperview" ref="316124907"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="475745140"/>
                                                                                                <string key="NSReuseIdentifierKey">_NS:1830</string>
                                                                                                <reference key="NSTableView" ref="260212452"/>
                                                                        </object>
                                                                        <string key="NSFrame">{{1, 17}, {118, 215}}</string>
                                                                        <reference key="NSSuperview" ref="419137310"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="260212452"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:1826</string>
                                                                        <reference key="NSDocView" ref="260212452"/>
                                                                        <int key="NSvFlags">-2147483392</int>
                                                                        <string key="NSFrame">{{224, 17}, {15, 102}}</string>
                                                                        <reference key="NSSuperview" ref="419137310"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="287845150"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:1845</string>
                                                                        <reference key="NSTarget" ref="419137310"/>
                                                                        <int key="NSvFlags">-2147483392</int>
                                                                        <string key="NSFrame">{{1, 48.325627356767654}, {82.028970718383789, 15}}</string>
                                                                        <reference key="NSSuperview" ref="419137310"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="310368570"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:1847</string>
                                                                        <int key="NSsFlags">1</int>
                                                                        </object>
                                                                        <string key="NSFrame">{{1, 0}, {118, 17}}</string>
                                                                        <reference key="NSSuperview" ref="419137310"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="152792208"/>
                                                                        <string key="NSReuseIdentifierKey">_NS:1831</string>
                                                                        <reference key="NSDocView" ref="152792208"/>
                                                        </object>
                                                        <string key="NSFrame">{{20, 47}, {120, 233}}</string>
                                                        <reference key="NSSuperview" ref="369507901"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="316124907"/>
                                                        <string key="NSReuseIdentifierKey">_NS:1824</string>
                                                        <int key="NSsFlags">133682</int>
                                                        <int key="NSvFlags">18</int>
                                                        <string key="NSFrame">{{147, 37}, {265, 249}}</string>
                                                        <reference key="NSSuperview" ref="369507901"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="646624756"/>
                                                        <string key="NSReuseIdentifierKey">_NS:608</string>
                                                        <object class="NSMutableArray" key="NSTabViewItems">
                                                                                                <int key="NSvFlags">268</int>
                                                                                                <string key="NSFrame">{{14, 183}, {41, 14}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="96425952"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="9695847">
                                                                                                <int key="NSvFlags">266</int>
                                                                                                <string key="NSFrame">{{60, 181}, {168, 19}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="571994001"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="34677607">
                                                                                                <int key="NSvFlags">266</int>
                                                                                                <string key="NSFrame">{{60, 123}, {168, 19}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="1017221490"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="1001750419">
                                                                                                <int key="NSvFlags">266</int>
                                                                                                <string key="NSFrame">{{60, 96}, {168, 19}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
-                                                                                               <reference key="NSNextKeyView" ref="666198740"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="525437489"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="350801514">
                                                                                                        <int key="NSCellFlags">-1267597759</int>
                                                                                                        <reference key="NSTextColor" ref="971696100"/>
                                                                                                </object>
                                                                                        </object>
+                                                                                       <object class="NSTextField" id="92717922">
+                                                                                               <reference key="NSNextResponder" ref="646624756"/>
+                                                                                               <int key="NSvFlags">266</int>
+                                                                                               <string key="NSFrame">{{60, 69}, {168, 19}}</string>
+                                                                                               <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="666198740"/>
+                                                                                               <bool key="NSEnabled">YES</bool>
+                                                                                               <object class="NSTextFieldCell" key="NSCell" id="772611148">
+                                                                                                       <int key="NSCellFlags">-1536033215</int>
+                                                                                                       <int key="NSCellFlags2">272761920</int>
+                                                                                                       <string key="NSContents"/>
+                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                       <reference key="NSControlView" ref="92717922"/>
+                                                                                                       <bool key="NSDrawsBackground">YES</bool>
+                                                                                                       <reference key="NSBackgroundColor" ref="1019997203"/>
+                                                                                                       <reference key="NSTextColor" ref="971696100"/>
+                                                                                               </object>
+                                                                                       </object>
                                                                                        <object class="NSTextField" id="507142965">
                                                                                                <reference key="NSNextResponder" ref="646624756"/>
                                                                                                <int key="NSvFlags">268</int>
                                                                                                <string key="NSFrame">{{14, 125}, {41, 14}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="287579732"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="993321662">
                                                                                                        <int key="NSCellFlags">68288064</int>
                                                                                                        <int key="NSCellFlags2">71304192</int>
-                                                                                                       <string key="NSContents">User:</string>
+                                                                                                       <string key="NSContents">UUID:</string>
                                                                                                        <reference key="NSSupport" ref="26"/>
                                                                                                        <reference key="NSControlView" ref="507142965"/>
                                                                                                        <bool key="NSDrawsBackground">YES</bool>
                                                                                                        <reference key="NSTextColor" ref="44104873"/>
                                                                                                </object>
                                                                                        </object>
+                                                                                       <object class="NSTextField" id="525437489">
+                                                                                               <reference key="NSNextResponder" ref="646624756"/>
+                                                                                               <int key="NSvFlags">268</int>
+                                                                                               <string key="NSFrame">{{14, 71}, {41, 14}}</string>
+                                                                                               <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="92717922"/>
+                                                                                               <bool key="NSEnabled">YES</bool>
+                                                                                               <object class="NSTextFieldCell" key="NSCell" id="887494614">
+                                                                                                       <int key="NSCellFlags">68288064</int>
+                                                                                                       <int key="NSCellFlags2">71304192</int>
+                                                                                                       <string key="NSContents">User:</string>
+                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                       <reference key="NSControlView" ref="525437489"/>
+                                                                                                       <bool key="NSDrawsBackground">YES</bool>
+                                                                                                       <reference key="NSBackgroundColor" ref="820783553"/>
+                                                                                                       <reference key="NSTextColor" ref="44104873"/>
+                                                                                               </object>
+                                                                                       </object>
                                                                                        <object class="NSTextField" id="1017221490">
                                                                                                <reference key="NSNextResponder" ref="646624756"/>
                                                                                                <int key="NSvFlags">268</int>
                                                                                                <string key="NSFrame">{{14, 98}, {41, 14}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="773004803"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="1037784646">
                                                                                                <int key="NSvFlags">268</int>
                                                                                                <string key="NSFrame">{{14, 150}, {86, 14}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="507142965"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="784421446">
                                                                                                <int key="NSvFlags">-2147483634</int>
                                                                                                <string key="NSFrame">{{-3, 170}, {251, 5}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="992895966"/>
                                                                                                <string key="NSOffsets">{0, 0}</string>
                                                                                                <object class="NSTextFieldCell" key="NSTitleCell">
                                                                                        <object class="NSButton" id="666198740">
                                                                                                <reference key="NSNextResponder" ref="646624756"/>
                                                                                                <int key="NSvFlags">268</int>
-                                                                                               <string key="NSFrame">{{57, 72}, {63, 18}}</string>
+                                                                                               <string key="NSFrame">{{57, 45}, {63, 18}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="764785507"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="269907300">
                                                                                                <int key="NSvFlags">289</int>
                                                                                                <string key="NSFrame">{{161, 4}, {72, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
-                                                                                               <reference key="NSNextKeyView" ref="247568729"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="950873176">
                                                                                                        <int key="NSCellFlags">-2080244224</int>
                                                                                                <int key="NSvFlags">289</int>
                                                                                                <string key="NSFrame">{{91, 4}, {72, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="646624756"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="750494034"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="327493266">
                                                                                </object>
                                                                                <string key="NSFrame">{{10, 33}, {245, 203}}</string>
                                                                                <reference key="NSSuperview" ref="247568729"/>
+                                                                               <reference key="NSWindow"/>
                                                                                <reference key="NSNextKeyView" ref="1055886655"/>
                                                                                <string key="NSReuseIdentifierKey">_NS:610</string>
                                                                        </object>
                                                                                                <int key="NSvFlags">289</int>
                                                                                                <string key="NSFrame">{{161, 4}, {72, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="689284120"/>
-                                                                                               <reference key="NSNextKeyView"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="592322209">
                                                                                                        <int key="NSCellFlags">-2080244224</int>
                                                                                                                                <int key="NSvFlags">256</int>
                                                                                                                                <string key="NSFrameSize">{209, 95}</string>
                                                                                                                                <reference key="NSSuperview" ref="490888020"/>
-                                                                                                                               <reference key="NSNextKeyView" ref="140942393"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="677192773"/>
                                                                                                                                <string key="NSReuseIdentifierKey">_NS:13</string>
                                                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                                                <object class="NSTableHeaderView" key="NSHeaderView" id="1047592526">
                                                                                                </object>
                                                                                                <string key="NSFrame">{{17, 40}, {211, 113}}</string>
                                                                                                <reference key="NSSuperview" ref="689284120"/>
-                                                                                               <reference key="NSNextKeyView" ref="677192773"/>
+                                                                                               <reference key="NSNextKeyView" ref="490888020"/>
                                                                                                <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                                                <int key="NSsFlags">133682</int>
                                                                                                <reference key="NSVScroller" ref="140942393"/>
                                                        <int key="NSvFlags">292</int>
                                                        <string key="NSFrame">{{20, 19}, {20, 20}}</string>
                                                        <reference key="NSSuperview" ref="369507901"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="862152318"/>
                                                        <string key="NSReuseIdentifierKey">_NS:2510</string>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <int key="NSvFlags">292</int>
                                                        <string key="NSFrame">{{39, 19}, {20, 20}}</string>
                                                        <reference key="NSSuperview" ref="369507901"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="247568729"/>
                                                        <string key="NSReuseIdentifierKey">_NS:2510</string>
                                                        <bool key="NSEnabled">YES</bool>
                                        </object>
                                        <string key="NSFrameSize">{425, 300}</string>
                                        <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="419137310"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
                                        </object>
                                        <int key="connectionID">893</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: displayname</string>
+                                               <reference key="source" ref="92717922"/>
+                                               <reference key="destination" ref="1001"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="92717922"/>
+                                                       <reference key="NSDestination" ref="1001"/>
+                                                       <string key="NSLabel">value: displayname</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">displayname</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <object class="NSArray" key="dict.sortedKeys">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <string>NSConditionallySetsEditable</string>
+                                                                       <string>NSContinuouslyUpdatesValue</string>
+                                                                       <string>NSValidatesImmediately</string>
+                                                               </object>
+                                                               <object class="NSArray" key="dict.values">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <boolean value="YES"/>
+                                                                       <boolean value="YES"/>
+                                                                       <boolean value="YES"/>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">905</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                        <reference ref="666198740"/>
                                                        <reference ref="750494034"/>
                                                        <reference ref="764785507"/>
+                                                       <reference ref="92717922"/>
+                                                       <reference ref="525437489"/>
                                                </object>
                                                <reference key="parent" ref="277431414"/>
                                        </object>
                                                <reference key="object" ref="774482893"/>
                                                <reference key="parent" ref="964702521"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">894</int>
+                                               <reference key="object" ref="92717922"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="772611148"/>
+                                               </object>
+                                               <reference key="parent" ref="646624756"/>
+                                               <string key="objectName">Token</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">895</int>
+                                               <reference key="object" ref="772611148"/>
+                                               <reference key="parent" ref="92717922"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">898</int>
+                                               <reference key="object" ref="525437489"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="887494614"/>
+                                               </object>
+                                               <reference key="parent" ref="646624756"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">899</int>
+                                               <reference key="object" ref="887494614"/>
+                                               <reference key="parent" ref="525437489"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>881.IBPluginDependency</string>
                                        <string>888.IBPluginDependency</string>
                                        <string>889.IBPluginDependency</string>
+                                       <string>894.IBPluginDependency</string>
+                                       <string>895.IBPluginDependency</string>
+                                       <string>898.IBPluginDependency</string>
+                                       <string>899.IBPluginDependency</string>
                                </object>
                                <object class="NSArray" key="dict.values">
                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                        <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">893</int>
+                       <int key="maxID">905</int>
+               </object>
+               <object class="IBClassDescriber" key="IBDocument.Classes">
+                       <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+                               <bool key="EncodedWithXMLCoder">YES</bool>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">GroupAndGroupMemberFormatter</string>
+                                       <string key="superclassName">NSFormatter</string>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/GroupAndGroupMemberFormatter.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">NonEmptyStringFormatter</string>
+                                       <string key="superclassName">NSFormatter</string>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/NonEmptyStringFormatter.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">PithosPreferencesController</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>addAccount:</string>
+                                                       <string>groupsApply:</string>
+                                                       <string>groupsRevert:</string>
+                                                       <string>login:</string>
+                                                       <string>loginCancel:</string>
+                                                       <string>removeAccount:</string>
+                                                       <string>syncApply:</string>
+                                                       <string>syncCancel:</string>
+                                                       <string>syncRefresh:</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <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>addAccount:</string>
+                                                       <string>groupsApply:</string>
+                                                       <string>groupsRevert:</string>
+                                                       <string>login:</string>
+                                                       <string>loginCancel:</string>
+                                                       <string>removeAccount:</string>
+                                                       <string>syncApply:</string>
+                                                       <string>syncCancel:</string>
+                                                       <string>syncRefresh:</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">addAccount:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">groupsApply:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">groupsRevert:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">login:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">loginCancel:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">removeAccount:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">syncApply:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">syncCancel:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">syncRefresh:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>accountsArrayController</string>
+                                                       <string>groupsDictionaryController</string>
+                                                       <string>selectedGroupMembersDictionaryController</string>
+                                                       <string>syncAccountsOutlineView</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSArrayController</string>
+                                                       <string>NSDictionaryController</string>
+                                                       <string>NSDictionaryController</string>
+                                                       <string>NSOutlineView</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>accountsArrayController</string>
+                                                       <string>groupsDictionaryController</string>
+                                                       <string>selectedGroupMembersDictionaryController</string>
+                                                       <string>syncAccountsOutlineView</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">accountsArrayController</string>
+                                                               <string key="candidateClassName">NSArrayController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">groupsDictionaryController</string>
+                                                               <string key="candidateClassName">NSDictionaryController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">selectedGroupMembersDictionaryController</string>
+                                                               <string key="candidateClassName">NSDictionaryController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">syncAccountsOutlineView</string>
+                                                               <string key="candidateClassName">NSOutlineView</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/PithosPreferencesController.h</string>
+                                       </object>
+                               </object>
+                       </object>
                </object>
-               <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
                <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
index 7fbbb03..ce4263f 100644 (file)
@@ -247,9 +247,7 @@ static NSImage *sharedIcon = nil;
                 ASIPithosObjectRequest *request = [ASIPithosObjectRequest objectMetadataRequestWithPithos:pithos 
                                                                                             containerName:pithosContainer.name 
                                                                                                objectName:prefix];
-                ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-                [networkQueue go];
-                [networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:request]] waitUntilFinished:YES];
+                [PithosUtilities startAndWaitForRequest:request];
                 if ([request error]) {
                     alert = [[NSAlert alloc] init];
                     [alert setMessageText:@"HTTP Request Error"];
@@ -268,9 +266,7 @@ static NSImage *sharedIcon = nil;
                         request = [ASIPithosObjectRequest deleteObjectRequestWithPithos:pithos 
                                                                           containerName:pithosContainer.name 
                                                                              objectName:prefix];
-                        ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-                        [networkQueue go];
-                        [networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:request]] waitUntilFinished:YES];
+                        [PithosUtilities startAndWaitForRequest:request];
                         if ([request error]) {
                             alert = [[NSAlert alloc] init];
                             [alert setMessageText:@"HTTP Request Error"];
index 35c1a3d..a382462 100644 (file)
         pithos.storageURLPrefix = [aPithos.storageURLPrefix copy];
         pithos.authURL = [aPithos.authURL copy];
         pithos.publicURLPrefix = [aPithos.publicURLPrefix copy];
+        pithos.userCatalogURL = [aPithos.userCatalogURL copy];
     }
     if (aPithos && 
         (![aPithos.authUser isEqualToString:pithos.authUser] || 
         pithos.storageURLPrefix = [aPithos.storageURLPrefix copy];
         pithos.authURL = [aPithos.authURL copy];
         pithos.publicURLPrefix = [aPithos.publicURLPrefix copy];
-    }        
+        pithos.userCatalogURL = [aPithos.userCatalogURL copy];
+    }
 }
 
 #pragma mark -
index 4cfc65c..2bbae93 100644 (file)
 + (ASIPithosRequest *)prepareRequest:(ASIPithosRequest *)request priority:(NSOperationQueuePriority)priority;
 + (ASIPithosRequest *)prepareRequest:(ASIPithosRequest *)request;
 + (ASIPithosRequest *)copyRequest:(ASIPithosRequest *)request;
++ (void)startAndWaitForRequest:(ASIPithosRequest *)request;
 
 @end
index b691748..91de07d 100644 (file)
                                                                                          objectName:objectName];
     if (sharingAccount)
         [objectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos];
-    ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-    [networkQueue go];
-    [networkQueue addOperations:[NSArray arrayWithObject:[self prepareRequest:objectRequest]] waitUntilFinished:YES];
+    [self startAndWaitForRequest:objectRequest];
     if (error != NULL) {
         *error = [objectRequest error];
         if (*error) {
                                                                                                         until:nil];
         if (sharingAccount)
             [containerRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos];
-        ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
-        [networkQueue go];
-        [networkQueue addOperations:[NSArray arrayWithObject:[self prepareRequest:containerRequest]] waitUntilFinished:YES];
+        [self startAndWaitForRequest:containerRequest];
         if ([containerRequest error]) {
             [self httpRequestErrorAlertWithRequest:containerRequest];
             return nil;
     return newRequest;
 }
 
++ (void)startAndWaitForRequest:(ASIPithosRequest *)request {
+    ASINetworkQueue *networkQueue = [ASINetworkQueue queue];
+    [networkQueue go];
+    [networkQueue addOperations:[NSArray arrayWithObject:[self prepareRequest:request]] waitUntilFinished:YES];
+}
+
 @end