Fix titles. Alfresco compatibility. t20
authorStefane Fermigier <sfermigier@nuxeo.com>
Tue, 09 Mar 2010 16:18:28 +0100
brancht20
changeset 40d63a83dcca61
parent 39 1e221a5b27f2
child 41 623884f10111
Fix titles. Alfresco compatibility.
Classes/DocViewController.h
Classes/DocViewController.m
Classes/NXObject.m
ROADMAP.txt
     1.1 --- a/Classes/DocViewController.h
     1.2 +++ b/Classes/DocViewController.h
     1.3 @@ -7,14 +7,20 @@
     1.4  //
     1.5  
     1.6  #import <UIKit/UIKit.h>
     1.7 +#import "NXDocument.h"
     1.8 +
     1.9  
    1.10  @interface DocViewController : UIViewController {
    1.11 +    // The attached document (not used for now!)
    1.12 +    NXDocument *document;
    1.13 +    // The document's download URL
    1.14      NSURL *url;
    1.15  
    1.16      IBOutlet UIView *spinnerView;
    1.17  }
    1.18  
    1.19  @property (nonatomic, retain) NSURL *url;
    1.20 +@property (nonatomic, retain) NXDocument *document;
    1.21  
    1.22  - (void)loadDocument;
    1.23  
     2.1 --- a/Classes/DocViewController.m
     2.2 +++ b/Classes/DocViewController.m
     2.3 @@ -11,11 +11,11 @@
     2.4  
     2.5  @implementation DocViewController
     2.6  
     2.7 -@synthesize url;
     2.8 +@synthesize url, document;
     2.9  
    2.10  - (void)viewDidLoad {
    2.11      [super viewDidLoad];
    2.12 -    self.navigationItem.title = @"My doc";
    2.13 +    //self.navigationItem.title = document.title;
    2.14      self.navigationItem.backBarButtonItem.enabled = YES;
    2.15  }
    2.16  
     3.1 --- a/Classes/NXObject.m
     3.2 +++ b/Classes/NXObject.m
     3.3 @@ -40,20 +40,27 @@
     3.4  }
     3.5  
     3.6  - (void)parse:(DDXMLElement *)entry {
     3.7 +    NSLog(@"entry: %@", [entry XMLString]);
     3.8      DDXMLElement *object = [[entry elementsForName:@"object"] objectAtIndex:0] ;
     3.9      DDXMLElement *props = [[object elementsForName:@"properties"] objectAtIndex:0];
    3.10 +
    3.11      for (DDXMLElement *prop in [props elementsForName:@"propertyId"]) {
    3.12          NSString *propName = [[prop attributeForName:@"propertyDefinitionId"] stringValue];
    3.13 -        NSString *propValue = [[[prop elementsForName:@"value"] objectAtIndex:0] stringValue];
    3.14 +        NSArray *values = [prop elementsForName:@"value"];
    3.15 +        NSString *propValue = @"";
    3.16 +        if ([values count] > 0) {
    3.17 +            propValue = [[values objectAtIndex:0] stringValue];
    3.18 +        }
    3.19 +        NSLog(@"%@ = %@", propName, propValue);
    3.20          [self.properties setObject:propValue forKey:propName];        
    3.21      }
    3.22      for (DDXMLElement *prop in [props elementsForName:@"propertyString"]) {
    3.23          NSString *propName = [[prop attributeForName:@"propertyDefinitionId"] stringValue];
    3.24 -        if ([propName isEqualToString:@"dc:subjects"] || [propName isEqualToString:@"content_roots"]
    3.25 -            || [propName isEqualToString:@"publish:sections"]) {
    3.26 -            continue;
    3.27 +        NSArray *values = [prop elementsForName:@"value"];
    3.28 +        NSString *propValue = @"";
    3.29 +        if ([values count] > 0) {
    3.30 +            propValue = [[values objectAtIndex:0] stringValue];
    3.31          }
    3.32 -        NSString *propValue = [[[prop elementsForName:@"value"] objectAtIndex:0] stringValue];
    3.33          NSLog(@"%@ = %@", propName, propValue);
    3.34          [self.properties setObject:propValue forKey:propName];        
    3.35      }
     4.1 --- a/ROADMAP.txt
     4.2 +++ b/ROADMAP.txt
     4.3 @@ -4,7 +4,7 @@
     4.4  Client side
     4.5  -----------
     4.6  
     4.7 -V 0.1:
     4.8 +V 0.1 [DONE]:
     4.9  
    4.10  + Navigate in repository
    4.11  + Show spinner when running HTTP requests