Monotone-Parent: 3f6384d2d667032c851f2ee92c9eb1305dd8e483
Monotone-Revision: 68a5a1ab4807ea7e9d97fe4cabcbd3910bd62260 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T15:51:25 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
b8d9e5f1e7
commit
c62f3b2634
|
@ -1,5 +1,15 @@
|
|||
2010-08-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* GCSSpecialQueries.m (-createEMailAlarmsFolderWithName:): new sql
|
||||
helper methods
|
||||
(emailAlarmsAttributeTypes:): new helper method that returns the
|
||||
types pertaining to the adaptor.
|
||||
|
||||
* GCSFolderManager.m (-alarmsFolder): new helper method.
|
||||
|
||||
* GCSAlarmsFolder.[hm]: new class module for handling alarm
|
||||
references.
|
||||
|
||||
* GCSFolder.m (-_channelManager): made method private.
|
||||
(-folderManager): removed method.
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
@class NSString, NSArray, NSURL, NSDictionary, NSException;
|
||||
@class GCSChannelManager, GCSFolder, GCSFolderType;
|
||||
@class GCSChannelManager, GCSAlarmsFolder, GCSFolder, GCSFolderType;
|
||||
|
||||
@interface GCSFolderManager : NSObject
|
||||
{
|
||||
|
@ -70,6 +70,9 @@
|
|||
- (NSException *)createFolderOfType:(NSString *)_type withName:(NSString *)_name atPath:(NSString *)_path;
|
||||
- (NSException *)deleteFolderAtPath:(NSString *)_path;
|
||||
|
||||
/* alarms */
|
||||
- (GCSAlarmsFolder *)alarmsFolder;
|
||||
|
||||
/* folder types */
|
||||
|
||||
- (GCSFolderType *)folderTypeWithName:(NSString *)_name;
|
||||
|
|
|
@ -37,13 +37,15 @@
|
|||
#import <NGExtensions/NGResourceLocator.h>
|
||||
#import <unistd.h>
|
||||
|
||||
#import "GCSFolderManager.h"
|
||||
#import "GCSChannelManager.h"
|
||||
#import "GCSFolderType.h"
|
||||
#import "EOAdaptorChannel+GCS.h"
|
||||
#import "GCSAlarmsFolder.h"
|
||||
#import "GCSFolder.h"
|
||||
#import "GCSFolderType.h"
|
||||
#import "GCSSpecialQueries.h"
|
||||
#import "NSURL+GCS.h"
|
||||
#import "EOAdaptorChannel+GCS.h"
|
||||
|
||||
#import "GCSFolderManager.h"
|
||||
|
||||
/*
|
||||
Required database schema:
|
||||
|
@ -323,6 +325,11 @@ static NSCharacterSet *asciiAlphaNumericCS = nil;
|
|||
return [folder autorelease];
|
||||
}
|
||||
|
||||
- (GCSAlarmsFolder *) alarmsFolder
|
||||
{
|
||||
return [GCSAlarmsFolder alarmsFolderWithFolderManager: self];
|
||||
}
|
||||
|
||||
/* path SQL */
|
||||
|
||||
- (NSString *)generateSQLWhereForInternalNames:(NSArray *)_names
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
|
||||
@interface GCSSpecialQueries : NSObject
|
||||
|
||||
- (NSString *) createEMailAlarmsFolderWithName: (NSString *) tableName;
|
||||
- (NSDictionary *) emailAlarmsAttributeTypes;
|
||||
|
||||
- (NSString *) createFolderTableWithName: (NSString *) tableName;
|
||||
- (NSString *) createFolderACLTableWithName: (NSString *) tableName;
|
||||
|
||||
|
|
|
@ -77,6 +77,20 @@
|
|||
|
||||
@implementation GCSSpecialQueries
|
||||
|
||||
- (NSString *) createEMailAlarmsFolderWithName: (NSString *) tableName
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSDictionary *) emailAlarmsAttributeTypes
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *) createFolderTableWithName: (NSString *) tableName
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
@ -95,6 +109,38 @@
|
|||
|
||||
@implementation GCSPostgreSQLSpecialQueries
|
||||
|
||||
- (NSString *) createEMailAlarmsFolderWithName: (NSString *) tableName
|
||||
{
|
||||
static NSString *sqlFolderFormat
|
||||
= (@"CREATE TABLE %@ ("
|
||||
@" c_path VARCHAR(255) NOT NULL,"
|
||||
@" c_name VARCHAR(255) NOT NULL,"
|
||||
@" c_uid VARCHAR(255) NOT NULL,"
|
||||
@" c_recurrence_id INT NULL,"
|
||||
@" c_alarm_number INT NOT NULL,"
|
||||
@" c_alarm_date INT NOT NULL)");
|
||||
|
||||
return [NSString stringWithFormat: sqlFolderFormat, tableName];
|
||||
}
|
||||
|
||||
- (NSDictionary *) emailAlarmsAttributeTypes
|
||||
{
|
||||
static NSMutableDictionary *types = nil;
|
||||
|
||||
if (!types)
|
||||
{
|
||||
types = [NSMutableDictionary new];
|
||||
[types setObject: @"varchar" forKey: @"c_path"];
|
||||
[types setObject: @"varchar" forKey: @"c_name"];
|
||||
[types setObject: @"varchar" forKey: @"c_uid"];
|
||||
[types setObject: @"int" forKey: @"c_recurrence_id"];
|
||||
[types setObject: @"int" forKey: @"c_alarm_number"];
|
||||
[types setObject: @"int" forKey: @"c_alarm_date"];
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
- (NSString *) createFolderTableWithName: (NSString *) tableName
|
||||
{
|
||||
static NSString *sqlFolderFormat
|
||||
|
@ -126,6 +172,38 @@
|
|||
|
||||
@implementation GCSMySQLSpecialQueries
|
||||
|
||||
- (NSString *) createEMailAlarmsFolderWithName: (NSString *) tableName
|
||||
{
|
||||
static NSString *sqlFolderFormat
|
||||
= (@"CREATE TABLE %@ ("
|
||||
@" c_path VARCHAR(255) NOT NULL,"
|
||||
@" c_name VARCHAR(255) NOT NULL,"
|
||||
@" c_uid VARCHAR(255) NOT NULL,"
|
||||
@" c_recurrence_id INT NULL,"
|
||||
@" c_alarm_number INT NOT NULL,"
|
||||
@" c_alarm_date INT NOT NULL)");
|
||||
|
||||
return [NSString stringWithFormat: sqlFolderFormat, tableName];
|
||||
}
|
||||
|
||||
- (NSDictionary *) emailAlarmsAttributeTypes
|
||||
{
|
||||
static NSMutableDictionary *types = nil;
|
||||
|
||||
if (!types)
|
||||
{
|
||||
types = [NSMutableDictionary new];
|
||||
[types setObject: @"varchar" forKey: @"c_path"];
|
||||
[types setObject: @"varchar" forKey: @"c_name"];
|
||||
[types setObject: @"varchar" forKey: @"c_uid"];
|
||||
[types setObject: @"int" forKey: @"c_recurrence_id"];
|
||||
[types setObject: @"int" forKey: @"c_alarm_number"];
|
||||
[types setObject: @"int" forKey: @"c_alarm_date"];
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
- (NSString *) createFolderTableWithName: (NSString *) tableName
|
||||
{
|
||||
static NSString *sqlFolderFormat
|
||||
|
@ -157,6 +235,38 @@
|
|||
|
||||
@implementation GCSOracleSpecialQueries
|
||||
|
||||
- (NSString *) createEMailAlarmsFolderWithName: (NSString *) tableName
|
||||
{
|
||||
static NSString *sqlFolderFormat
|
||||
= (@"CREATE TABLE %@ ("
|
||||
@" c_path VARCHAR2(255) NOT NULL,"
|
||||
@" c_name VARCHAR2(255) NOT NULL,"
|
||||
@" c_uid VARCHAR2(255) NOT NULL,"
|
||||
@" c_recurrence_id INTEGER NULL,"
|
||||
@" c_alarm_number INTEGER NOT NULL,"
|
||||
@" c_alarm_date INTEGER NOT NULL)");
|
||||
|
||||
return [NSString stringWithFormat: sqlFolderFormat, tableName];
|
||||
}
|
||||
|
||||
- (NSDictionary *) emailAlarmsAttributeTypes
|
||||
{
|
||||
static NSMutableDictionary *types = nil;
|
||||
|
||||
if (!types)
|
||||
{
|
||||
types = [NSMutableDictionary new];
|
||||
[types setObject: @"varchar2" forKey: @"c_path"];
|
||||
[types setObject: @"varchar2" forKey: @"c_name"];
|
||||
[types setObject: @"varchar2" forKey: @"c_uid"];
|
||||
[types setObject: @"integer" forKey: @"c_recurrence_id"];
|
||||
[types setObject: @"integer" forKey: @"c_alarm_number"];
|
||||
[types setObject: @"integer" forKey: @"c_alarm_date"];
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
- (NSString *) createFolderTableWithName: (NSString *) tableName
|
||||
{
|
||||
static NSString *sqlFolderFormat
|
||||
|
|
|
@ -24,6 +24,7 @@ libGDLContentStore_HEADER_FILES += \
|
|||
NSURL+GCS.h \
|
||||
EOAdaptorChannel+GCS.h \
|
||||
\
|
||||
GCSAlarmsFolder.h \
|
||||
GCSContext.h \
|
||||
GCSFieldInfo.h \
|
||||
GCSFolder.h \
|
||||
|
@ -39,6 +40,7 @@ libGDLContentStore_OBJC_FILES += \
|
|||
EOAdaptorChannel+GCS.m \
|
||||
EOQualifier+GCS.m \
|
||||
\
|
||||
GCSAlarmsFolder.m \
|
||||
GCSContext.m \
|
||||
GCSFieldInfo.m \
|
||||
GCSFolder.m \
|
||||
|
|
Loading…
Reference in New Issue