]> err.no Git - sope/blob - sope-appserver/NGXmlRpc/EOFetchSpecification+XmlRpcCoding.m
fixed sonames, lib versions
[sope] / sope-appserver / NGXmlRpc / EOFetchSpecification+XmlRpcCoding.m
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include <EOControl/EOFetchSpecification.h>
24 #include <EOControl/EOSortOrdering.h>
25 #include "common.h"
26 #include <XmlRpc/XmlRpcCoder.h>
27 #include <EOControl/EOQualifier.h>
28
29 @implementation EOFetchSpecification(XmlRpcCoding)
30
31 - (id)initWithXmlRpcCoder:(XmlRpcDecoder *)_coder {
32   if ((self = [super init])) {
33     id q;
34     
35     [self setUsesDistinct:[_coder decodeBooleanForKey:@"usesDistinct"]];
36     [self setLocksObjects:[_coder decodeBooleanForKey:@"locksObjects"]];
37     [self setEntityName:  [_coder decodeStringForKey:@"entityName"]];
38     [self setFetchLimit:  [_coder decodeIntForKey:@"fetchLimit"]];
39     [self setHints:       [_coder decodeStructForKey:@"hints"]];
40     
41     if ((q = [_coder decodeObjectForKey:@"qualifier"])) {
42       if ([q isKindOfClass:[EOQualifier class]])
43         /* already a qualifier :-) [ObjC on the other side ..] */
44         [q retain];
45       else {
46         q = [[EOQualifier alloc] initWithPropertyList:q owner:nil];
47       }
48     }
49     
50     [self setQualifier:q];
51     [self setSortOrderings:[_coder decodeObjectForKey:@"sortOrderings"]];
52     
53     [q release];
54   }
55   return self;
56 }
57
58 - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder {
59   [_coder encodeBoolean:[self usesDistinct] forKey:@"usesDistinct"];
60   [_coder encodeBoolean:[self locksObjects] forKey:@"locksObjects"];
61   [_coder encodeString:[self entityName]    forKey:@"entityName"];
62   [_coder encodeInt:[self fetchLimit]       forKey:@"fetchLimit"];
63   [_coder encodeStruct:[self hints]         forKey:@"hints"];
64   [_coder encodeObject:[self qualifier]     forKey:@"qualifier"];
65   [_coder encodeObject:[self sortOrderings] forKey:@"sortOrderings"];
66 }
67
68 @end /* EOFetchSpecification(XmlRpcCoding) */