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>
|
|
|
|
|
|
|
|
/*
|
|
|
|
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;
|
2007-05-09 21:23:45 +02:00
|
|
|
@class GCSFolderManager;
|
|
|
|
@class GCSFolder;
|
|
|
|
|
|
|
|
@class SOGoUserFolder;
|
|
|
|
@class SOGoGroupsFolder;
|
2006-12-14 22:20:13 +01:00
|
|
|
@class SOGoDAVSet;
|
|
|
|
|
|
|
|
#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;
|
2007-06-02 00:16:20 +02:00
|
|
|
id container;
|
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
|
|
|
|
|
|
|
/* accessors */
|
|
|
|
|
2007-03-28 20:37:23 +02:00
|
|
|
- (NSString *) nameInContainer;
|
|
|
|
- (id) container;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-09-14 23:59:00 +02:00
|
|
|
- (NSArray *) pathArrayToSOGoObject;
|
|
|
|
|
2007-05-30 22:18:42 +02:00
|
|
|
- (NSURL *) davURL;
|
|
|
|
- (NSURL *) soURL;
|
|
|
|
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid;
|
|
|
|
- (NSURL *) soURLToBaseContainerForCurrentUser;
|
|
|
|
|
2007-09-14 23:59:00 +02:00
|
|
|
- (NSString *) labelForKey: (NSString *) key;
|
|
|
|
|
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;
|
|
|
|
- (SOGoGroupsFolder *) lookupGroupsFolder;
|
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;
|
|
|
|
|
2006-12-14 22:20:13 +01:00
|
|
|
- (SOGoDAVSet *) davCurrentUserPrivilegeSet;
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
/* 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;
|
|
|
|
- (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
|
|
|
|
2008-02-22 22:19:29 +01:00
|
|
|
/* dav */
|
|
|
|
- (NSArray *) davNamespaces;
|
|
|
|
- (NSString *) davRecordForUser: (NSString *) user;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
#endif /* __SoObjects_SOGoObject_H__ */
|