From: helge Date: Mon, 22 Aug 2005 15:17:53 +0000 (+0000) Subject: prepared blog view page X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba2cbd92ba861b32ceb2344adf5bc53786f3eaab;p=sope prepared blog view page git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1060 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/samples/CoreDataBlog/GNUmakefile b/sope-appserver/samples/CoreDataBlog/GNUmakefile index 117f5495..a1bc32ce 100644 --- a/sope-appserver/samples/CoreDataBlog/GNUmakefile +++ b/sope-appserver/samples/CoreDataBlog/GNUmakefile @@ -9,11 +9,13 @@ CoreDataBlog_OBJC_FILES += \ WOCoreDataApplication.m \ WOSession+CoreData.m \ \ - CoreDataBlog.m \ - Session.m \ - Main.m + CoreDataBlog.m \ + Session.m \ + Main.m \ + \ + MonthPage.m -CoreDataBlog_COMPONENTS += Main.wo +CoreDataBlog_COMPONENTS += Main.wo MonthPage.wo CoreDataBlog_COREDATA_MODELS += \ BlogDemo_DataModel.xcdatamodel diff --git a/sope-appserver/samples/CoreDataBlog/GNUmakefile.preamble b/sope-appserver/samples/CoreDataBlog/GNUmakefile.preamble index 2aee8626..73536746 100644 --- a/sope-appserver/samples/CoreDataBlog/GNUmakefile.preamble +++ b/sope-appserver/samples/CoreDataBlog/GNUmakefile.preamble @@ -24,10 +24,12 @@ ADDITIONAL_TOOL_LIBS += \ ifneq ($(frameworks),yes) ADDITIONAL_TOOL_LIBS += \ -lEOCoreData \ + -lNGExtensions \ -lEOControl \ -lDOM -lXmlRpc -lSaxObjC else ADDITIONAL_TOOL_LIBS += \ + -framework NGExtensions \ -framework EOCoreData \ -framework EOControl \ -framework XmlRpc -framework DOM -framework SaxObjC @@ -39,6 +41,7 @@ endif DEP_DIRS = \ $(SOPE_ROOT)/sope-appserver/NGObjWeb \ $(SOPE_ROOT)/sope-mime \ + $(SOPE_ROOT)/sope-mime/NGMail \ $(SOPE_ROOT)/sope-core/EOCoreData \ $(SOPE_ROOT)/sope-core/NGStreams \ $(SOPE_ROOT)/sope-core/NGExtensions \ diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.m b/sope-appserver/samples/CoreDataBlog/MonthPage.m new file mode 100644 index 00000000..b59ba8c8 --- /dev/null +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.m @@ -0,0 +1,61 @@ +/* + 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 + +@class NSArray; + +@interface MonthPage : WOComponent +{ +} + +@end + +#include "WOSession+CoreData.h" +#include +#include "common.h" + +@implementation MonthPage + +- (id)initWithContext:(id)_ctx { + if ((self = [super initWithContext:_ctx])) { + } + return self; +} + +- (void)dealloc { + [super dealloc]; +} + +/* accessors */ + +- (NSCalendarDate *)date { + return [NSCalendarDate date]; +} + +- (NSArray *)calMatrix { + return [[self date] calendarMatrixWithStartDayOfWeek:1 /* Monday */ + onlyCurrentMonth:NO]; +} + +/* actions */ + +@end /* MonthPage */ diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html new file mode 100644 index 00000000..f1fe8e90 --- /dev/null +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html @@ -0,0 +1,55 @@ + + + + SOPE CoreData Test: MonthPage + + + + + + + + + + <#Weeks> + + <#Week> + <#IsSameMonth> + + + <#IsOtherMonth> + + + + + +
<#MonthName/>
<#Day/><#Day/>
+ + +

Posts

+ <#Posts> +

<#PostTitle/>

+

<#PostBody/>

+ + + + diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod new file mode 100644 index 00000000..93d8ca53 --- /dev/null +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod @@ -0,0 +1,45 @@ +// bind template to controller + +Posts: WORepetition { + list = postDisplayGroup.displayedObjects; + item = post; +} + +PostTitle: WOString { + value = post.title; + valueWhenEmpty = "[no title]"; +} +PostBody: WOString { + value = post.body; + valueWhenEmpty = "[no body]"; +} + + +// Calendar + +MonthName: WOString { + value = date; + dateformat = "%B"; +} + +Weeks: WORepetition { + list = calMatrix; + item = week; +} +Week: WORepetition { + list = week; + item = day; +} +Day: WOString { + value = day.dayOfMonth; +} + +IsSameMonth: WOConditional { + condition = date.monthOfYear; + value = day.monthOfYear; +} +IsOtherMonth: WOConditional { + condition = date.monthOfYear; + value = day.monthOfYear; + negate = YES; +} diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo new file mode 100644 index 00000000..0bf3f95b --- /dev/null +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo @@ -0,0 +1,28 @@ +{ + variables = { + postDisplayGroup = { + class = WODisplayGroup; + dataSource = { + class = EOCoreDataSource; + editingContext = session.defaultManagedObjectContext; + fetchSpecification = { + class = EOFetchSpecification; + entityName = Post; + fetchLimit = 0; + isDeep = YES; + sortOrderings = ( + { class = EOSortOrdering; + key = "creationDate"; + selector = "compareDescending:"; + } + ); + }; + }; + formatForLikeQualifier = "%@*"; + localKeys = (); + numberOfObjectsPerBatch = 0; + selectsFirstObjectAfterFetch = YES; + fetchesOnLoad = YES; + }; + }; +}