Cleanup. t20
authorStefane Fermigier <sfermigier@nuxeo.com>
Mon, 08 Mar 2010 19:41:01 +0100
brancht20
changeset 370c7da81f2e98
parent 36 c162e52d9e5b
child 38 66ef59e17ee3
Cleanup.
Classes/CmisClient.h
Classes/CmisClient.m
Classes/SearchViewController.m
Classes/iNuxeoAppDelegate.m
     1.1 --- a/Classes/CmisClient.h
     1.2 +++ b/Classes/CmisClient.h
     1.3 @@ -25,11 +25,6 @@
     1.4  - (NXFolder*)getFolderInfoAt:(NSURL*)url;
     1.5  - (NSURL*)fetchDocumentAt:(NSURL*)url;
     1.6  - (NSMutableURLRequest *)makeRequestForURL:(NSURL *)url consumes:(NSString*)mimeType;
     1.7 -
     1.8 -#pragma mark private API
     1.9 -
    1.10  - (void)fetchServiceDocument;
    1.11 -- (NSData*)get:(NSURL*)url consumes:(NSString*)mimeType;
    1.12 -- (NSString*)queryXPath:(NSData*)data withQuery:(NSString*)query;
    1.13  
    1.14  @end
     2.1 --- a/Classes/CmisClient.m
     2.2 +++ b/Classes/CmisClient.m
     2.3 @@ -10,6 +10,11 @@
     2.4  #import "DDXML.h"
     2.5  #import "StringUtil.h"
     2.6  
     2.7 +@interface CmisClient (Private)
     2.8 +- (NSData*)get:(NSURL*)url consumes:(NSString*)mimeType;
     2.9 +- (NSString*)queryXPath:(NSData*)data withQuery:(NSString*)query;
    2.10 +@end
    2.11 +
    2.12  @implementation CmisClient
    2.13  
    2.14  static CmisClient *sharedClient = NULL;
    2.15 @@ -57,8 +62,6 @@
    2.16      NSArray *entries = [doc nodesForXPath:@"/*[local-name()='feed']/*[local-name()='entry']" error:nil];
    2.17      
    2.18      for (DDXMLElement *entry in entries) {
    2.19 -        
    2.20 -        NSString *title = [[[entry elementsForName:@"title"] objectAtIndex:0] stringValue];
    2.21          NSString *url;
    2.22          BOOL isFolder = YES;
    2.23          NXObject *childObject;
    2.24 @@ -87,7 +90,6 @@
    2.25      return folder;
    2.26  }
    2.27  
    2.28 -#if 0
    2.29  - (NSURL*)fetchDocumentAt:(NSURL*)url {
    2.30      NSData *data = [self get:url consumes:@"*/*"];
    2.31      NSString *path = [NSTemporaryDirectory() stringByAppendingString:@"tempfile"];
    2.32 @@ -99,7 +101,6 @@
    2.33      NSURL *tempUrl = [NSURL fileURLWithPath:path];
    2.34      return tempUrl;
    2.35  }
    2.36 -#endif
    2.37  
    2.38  - (NSMutableURLRequest *)makeRequestForURL:(NSURL *)url consumes:(NSString*)mimeType {
    2.39      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
     3.1 --- a/Classes/SearchViewController.m
     3.2 +++ b/Classes/SearchViewController.m
     3.3 @@ -8,7 +8,7 @@
     3.4  
     3.5  #import "SearchViewController.h"
     3.6  
     3.7 -#define SEARCH_TPL "<?xml version='1.0' ?><query xmlns='http://docs.oasis-open.org/ns/cmis/core/200908/'>\
     3.8 +#define SEARCH_TPL @"<?xml version='1.0'?><query xmlns='http://docs.oasis-open.org/ns/cmis/core/200908/'>\
     3.9      <statement><![CDATA[SELECT * FROM cmis:folder WHERE contains(%s)]]></statement></query>"
    3.10  
    3.11  @implementation SearchViewController
     4.1 --- a/Classes/iNuxeoAppDelegate.m
     4.2 +++ b/Classes/iNuxeoAppDelegate.m
     4.3 @@ -14,6 +14,13 @@
     4.4  @synthesize tabController;
     4.5  
     4.6  - (void)applicationDidFinishLaunching:(UIApplication *)application {
     4.7 +    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];    
     4.8 +    if (nil == [userDefaults stringForKey:@"serviceUrl"]
     4.9 +        || nil == [userDefaults stringForKey:@"username"]
    4.10 +        || nil == [userDefaults stringForKey:@"password"]) {
    4.11 +        tabController.selectedIndex = 3;
    4.12 +    }
    4.13 +    
    4.14  	// Configure and show the window
    4.15  	[window addSubview:[tabController view]];
    4.16  	[window makeKeyAndVisible];