2 Copyright (C) 2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
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.
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
23 #include "SOGoObject.h"
26 @implementation SOGoObject
28 - (BOOL)doesRetainContainer {
32 - (id)initWithName:(NSString *)_name inContainer:(id)_container {
33 if ((self = [super init])) {
34 self->nameInContainer = [_name copy];
36 [self doesRetainContainer] ? [_container retain] : _container;
41 return [self initWithName:nil inContainer:nil];
45 if ([self doesRetainContainer])
46 [self->container release];
47 [self->nameInContainer release];
53 - (NSString *)nameInContainer {
54 return self->nameInContainer;
57 return self->container;
60 /* looking up shared objects */
62 - (SOGoUserFolder *)lookupUserFolder {
63 if (![self->container respondsToSelector:_cmd])
66 return [self->container lookupUserFolder];
71 - (NSException *)delete {
72 return [NSException exceptionWithHTTPStatus:500 /* not implemented */
73 reason:@"delete not yet implemented, sorry ..."];
78 - (id)valueForUndefinedKey:(NSString *)_key {
84 - (NSString *)davDisplayName {
85 return [self nameInContainer];
88 - (id)DELETEAction:(id)_ctx {
94 - (void)appendAttributesToDescription:(NSMutableString *)_ms {
95 if (self->nameInContainer)
96 [_ms appendFormat:@" name=%@", self->nameInContainer];
98 [_ms appendFormat:@" container=0x%08X", self->container];
101 - (NSString *)description {
104 ms = [NSMutableString stringWithCapacity:64];
105 [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
106 [self appendAttributesToDescription:ms];
107 [ms appendString:@">"];
111 @end /* SOGoObject */