2006-06-15 21:34:10 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2004-2005 SKYRIX Software AG
|
|
|
|
|
|
|
|
This file is part of OpenGroupware.org.
|
|
|
|
|
|
|
|
OGo is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Lesser General Public License as published by the
|
|
|
|
Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
later version.
|
|
|
|
|
|
|
|
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with OGo; see the file COPYING. If not, write to the
|
|
|
|
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SoObjects_SOGoObject_H__
|
|
|
|
#define __SoObjects_SOGoObject_H__
|
|
|
|
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
2008-05-03 01:08:15 +02:00
|
|
|
#if LIB_FOUNDATION_LIBRARY
|
|
|
|
#error SOGo will not work properly with libFoundation.
|
|
|
|
#error Please use gnustep-base instead.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
/*
|
|
|
|
SOGoObject
|
|
|
|
|
|
|
|
This is the abstract class used by all SOGo SoObjects. It contains the
|
|
|
|
ability to track a container as well as the key the object was invoked with.
|
|
|
|
|
|
|
|
In addition it provides some generic methods like user or group folder
|
|
|
|
lookup.
|
|
|
|
*/
|
|
|
|
|
2007-05-09 21:23:45 +02:00
|
|
|
#import <NGObjWeb/SoObject.h>
|
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
@class NSArray;
|
|
|
|
@class NSMutableString;
|
|
|
|
@class NSException;
|
|
|
|
@class NSTimeZone;
|
2007-05-30 22:18:42 +02:00
|
|
|
@class NSURL;
|
2007-05-09 21:23:45 +02:00
|
|
|
|
2006-12-14 22:20:13 +01:00
|
|
|
@class WOContext;
|
2008-07-04 20:22:06 +02:00
|
|
|
@class WORequest;
|
2007-05-09 21:23:45 +02:00
|
|
|
@class GCSFolderManager;
|
|
|
|
@class GCSFolder;
|
|
|
|
|
|
|
|
@class SOGoUserFolder;
|
2008-05-03 01:08:15 +02:00
|
|
|
@class SOGoWebDAVValue;
|
|
|
|
@class SOGoWebDAVAclManager;
|
2006-12-14 22:20:13 +01:00
|
|
|
|
|
|
|
#define $(class) NSClassFromString(class)
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
@interface SOGoObject : NSObject
|
|
|
|
{
|
2007-04-11 21:03:42 +02:00
|
|
|
WOContext *context;
|
2006-06-15 21:34:10 +02:00
|
|
|
NSString *nameInContainer;
|
2007-06-01 06:07:13 +02:00
|
|
|
NSString *owner;
|
2008-05-03 01:08:15 +02:00
|
|
|
SOGoWebDAVAclManager *webdavAclManager;
|
2007-06-02 00:16:20 +02:00
|
|
|
id container;
|
2008-06-13 22:08:45 +02:00
|
|
|
BOOL activeUserIsOwner;
|
2010-06-02 18:35:59 +02:00
|
|
|
BOOL isInPublicZone;
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2007-09-14 23:59:00 +02:00
|
|
|
+ (NSString *) globallyUniqueObjectId;
|
|
|
|
- (NSString *) globallyUniqueObjectId;
|
|
|
|
|
2006-08-21 19:43:36 +02:00
|
|
|
+ (id) objectWithName: (NSString *)_name inContainer:(id)_container;
|
|
|
|
|
2007-03-28 20:37:23 +02:00
|
|
|
- (id) initWithName: (NSString *) _name inContainer:(id)_container;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-10-15 23:33:56 +02:00
|
|
|
+ (SOGoWebDAVAclManager *) webdavAclManager;
|
|
|
|
|
2010-06-02 18:35:59 +02:00
|
|
|
- (BOOL) isInPublicZone;
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
/* accessors */
|
|
|
|
|
2007-03-28 20:37:23 +02:00
|
|
|
- (NSString *) nameInContainer;
|
|
|
|
- (id) container;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-05-30 22:18:42 +02:00
|
|
|
- (NSURL *) davURL;
|
|
|
|
- (NSURL *) soURL;
|
|
|
|
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid;
|
|
|
|
- (NSURL *) soURLToBaseContainerForCurrentUser;
|
2009-10-21 23:17:11 +02:00
|
|
|
- (NSString *) davURLAsString;
|
2007-05-30 22:18:42 +02:00
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
/* ownership */
|
|
|
|
|
2006-12-20 23:47:54 +01:00
|
|
|
- (void) setOwner: (NSString *) newOwner;
|
2007-03-28 20:37:23 +02:00
|
|
|
- (NSString *) ownerInContext: (id) _ctx;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/* looking up shared objects */
|
|
|
|
|
2007-03-28 20:37:23 +02:00
|
|
|
- (SOGoUserFolder *) lookupUserFolder;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-03-28 20:37:23 +02:00
|
|
|
- (void) sleep;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/* hierarchy */
|
|
|
|
|
2007-03-28 20:37:23 +02:00
|
|
|
- (NSArray *) fetchSubfolders; /* uses toManyRelationshipKeys */
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/* operations */
|
|
|
|
|
|
|
|
- (NSException *)delete;
|
|
|
|
- (id)GETAction:(id)_ctx;
|
|
|
|
|
|
|
|
/* etag support */
|
|
|
|
|
2007-09-14 23:59:00 +02:00
|
|
|
- (NSException *) matchesRequestConditionInContext:(id)_ctx;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-04-17 16:09:29 +02:00
|
|
|
/* acls */
|
|
|
|
|
2007-11-29 17:14:11 +01:00
|
|
|
- (NSArray *) subscriptionRoles;
|
|
|
|
|
2008-02-22 22:19:29 +01:00
|
|
|
- (BOOL) addUserInAcls: (NSString *) uid;
|
|
|
|
- (BOOL) removeUserFromAcls: (NSString *) uid;
|
|
|
|
|
2007-05-19 02:39:52 +02:00
|
|
|
- (NSArray *) aclUsers;
|
2007-04-17 16:09:29 +02:00
|
|
|
- (NSArray *) aclsForUser: (NSString *) uid;
|
2007-04-25 00:45:38 +02:00
|
|
|
- (void) setRoles: (NSArray *) roles
|
2007-04-17 16:09:29 +02:00
|
|
|
forUser: (NSString *) uid;
|
2010-01-15 00:19:19 +01:00
|
|
|
- (void) setRoles: (NSArray *) roles
|
|
|
|
forUsers: (NSArray *) users;
|
2007-04-17 16:09:29 +02:00
|
|
|
- (void) removeAclsForUsers: (NSArray *) users;
|
2007-05-22 20:36:23 +02:00
|
|
|
- (NSString *) defaultUserID;
|
2007-05-30 22:18:42 +02:00
|
|
|
|
|
|
|
- (void) sendACLAdditionAdvisoryToUser: (NSString *) uid;
|
|
|
|
- (void) sendACLRemovalAdvisoryToUser: (NSString *) uid;
|
|
|
|
|
|
|
|
- (NSString *) httpURLForAdvisoryToUser: (NSString *) uid;
|
|
|
|
- (NSString *) resourceURLForAdvisoryToUser: (NSString *) uid;
|
2007-04-17 16:09:29 +02:00
|
|
|
|
2010-01-15 00:19:19 +01:00
|
|
|
- (SOGoObject *) lookupObjectAtDAVUrl: (NSString *) davURL;
|
|
|
|
|
2008-06-30 20:31:29 +02:00
|
|
|
- (NSArray *) davComplianceClassesInContext: (WOContext *) localContext;
|
|
|
|
|
2008-07-04 20:22:06 +02:00
|
|
|
- (id) davPOSTRequest: (WORequest *) request
|
|
|
|
withContentType: (NSString *) cType
|
|
|
|
inContext: (WOContext *) localContext;
|
|
|
|
|
2008-05-03 01:08:15 +02:00
|
|
|
/* dav acls */
|
|
|
|
- (SOGoWebDAVValue *) davCurrentUserPrivilegeSet;
|
|
|
|
|
|
|
|
/* inverse dav extensions for acls */
|
2008-12-23 23:39:56 +01:00
|
|
|
- (NSString *) davRecordForUser: (NSString *) user
|
|
|
|
parameters: (NSArray *) params;
|
2008-02-22 22:19:29 +01:00
|
|
|
|
2010-04-20 21:53:13 +02:00
|
|
|
/* utilities */
|
|
|
|
- (NSString *) labelForKey: (NSString *) key;
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
/* description */
|
|
|
|
|
2007-04-17 16:09:29 +02:00
|
|
|
- (void) appendAttributesToDescription:(NSMutableString *)_ms;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2008-05-03 01:08:15 +02:00
|
|
|
@interface SOGoObject (SOGo)
|
|
|
|
|
|
|
|
- (NSString *) contentAsString;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
#endif /* __SoObjects_SOGoObject_H__ */
|