uri = r->uri;
requestContentLength = 0;
requestBody = NULL;
-
+
#ifndef AP_VERSION_1
if (r->handler == NULL)
return DECLINED;
+2005-08-03 Helge Hess <helge.hess@opengroupware.org>
+
+ * added classes to map EOControl objects to CoreData ones
+
2005-08-01 Helge Hess <helge.hess@opengroupware.org>
* started CoreData demo
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE 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.
+
+ SOPE 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 SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#ifndef __EOFetchSpecification_CoreData_H__
+#define __EOFetchSpecification_CoreData_H__
+
+#include <EOControl/EOFetchSpecification.h>
+
+/*
+ EOFetchSpecification(CoreData)
+
+ Convert an libEOControl EOFetchSpecification to a CoreData compliant fetch
+ specification.
+
+ A major difference is that a CoreData NSFetchRequest takes the entity object
+ while in EOF we just pass the name of it.
+*/
+
+@class NSArray;
+@class NSFetchRequest, NSManagedObjectModel;
+
+@interface EOFetchSpecification(CoreData)
+
+- (NSFetchRequest *)fetchRequestWithModel:(NSManagedObjectModel *)_model;
+- (NSArray *)sortOrderingsAsSortDescriptors;
+
+@end
+
+#endif /* __EOFetchSpecification_CoreData_H__ */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE 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.
+
+ SOPE 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 SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include "EOFetchSpecification+CoreData.h"
+#include "EOSortOrdering+CoreData.h"
+#include "EOQualifier+CoreData.h"
+#include "common.h"
+
+
+@implementation EOFetchSpecification(CoreData)
+
+- (NSArray *)sortOrderingsAsSortDescriptors {
+ NSMutableArray *ma;
+ NSArray *a;
+ unsigned i, count;
+
+ if ((a = [self sortOrderings]) == nil)
+ return nil;
+ if ((count = [a count]) == 0)
+ return nil;
+
+ if (count == 1) /* common, optimization */
+ return [NSArray arrayWithObject:[[a objectAtIndex:0] asSortDescriptor]];
+
+ ma = [NSMutableArray arrayWithCapacity:count];
+ for (i = 0; i < count; i++)
+ [ma addObject:[[a objectAtIndex:i] asSortDescriptor]];
+ return ma;
+}
+
+- (NSFetchRequest *)fetchRequestWithModel:(NSManagedObjectModel *)_model {
+ NSFetchRequest *fr;
+ NSString *s;
+
+ fr = [[[NSFetchRequest alloc] init] autorelease];
+
+ if ((s = [self entityName]) != nil)
+ [fr setEntity:[[_model entitiesByName] objectForKey:s]];
+
+ [fr setFetchLimit:[self fetchLimit]];
+ [fr setPredicate:[[self qualifier] asPredicate]];
+ [fr setSortDescriptors:[self sortOrderingsAsSortDescriptors]];
+
+ return fr;
+}
+
+@end /* EOFetchSpecification(CoreData) */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE 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.
+
+ SOPE 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 SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#ifndef __EOQualifier_CoreData_H__
+#define __EOQualifier_CoreData_H__
+
+#include <EOControl/EOQualifier.h>
+
+/*
+ EOQualifier(CoreData)
+
+ Convert an libEOControl EOQualifier to a CoreData compliant NSPredicate
+ object.
+*/
+
+@class NSPredicate;
+
+@interface EOQualifier(CoreData)
+
+- (NSPredicate *)asPredicate;
+
+@end
+
+#endif /* __EOQualifier_CoreData_H__ */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE 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.
+
+ SOPE 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 SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include "EOQualifier+CoreData.h"
+#include "common.h"
+
+@implementation EOQualifier(CoreData)
+
+- (NSPredicate *)asPredicate {
+#warning IMPLEMENT ME
+ [self logWithFormat:@"TODO: AS PREDICATE ..."];
+ return nil;
+}
+
+@end /* EOQualifier(CoreData) */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE 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.
+
+ SOPE 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 SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#ifndef __EOSortOrdering_CoreData_H__
+#define __EOSortOrdering_CoreData_H__
+
+#include <EOControl/EOSortOrdering.h>
+
+/*
+ EOSortOrdering(CoreData)
+
+ Convert an libEOControl EOSortOrdering to a CoreData compliant
+ NSSortDescriptor object.
+*/
+
+@class NSSortDescriptor;
+
+@interface EOSortOrdering(CoreData)
+
+- (NSSortDescriptor *)asSortDescriptor;
+
+@end
+
+#endif /* __EOSortOrdering_CoreData_H__ */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE 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.
+
+ SOPE 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 SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include "EOSortOrdering+CoreData.h"
+#include "common.h"
+
+@implementation EOSortOrdering(CoreData)
+
+- (NSSortDescriptor *)asSortDescriptor {
+ [self logWithFormat:@"TODO: AS SORT DESCRIPTOR ..."];
+ return nil;
+}
+
+@end /* EOSortOrdering(CoreData) */
WOAPP_NAME = CoreDataBlog
CoreDataBlog_OBJC_FILES += \
- WOCoreDataApplication.m \
- WOSession+CoreData.m \
+ WOCoreDataApplication.m \
+ WOSession+CoreData.m \
+ EOFetchSpecification+CoreData.m \
+ EOQualifier+CoreData.m \
+ EOSortOrdering+CoreData.m \
\
CoreDataBlog.m \
Session.m \