-
Notifications
You must be signed in to change notification settings - Fork 13
/
ZPServerResponseXMLParserCollection.m
50 lines (37 loc) · 1.2 KB
/
ZPServerResponseXMLParserCollection.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// ZPServerResponseXMLParserCollection.m
// ZotPad
//
// Created by Rönkkö Mikko on 12/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "ZPCore.h"
#import "ZPServerResponseXMLParserCollection.h"
#import "ZPZoteroCollection.h"
@implementation ZPServerResponseXMLParserCollection
- (void) _initNewElementWithID:(NSString*)id{
_currentElement = [ZPZoteroCollection dataObjectWithKey:id];
[(ZPZoteroCollection*)_currentElement setLibraryID:_libraryID];
[super _processTemporaryFieldStorage];
}
/*
Translate results to appropriate attributes
*/
- (void) _setField:(NSString*)field toValue:(NSString*)value{
if (_currentElement == NULL){
[super _setField:field toValue:value];
}
else if([field isEqualToString:@"updated"]){
[(ZPZoteroCollection*) _currentElement setServerTimestamp:value];
}
//TODO: Consider setting this to a separate variable. Children is child collections
/*
else if([field isEqualToString:@"zapi:numItems"]){
[(ZPZoteroCollection*) _currentElement setNumChildren:[NSNumber numberWithInt:[value intValue]]];
}
*/
else{
[super _setField:field toValue:value];
}
}
@end