2007-10-03 00:03:27 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2004-2007 SKYRIX Software AG
|
|
|
|
Copyright (C) 2007 Helge Hess
|
|
|
|
|
|
|
|
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 __GDLContentStore_GCSFolder_H__
|
|
|
|
#define __GDLContentStore_GCSFolder_H__
|
|
|
|
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
GCSFolder
|
|
|
|
|
|
|
|
TODO: document
|
|
|
|
|
|
|
|
Fixed Quick-Table SQL fields:
|
|
|
|
- "c_name" (name of the file in the folder)
|
|
|
|
|
|
|
|
Fixed BLOB-Table SQL fields:
|
|
|
|
- "c_name" (name of the file in the folder)
|
|
|
|
- "c_content" (content of the file in the folder)
|
|
|
|
- "c_version" (update revision of the file in the folder)
|
|
|
|
*/
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
@class NSString;
|
|
|
|
@class NSURL;
|
|
|
|
@class NSNumber;
|
|
|
|
@class NSArray;
|
|
|
|
@class NSMutableArray;
|
|
|
|
@class NSException;
|
|
|
|
@class NSMutableString;
|
2007-10-03 00:03:27 +02:00
|
|
|
@class NSDictionary;
|
2008-06-13 22:07:32 +02:00
|
|
|
@class EOQualifier;
|
|
|
|
@class EOFetchSpecification;
|
2007-10-03 00:03:27 +02:00
|
|
|
@class EOAdaptorChannel;
|
2008-06-13 22:07:32 +02:00
|
|
|
@class GCSFolderManager;
|
|
|
|
@class GCSFolderType;
|
|
|
|
@class GCSChannelManager;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
|
|
|
@interface GCSFolder : NSObject
|
|
|
|
{
|
|
|
|
GCSFolderManager *folderManager;
|
2008-06-13 22:07:32 +02:00
|
|
|
GCSFolderType *folderInfo;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
|
|
|
NSNumber *folderId;
|
|
|
|
NSString *folderName;
|
|
|
|
NSString *path;
|
2008-06-13 22:07:32 +02:00
|
|
|
NSURL *location;
|
|
|
|
NSURL *quickLocation;
|
|
|
|
NSURL *aclLocation;
|
2007-10-03 00:03:27 +02:00
|
|
|
NSString *folderTypeName;
|
2008-06-13 22:07:32 +02:00
|
|
|
NSMutableArray *quickFieldNames;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
int requiresFolderSelect:1;
|
|
|
|
int sameTableForQuick:1;
|
|
|
|
int reserved:30;
|
|
|
|
} ofFlags;
|
|
|
|
}
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (id) initWithPath: (NSString *) _path
|
|
|
|
primaryKey: (id) _folderId
|
|
|
|
folderTypeName: (NSString *) _ftname
|
|
|
|
folderType: (GCSFolderType *) _ftype
|
|
|
|
location: (NSURL *) _loc
|
|
|
|
quickLocation: (NSURL *) _qloc
|
|
|
|
aclLocation: (NSURL *) _aloc
|
|
|
|
folderManager: (GCSFolderManager *) _fm;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
|
|
|
/* accessors */
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (NSNumber *) folderId;
|
|
|
|
- (NSString *) folderName;
|
|
|
|
- (NSString *) path;
|
|
|
|
- (NSURL *) location;
|
|
|
|
- (NSURL *) quickLocation;
|
|
|
|
- (NSURL *) aclLocation;
|
|
|
|
- (NSString *) folderTypeName;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (NSString *) storeTableName;
|
|
|
|
- (NSString *) quickTableName;
|
|
|
|
- (NSString *) aclTableName;
|
|
|
|
- (BOOL) isQuickInfoStoredInContentTable;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
|
|
|
/* connection */
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (EOAdaptorChannel *) acquireStoreChannel;
|
|
|
|
- (EOAdaptorChannel *) acquireQuickChannel;
|
|
|
|
- (EOAdaptorChannel *) acquireAclChannel;
|
|
|
|
- (void) releaseChannel: (EOAdaptorChannel *) _channel;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (BOOL) canConnectStore;
|
|
|
|
- (BOOL) canConnectQuick;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
|
|
|
/* operations */
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (NSArray *) subFolderNames;
|
|
|
|
- (NSArray *) allSubFolderNames;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
2008-01-16 19:59:07 +01:00
|
|
|
- (NSDictionary *) recordOfEntryWithName: (NSString *) name;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (NSException *) writeContent: (NSString *) _content
|
|
|
|
toName: (NSString *) _name
|
|
|
|
baseVersion: (unsigned int) _baseVersion;
|
|
|
|
- (NSException *) writeContent: (NSString *) _content
|
|
|
|
toName: (NSString *) _name;
|
|
|
|
- (NSException *) deleteContentWithName: (NSString *) _name;
|
2009-09-10 19:26:57 +02:00
|
|
|
- (NSException *) deleteAllContent;
|
2008-06-13 22:07:32 +02:00
|
|
|
|
|
|
|
- (NSException *) deleteFolder;
|
|
|
|
|
2011-10-03 21:32:37 +02:00
|
|
|
- (NSException *) updateQuickFields: (NSDictionary *) _fields
|
|
|
|
whereColumn: (NSString *) _colname
|
|
|
|
isEqualTo: (id) _value;
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (NSArray *) fetchFields: (NSArray *) _flds
|
|
|
|
fetchSpecification: (EOFetchSpecification *) _fs;
|
2008-09-22 22:30:38 +02:00
|
|
|
- (NSArray *) fetchFields: (NSArray *) fields
|
|
|
|
fetchSpecification: (EOFetchSpecification *) spec
|
|
|
|
ignoreDeleted: (BOOL) ignoreDeleted;
|
|
|
|
|
2008-06-13 22:07:32 +02:00
|
|
|
- (NSArray *) fetchFields: (NSArray *) _flds
|
|
|
|
matchingQualifier: (EOQualifier *) _q;
|
|
|
|
- (NSArray *) fetchAclMatchingQualifier: (EOQualifier *) _q;
|
|
|
|
- (void) deleteAclMatchingQualifier: (EOQualifier *) _q;
|
|
|
|
- (void) deleteAclWithSpecification: (EOFetchSpecification *) _fs;
|
2007-10-03 00:03:27 +02:00
|
|
|
|
2009-06-02 18:22:28 +02:00
|
|
|
- (unsigned int) recordsCountByExcludingDeleted: (BOOL) includeDeleted;
|
|
|
|
|
2011-05-30 23:17:26 +02:00
|
|
|
- (NSCalendarDate *) lastModificationDate;
|
|
|
|
|
2007-10-03 00:03:27 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* __GDLContentStore_GCSFolder_H__ */
|